diff options
author | Ken Moore <ken@pcbsd.org> | 2015-02-17 11:09:49 -0500 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2015-02-17 11:09:49 -0500 |
commit | f6edbc3d9ca5f244c6d5cd8b2e8be26bb98159a4 (patch) | |
tree | b41e560717719b87f3d76dd72cdb38e2d765aebf /lumina-config/AppDialog.h | |
parent | Clean up a few things in Lumina: (diff) | |
download | lumina-f6edbc3d9ca5f244c6d5cd8b2e8be26bb98159a4.tar.gz lumina-f6edbc3d9ca5f244c6d5cd8b2e8be26bb98159a4.tar.bz2 lumina-f6edbc3d9ca5f244c6d5cd8b2e8be26bb98159a4.zip |
Add the ability to "reset" an application back to defaults in lumina-config - and setup the web browser/email/file manager/terminal buttons to use this functionality.
Diffstat (limited to 'lumina-config/AppDialog.h')
-rw-r--r-- | lumina-config/AppDialog.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lumina-config/AppDialog.h b/lumina-config/AppDialog.h index 0ea9b93a..acc6c73e 100644 --- a/lumina-config/AppDialog.h +++ b/lumina-config/AppDialog.h @@ -33,6 +33,7 @@ public: AppDialog(QWidget *parent = 0, QList<XDGDesktop> applist = QList<XDGDesktop>()) : QDialog(parent), ui(new Ui::AppDialog){ ui->setupUi(this); //load the designer file APPS = applist; //save this for later + appreset = false; ui->comboBox->clear(); for(int i=0; i<APPS.length(); i++){ ui->comboBox->addItem( LXDG::findIcon(APPS[i].icon,"application-x-executable"), APPS[i].name ); @@ -44,8 +45,17 @@ public: ~AppDialog(){} - XDGDesktop appselected; + void allowReset(bool allow){ + if(allow){ + ui->buttonBox->setStandardButtons(QDialogButtonBox::RestoreDefaults | QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + }else{ + ui->buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + } + } + XDGDesktop appselected; //selected application (empty template for cancelled/reset) + bool appreset; //Did the user select to reset to defaults? + private slots: void on_buttonBox_accepted(){ appselected = APPS[ ui->comboBox->currentIndex() ]; @@ -54,7 +64,12 @@ private slots: void on_buttonBox_rejected(){ this->close(); } - + void on_buttonBox_clicked(QAbstractButton *button){ + if(ui->buttonBox->standardButton(button) == QDialogButtonBox::RestoreDefaults){ + appreset = true; + this->close(); + } + } }; #endif |