diff options
author | Ken Moore <ken@ixsystems.com> | 2018-03-06 10:59:57 -0500 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2018-03-06 10:59:57 -0500 |
commit | 9157e0cc924ffde453e4c0347cb4913757082b69 (patch) | |
tree | 507ff69a72f4f4941b478117c812c3ee93f24bf8 | |
parent | A few final tweaks for lumina-pdf before syncing with TrueOS ports. (diff) | |
download | lumina-9157e0cc924ffde453e4c0347cb4913757082b69.tar.gz lumina-9157e0cc924ffde453e4c0347cb4913757082b69.tar.bz2 lumina-9157e0cc924ffde453e4c0347cb4913757082b69.zip |
Add some better success/error reporting when saving screen configuration.
-rw-r--r-- | src-qt5/core-utils/lumina-xconfig/MainUI.cpp | 16 | ||||
-rw-r--r-- | src-qt5/core-utils/lumina-xconfig/MainUI.h | 2 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src-qt5/core-utils/lumina-xconfig/MainUI.cpp b/src-qt5/core-utils/lumina-xconfig/MainUI.cpp index aecc5122..cbec6443 100644 --- a/src-qt5/core-utils/lumina-xconfig/MainUI.cpp +++ b/src-qt5/core-utils/lumina-xconfig/MainUI.cpp @@ -13,6 +13,7 @@ #include <QTimer> #include <QInputDialog> #include <QLineEdit> +#include <QMessageBox> MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){ ui->setupUi(this); @@ -403,9 +404,15 @@ void MainUI::ApplyChanges(){ QTimer::singleShot(1000, this, SLOT(RestartFluxbox()) ); } -void MainUI::SaveSettings(){ +void MainUI::SaveSettings(bool quiet){ SyncBackend(); - RRSettings::SaveScreens(SCREENS); + bool ok = RRSettings::SaveScreens(SCREENS); + if(quiet){ return; } //do not show the popup info boxes. + if(ok){ + QMessageBox::information(this, tr("Settings Saved"), tr("Screen configuration saved as the default for future use")); + }else{ + QMessageBox::warning(this, tr("Settings Error"), tr("Screen configuration could not be saved. Please check file permissions and try again.")); + } } void MainUI::RestartFluxbox(){ @@ -452,6 +459,9 @@ void MainUI::saveAsProfile(QAction *act){ if(!ok || profile.isEmpty()){ return; } //cancelled } } - RRSettings::SaveScreens(SCREENS, profile); + bool ok = RRSettings::SaveScreens(SCREENS, profile); updateProfiles(); + if(ok){ + QMessageBox::information(this, tr("Profile Created"), tr("Current screen configuration saved as profile:")+"\n\n"+profile); + } } diff --git a/src-qt5/core-utils/lumina-xconfig/MainUI.h b/src-qt5/core-utils/lumina-xconfig/MainUI.h index 53bf06db..97124d32 100644 --- a/src-qt5/core-utils/lumina-xconfig/MainUI.h +++ b/src-qt5/core-utils/lumina-xconfig/MainUI.h @@ -62,7 +62,7 @@ private slots: void DeactivateScreen(); void ActivateScreen(); void ApplyChanges(); //config changes - void SaveSettings(); + void SaveSettings(bool quiet = false); void RestartFluxbox(); void removeProfile(); |