diff options
-rw-r--r-- | libLumina/LuminaUtils.cpp | 24 | ||||
-rw-r--r-- | lumina-config/mainUI.cpp | 2 | ||||
-rw-r--r-- | lumina-desktop/LSession.cpp | 12 | ||||
-rw-r--r-- | lumina-desktop/defaults/luminaDesktop.conf | 6 | ||||
-rw-r--r-- | lumina-desktop/panel-plugins/clock/LClock.cpp | 8 |
5 files changed, 42 insertions, 10 deletions
diff --git a/libLumina/LuminaUtils.cpp b/libLumina/LuminaUtils.cpp index fa6c64f8..fd65ce03 100644 --- a/libLumina/LuminaUtils.cpp +++ b/libLumina/LuminaUtils.cpp @@ -201,8 +201,13 @@ void LUtils::LoadSystemDefaults(bool skipOS){ //Find the number of the left-most desktop screen QString screen = "0"; QDesktopWidget *desk =QApplication::desktop(); + QRect screenGeom; for(int i=0; i<desk->screenCount(); i++){ - if(desk->screenGeometry(i).x()==0){ screen = QString::number(i); break; } + if(desk->screenGeometry(i).x()==0){ + screen = QString::number(i); + screenGeom = desk->screenGeometry(i); + break; + } } //Now setup the default "desktopsettings.conf" and "sessionsettings.conf" files QStringList deskset, sesset; @@ -244,7 +249,11 @@ void LUtils::LoadSystemDefaults(bool skipOS){ QString val = tmp[i].section("=",1,1).section("#",0,0).toLower().simplified(); QString istrue = (val=="true") ? "true": "false"; //Now parse the variable and put the value in the proper file - if(var=="panel1.pixelsize"){ deskset << "height="+val; } + if(var=="panel1.pixelsize"){ + if(val.endsWith("%H")){ val = QString::number( (screenGeom.height()*val.section("%",0,0).toDouble())/100 ); }//adjust value to a percentage of the height of the screen + else if(val.endsWith("%W")){ val = QString::number( (screenGeom.width()*val.section("%",0,0).toDouble())/100 ); }//adjust value to a percentage of the width of the screen + deskset << "height="+val; + } else if(var=="panel1.autohide"){ deskset << "hidepanel="+istrue; } else if(var=="panel1.location"){ deskset << "location="+val; } else if(var=="panel1.plugins"){ deskset << "pluginlist="+val; } @@ -259,7 +268,11 @@ void LUtils::LoadSystemDefaults(bool skipOS){ QString val = tmp[i].section("=",1,1).section("#",0,0).toLower().simplified(); QString istrue = (val=="true") ? "true": "false"; //Now parse the variable and put the value in the proper file - if(var=="panel2.pixelsize"){ deskset << "height="+val; } + if(var=="panel2.pixelsize"){ + if(val.endsWith("%H")){ val = QString::number( (screenGeom.height()*val.section("%",0,0).toDouble())/100 ); }//adjust value to a percentage of the height of the screen + else if(val.endsWith("%W")){ val = QString::number( (screenGeom.width()*val.section("%",0,0).toDouble())/100 ); }//adjust value to a percentage of the width of the screen + deskset << "height="+val; + } else if(var=="panel2.autohide"){ deskset << "hidepanel="+istrue; } else if(var=="panel2.location"){ deskset << "location="+val; } else if(var=="panel2.plugins"){ deskset << "pluginlist="+val; } @@ -290,7 +303,10 @@ void LUtils::LoadSystemDefaults(bool skipOS){ else if(var=="theme.colorfile"){ themesettings[1] = val; } else if(var=="theme.iconset"){ themesettings[2] = val; } else if(var=="theme.font"){ themesettings[3] = val; } - else if(var=="theme.fontsize"){ themesettings[4] = val; } + else if(var=="theme.fontsize"){ + if(val.endsWith("%")){ val = QString::number( (screenGeom.height()*val.section("%",0,0).toDouble())/100 )+"px"; } + themesettings[4] = val; + } } //Now double check that the custom theme/color files exist and reset it will the full path as necessary if(setTheme){ diff --git a/lumina-config/mainUI.cpp b/lumina-config/mainUI.cpp index b1a8e797..8f0a5ac7 100644 --- a/lumina-config/mainUI.cpp +++ b/lumina-config/mainUI.cpp @@ -1821,7 +1821,7 @@ void MainUI::loadSessionSettings(){ ui->push_session_setUserIcon->setIcon( LXDG::findIcon(QDir::homePath()+"/.loginIcon.png", "user-identity") ); ui->line_session_time->setText( sessionsettings->value("TimeFormat","").toString() ); ui->line_session_date->setText( sessionsettings->value("DateFormat","").toString() ); - index = ui->combo_session_datetimeorder->findData( sessionsettings->value("DateTimeOrder").toString() ); + index = ui->combo_session_datetimeorder->findData( sessionsettings->value("DateTimeOrder","timeonly").toString() ); ui->combo_session_datetimeorder->setCurrentIndex(index); if( !sessionsettings->value("CustomTimeZone", false).toBool() ){ //System Time selected diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp index 0fea2fa1..994faad8 100644 --- a/lumina-desktop/LSession.cpp +++ b/lumina-desktop/LSession.cpp @@ -284,6 +284,18 @@ void LSession::watcherChange(QString changed){ if(changed.endsWith("fluxbox-init") || changed.endsWith("fluxbox-keys")){ refreshWindowManager(); } else if(changed.endsWith("sessionsettings.conf") ){ sessionsettings->sync(); emit SessionConfigChanged(); } else if(changed.endsWith("desktopsettings.conf") ){ emit DesktopConfigChanged(); } + + //Now double-check all the watches files to ensure that none of them got removed + + QStringList files = watcher->files(); + if(files.length() < 4){ + qDebug() << " - Resetting Watched Files..."; + watcher->removePaths(files); //clear the current files before re-setting them + watcher->addPath( QDir::homePath()+"/.lumina/LuminaDE/sessionsettings.conf" ); + watcher->addPath( QDir::homePath()+"/.lumina/LuminaDE/desktopsettings.conf" ); + watcher->addPath( QDir::homePath()+"/.lumina/fluxbox-init" ); + watcher->addPath( QDir::homePath()+"/.lumina/fluxbox-keys" ); + } } void LSession::checkUserFiles(){ diff --git a/lumina-desktop/defaults/luminaDesktop.conf b/lumina-desktop/defaults/luminaDesktop.conf index f35f0654..fe3269ac 100644 --- a/lumina-desktop/defaults/luminaDesktop.conf +++ b/lumina-desktop/defaults/luminaDesktop.conf @@ -14,7 +14,7 @@ # terminal, filemanager, applications, line, settings, windowlist, app::<absolute path to *.desktop file> #GENERAL SESSION SETTINGS -session.enablenumlock=true #[true/false] Enable numlock on login using "numlockx" +session.enablenumlock=false #[true/false] Enable numlock on login using "numlockx" session.playloginaudio=true #[true/false] Play the audio chimes on log in session.playlogoutaudio=true #[true/false] Play the audio chimes on log out @@ -23,7 +23,7 @@ session.playlogoutaudio=true #[true/false] Play the audio chimes on log out #theme.colorfile=<file path> #Absolute path to the color spec file to use for theming theme.iconset=oxygen #Name of the icon theme to use theme.font=Arial #Name of the font family to use -theme.fontsize=10pt #Default size of the fonts to use on the desktop +theme.fontsize=10pt #Default size of the fonts to use on the desktop (can also use a percentage of the screen height (<number>%) ) #DESKTOP SETTINGS (used for the left-most screen in multi-screen setups) desktop.visiblepanels=1 #[0/1/2] The number of panels visible by default @@ -34,7 +34,7 @@ desktop.plugins=desktopview #list of plugins to be shown on the desktop by defau #PANEL SETTINGS (preface with panel1.<setting> or panel2.<setting>, depending on the number of panels you have visible by default) #NOTE: If two panels, they need to be on opposite screen edges (top/bottom or left/right) panel1.location=top #[top/bottom/left/right] Screen edge the panel should be on -panel1.pixelsize=30 #number of pixels wide/high the panel should be +panel1.pixelsize=4%H #number of pixels wide/high the panel should be (or <number>%[W/H] for a percentage of the screen width/height) panel1.autohide=false #[true/false] Have the panel become visible on mouse-over panel1.plugins=userbutton, taskmanager, spacer, systemtray, clock, systemdashboard #list of plugins for the panel diff --git a/lumina-desktop/panel-plugins/clock/LClock.cpp b/lumina-desktop/panel-plugins/clock/LClock.cpp index c3eb1451..1e407083 100644 --- a/lumina-desktop/panel-plugins/clock/LClock.cpp +++ b/lumina-desktop/panel-plugins/clock/LClock.cpp @@ -49,9 +49,12 @@ void LClock::updateTime(){ labelWidget->setToolTip(timelabel); }else if(datetimeorder == "timedate"){ label = timelabel + " " + datelabel; + labelWidget->setToolTip(""); }else if(datetimeorder == "datetime"){ label = datelabel + " " + timelabel; - }else{ label = timelabel; + labelWidget->setToolTip(""); + }else{ + label = timelabel; labelWidget->setToolTip(datelabel); } if( this->layout()->direction() == QBoxLayout::TopToBottom ){ @@ -62,11 +65,12 @@ void LClock::updateTime(){ } void LClock::updateFormats(){ + qDebug() << "Updating clock format"; timefmt = LSession::handle()->sessionSettings()->value("TimeFormat","").toString(); datefmt = LSession::handle()->sessionSettings()->value("DateFormat","").toString(); deftime = timefmt.simplified().isEmpty(); defdate = datefmt.simplified().isEmpty(); - datetimeorder = LSession::handle()->sessionSettings()->value("DateTimeOrder", "timeonly").toString(); + datetimeorder = LSession::handle()->sessionSettings()->value("DateTimeOrder", "timeonly").toString().toLower(); useTZ = LSession::handle()->sessionSettings()->value("CustomTimeZone",false).toBool(); if(useTZ){ TZ = QTimeZone( LSession::handle()->sessionSettings()->value("TimeZoneByteCode", QByteArray()).toByteArray() ); } |