void ProfileDataInfoDialog::pattern_wizard() { SimplePatternWizardDialog *dialog = new SimplePatternWizardDialog(ui.qlineedit_pattern->text(), suffix, this); if (dialog->exec() != QDialog::Accepted) { delete dialog; return; } ui.qlineedit_pattern->setText(dialog->pattern); delete dialog; trigger_changed(); }
ProfileDataInfoDialog::ProfileDataInfoDialog(const QStringList& text, const QString& pattern, const QString& suffix, QWidget *parent) : QDialog(parent) { Q_UNUSED(parent); this->text = text; this->pattern = pattern; this->suffix = suffix; setWindowTitle(i18n("Info Settings")); QVBoxLayout *mainLayout = new QVBoxLayout; setLayout(mainLayout); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Apply); QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); okButton->setDefault(true); okButton->setShortcut(Qt::CTRL | Qt::Key_Return); applyButton = buttonBox->button(QDialogButtonBox::Apply); connect(buttonBox, &QDialogButtonBox::accepted, this, &ProfileDataInfoDialog::slotAccepted); connect(buttonBox, &QDialogButtonBox::rejected, this, &ProfileDataInfoDialog::reject); connect(applyButton, &QPushButton::clicked, this, &ProfileDataInfoDialog::slotApplied); QWidget *widget = new QWidget(this); mainLayout->addWidget(widget); mainLayout->addWidget(buttonBox); ui.setupUi(widget); connect(ui.kpushbutton_pattern, SIGNAL(clicked()), this, SLOT(pattern_wizard())); ui.kpushbutton_pattern->setIcon(QIcon::fromTheme("tools-wizard")); ui.ktextedit_text->setPlainText(text.join("\n")); connect(ui.ktextedit_text, SIGNAL(textChanged()), this, SLOT(trigger_changed())); ui.qlineedit_pattern->setText(pattern); connect(ui.qlineedit_pattern, SIGNAL(textEdited(const QString&)), this, SLOT(trigger_changed())); ui.qlineedit_suffix->setText(suffix); connect(ui.qlineedit_suffix, SIGNAL(textEdited(const QString&)), this, SLOT(trigger_changed())); ui.kpushbutton_load->setIcon(QIcon::fromTheme("document-open")); ui.kpushbutton_save->setIcon(QIcon::fromTheme("document-save")); connect(ui.kurllabel_aboutvariables, SIGNAL(leftClickedUrl()), this, SLOT(about_variables())); connect(ui.kpushbutton_load, SIGNAL(clicked()), this, SLOT(load_text())); connect(ui.kpushbutton_save, SIGNAL(clicked()), this, SLOT(save_text())); applyButton->setEnabled(false); }
void ProfileDataCoverDialog::pattern_wizard() { QString suffix = ui.kcombobox_format->itemData(ui.kcombobox_format->currentIndex()).toString().toLower(); SimplePatternWizardDialog *dialog = new SimplePatternWizardDialog(ui.qlineedit_pattern->text(), suffix, this); if (dialog->exec() != QDialog::Accepted) { delete dialog; return; } ui.qlineedit_pattern->setText(dialog->pattern); delete dialog; trigger_changed(); }
CDDAHeaderDataDialog::CDDAHeaderDataDialog(CDDAModel *cddaModel, QWidget *parent) : QDialog(parent) { Q_UNUSED(parent); cdda_model = cddaModel; if (!cdda_model) { qDebug() << "CDDAModel is NULL!"; return; } setWindowTitle(i18n("Edit Data")); QVBoxLayout *mainLayout = new QVBoxLayout; setLayout(mainLayout); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Apply|QDialogButtonBox::Cancel); okButton = buttonBox->button(QDialogButtonBox::Ok); applyButton = buttonBox->button(QDialogButtonBox::Apply); okButton->setDefault(true); okButton->setShortcut(Qt::CTRL | Qt::Key_Return); connect(buttonBox, &QDialogButtonBox::accepted, this, &CDDAHeaderDataDialog::slotAccepted); connect(buttonBox, &QDialogButtonBox::rejected, this, &CDDAHeaderDataDialog::reject); connect(applyButton, &QPushButton::clicked, this, &CDDAHeaderDataDialog::slotApplied); QWidget *widget = new QWidget(this); mainLayout->addWidget(widget); mainLayout->addWidget(buttonBox); ui.setupUi(widget); QStringList genres; for (int i = 0; i < GENRE_MAX; ++i) genres.append(QString().fromAscii(ID3_GENRES[i])); genres.sort(); KCompletion *comp = ui.kcombobox_genre->completionObject(); comp->insertItems(genres); ui.kcombobox_genre->addItems(genres); connect(ui.kcombobox_genre, SIGNAL(returnPressed(const QString&)), comp, SLOT(addItem(const QString&))); ui.checkBox_various->setChecked(cdda_model->isVarious()); connect(ui.checkBox_various, SIGNAL(toggled(bool)), this, SLOT(trigger_changed())); ui.checkBox_multicd->setChecked(cdda_model->isMultiCD()); connect(ui.checkBox_multicd, SIGNAL(toggled(bool)), this, SLOT(enable_checkbox_multicd(bool))); connect(ui.checkBox_multicd, SIGNAL(toggled(bool)), this, SLOT(trigger_changed())); ui.qlineedit_artist->setText(cdda_model->artist()); connect(ui.qlineedit_artist, SIGNAL(textEdited(const QString&)), this, SLOT(trigger_changed())); ui.qlineedit_title->setText(cdda_model->title()); connect(ui.qlineedit_title, SIGNAL(textEdited(const QString&)), this, SLOT(trigger_changed())); ui.kintspinbox_cdnum->setValue(cdda_model->cdNum()); connect(ui.kintspinbox_cdnum, SIGNAL(valueChanged(int)), this, SLOT(trigger_changed())); ui.kintspinbox_trackoffset->setValue(cdda_model->trackOffset()); connect(ui.kintspinbox_trackoffset, SIGNAL(valueChanged(int)), this, SLOT(trigger_changed())); ui.kcombobox_genre->lineEdit()->setText(cdda_model->genre()); connect(ui.kcombobox_genre->lineEdit(), SIGNAL(textEdited(const QString&)), this, SLOT(trigger_changed())); { bool ok; int year = cdda_model->year().toInt(&ok); if (ok) ui.kintspinbox_year->setValue(year); else ui.kintspinbox_year->setValue(QDate::currentDate().year()); } connect(ui.kintspinbox_year, SIGNAL(valueChanged(int)), this, SLOT(trigger_changed())); ui.ktextedit_extdata->setText(cdda_model->extendedData().join("\n")); connect(ui.ktextedit_extdata, SIGNAL(textChanged()), this, SLOT(trigger_changed())); ui.qlineedit_freedbdiscid->setText(QString("0x%1").arg(DiscIDCalculator::FreeDBId(cdda_model->discSignature()), 0, 16)); enable_checkbox_multicd(cdda_model->isMultiCD()); applyButton->setEnabled(false); }
ProfileDataDialog::ProfileDataDialog(ProfileModel *profileModel, const int profileRow, QWidget *parent) : KDialog(parent) { Q_UNUSED(parent); profile_model = profileModel; if (!profile_model) { kDebug() << "ProfileModel is NULL!"; return; } profile_row = profileRow; QWidget *widget = new QWidget(this); ui.setupUi(widget); setMainWidget(widget); if (profile_row >= 0) { lame_parameters.fromString(profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_ENCODER_LAME_PARAMETERS_INDEX)).toString()); oggenc_parameters.fromString(profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_ENCODER_OGGENC_PARAMETERS_INDEX)).toString()); flac_parameters.fromString(profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_ENCODER_FLAC_PARAMETERS_INDEX)).toString()); faac_parameters.fromString(profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_ENCODER_FAAC_PARAMETERS_INDEX)).toString()); wave_parameters.fromString(profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_ENCODER_WAVE_PARAMETERS_INDEX)).toString()); custom_parameters.fromString(profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_ENCODER_CUSTOM_PARAMETERS_INDEX)).toString()); } lame_widget = new lameWidget(&lame_parameters, this); connect(lame_widget, SIGNAL(triggerChanged()), this, SLOT(trigger_changed())); oggenc_widget = new oggencWidget(&oggenc_parameters, this); connect(oggenc_widget, SIGNAL(triggerChanged()), this, SLOT(trigger_changed())); flac_widget = new flacWidget(&flac_parameters, this); connect(flac_widget, SIGNAL(triggerChanged()), this, SLOT(trigger_changed())); faac_widget = new faacWidget(&faac_parameters, this); connect(faac_widget, SIGNAL(triggerChanged()), this, SLOT(trigger_changed())); wave_widget = new waveWidget(&wave_parameters, this); connect(wave_widget, SIGNAL(triggerChanged()), this, SLOT(trigger_changed())); custom_widget = new customWidget(&custom_parameters, this); connect(custom_widget, SIGNAL(triggerChanged()), this, SLOT(trigger_changed())); ui.stackedWidget_encoder->addWidget(lame_widget); ui.stackedWidget_encoder->addWidget(oggenc_widget); ui.stackedWidget_encoder->addWidget(flac_widget); ui.stackedWidget_encoder->addWidget(faac_widget); ui.stackedWidget_encoder->addWidget(wave_widget); ui.stackedWidget_encoder->addWidget(custom_widget); QMap<int,QString> encoders = EncoderAssistant::availableEncoderNameList(); QMap<int,QString>::const_iterator i = encoders.constBegin(); while (i != encoders.constEnd()) { ui.kcombobox_encoder->addItem(i.value(), i.key()); ++i; } connect(ui.kcombobox_encoder, SIGNAL(activated(int)), this, SLOT(set_encoder_by_combobox(int))); connect(ui.kpushbutton_pattern, SIGNAL(clicked()), this, SLOT(pattern_wizard())); ui.kpushbutton_pattern->setIcon(KIcon("tools-wizard")); connect(ui.kpushbutton_cover, SIGNAL(clicked()), this, SLOT(cover_settings())); connect(ui.kpushbutton_playlist, SIGNAL(clicked()), this, SLOT(playlist_settings())); connect(ui.kpushbutton_info, SIGNAL(clicked()), this, SLOT(info_settings())); connect(ui.kpushbutton_hashlist, SIGNAL(clicked()), this, SLOT(hashlist_settings())); connect(ui.kpushbutton_cuesheet, SIGNAL(clicked()), this, SLOT(cuesheet_settings())); connect(ui.kpushbutton_singlefile, SIGNAL(clicked()), this, SLOT(singlefile_settings())); connect(ui.checkBox_cover, SIGNAL(toggled(bool)), this, SLOT(enable_settings_cover(bool))); connect(ui.checkBox_playlist, SIGNAL(toggled(bool)), this, SLOT(enable_settings_playlist(bool))); connect(ui.checkBox_info, SIGNAL(toggled(bool)), this, SLOT(enable_settings_info(bool))); connect(ui.checkBox_hashlist, SIGNAL(toggled(bool)), this, SLOT(enable_settings_hashlist(bool))); connect(ui.checkBox_cuesheet, SIGNAL(toggled(bool)), this, SLOT(enable_settings_cuesheet(bool))); connect(ui.checkBox_singlefile, SIGNAL(toggled(bool)), this, SLOT(enable_settings_singlefile(bool))); connect(ui.checkBox_singlefile, SIGNAL(toggled(bool)), this, SLOT(disable_filenames(bool))); connect(ui.checkBox_singlefile, SIGNAL(toggled(bool)), this, SLOT(disable_playlist(bool))); if (profile_row >= 0) { setCaption(i18n("Modify Profile")); setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Apply); ui.klineedit_name->setText(profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_NAME_INDEX)).toString()); connect(ui.klineedit_name, SIGNAL(textEdited(const QString&)), this, SLOT(trigger_changed())); ui.klineedit_name->setCursorPosition(0); ui.kiconbutton_icon->setIcon(profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_ICON_INDEX)).toString()); connect(ui.kiconbutton_icon, SIGNAL(iconChanged(const QString&)), this, SLOT(trigger_changed())); set_encoder(profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_ENCODER_SELECTED_INDEX)).toInt()); connect(ui.kcombobox_encoder, SIGNAL(activated(int)), this, SLOT(trigger_changed())); ui.klineedit_pattern->setText(profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_PATTERN_INDEX)).toString()); connect(ui.klineedit_pattern, SIGNAL(textEdited(const QString&)), this, SLOT(trigger_changed())); ui.klineedit_pattern->setCursorPosition(0); ui.checkBox_fat32compatible->setChecked(profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_FAT32COMPATIBLE_INDEX)).toBool()); connect(ui.checkBox_fat32compatible, SIGNAL(toggled(bool)), this, SLOT(trigger_changed())); ui.checkBox_underscore->setChecked(profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_UNDERSCORE_INDEX)).toBool()); connect(ui.checkBox_underscore, SIGNAL(toggled(bool)), this, SLOT(trigger_changed())); ui.checkBox_2digitstracknum->setChecked(profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_2DIGITSTRACKNUM_INDEX)).toBool()); connect(ui.checkBox_2digitstracknum, SIGNAL(toggled(bool)), this, SLOT(trigger_changed())); ui.checkBox_cover->setChecked(profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_SC_INDEX)).toBool()); enable_settings_cover(ui.checkBox_cover->isChecked()); connect(ui.checkBox_cover, SIGNAL(toggled(bool)), this, SLOT(trigger_changed())); ui.checkBox_playlist->setChecked(profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_PL_INDEX)).toBool()); enable_settings_playlist(ui.checkBox_playlist->isChecked()); connect(ui.checkBox_playlist, SIGNAL(toggled(bool)), this, SLOT(trigger_changed())); ui.checkBox_info->setChecked(profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_INF_INDEX)).toBool()); enable_settings_info(ui.checkBox_info->isChecked()); connect(ui.checkBox_info, SIGNAL(toggled(bool)), this, SLOT(trigger_changed())); ui.checkBox_hashlist->setChecked(profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_HL_INDEX)).toBool()); enable_settings_hashlist(ui.checkBox_hashlist->isChecked()); connect(ui.checkBox_hashlist, SIGNAL(toggled(bool)), this, SLOT(trigger_changed())); ui.checkBox_cuesheet->setChecked(profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_CUE_INDEX)).toBool()); enable_settings_cuesheet(ui.checkBox_cuesheet->isChecked()); connect(ui.checkBox_cuesheet, SIGNAL(toggled(bool)), this, SLOT(trigger_changed())); ui.checkBox_singlefile->setChecked(profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_SF_INDEX)).toBool()); enable_settings_singlefile(ui.checkBox_singlefile->isChecked()); connect(ui.checkBox_singlefile, SIGNAL(toggled(bool)), this, SLOT(trigger_changed())); ui.checkBox_replaygain->setChecked(profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_RG_INDEX)).toBool()); connect(ui.checkBox_replaygain, SIGNAL(toggled(bool)), this, SLOT(trigger_changed())); disable_playlist(ui.checkBox_singlefile->isChecked()); //profile data cover data pdcd_scale = profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_SC_SCALE_INDEX)).toBool(); pdcd_size = profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_SC_SIZE_INDEX)).toSize(); pdcd_format = profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_SC_FORMAT_INDEX)).toString(); pdcd_pattern = profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_SC_NAME_INDEX)).toString(); //profile data playlist data pdpd_format = profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_PL_FORMAT_INDEX)).toString(); pdpd_pattern = profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_PL_NAME_INDEX)).toString(); pdpd_abs_file_path = profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_PL_ABS_FILE_PATH_INDEX)).toBool(); pdpd_utf8 = profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_PL_UTF8_INDEX)).toBool(); //profile data info data pdid_text = profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_INF_TEXT_INDEX)).toStringList(); pdid_pattern = profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_INF_NAME_INDEX)).toString(); pdid_suffix = profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_INF_SUFFIX_INDEX)).toString(); //profile data hashlist data pdhd_format = profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_HL_FORMAT_INDEX)).toString(); pdhd_pattern = profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_HL_NAME_INDEX)).toString(); //profile data cue sheet data pdud_pattern = profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_CUE_NAME_INDEX)).toString(); //profile data single file data pdsd_pattern = profile_model->data(profile_model->index(profile_row, PROFILE_MODEL_COLUMN_SF_NAME_INDEX)).toString(); enableButtonApply(false); }
void Socket::set_type(SocketType type) { type_ = type; trigger_changed(); }
void Socket::set_parent(GraphNode *parent) { parent_ = parent; trigger_changed(); }
void Socket::set_index(int index) { trigger_changed(); index_ = index; }
void Socket::set_name(const std::string& name) { trigger_changed(); name_ = name; }