From b4803118c5e22e7a00d313698868a0ebbe5188ba Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Mon, 6 Oct 2014 19:27:57 +0200 Subject: make window manager selectable from lumina-config>settings>general --- lumina-config/mainUI.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lumina-config/mainUI.cpp') 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(){ -- cgit