diff options
author | Ken Moore <moorekou@gmail.com> | 2015-07-10 08:48:54 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-07-10 08:48:54 -0400 |
commit | f6e8efef826cd3b45db8f5be03f540dc7b528d96 (patch) | |
tree | ab539ea4c627fdfa41bfb541f2c166a5c9eae9bd /lumina-config/mainUI.cpp | |
parent | Ok, NOW the desktop plugins layout methodology is consistent/reliable. Had to... (diff) | |
download | lumina-f6e8efef826cd3b45db8f5be03f540dc7b528d96.tar.gz lumina-f6e8efef826cd3b45db8f5be03f540dc7b528d96.tar.bz2 lumina-f6e8efef826cd3b45db8f5be03f540dc7b528d96.zip |
Clean up a few last things in lumina-config:
1) Centering the app selection window on the parent
2) When a special keypress is detected (no modifiers), prepend "None" to the Fluxbox key string (seems to be more reliable).
3) After saving the list of desktop plugins, have it re-load the setting from the file 1 second later to catch the unique identifiers that each plugin was assigned by the desktop.
Diffstat (limited to 'lumina-config/mainUI.cpp')
-rw-r--r-- | lumina-config/mainUI.cpp | 38 |
1 files changed, 14 insertions, 24 deletions
diff --git a/lumina-config/mainUI.cpp b/lumina-config/mainUI.cpp index 433df9a9..4c1bd4a4 100644 --- a/lumina-config/mainUI.cpp +++ b/lumina-config/mainUI.cpp @@ -14,6 +14,8 @@ #include <QTimeZone> #include <QScrollBar> +#include <unistd.h> + MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI()){ ui->setupUi(this); //load the designer file this->setWindowIcon( LXDG::findIcon("preferences-desktop-display","") ); @@ -91,27 +93,6 @@ void MainUI::setupIcons(){ //Panels Page ui->tool_panels_add->setIcon( LXDG::findIcon("list-add","") ); - /*ui->tool_panel1_add->setIcon( LXDG::findIcon("list-add","") ); - ui->tool_panel1_rm->setIcon( LXDG::findIcon("list-remove","") ); - ui->tool_panel1_addplugin->setIcon( LXDG::findIcon("list-add","") ); - ui->tool_panel1_rmplugin->setIcon( LXDG::findIcon("list-remove","") ); - ui->tool_panel1_upplug->setIcon( LXDG::findIcon("go-up","") ); - ui->tool_panel1_dnplug->setIcon( LXDG::findIcon("go-down","") ); - ui->tool_panel1_getcolor->setIcon( LXDG::findIcon("preferences-desktop-color","") ); - ui->toolBox_panel1->setItemIcon(0,LXDG::findIcon("preferences-desktop-display","")); - ui->toolBox_panel1->setItemIcon(1,LXDG::findIcon("preferences-plugin","")); - ui->tool_panel2_add->setIcon( LXDG::findIcon("list-add","") ); - ui->tool_panel2_rm->setIcon( LXDG::findIcon("list-remove","") ); - ui->tool_panel2_addplugin->setIcon( LXDG::findIcon("list-add","") ); - ui->tool_panel2_rmplugin->setIcon( LXDG::findIcon("list-remove","") ); - ui->tool_panel2_upplug->setIcon( LXDG::findIcon("go-up","") ); - ui->tool_panel2_dnplug->setIcon( LXDG::findIcon("go-down","") ); - ui->tool_panel2_getcolor->setIcon( LXDG::findIcon("preferences-desktop-color","") ); - ui->toolBox_panel2->setItemIcon(0,LXDG::findIcon("preferences-desktop-display","")); - ui->toolBox_panel2->setItemIcon(1,LXDG::findIcon("preferences-plugin","")); - ui->tabWidget_panels->setTabIcon( ui->tabWidget_panels->indexOf(ui->tab_panels), LXDG::findIcon("configure-toolbars","") ); - ui->tabWidget_panels->setTabIcon( ui->tabWidget_panels->indexOf(ui->tab_desktopInterface), LXDG::findIcon("preferences-plugin","") ); - */ //Menu Page ui->tool_menu_add->setIcon( LXDG::findIcon("list-add","") ); @@ -547,7 +528,7 @@ void MainUI::loadCurrentSettings(bool screenonly){ void MainUI::saveCurrentSettings(bool screenonly){ QString DPrefix = "desktop-"+QString::number(currentDesktop())+"/"; - + bool needreload = false; // Desktop Page if(moddesk){ QStringList bgs; //get the list of backgrounds to use @@ -567,7 +548,10 @@ void MainUI::saveCurrentSettings(bool screenonly){ for(int i=0; i<ui->list_desktop_plugins->count(); i++){ plugs << ui->list_desktop_plugins->item(i)->whatsThis(); } - settings->setValue(DPrefix+"pluginlist", plugs); + if(settings->value(DPrefix+"pluginlist",QStringList()).toStringList() != plugs){ + settings->setValue(DPrefix+"pluginlist", plugs); + needreload = true; + } } // Panels Page @@ -607,6 +591,11 @@ void MainUI::saveCurrentSettings(bool screenonly){ if(!screenonly){ modmenu = modshort = moddef = modses = false; } ui->push_save->setEnabled(modmenu || modshort || moddef || modses); //wait for new changes //ui->push_save->setVisible(!ui->actionDefaults->isChecked() || modmenu || modshort || moddef || modses); + if(needreload){ + //Wait 1 second + for(int i=0; i<10; i++){ QApplication::processEvents(); usleep(100000); } + loadCurrentSettings(screenonly); + } } @@ -900,7 +889,8 @@ void MainUI::loadKeyboardShortcuts(){ << "Exec lumina-open -volumedown::::"+tr("Audio Volume Down") \ << "Exec lumina-open -brightnessup::::"+tr("Screen Brightness Up") \ << "Exec lumina-open -brightnessdown::::"+tr("Screen Brightness Down") \ - << "Exec lumina-screenshot::::"+tr("Take Screenshot"); + << "Exec lumina-screenshot::::"+tr("Take Screenshot") \ + << "Exec xscreensaver-command -lock::::"+tr("Lock Screen"); for(int i=0; i<special.length(); i++){ QString spec = info.filter(":"+special[i].section("::::",0,0)).join("").simplified(); QTreeWidgetItem *it = new QTreeWidgetItem(); |