9#include "ui_recorder_profile_settings.h"
11#include <klocalizedstring.h>
12#include <kstandardguiitem.h>
17enum ArgumentsPageIndex
31 KGuiItem::assign(
ui->buttonBox->button(QDialogButtonBox::Ok), KStandardGuiItem::ok());
32 KGuiItem::assign(
ui->buttonBox->button(QDialogButtonBox::Cancel), KStandardGuiItem::cancel());
35 ui->stackedWidget->setCurrentIndex(ArgumentsPageIndex::PageEdit);
50 disconnect(
ui->buttonPresetRevert);
51 connect(
ui->buttonPresetRevert, &QPushButton::clicked, [&] { fillProfile(defaultProfile); });
53 if (exec() != QDialog::Accepted)
56 profile->
name =
ui->editProfileName->text();
58 profile->
arguments =
ui->editFfmpegArguments->toPlainText();
65 ui->editPreview->setPlainText(preview);
70 const QString &name =
ui->editProfileName->text();
71 const QString &extension =
ui->editFileExtension->text();
72 const QString &arguments =
ui->editFfmpegArguments->toPlainText();
74 bool isValid = (!name.isEmpty()) && (!extension.isEmpty()) && (!arguments.isEmpty());
75 ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(isValid);
80 ui->editFfmpegArguments->insertPlainText(link);
81 ui->editFfmpegArguments->setFocus();
89 ui->stackedWidget->setCurrentIndex(checked ? ArgumentsPageIndex::PagePreview : ArgumentsPageIndex::PageEdit);
94 ui->editProfileName->setText(profile.
name);
96 ui->editFfmpegArguments->setPlainText(profile.
arguments);
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
bool editProfile(RecorderProfile *profile, const RecorderProfile &defaultProfile)
void onLinkActivated(const QString &link)
void fillProfile(const RecorderProfile &profile)
Ui::RecorderProfileSettings * ui
void setPreview(const QString &preview)
RecorderProfileSettings(QWidget *parent=nullptr)
void onPreviewToggled(bool checked)
void requestPreview(QString arguments)
~RecorderProfileSettings()
QIcon loadIcon(const QString &name)