aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop
diff options
context:
space:
mode:
Diffstat (limited to 'lumina-desktop')
-rw-r--r--lumina-desktop/LSession.cpp34
-rw-r--r--lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp9
-rw-r--r--lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.h1
3 files changed, 26 insertions, 18 deletions
diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp
index 994faad8..8b05b5ef 100644
--- a/lumina-desktop/LSession.cpp
+++ b/lumina-desktop/LSession.cpp
@@ -112,6 +112,15 @@ void LSession::setupSession(){
if(DEBUG){ qDebug() << " - Init SettingsMenu:" << timer->elapsed();}
settingsmenu = new SettingsMenu();
+ //Re-load the screen brightness and volume settings from the previous session
+ qDebug() << " - Loading previous settings";
+ int tmp = LOS::audioVolume();
+ LOS::setAudioVolume(tmp);
+ qDebug() << " - - Audio Volume:" << QString::number(tmp)+"%";
+ tmp = LOS::ScreenBrightness();
+ LOS::setScreenBrightness( tmp );
+ qDebug() << " - - Screen Brightness:" << QString::number(tmp)+"%";
+
//Now setup the system watcher for changes
qDebug() << " - Initialize file system watcher";
if(DEBUG){ qDebug() << " - Init QFileSystemWatcher:" << timer->elapsed();}
@@ -209,6 +218,17 @@ int LSession::VersionStringToNumber(QString version){
void LSession::launchStartupApps(){
//First start any system-defined startups, then do user defined
qDebug() << "Launching startup applications";
+ //Now play the login music
+ if(sessionsettings->value("PlayStartupAudio",true).toBool()){
+ //Make sure to re-set the system volume to the last-used value at outset
+ int vol = LOS::audioVolume();
+ if(vol>=0){ LOS::setAudioVolume(vol); }
+ LSession::playAudioFile(LOS::LuminaShare()+"Login.ogg");
+ }
+ //Enable Numlock
+ if(sessionsettings->value("EnableNumlock",false).toBool()){
+ QProcess::startDetached("numlockx on");
+ }
//First create the list of all possible locations in order of precedence
// NOTE: Lumina/system defaults should be launched earlier due to possible system admin utilities
QStringList filelist;
@@ -235,19 +255,10 @@ void LSession::launchStartupApps(){
entries.removeDuplicates(); //Just in case something is duplicated between system/user defaults
for(int i=0; i<entries.length(); i++){
qDebug() << " - Starting Application:" << entries[i];
- LSession::LaunchApplication(entries[i]);
+ LSession::LaunchApplication(entries[i]);
+ LSession::processEvents();
}
- //Now play the login music
- if(sessionsettings->value("PlayStartupAudio",true).toBool()){
- //Make sure to re-set the system volume to the last-used value at outset
- int vol = LOS::audioVolume();
- if(vol>=0){ LOS::setAudioVolume(vol); }
- LSession::playAudioFile(LOS::LuminaShare()+"Login.ogg");
- }
- if(sessionsettings->value("EnableNumlock",false).toBool()){
- QProcess::startDetached("numlockx on");
- }
//Now get any XDG startup applications and launch them
QList<XDGDesktop> xdgapps = LXDG::findAutoStartFiles();
for(int i=0; i<xdgapps.length(); i++){
@@ -258,6 +269,7 @@ void LSession::launchStartupApps(){
//Don't update the mouse cursor
QProcess::startDetached("lumina-open \""+xdgapps[i].filePath+"\"");
}
+ LSession::processEvents();
}
}
diff --git a/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp b/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp
index b470f191..0cf053fa 100644
--- a/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp
+++ b/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp
@@ -12,13 +12,12 @@
LSysMenuQuick::LSysMenuQuick(QWidget *parent) : QWidget(parent), ui(new Ui::LSysMenuQuick){
ui->setupUi(this);
- settings = new QSettings("panel-plugins","systemdashboard");
brighttimer = new QTimer(this);
brighttimer->setSingleShot(true);
brighttimer->setInterval(50); //50ms delay in setting the new value
- //Now reset the initial saved settings (if any)
- LOS::setScreenBrightness( settings->value("screenbrightness",100).toInt() ); //default to 100%
- LOS::setAudioVolume( settings->value("audiovolume", 100).toInt() ); //default to 100%
+ //Now reset the initial saved settings (this is handles by the LOS/session now - 4/22/15)
+ UpdateMenu(); //do this once before all the signals/slots are connected below
+
//Now setup the connections
connect(ui->slider_volume, SIGNAL(valueChanged(int)), this, SLOT(volSliderChanged()) );
connect(ui->slider_brightness, SIGNAL(valueChanged(int)), this, SLOT(brightSliderChanged()) );
@@ -102,7 +101,6 @@ void LSysMenuQuick::UpdateMenu(){
void LSysMenuQuick::volSliderChanged(){
int val = ui->slider_volume->value();
LOS::setAudioVolume(val);
- settings->setValue("audiovolume",val);
QString txt = QString::number(val)+"%";
if(val<100){ txt.prepend(" "); } //make sure no widget resizing
ui->label_vol_text->setText( txt );
@@ -131,7 +129,6 @@ void LSysMenuQuick::brightSliderChanged(){
void LSysMenuQuick::setCurrentBrightness(){
int val = ui->slider_brightness->value();
LOS::setScreenBrightness(val);
- settings->setValue("screenbrightness",val);
QString txt = QString::number(val)+"%";
if(val<100){ txt.prepend(" "); } //make sure no widget resizing
ui->label_bright_text->setText( txt );
diff --git a/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.h b/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.h
index 816eb009..a9580cce 100644
--- a/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.h
+++ b/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.h
@@ -31,7 +31,6 @@ public:
private:
Ui::LSysMenuQuick *ui;
- QSettings *settings;
QTimer *brighttimer;
QString getRemainingTime(); //battery time left
bgstack15