From 604e48172be8fd6674f6d46f4bccd6a0c2b0bb0d Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 17 Apr 2015 08:45:54 -0400 Subject: Fix the implementation of the hardware brightness control on PC-BSD. Now it works consistently. --- libLumina/LuminaOS-FreeBSD.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libLumina/LuminaOS-FreeBSD.cpp b/libLumina/LuminaOS-FreeBSD.cpp index 73637048..430a31fc 100644 --- a/libLumina/LuminaOS-FreeBSD.cpp +++ b/libLumina/LuminaOS-FreeBSD.cpp @@ -8,6 +8,7 @@ #include "LuminaOS.h" #include +#include //can't read xbrightness settings - assume invalid until set static int screenbrightness = -1; @@ -71,17 +72,18 @@ void LOS::setScreenBrightness(int percent){ //ensure bounds if(percent<0){percent=0;} else if(percent>100){ percent=100; } - float pf = percent/100.0; //convert to a decimel //Run the command(s) bool success = false; // - try hardware setting first (PC-BSD only) if(QFile::exists("/usr/local/bin/pc-sysconfig")){ - QString ret = LUtils::getCmdOutput("pc-sysconfig \"setscreenbrightness "+QString::number(percent)+"\"").join(""); - success = (ret.simplified() == "[SUCCESS]"); + QString ret = LUtils::getCmdOutput("pc-sysconfig", QStringList() <<"setscreenbrightness "+QString::number(percent)).join(""); + success = ret.toLower().contains("success"); + qDebug() << "Set hardware brightness:" << percent << success; } // - if hardware brightness does not work, use software brightness if(!success){ QString cmd = "xbrightness %1"; + float pf = percent/100.0; //convert to a decimel cmd = cmd.arg( QString::number( int(65535*pf) ) ); success = (0 == LUtils::runCmd(cmd) ); } -- cgit From 8c39043b81d6f56b1db61002c38d7b40c520b711 Mon Sep 17 00:00:00 2001 From: wi Date: Fri, 17 Apr 2015 21:35:00 +0200 Subject: Fix a problem when removing items from the exclude list of lumina-search --- lumina-search/ConfigUI.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lumina-search/ConfigUI.cpp b/lumina-search/ConfigUI.cpp index 25c12246..ada82946 100644 --- a/lumina-search/ConfigUI.cpp +++ b/lumina-search/ConfigUI.cpp @@ -59,10 +59,7 @@ void ConfigUI::on_tool_adddirs_clicked(){ } void ConfigUI::on_tool_rmdir_clicked(){ - QList sel = ui->list_excludes->selectedItems(); - for(int i=0; ilist_excludes->removeItemWidget(sel[i]); - } + qDeleteAll(ui->list_excludes->selectedItems()); } void ConfigUI::on_list_excludes_itemSelectionChanged(){ -- cgit From bd668294210a83bdaa6ea685c60ae336eb321709 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 17 Apr 2015 16:17:56 -0400 Subject: A couple changes to lumina-config: 1) Fix loading the current "applauncher" panel plugins for the second panel. 2) If the save button is active when the "defaults" page is selected, keep the save button visible until clicked. --- lumina-config/mainUI.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/lumina-config/mainUI.cpp b/lumina-config/mainUI.cpp index 744d4bdf..987324f3 100644 --- a/lumina-config/mainUI.cpp +++ b/lumina-config/mainUI.cpp @@ -440,7 +440,7 @@ void MainUI::slotChangePage(bool enabled){ } ui->group_screen->setVisible(showScreen && (ui->spin_screen->maximum()>1) ); //Hide the save button for particular pages - ui->push_save->setVisible(!ui->actionDefaults->isChecked()); //hide on the default page + ui->push_save->setVisible(!ui->actionDefaults->isChecked() || moddesk || modpan || modmenu || modshort || moddef || modses); //hide on the default page if nothing waiting to be saved //Special functions for particular pages if(ui->page_panels->isVisible()){ checkpanels(); } @@ -557,11 +557,21 @@ void MainUI::loadCurrentSettings(bool screenonly){ ui->list_panel2_plugins->clear(); for(int i=0; ipanelPluginInfo(pid); - if(!info.ID.isEmpty()){ - QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(info.icon,""), info.name ); + if(pid.startsWith("applauncher")){ + bool ok = false; + XDGDesktop desk = LXDG::loadDesktopFile(pid.section("::",1,1),ok); + if(ok){ + QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(desk.icon,""), desk.name ); + it->setWhatsThis(plugs[i]); //make sure to preserve the entire plugin ID (is the unique version) + ui->list_panel2_plugins->addItem(it); + } + }else{ + LPI info = PINFO->panelPluginInfo(pid); + if(!info.ID.isEmpty()){ + QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(info.icon,""), info.name ); it->setWhatsThis(plugs[i]); //make sure to preserve the entire plugin ID (is the unique version) - ui->list_panel2_plugins->addItem(it); + ui->list_panel2_plugins->addItem(it); + } } } QString color = settings->value(PPrefix+"color","rgba(255,255,255,160)").toString(); @@ -730,6 +740,7 @@ void MainUI::saveCurrentSettings(bool screenonly){ moddesk = modpan = false; 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); } -- cgit From 3284332399bd373c20763731e3742431d943cc9f Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Sat, 18 Apr 2015 20:21:20 +0200 Subject: new snapshot --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index b12b8d20..378e59af 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +lumina-desktop (0.8.3.475-1nano) unstable; urgency=low + + * New git snapshot + + -- Christopher Roy Bratusek Sat, 18 Apr 2015 20:21:00 +0200 + lumina-desktop (0.8.3.440-1nano) unstable; urgency=low * New git snapshot -- cgit From 43e44e43c17098b60523d805829f7d0049653bc2 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Sat, 18 Apr 2015 20:28:37 +0200 Subject: a few runtime dependencies --- debian/changelog | 6 ++++++ debian/control | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 378e59af..4fc386d9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,12 @@ lumina-desktop (0.8.3.475-1nano) unstable; urgency=low * New git snapshot + * add runtime depencies for lumina-desktop: + - gstreamer1.0-plugins-base + - phonon4qt5-backend-gstreamer + - pavucontrol + - alsa-utils + - acpi -- Christopher Roy Bratusek Sat, 18 Apr 2015 20:21:00 +0200 diff --git a/debian/control b/debian/control index 2ef40b6a..28606ea2 100644 --- a/debian/control +++ b/debian/control @@ -18,7 +18,8 @@ Depends: ${misc:Depends}, ${shlibs:Depends}, libluminautils1 (= ${binary:Version libluminautils1, lumina-config, lumina-fm, oxygen-icon-theme, lumina-open, lumina-screenshot, lumina-search, lumina-info, lxpolkit, lumina-data, fluxbox, numlockx, xbacklight, xscreensaver, - usbmount + usbmount, gstreamer1.0-plugins-base, phonon4qt5-backend-gstreamer, + alsa-utils, acpi, pavucontrol Recommends: qt5-configuration-tool Description: Lightweight Qt5-based desktop environment Metapackage depending on all other lumina packages. -- cgit From 66c44f3497d80c9c604d90c406121555694c7d54 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Sat, 18 Apr 2015 21:13:49 +0200 Subject: lumina-fm show separated number of folders and files in status bar --- lumina-fm/BackgroundWorker.cpp | 10 ++++++++-- lumina-fm/BackgroundWorker.h | 2 +- lumina-fm/MainUI.cpp | 10 +++++----- lumina-fm/MainUI.h | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/lumina-fm/BackgroundWorker.cpp b/lumina-fm/BackgroundWorker.cpp index 125e0e1c..76b8ff8c 100644 --- a/lumina-fm/BackgroundWorker.cpp +++ b/lumina-fm/BackgroundWorker.cpp @@ -88,14 +88,19 @@ void BackgroundWorker::startDirChecks(QString path){ } -void BackgroundWorker::createStatusBarMsg(QFileInfoList fileList, QString path, QString message){ +void BackgroundWorker::createStatusBarMsg(QFileInfoList fileList, QString path, QString messageFolders, QString messageFiles){ + //collect some statistics of dir and display them in statusbar //Get the total size of the items double totalSizes = 0; + int numberFolders = 0; + int numberFiles = 0; for(int i=0; i 0){ totalSizes = qRound(totalSizes*100)/100.0; //round to 2 decimel places msgStatusBar += " "+QString(tr("Total size: %1 %2")).arg(QString::number(totalSizes), units[cunit]); diff --git a/lumina-fm/BackgroundWorker.h b/lumina-fm/BackgroundWorker.h index d50612fa..72060cad 100644 --- a/lumina-fm/BackgroundWorker.h +++ b/lumina-fm/BackgroundWorker.h @@ -34,7 +34,7 @@ public slots: //Kickoff processes with these slots // and then listen for the appropriate signals when finished void startDirChecks(QString path); - void createStatusBarMsg(QFileInfoList fileList, QString path, QString message); + void createStatusBarMsg(QFileInfoList fileList, QString path, QString messageFolders, QString messageFiles); signals: void ImagesAvailable(QStringList files); diff --git a/lumina-fm/MainUI.cpp b/lumina-fm/MainUI.cpp index 604e4c9c..0c38ae34 100644 --- a/lumina-fm/MainUI.cpp +++ b/lumina-fm/MainUI.cpp @@ -219,7 +219,7 @@ void MainUI::setupConnections(){ connect(worker, SIGNAL(SnapshotsAvailable(QString, QStringList)), this, SLOT(AvailableBackups(QString, QStringList)) ); //Background worker class for statusbar - connect(this, SIGNAL(Si_AdaptStatusBar(QFileInfoList, QString, QString)), worker, SLOT(createStatusBarMsg(QFileInfoList, QString, QString)) ); + connect(this, SIGNAL(Si_AdaptStatusBar(QFileInfoList, QString, QString, QString)), worker, SLOT(createStatusBarMsg(QFileInfoList, QString, QString, QString)) ); connect(worker, SIGNAL(Si_DisplayStatusBar(QString)), this, SLOT(DisplayStatusBar(QString)) ); //Action buttons on browser page @@ -850,7 +850,7 @@ void MainUI::currentDirectoryLoaded(){ ui->tool_goToRestore->setVisible(false); ui->tool_goToImages->setVisible(false); emit DirChanged(getCurrentDir()); - emit Si_AdaptStatusBar(fsmod->rootDirectory().entryInfoList(), getCurrentDir(), tr("Items")); + emit Si_AdaptStatusBar(fsmod->rootDirectory().entryInfoList(), getCurrentDir(), tr("Folders"), tr("Files")); ItemSelectionChanged(); } @@ -983,9 +983,9 @@ void MainUI::ItemSelectionChanged(){ QFileInfoList sel = getSelectedItems(); //display info related to files selected. //TO CHECK: impact if filesystem is very slow - if(sel.size()>0){ emit Si_AdaptStatusBar(sel, "", tr("Items selected")); } - else{ emit Si_AdaptStatusBar(fsmod->rootDirectory().entryInfoList(), getCurrentDir(), tr("Items")); } - + if(sel.size()>0){ emit Si_AdaptStatusBar(sel, "", tr("Selected Folders"), tr("Files"));} + else{ emit Si_AdaptStatusBar(fsmod->rootDirectory().entryInfoList(), getCurrentDir(), tr("Folders"), tr("Files")); } + ui->tool_act_run->setEnabled(sel.length()==1); ui->tool_act_runwith->setEnabled(sel.length()==1); ui->tool_act_rm->setEnabled(!sel.isEmpty() && isUserWritable); diff --git a/lumina-fm/MainUI.h b/lumina-fm/MainUI.h index d88492d6..58f03ee8 100644 --- a/lumina-fm/MainUI.h +++ b/lumina-fm/MainUI.h @@ -225,7 +225,7 @@ private slots: signals: void DirChanged(QString path); - void Si_AdaptStatusBar(QFileInfoList fileList, QString path, QString message); + void Si_AdaptStatusBar(QFileInfoList fileList, QString path, QString messageFolders, QString messageFiles); protected: void resizeEvent(QResizeEvent*); -- cgit From 7b0f1cb26ed0e64b73562569f16e7a94d449ddc5 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Sat, 18 Apr 2015 21:21:20 +0200 Subject: use ++ in createStatusBarMgs over += 1 --- lumina-fm/BackgroundWorker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lumina-fm/BackgroundWorker.cpp b/lumina-fm/BackgroundWorker.cpp index 76b8ff8c..02d2f02e 100644 --- a/lumina-fm/BackgroundWorker.cpp +++ b/lumina-fm/BackgroundWorker.cpp @@ -97,10 +97,10 @@ void BackgroundWorker::createStatusBarMsg(QFileInfoList fileList, QString path, int numberFiles = 0; for(int i=0; i Date: Sun, 19 Apr 2015 10:15:19 +0200 Subject: 4 time display modes for panel clock: timeonly (default): display time, date as tooltip dateonly : display date, time as tooltip datetime : display date first then time timedate : display time first then date LSession option: DateTimeOrder (no UI yet) --- lumina-desktop/panel-plugins/clock/LClock.cpp | 21 +++++++++++++++++---- lumina-desktop/panel-plugins/clock/LClock.h | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/lumina-desktop/panel-plugins/clock/LClock.cpp b/lumina-desktop/panel-plugins/clock/LClock.cpp index 79cae84b..c3eb1451 100644 --- a/lumina-desktop/panel-plugins/clock/LClock.cpp +++ b/lumina-desktop/panel-plugins/clock/LClock.cpp @@ -38,10 +38,22 @@ void LClock::updateTime(){ if(useTZ){ CT = CT.toTimeZone(TZ); } //Now update the display QString label; - if(deftime){ label = CT.time().toString(Qt::SystemLocaleShortDate) ; } - else{ label=CT.toString(timefmt); } - if(defdate){ labelWidget->setToolTip(CT.date().toString(Qt::SystemLocaleLongDate)); } - else{ labelWidget->setToolTip(CT.toString(datefmt)); } + QString timelabel; + QString datelabel; + if(deftime){ timelabel = CT.time().toString(Qt::SystemLocaleShortDate) ; } + else{ timelabel=CT.toString(timefmt); } + if(defdate){ datelabel = CT.date().toString(Qt::SystemLocaleLongDate); } + else{ datelabel = CT.toString(datefmt); } + if(datetimeorder == "dateonly"){ + label = datelabel; + labelWidget->setToolTip(timelabel); + }else if(datetimeorder == "timedate"){ + label = timelabel + " " + datelabel; + }else if(datetimeorder == "datetime"){ + label = datelabel + " " + timelabel; + }else{ label = timelabel; + labelWidget->setToolTip(datelabel); + } if( this->layout()->direction() == QBoxLayout::TopToBottom ){ //different routine for vertical text (need newlines instead of spaces) label.replace(" ","\n"); @@ -54,6 +66,7 @@ void LClock::updateFormats(){ datefmt = LSession::handle()->sessionSettings()->value("DateFormat","").toString(); deftime = timefmt.simplified().isEmpty(); defdate = datefmt.simplified().isEmpty(); + datetimeorder = LSession::handle()->sessionSettings()->value("DateTimeOrder", "timeonly").toString(); useTZ = LSession::handle()->sessionSettings()->value("CustomTimeZone",false).toBool(); if(useTZ){ TZ = QTimeZone( LSession::handle()->sessionSettings()->value("TimeZoneByteCode", QByteArray()).toByteArray() ); } diff --git a/lumina-desktop/panel-plugins/clock/LClock.h b/lumina-desktop/panel-plugins/clock/LClock.h index 8156e7d8..31bf13d6 100644 --- a/lumina-desktop/panel-plugins/clock/LClock.h +++ b/lumina-desktop/panel-plugins/clock/LClock.h @@ -26,7 +26,7 @@ public: private: QTimer *timer; QLabel *labelWidget; - QString timefmt, datefmt; + QString timefmt, datefmt, datetimeorder; bool deftime, defdate, useTZ; QTimeZone TZ; -- cgit From bd8b0221038b0461c7e3647c7fe4f919867b08d1 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Sun, 19 Apr 2015 11:10:41 +0200 Subject: UI for DateTimeOrder --- lumina-config/mainUI.cpp | 13 +++- lumina-config/mainUI.ui | 158 +++++++++++++++++++++++++---------------------- 2 files changed, 96 insertions(+), 75 deletions(-) diff --git a/lumina-config/mainUI.cpp b/lumina-config/mainUI.cpp index 987324f3..b1a8e797 100644 --- a/lumina-config/mainUI.cpp +++ b/lumina-config/mainUI.cpp @@ -237,6 +237,7 @@ void MainUI::setupConnections(){ connect(ui->line_session_time, SIGNAL(textChanged(QString)), this, SLOT(sessionLoadTimeSample()) ); connect(ui->line_session_date, SIGNAL(textChanged(QString)), this, SLOT(sessionLoadDateSample()) ); connect(ui->combo_session_timezone, SIGNAL(currentIndexChanged(int)), this, SLOT(sessionoptchanged()) ); + connect(ui->combo_session_datetimeorder, SIGNAL(currentIndexChanged(int)), this, SLOT(sessionoptchanged()) ); } void MainUI::setupMenus(){ @@ -275,6 +276,13 @@ void MainUI::setupMenus(){ ui->combo_session_wtheme->addItem(fbstyles[i], fbdir.absoluteFilePath(fbstyles[i])); } + //Display formats for panel clock + ui->combo_session_datetimeorder->clear(); + ui->combo_session_datetimeorder->addItem( tr("Time (Date as tooltip)"), "timeonly"); + ui->combo_session_datetimeorder->addItem( tr("Date (Time as tooltip)"), "dateonly"); + ui->combo_session_datetimeorder->addItem( tr("Time first then Date"), "timedate"); + ui->combo_session_datetimeorder->addItem( tr("Date first then Time"), "datetime"); + //Available Time zones ui->combo_session_timezone->clear(); QList TZList = QTimeZone::availableTimeZoneIds(); @@ -1813,11 +1821,13 @@ 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() ); + ui->combo_session_datetimeorder->setCurrentIndex(index); if( !sessionsettings->value("CustomTimeZone", false).toBool() ){ //System Time selected ui->combo_session_timezone->setCurrentIndex(0); }else{ - int index = ui->combo_session_timezone->findData( sessionsettings->value("TimeZoneByteCode",QByteArray()).toByteArray() ); + index = ui->combo_session_timezone->findData( sessionsettings->value("TimeZoneByteCode",QByteArray()).toByteArray() ); if(index>0){ ui->combo_session_timezone->setCurrentIndex(index); } else{ ui->combo_session_timezone->setCurrentIndex(0); } } @@ -1913,6 +1923,7 @@ void MainUI::saveSessionSettings(){ sessionsettings->setValue("PlayLogoutAudio", ui->check_session_playlogoutaudio->isChecked()); sessionsettings->setValue("TimeFormat", ui->line_session_time->text()); sessionsettings->setValue("DateFormat", ui->line_session_date->text()); + sessionsettings->setValue("DateTimeOrder", ui->combo_session_datetimeorder->currentData().toString()); if( ui->combo_session_timezone->currentIndex()==0){ //System Time selected sessionsettings->setValue("CustomTimeZone", false); diff --git a/lumina-config/mainUI.ui b/lumina-config/mainUI.ui index 07abacab..6061cae4 100644 --- a/lumina-config/mainUI.ui +++ b/lumina-config/mainUI.ui @@ -602,8 +602,8 @@ 0 0 - 233 - 150 + 263 + 178 @@ -701,7 +701,7 @@ 0 0 - 197 + 198 117 @@ -799,8 +799,8 @@ 0 0 - 233 - 150 + 263 + 178 @@ -898,7 +898,7 @@ 0 0 - 197 + 198 117 @@ -1467,19 +1467,6 @@ General Options - - - - Qt::Vertical - - - - 20 - 128 - - - - @@ -1535,7 +1522,62 @@ - + + + + + 50 + false + + + + Reset Desktop Settings + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Return to system defaults + + + + + + + Return to Lumina defaults + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + QFormLayout::AllNonFixedFieldsGrow @@ -1654,62 +1696,30 @@ + + + + + + + Display Format + + + - - - - - 50 - false - + + + + Qt::Vertical - - Reset Desktop Settings + + + 20 + 128 + - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Return to system defaults - - - - - - - Return to Lumina defaults - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - + @@ -1791,8 +1801,8 @@ 0 0 - 128 - 28 + 510 + 107 -- cgit From 24e136352943b7dd8fb016e427d89b5e87fba264 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Sun, 19 Apr 2015 11:27:59 +0200 Subject: bump version in debian/changelog --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 4fc386d9..e9ce4488 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -lumina-desktop (0.8.3.475-1nano) unstable; urgency=low +lumina-desktop (0.8.4.475-1nano) unstable; urgency=low * New git snapshot * add runtime depencies for lumina-desktop: -- cgit From 6b305b2ea0627b8abe4905da1f72026854c43628 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Sun, 19 Apr 2015 12:02:22 +0200 Subject: add lumina-xconfig dependency --- debian/control | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/control b/debian/control index 28606ea2..da781d4a 100644 --- a/debian/control +++ b/debian/control @@ -17,9 +17,9 @@ Replaces: lumina-core (<< 0.8.3.372) Depends: ${misc:Depends}, ${shlibs:Depends}, libluminautils1 (= ${binary:Version}), libluminautils1, lumina-config, lumina-fm, oxygen-icon-theme, lumina-open, lumina-screenshot, lumina-search, lumina-info, - lxpolkit, lumina-data, fluxbox, numlockx, xbacklight, xscreensaver, - usbmount, gstreamer1.0-plugins-base, phonon4qt5-backend-gstreamer, - alsa-utils, acpi, pavucontrol + lumina-xconfig, lxpolkit, lumina-data, fluxbox, numlockx, xbacklight, + xscreensaver, usbmount, gstreamer1.0-plugins-base, + phonon4qt5-backend-gstreamer, alsa-utils, acpi, pavucontrol Recommends: qt5-configuration-tool Description: Lightweight Qt5-based desktop environment Metapackage depending on all other lumina packages. -- cgit From e72395a608a739ebaf4e0a23595ea0918fa9af40 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Sun, 19 Apr 2015 13:47:29 -0400 Subject: Adjust te brightness control labelling a bit in the sytem dashboard. Now the label will always stay in sync with the slider (no delay), it is only the backend setting routine which is on a slight (50ms) delay. --- lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp b/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp index 08ab49d0..b470f191 100644 --- a/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp +++ b/lumina-desktop/panel-plugins/systemdashboard/SysMenuQuick.cpp @@ -15,7 +15,7 @@ LSysMenuQuick::LSysMenuQuick(QWidget *parent) : QWidget(parent), ui(new Ui::LSys settings = new QSettings("panel-plugins","systemdashboard"); brighttimer = new QTimer(this); brighttimer->setSingleShot(true); - brighttimer->setInterval(100); //100ms delay in setting the new value + 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% @@ -121,6 +121,11 @@ void LSysMenuQuick::brightSliderChanged(){ //Brightness controls cannot operate extremely quickly - combine calls as necessary if(brighttimer->isActive()){ brighttimer->stop(); } brighttimer->start(); + //*DO* update the label right away + int val = ui->slider_brightness->value(); + QString txt = QString::number(val)+"%"; + if(val<100){ txt.prepend(" "); } //make sure no widget resizing + ui->label_bright_text->setText( txt ); } void LSysMenuQuick::setCurrentBrightness(){ -- cgit From c90279a8649744171e7a24a99ace0512f41fed70 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Sun, 19 Apr 2015 19:49:11 +0200 Subject: auto-detect Debian vs. non-Debian Linux distribution --- debian/rules | 2 -- libLumina/libLumina.pro | 14 +++++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/debian/rules b/debian/rules index 877c4cbb..e1e14d53 100755 --- a/debian/rules +++ b/debian/rules @@ -30,14 +30,12 @@ QMAKE_EXTRA_DIRS = libLumina \ dh $@ --parallel override_dh_auto_configure: - sed -e 's/LuminaOS-Linux/LuminaOS-Debian/g' -i libLumina/libLumina.pro $(QMAKE) $(USER_QMAKE_FLAGS) for d in $(QMAKE_EXTRA_DIRS) ; do (cd $$d && $(QMAKE) $(USER_QMAKE_FLAGS)); done override_dh_auto_clean: dh_auto_clean -find $(CURDIR) -name *.qm -delete - -sed -e 's/LuminaOS-Debian/LuminaOS-Linux/g' -i libLumina/libLumina.pro override_dh_install: dh_install --list-missing diff --git a/libLumina/libLumina.pro b/libLumina/libLumina.pro index 1b78367a..8da9598c 100644 --- a/libLumina/libLumina.pro +++ b/libLumina/libLumina.pro @@ -36,10 +36,22 @@ SOURCES += LuminaXDG.cpp \ LuminaOS-FreeBSD.cpp \ LuminaOS-DragonFly.cpp \ LuminaOS-OpenBSD.cpp \ - LuminaOS-Linux.cpp \ LuminaOS-kFreeBSD.cpp # new OS support can be added here +# check linux distribution and use specific +# LuminaOS support functions (or fall back to +# generic one + +LINUX_DISTRIBUTION = $$system(lsb_release -si) + +equals(LINUX_DISTRIBUTION, "Debian"): { + SOURCES += LuminaOS-Debian.cpp +} else { + SOURCES += LuminaOS-Linux.cpp +} + + INCLUDEPATH += $$PREFIX/include LIBS += -lX11 -lXrender -lXcomposite -lxcb -lxcb-ewmh -lxcb-icccm -lxcb-image -lxcb-composite -- cgit From fbd67e202c15ffec78ad15dc9ea1ba8b6eb1b798 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Sun, 19 Apr 2015 14:19:11 -0400 Subject: Add support to LuminaOS for checking/starting the system suspend functionality. --- libLumina/LuminaOS-Debian.cpp | 10 ++++++++++ libLumina/LuminaOS-DragonFly.cpp | 10 ++++++++++ libLumina/LuminaOS-FreeBSD.cpp | 16 ++++++++++++++++ libLumina/LuminaOS-Linux.cpp | 10 ++++++++++ libLumina/LuminaOS-OpenBSD.cpp | 10 ++++++++++ libLumina/LuminaOS-kFreeBSD.cpp | 10 ++++++++++ libLumina/LuminaOS-template.cpp | 10 ++++++++++ libLumina/LuminaOS.h | 5 +++++ 8 files changed, 81 insertions(+) diff --git a/libLumina/LuminaOS-Debian.cpp b/libLumina/LuminaOS-Debian.cpp index 7ce8250f..a7be653c 100644 --- a/libLumina/LuminaOS-Debian.cpp +++ b/libLumina/LuminaOS-Debian.cpp @@ -152,6 +152,16 @@ void LOS::systemRestart(){ //start reboot sequence QProcess::startDetached("shutdown -r now"); } +//Check for suspend support +bool LOS::systemCanSuspend(){ + return false; +} + +//Put the system into the suspend state +void LOS::systemSuspend(){ + +} + //Battery Availability bool LOS::hasBattery(){ QString my_status = LUtils::getCmdOutput("acpi -b").join(""); diff --git a/libLumina/LuminaOS-DragonFly.cpp b/libLumina/LuminaOS-DragonFly.cpp index b9ba58a2..57ff1b2a 100644 --- a/libLumina/LuminaOS-DragonFly.cpp +++ b/libLumina/LuminaOS-DragonFly.cpp @@ -148,6 +148,16 @@ void LOS::systemRestart(){ //start reboot sequence QProcess::startDetached("shutdown -r now"); } +//Check for suspend support +bool LOS::systemCanSuspend(){ + return false; +} + +//Put the system into the suspend state +void LOS::systemSuspend(){ + +} + //Battery Availability bool LOS::hasBattery(){ int val = LUtils::getCmdOutput("apm -l").join("").toInt(); diff --git a/libLumina/LuminaOS-FreeBSD.cpp b/libLumina/LuminaOS-FreeBSD.cpp index 430a31fc..e294cf25 100644 --- a/libLumina/LuminaOS-FreeBSD.cpp +++ b/libLumina/LuminaOS-FreeBSD.cpp @@ -171,6 +171,22 @@ void LOS::systemRestart(){ //start reboot sequence QProcess::startDetached("shutdown -ro now"); } +//Check for suspend support +bool LOS::systemCanSuspend(){ + //Check the supported CPU sleep states and ensure that S3 is listed + QStringList info = LUtils::getCmdOutput("sysctl -ae").filter("hw.acpi.supported_sleep_state="); + bool ok = false; + if(!info.isEmpty()){ + ok = info.first().section("=",1,1).split(" ").contains("S3"); + } + return ok; +} + +//Put the system into the suspend state +void LOS::systemSuspend(){ + LUtils::runCmd("acpiconf -s 3"); +} + //Battery Availability bool LOS::hasBattery(){ int val = LUtils::getCmdOutput("apm -l").join("").toInt(); diff --git a/libLumina/LuminaOS-Linux.cpp b/libLumina/LuminaOS-Linux.cpp index 46a6371a..6929c9c3 100644 --- a/libLumina/LuminaOS-Linux.cpp +++ b/libLumina/LuminaOS-Linux.cpp @@ -149,6 +149,16 @@ void LOS::systemRestart(){ //start reboot sequence QProcess::startDetached("shutdown -r now"); } +//Check for suspend support +bool LOS::systemCanSuspend(){ + return false; +} + +//Put the system into the suspend state +void LOS::systemSuspend(){ + +} + //Battery Availability bool LOS::hasBattery(){ QString my_status = LUtils::getCmdOutput("acpi -b").join(""); diff --git a/libLumina/LuminaOS-OpenBSD.cpp b/libLumina/LuminaOS-OpenBSD.cpp index df6ddeba..5fda4866 100644 --- a/libLumina/LuminaOS-OpenBSD.cpp +++ b/libLumina/LuminaOS-OpenBSD.cpp @@ -166,6 +166,16 @@ void LOS::systemRestart(){ //start reboot sequence QProcess::startDetached("shutdown -r now"); } +//Check for suspend support +bool LOS::systemCanSuspend(){ + return false; +} + +//Put the system into the suspend state +void LOS::systemSuspend(){ + +} + //Battery Availability bool LOS::hasBattery(){ int val = LUtils::getCmdOutput("apm -b").join("").toInt(); diff --git a/libLumina/LuminaOS-kFreeBSD.cpp b/libLumina/LuminaOS-kFreeBSD.cpp index 2b24ce51..dee5a6c8 100644 --- a/libLumina/LuminaOS-kFreeBSD.cpp +++ b/libLumina/LuminaOS-kFreeBSD.cpp @@ -133,6 +133,16 @@ void LOS::systemRestart(){ //start reboot sequence QProcess::startDetached("shutdown -r now"); } +//Check for suspend support +bool LOS::systemCanSuspend(){ + return false; +} + +//Put the system into the suspend state +void LOS::systemSuspend(){ + +} + //Battery Availability bool LOS::hasBattery(){ return false; diff --git a/libLumina/LuminaOS-template.cpp b/libLumina/LuminaOS-template.cpp index dfb9d850..aabd7da3 100644 --- a/libLumina/LuminaOS-template.cpp +++ b/libLumina/LuminaOS-template.cpp @@ -81,6 +81,16 @@ void LOS::systemRestart(){ //start reboot sequence QProcess::startDetached("shutdown -r now"); } +//Check for suspend support +bool LOS::systemCanSuspend(){ + return false; +} + +//Put the system into the suspend state +void LOS::systemSuspend(){ + +} + //Battery Availability bool LOS::hasBattery(){ return false; //not implemented yet diff --git a/libLumina/LuminaOS.h b/libLumina/LuminaOS.h index 091a8d96..eb0e2eb6 100644 --- a/libLumina/LuminaOS.h +++ b/libLumina/LuminaOS.h @@ -71,6 +71,11 @@ public: static void systemShutdown(); //start poweroff sequence //System Restart static void systemRestart(); //start reboot sequence + //Check for suspend support + static bool systemCanSuspend(); + //Put the system into the suspend state + static void systemSuspend(); + //Battery Availability static bool hasBattery(); -- cgit From 1b3a24268a6b3e030550a00c0ddfdcee37db56ff Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Sun, 19 Apr 2015 15:22:37 -0400 Subject: Clean up the new suspend support in Lumina, and add it to the system "log out" menu as an option (if supported on that system). --- libLumina/LuminaOS-FreeBSD.cpp | 12 ++++---- lumina-desktop/SystemWindow.cpp | 12 ++++++++ lumina-desktop/SystemWindow.h | 4 ++- lumina-desktop/SystemWindow.ui | 65 ++++++++++++++++++++++++++++++++++------- 4 files changed, 75 insertions(+), 18 deletions(-) diff --git a/libLumina/LuminaOS-FreeBSD.cpp b/libLumina/LuminaOS-FreeBSD.cpp index e294cf25..c9874605 100644 --- a/libLumina/LuminaOS-FreeBSD.cpp +++ b/libLumina/LuminaOS-FreeBSD.cpp @@ -173,18 +173,18 @@ void LOS::systemRestart(){ //start reboot sequence //Check for suspend support bool LOS::systemCanSuspend(){ - //Check the supported CPU sleep states and ensure that S3 is listed - QStringList info = LUtils::getCmdOutput("sysctl -ae").filter("hw.acpi.supported_sleep_state="); - bool ok = false; - if(!info.isEmpty()){ - ok = info.first().section("=",1,1).split(" ").contains("S3"); + //This will only function on PC-BSD + //(permissions issues on standard FreeBSD unless setup a special way) + bool ok = QFile::exists("/usr/local/bin/pc-sysconfig"); + if(ok){ + ok = LUtils::getCmdOutput("pc-sysconfig systemcansuspend").join("").toLower().contains("true"); } return ok; } //Put the system into the suspend state void LOS::systemSuspend(){ - LUtils::runCmd("acpiconf -s 3"); + QProcess::startDetached("pc-sysconfig suspendsystem"); } //Battery Availability diff --git a/lumina-desktop/SystemWindow.cpp b/lumina-desktop/SystemWindow.cpp index 0540a5d9..02de54b9 100644 --- a/lumina-desktop/SystemWindow.cpp +++ b/lumina-desktop/SystemWindow.cpp @@ -17,19 +17,23 @@ SystemWindow::SystemWindow() : QDialog(), ui(new Ui::SystemWindow){ ui->tool_logout->setIcon( LXDG::findIcon("system-log-out","") ); ui->tool_restart->setIcon( LXDG::findIcon("system-reboot","") ); ui->tool_shutdown->setIcon( LXDG::findIcon("system-shutdown","") ); + ui->tool_suspend->setIcon( LXDG::findIcon("system-suspend","") ); ui->push_cancel->setIcon( LXDG::findIcon("dialog-cancel","") ); ui->push_lock->setIcon( LXDG::findIcon("system-lock-screen","") ); //Connect the signals/slots connect(ui->tool_logout, SIGNAL(clicked()), this, SLOT(sysLogout()) ); connect(ui->tool_restart, SIGNAL(clicked()), this, SLOT(sysRestart()) ); connect(ui->tool_shutdown, SIGNAL(clicked()), this, SLOT(sysShutdown()) ); + connect(ui->tool_suspend, SIGNAL(clicked()), this, SLOT(sysSuspend()) ); connect(ui->push_cancel, SIGNAL(clicked()), this, SLOT(sysCancel()) ); connect(ui->push_lock, SIGNAL(clicked()), this, SLOT(sysLock()) ); //Disable the shutdown/restart buttons if necessary if( !LOS::userHasShutdownAccess() ){ ui->tool_restart->setEnabled(false); ui->tool_shutdown->setEnabled(false); + } + ui->tool_suspend->setVisible(LOS::systemCanSuspend()); //Center this window on the screen QPoint center = QApplication::desktop()->screenGeometry(QCursor::pos()).center(); //get the center of the current screen this->move(center.x() - this->width()/2, center.y() - this->height()/2); @@ -55,6 +59,14 @@ void SystemWindow::sysShutdown(){ this->close(); } +void SystemWindow::sysSuspend(){ + //Make sure to lock the system first (otherwise anybody can access it again) + LUtils::runCmd("xscreensaver-command -lock"); + //Now suspend the system + LOS::systemSuspend(); + this->close(); +} + void SystemWindow::sysLock(){ qDebug() << "Locking the desktop..."; QProcess::startDetached("xscreensaver-command -lock"); diff --git a/lumina-desktop/SystemWindow.h b/lumina-desktop/SystemWindow.h index 211de5fd..4b1fab44 100644 --- a/lumina-desktop/SystemWindow.h +++ b/lumina-desktop/SystemWindow.h @@ -38,6 +38,8 @@ private slots: void sysShutdown(); + void sysSuspend(); + void sysCancel(){ this->close(); } @@ -45,4 +47,4 @@ private slots: void sysLock(); }; -#endif \ No newline at end of file +#endif diff --git a/lumina-desktop/SystemWindow.ui b/lumina-desktop/SystemWindow.ui index b03039f5..9e25509b 100644 --- a/lumina-desktop/SystemWindow.ui +++ b/lumina-desktop/SystemWindow.ui @@ -14,8 +14,17 @@ System Options - - 0 + + 2 + + + 2 + + + 2 + + + 2 @@ -47,8 +56,8 @@ - 60 - 60 + 64 + 64 @@ -63,8 +72,8 @@ - 60 - 60 + 64 + 64 @@ -79,8 +88,8 @@ - 60 - 60 + 64 + 64 @@ -113,10 +122,19 @@ - + Cancel + + + 32 + 32 + + + + Qt::ToolButtonTextUnderIcon + @@ -133,9 +151,34 @@ - + - Lock Screen + Lock + + + + 32 + 32 + + + + Qt::ToolButtonTextUnderIcon + + + + + + + Suspend + + + + 32 + 32 + + + + Qt::ToolButtonTextUnderIcon -- cgit From 570272ccbe285afcad3f5b4ab00a18475ef163ed Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 20 Apr 2015 10:47:57 -0400 Subject: Remove the last libX11 usage in the sytem tray protocols. Move the damage ID creation to XCB, and place it within the embedding routine in LuminaX11 instead. --- libLumina/LuminaX11.cpp | 14 ++++++++++---- libLumina/LuminaX11.h | 2 +- lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp | 15 +++++++-------- lumina-desktop/panel-plugins/systemtray/TrayIcon.h | 14 ++------------ 4 files changed, 20 insertions(+), 25 deletions(-) diff --git a/libLumina/LuminaX11.cpp b/libLumina/LuminaX11.cpp index 05a03631..89c138ca 100644 --- a/libLumina/LuminaX11.cpp +++ b/libLumina/LuminaX11.cpp @@ -27,6 +27,7 @@ #include #include #include +#include //===== WindowList() ======== @@ -1357,15 +1358,16 @@ void LXCB::MoveResizeWindow(WId win, QRect geom){ } // === EmbedWindow() === -bool LXCB::EmbedWindow(WId win, WId container){ - if(win==0 || container==0){ return false; } +uint LXCB::EmbedWindow(WId win, WId container){ + //This returns the damage control ID number (or 0 for a failure) + if(win==0 || container==0){ return 0; } //qDebug() << "Embed Window:" << win << container; //Initialize any atoms that will be needed xcb_intern_atom_cookie_t ecookie = xcb_intern_atom_unchecked(QX11Info::connection(), 0, 7, "_XEMBED"); xcb_intern_atom_reply_t *ereply = xcb_intern_atom_reply(QX11Info::connection(), ecookie, NULL); - if(ereply==0){ return false; } //unable to initialize the atom + if(ereply==0){ return 0; } //unable to initialize the atom xcb_atom_t emb = ereply->atom; free(ereply); //done with this structure @@ -1399,8 +1401,12 @@ bool LXCB::EmbedWindow(WId win, WId container){ //Now map the window (will be a transparent child of the container) xcb_map_window(QX11Info::connection(), win); + //Now create/register the damage handler + xcb_damage_damage_t dmgID = xcb_generate_id(QX11Info::connection()); //This is a typedef for a 32-bit unsigned integer + xcb_damage_create(QX11Info::connection(), dmgID, win, XCB_DAMAGE_REPORT_LEVEL_RAW_RECTANGLES); + //qDebug() << " - Done"; - return true; + return ( (uint) dmgID ); } // === Unembed Window() === diff --git a/libLumina/LuminaX11.h b/libLumina/LuminaX11.h index 4ce279f4..0a950d63 100644 --- a/libLumina/LuminaX11.h +++ b/libLumina/LuminaX11.h @@ -153,7 +153,7 @@ public: void MoveResizeWindow(WId win, QRect geom); //Window Embedding/Detaching (for system tray) - bool EmbedWindow(WId win, WId container); + uint EmbedWindow(WId win, WId container); //returns the damage ID (or 0 for an error) bool UnembedWindow(WId win); }; diff --git a/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp b/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp index 8d0cacb3..a35db4d7 100644 --- a/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp +++ b/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp @@ -8,19 +8,20 @@ //#include //#include -#include +//#include //#include //static xcb_damage_damage_t dmgID; #include #include - -static int dmgID = 0; +#include +//static int dmgID = 0; TrayIcon::TrayIcon(QWidget *parent) : QWidget(parent){ AID = 0; //nothing yet IID = 0; + dmgID = 0; } TrayIcon::~TrayIcon(){ @@ -38,12 +39,10 @@ void TrayIcon::attachApp(WId id){ else if(AID!=0){ qWarning() << "Tray Icon is already attached to a window!"; return; } AID = id; IID = this->winId(); //embed directly into this widget - //IID = LX11::CreateWindow( this->winId(), this->rect() ); //Create an intermediate window to be the parent - if( LSession::handle()->XCB->EmbedWindow(AID, IID) ){ + dmgID = LSession::handle()->XCB->EmbedWindow(AID, IID); + if( dmgID != 0 ){ LX11::RestoreWindow(AID); //make it visible - //XSelectInput(QX11Info::display(), AID, StructureNotifyMask); - //xcb_damage_create(QX11Info::connection(), dmgID, AID, XCB_DAMAGE_REPORT_LEVEL_RAW_RECTANGLES); - dmgID = XDamageCreate( QX11Info::display(), AID, XDamageReportRawRectangles ); + //dmgID = XDamageCreate( QX11Info::display(), AID, XDamageReportRawRectangles ); qDebug() << "New System Tray App:" << AID; QTimer::singleShot(1000, this, SLOT(updateIcon()) ); }else{ diff --git a/lumina-desktop/panel-plugins/systemtray/TrayIcon.h b/lumina-desktop/panel-plugins/systemtray/TrayIcon.h index a3cbac31..18c51a66 100644 --- a/lumina-desktop/panel-plugins/systemtray/TrayIcon.h +++ b/lumina-desktop/panel-plugins/systemtray/TrayIcon.h @@ -22,9 +22,7 @@ #include // libLumina includes -#include - -//Local includes +//#include class TrayIcon : public QWidget{ Q_OBJECT @@ -42,19 +40,11 @@ public slots: private: WId IID, AID; //icon ID and app ID - -//private slots: - //void slotAttach(); //so that the attachment can be done in a new thread - + uint dmgID; protected: void paintEvent(QPaintEvent *event); - //void moveEvent(QMoveEvent *event); void resizeEvent(QResizeEvent *event); - //bool x11Event(XEvent *event); -//signals: - //void AppClosed(); - //void AppAttached(); }; #endif \ No newline at end of file -- cgit From 5260eecf035a37e54eaceef2f7a45e8162400864 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 20 Apr 2015 12:34:06 -0400 Subject: Update th elibLumina.pro: 1)Require the xcb-damage library 2) Verify the existance of "lsb_release" before trying to use it (Linux/Debian distinction utility). --- libLumina/libLumina.pro | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libLumina/libLumina.pro b/libLumina/libLumina.pro index 8da9598c..ef30bd20 100644 --- a/libLumina/libLumina.pro +++ b/libLumina/libLumina.pro @@ -43,7 +43,9 @@ SOURCES += LuminaXDG.cpp \ # LuminaOS support functions (or fall back to # generic one -LINUX_DISTRIBUTION = $$system(lsb_release -si) +exists(/bin/lsb_release){ + LINUX_DISTRIBUTION = $$system(lsb_release -si) +} equals(LINUX_DISTRIBUTION, "Debian"): { SOURCES += LuminaOS-Debian.cpp @@ -52,9 +54,10 @@ equals(LINUX_DISTRIBUTION, "Debian"): { } + INCLUDEPATH += $$PREFIX/include -LIBS += -lX11 -lXrender -lXcomposite -lxcb -lxcb-ewmh -lxcb-icccm -lxcb-image -lxcb-composite +LIBS += -lX11 -lXrender -lXcomposite -lxcb -lxcb-ewmh -lxcb-icccm -lxcb-image -lxcb-composite -lxcb-damage include.path=$$PREFIX/include/ include.files=LuminaXDG.h \ -- cgit From 3195432db816416fab7a895dcd442e898290c0dc Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 20 Apr 2015 13:20:52 -0400 Subject: Add a special flag to prevent the lumina-open crash handler from starting up during the session cleanup procedures. --- lumina-desktop/LSession.cpp | 5 +++++ lumina-open/main.cpp | 18 +++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp index e076210f..0fea2fa1 100644 --- a/lumina-desktop/LSession.cpp +++ b/lumina-desktop/LSession.cpp @@ -75,6 +75,7 @@ LSession::~LSession(){ void LSession::setupSession(){ qDebug() << "Initializing Session"; + if(QFile::exists("/tmp/.luminastopping")){ QFile::remove("/tmp/.luminastopping"); } QTime* timer = 0; if(DEBUG){ timer = new QTime(); timer->start(); qDebug() << " - Init srand:" << timer->elapsed();} //Seed random number generator (if needed) @@ -134,6 +135,8 @@ void LSession::CleanupSession(){ LSession::processEvents(); QDateTime time = QDateTime::currentDateTime(); qDebug() << "Start closing down the session: " << time.toString( Qt::SystemLocaleShortDate); + //Create a temporary flag to prevent crash dialogs from opening during cleanup + LUtils::writeFile("/tmp/.luminastopping",QStringList() << "yes", true); //Start the logout chimes (if necessary) bool playaudio = sessionsettings->value("PlayLogoutAudio",true).toBool(); if( playaudio ){ playAudioFile(LOS::LuminaShare()+"Logout.ogg"); } @@ -184,6 +187,8 @@ void LSession::CleanupSession(){ }else{ for(int i=0; i<20; i++){ LSession::processEvents(); usleep(25000); } //1/2 second pause } + //Clean up the temporary flag + if(QFile::exists("/tmp/.luminastopping")){ QFile::remove("/tmp/.luminastopping"); } //if(audioThread!=0){ audioThread->exit(0); } } diff --git a/lumina-open/main.cpp b/lumina-open/main.cpp index de7d137b..d0d2ced1 100644 --- a/lumina-open/main.cpp +++ b/lumina-open/main.cpp @@ -325,19 +325,19 @@ int main(int argc, char **argv){ } retcode = p->exitCode(); //qDebug() << "[lumina-open] Finished Cmd:" << cmd << retcode << p->exitStatus(); - + if( QFile::exists("/tmp/.luminastopping") ){ watch = false; } //closing down session - ignore "crashes" (app could have been killed during cleanup) if( (p->exitStatus() == QProcess::CrashExit || retcode > 0) && watch){ qDebug() << "[lumina-open] Application Error:" << retcode; QString err = QString(p->readAllStandardError()); if(err.isEmpty()){ err = QString(p->readAllStandardOutput()); } - //Setup the application - QApplication App(argc, argv); - LuminaThemeEngine theme(&App); - LUtils::LoadTranslation(&App,"lumina-open"); - QMessageBox dlg(QMessageBox::Critical, QObject::tr("Application Error"), QObject::tr("The following application experienced an error and needed to close:")+"\n\n"+cmd ); - if(!err.isEmpty()){ dlg.setDetailedText(err); } - dlg.exec(); - } + //Setup the application + QApplication App(argc, argv); + LuminaThemeEngine theme(&App); + LUtils::LoadTranslation(&App,"lumina-open"); + QMessageBox dlg(QMessageBox::Critical, QObject::tr("Application Error"), QObject::tr("The following application experienced an error and needed to close:")+"\n\n"+cmd ); + if(!err.isEmpty()){ dlg.setDetailedText(err); } + dlg.exec(); + } } return retcode; } -- cgit