Git commit 4f6af0d5ddf7c0733ca064c8eba92874c963da1c by Tobias Leupold. Committed on 16/08/2016 at 15:35. Pushed by tleupold into branch 'master'. Made the settings dialog work again by fixing the "OK", "Apply" and "Cancel= " button. M +17 -21 Settings/SettingsDialog.cpp http://commits.kde.org/kphotoalbum/4f6af0d5ddf7c0733ca064c8eba92874c963da1c diff --git a/Settings/SettingsDialog.cpp b/Settings/SettingsDialog.cpp index c9d69fd..cbb54dc 100644 --- a/Settings/SettingsDialog.cpp +++ b/Settings/SettingsDialog.cpp @@ -107,33 +107,29 @@ Settings::SettingsDialog::SettingsDialog( QWidget* pa= rent) ++i; } = + setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | Q= DialogButtonBox::Apply); + connect(this, &QDialog::accepted, + this, &SettingsDialog::slotMyOK); + connect(button(QDialogButtonBox::Apply), &QPushButton::clicked, + this, &SettingsDialog::slotMyOK); + connect(this, &QDialog::rejected, m_birthdayPage, &Settings::BirthdayP= age::discardChanges); = - QDialogButtonBox *buttonBox =3D new QDialogButtonBox(QDialogButtonBox:= :Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Apply); - QWidget *mainWidget =3D new QWidget(this); - QVBoxLayout *mainLayout =3D new QVBoxLayout; - setLayout(mainLayout); - mainLayout->addWidget(mainWidget); - QPushButton *okButton =3D buttonBox->button(QDialogButtonBox::Ok); - okButton->setDefault(true); - okButton->setShortcut(Qt::CTRL | Qt::Key_Return); - connect(buttonBox, &QDialogButtonBox::accepted, this, &SettingsDialog:= :accept); - connect(buttonBox, &QDialogButtonBox::rejected, this, &SettingsDialog:= :reject); - //PORTING SCRIPT: WARNING mainLayout->addWidget(buttonBox) must be las= t item in layout. Please move it. - mainLayout->addWidget(buttonBox); setWindowTitle( i18n( "Settings" ) ); = - connect(m_categoryPage, &Settings::CategoryPage::categoryChangesPendin= g, m_tagGroupsPage, &Settings::TagGroupsPage::categoryChangesPending); - connect(this, &SettingsDialog::currentPageChanged, m_tagGroupsPage, &S= ettings::TagGroupsPage::slotPageChange); + connect(m_categoryPage, &Settings::CategoryPage::categoryChangesPendin= g, + m_tagGroupsPage, &Settings::TagGroupsPage::categoryChangesPend= ing); + connect(this, &SettingsDialog::currentPageChanged, + m_tagGroupsPage, &Settings::TagGroupsPage::slotPageChange); #ifdef HAVE_KFACE - connect(this, &SettingsDialog::currentPageChanged, m_faceManagementPag= e, &Settings::FaceManagementPage::slotPageChange); + connect(this, &SettingsDialog::currentPageChanged, + m_faceManagementPage, &Settings::FaceManagementPage::slotPageC= hange); #endif - connect(this, &SettingsDialog::currentPageChanged, m_birthdayPage, &Se= ttings::BirthdayPage::pageChange); - connect(buttonBox->button(QDialogButtonBox::Cancel), &QPushButton::cli= cked, m_birthdayPage, &Settings::BirthdayPage::discardChanges); - // slot is protected -> use old style connect: - connect(this, SIGNAL(cancelClicked()), m_categoryPage, SLOT(resetCateg= oryLabel())); + connect(this, &SettingsDialog::currentPageChanged, + m_birthdayPage, &Settings::BirthdayPage::pageChange); = - connect(buttonBox->button(QDialogButtonBox::Apply), &QPushButton::clic= ked, this, &SettingsDialog::slotMyOK); - connect(okButton, &QPushButton::clicked, this, &SettingsDialog::slotMy= OK); + // slot is protected -> use old style connect: + connect(this, SIGNAL(cancelClicked()), + m_categoryPage, SLOT(resetCategoryLabel())); } = void Settings::SettingsDialog::show()