diff options
-rw-r--r-- | lumina-config/mainUI.cpp | 19 | ||||
-rw-r--r-- | lumina-config/mainUI.h | 1 | ||||
-rw-r--r-- | lumina-config/mainUI.ui | 54 | ||||
-rw-r--r-- | lumina-desktop/WMProcess.cpp | 13 |
4 files changed, 67 insertions, 20 deletions
diff --git a/lumina-config/mainUI.cpp b/lumina-config/mainUI.cpp index eb29ee8f..f6a8b1f3 100644 --- a/lumina-config/mainUI.cpp +++ b/lumina-config/mainUI.cpp @@ -117,6 +117,7 @@ void MainUI::setupIcons(){ ui->tool_session_addapp->setIcon( LXDG::findIcon("system-run","") ); ui->tool_session_addbin->setIcon( LXDG::findIcon("system-search","") ); ui->tool_session_addfile->setIcon( LXDG::findIcon("run-build-file","") ); + ui->tool_session_findwm->setIcon( LXDG::findIcon("system-search","") ); } @@ -193,6 +194,8 @@ void MainUI::setupConnections(){ connect(ui->check_session_numlock, SIGNAL(stateChanged(int)), this, SLOT(sessionoptchanged()) ); connect(ui->check_session_playloginaudio, SIGNAL(stateChanged(int)), this, SLOT(sessionoptchanged()) ); connect(ui->check_session_playlogoutaudio, SIGNAL(stateChanged(int)), this, SLOT(sessionoptchanged()) ); + connect(ui->tool_session_findwm, SIGNAL(clicked()), this, SLOT(findsessionwindowmanager()) ); + connect(ui->line_session_windowmanager, SIGNAL(textChanged(QString)), this, SLOT(sessionoptchanged()) ); connect(ui->spin_session_wkspaces, SIGNAL(valueChanged(int)), this, SLOT(sessionoptchanged()) ); connect(ui->list_session_start, SIGNAL(currentRowChanged(int)), this, SLOT(sessionstartchanged()) ); } @@ -1343,10 +1346,25 @@ void MainUI::loadSessionSettings(){ ui->check_session_numlock->setChecked( sessionsettings->value("EnableNumlock", true).toBool() ); ui->check_session_playloginaudio->setChecked( sessionsettings->value("PlayStartupAudio",true).toBool() ); ui->check_session_playlogoutaudio->setChecked( sessionsettings->value("PlayLogoutAudio",true).toBool() ); + ui->line_session_windowmanager->setText( sessionsettings->value("WindowManager","fluxbox").toString() ); sessionstartchanged(); //make sure to update buttons } +void MainUI::findsessionwindowmanager(){ + QString chkpath = LOS::AppPrefix() + "bin"; + if(!QFile::exists(chkpath)){ chkpath = QDir::homePath(); } + QString bin = QFileDialog::getOpenFileName(this, tr("Set Default Window Manager"), chkpath, tr("Application Binaries (*)") ); + if( bin.isEmpty() || !QFile::exists(bin) ){ return; } //cancelled + if( !QFileInfo(bin).isExecutable() ){ + QMessageBox::warning(this, tr("Invalid Binary"), tr("The selected file is not executable!")); + return; + } + ui->line_session_windowmanager->setText(bin); + ui->push_save->setEnabled(true); + modmenu = true; +} + void MainUI::saveSessionSettings(){ //Do the fluxbox settings first QStringList FB = readFile(QDir::homePath()+"/.lumina/fluxbox-init"); @@ -1386,6 +1404,7 @@ void MainUI::saveSessionSettings(){ sessionsettings->setValue("EnableNumlock", ui->check_session_numlock->isChecked()); sessionsettings->setValue("PlayStartupAudio", ui->check_session_playloginaudio->isChecked()); sessionsettings->setValue("PlayLogoutAudio", ui->check_session_playlogoutaudio->isChecked()); + sessionsettings->setValue("WindowManager", ui->line_session_windowmanager->text() ); } void MainUI::rmsessionstartitem(){ diff --git a/lumina-config/mainUI.h b/lumina-config/mainUI.h index 565a3c61..a7f159b0 100644 --- a/lumina-config/mainUI.h +++ b/lumina-config/mainUI.h @@ -145,6 +145,7 @@ private slots: void addsessionstartapp(); void addsessionstartbin(); void addsessionstartfile(); + void findsessionwindowmanager(); void sessionoptchanged(); void sessionthemechanged(); void sessionstartchanged(); diff --git a/lumina-config/mainUI.ui b/lumina-config/mainUI.ui index f1fd2542..578856c4 100644 --- a/lumina-config/mainUI.ui +++ b/lumina-config/mainUI.ui @@ -9,8 +9,8 @@ <rect> <x>0</x> <y>0</y> - <width>573</width> - <height>385</height> + <width>579</width> + <height>392</height> </rect> </property> <property name="windowTitle"> @@ -372,8 +372,8 @@ <rect> <x>0</x> <y>0</y> - <width>157</width> - <height>90</height> + <width>166</width> + <height>92</height> </rect> </property> <attribute name="label"> @@ -454,8 +454,8 @@ <rect> <x>0</x> <y>0</y> - <width>177</width> - <height>106</height> + <width>194</width> + <height>107</height> </rect> </property> <attribute name="label"> @@ -592,8 +592,8 @@ <rect> <x>0</x> <y>0</y> - <width>157</width> - <height>90</height> + <width>166</width> + <height>92</height> </rect> </property> <attribute name="label"> @@ -674,8 +674,8 @@ <rect> <x>0</x> <y>0</y> - <width>177</width> - <height>106</height> + <width>194</width> + <height>107</height> </rect> </property> <attribute name="label"> @@ -1083,7 +1083,7 @@ <string/> </property> <property name="currentIndex"> - <number>2</number> + <number>0</number> </property> <widget class="QWidget" name="tab"> <attribute name="title"> @@ -1112,6 +1112,30 @@ </widget> </item> <item> + <layout class="QHBoxLayout" name="horizontalLayout_18"> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="label_12"> + <property name="text"> + <string>Window Manager</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="line_session_windowmanager"/> + </item> + <item> + <widget class="QToolButton" name="tool_session_findwm"> + <property name="text"> + <string>...</string> + </property> + </widget> + </item> + </layout> + </item> + <item> <spacer name="verticalSpacer_2"> <property name="orientation"> <enum>Qt::Vertical</enum> @@ -1266,8 +1290,8 @@ <rect> <x>0</x> <y>0</y> - <width>509</width> - <height>71</height> + <width>491</width> + <height>59</height> </rect> </property> <property name="sizePolicy"> @@ -1373,8 +1397,8 @@ <rect> <x>0</x> <y>0</y> - <width>573</width> - <height>20</height> + <width>579</width> + <height>19</height> </rect> </property> </widget> diff --git a/lumina-desktop/WMProcess.cpp b/lumina-desktop/WMProcess.cpp index aecd4bac..eb88c8e6 100644 --- a/lumina-desktop/WMProcess.cpp +++ b/lumina-desktop/WMProcess.cpp @@ -5,6 +5,7 @@ // See the LICENSE file for full details //=========================================== #include "WMProcess.h" +#include "LSession.h" WMProcess::WMProcess() : QProcess(){ connect(this,SIGNAL(finished(int, QProcess::ExitStatus)),this,SLOT(processFinished(int, QProcess::ExitStatus)) ); @@ -17,7 +18,7 @@ WMProcess::WMProcess() : QProcess(){ } WMProcess::~WMProcess(){ - + } // ======================= @@ -55,7 +56,7 @@ bool WMProcess::isRunning(){ } QString WMProcess::setupWM(){ - QString WM = "fluxbox"; + QString WM = LSession::sessionSettings()->value("WindowManager", "fluxbox").toString(); QString cmd="echo WM Disabled"; //leave the option to add other window managers here (for testing purposes) if(WM=="openbox"){ @@ -85,6 +86,8 @@ QString WMProcess::setupWM(){ QFile::setPermissions(confDir+"/lumina-menu.xml", QFile::ReadOwner | QFile::WriteOwner | QFile::ReadUser | QFile::ReadOther | QFile::ReadGroup); }*/ cmd = "fluxbox -rc "+confDir+"/fluxbox-init"; + }else { + cmd = WM; } return cmd; } @@ -103,13 +106,13 @@ void WMProcess::processFinished(int exitcode, QProcess::ExitStatus status){ if(!inShutdown){ if(exitcode == 0 && status == QProcess::NormalExit){ cleanupConfig(); - emit WMShutdown(); + emit WMShutdown(); }else{ //restart the Window manager this->startWM(); } }else{ - cleanupConfig(); + cleanupConfig(); } } - + |