Skip to content

Commit

Permalink
Fixed Reset button in Clock config dialog
Browse files Browse the repository at this point in the history
Related to #1741
  • Loading branch information
tsujan committed Mar 13, 2022
1 parent 6ad2e5e commit 6a17924
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions plugin-worldclock/lxqtworldclockconfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,3 +658,12 @@ void LXQtWorldClockConfiguration::moveTimeZoneDown()

saveSettings();
}

void LXQtWorldClockConfiguration::dialogButtonsAction(QAbstractButton *btn)
{
LXQtPanelPluginConfigDialog::dialogButtonsAction(btn);
// also, apply the changes if the Reset button is clicked
QDialogButtonBox *box = qobject_cast<QDialogButtonBox*>(btn->parent());
if (box && box->buttonRole(btn) == QDialogButtonBox::ResetRole)
saveSettings();
}
2 changes: 2 additions & 0 deletions plugin-worldclock/lxqtworldclockconfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public slots:
*/
void loadSettings();

void dialogButtonsAction(QAbstractButton *btn);

private slots:
void timeFormatChanged(int);
void dateGroupToggled(bool);
Expand Down

0 comments on commit 6a17924

Please sign in to comment.