diff options
author | Ken Moore <ken@pcbsd.org> | 2015-04-24 18:55:20 -0400 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2015-04-24 18:55:20 -0400 |
commit | 4e03c0a4f2829d2dc94a902220f74cb7650dc8d6 (patch) | |
tree | eb2e93963aeedf09d88b1ab1c3bd9d6d7cb21f51 | |
parent | Before activating the panel on mouse-over, save the ID of the currently activ... (diff) | |
parent | Merge branch 'master' of github.com:pcbsd/lumina (diff) | |
download | lumina-4e03c0a4f2829d2dc94a902220f74cb7650dc8d6.tar.gz lumina-4e03c0a4f2829d2dc94a902220f74cb7650dc8d6.tar.bz2 lumina-4e03c0a4f2829d2dc94a902220f74cb7650dc8d6.zip |
Merge branch 'master' of github.com:pcbsd/lumina
-rw-r--r-- | debian/changelog | 7 | ||||
-rw-r--r-- | libLumina/LuminaOS-Debian.cpp | 21 | ||||
-rw-r--r-- | libLumina/LuminaOS-FreeBSD.cpp | 4 | ||||
-rw-r--r-- | lumina-desktop/LSession.cpp | 34 | ||||
-rw-r--r-- | lumina-fm/MainUI.cpp | 59 | ||||
-rw-r--r-- | lumina-fm/MainUI.h | 6 | ||||
-rw-r--r-- | lumina-open/main.cpp | 15 |
7 files changed, 86 insertions, 60 deletions
diff --git a/debian/changelog b/debian/changelog index bacb03b1..e3fa52c1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +lumina-desktop (0.8.4.556-1nano) unstable; urgency=low + + * New git snapshot + * reboot, shutdown and suspend via logind + + -- Christopher Roy Bratusek <nano@jpberlin.de> Thu, 23 Apr 2015 20:27:23 +0200 + lumina-desktop (0.8.4.533-1nano) unstable; urgency=low * New git snapshot diff --git a/libLumina/LuminaOS-Debian.cpp b/libLumina/LuminaOS-Debian.cpp index a7be653c..650a2b5a 100644 --- a/libLumina/LuminaOS-Debian.cpp +++ b/libLumina/LuminaOS-Debian.cpp @@ -100,7 +100,6 @@ QString info = LUtils::getCmdOutput("amixer get Master").join("").simplified();; } return out; - } //Set the current volume @@ -139,27 +138,37 @@ void LOS::startMixerUtility(){ //Check for user system permission (shutdown/restart) bool LOS::userHasShutdownAccess(){ - return true; //not implemented yet + QProcess::startDetached("dbus-send --system --print-reply=literal \ + --type=method_call --dest=org.freedesktop.login1 \ + /org/freedesktop/login1 org.freedesktop.login1.Manager.CanPowerOff"); } //System Shutdown void LOS::systemShutdown(){ //start poweroff sequence - QProcess::startDetached("shutdown -h now"); + QProcess::startDetached("dbus-send --system --print-reply \ + --dest=org.freedesktop.login1 /org/freedesktop/login1 \ + org.freedesktop.login1.Manager.PowerOff boolean:true"); } //System Restart void LOS::systemRestart(){ //start reboot sequence - QProcess::startDetached("shutdown -r now"); + QProcess::startDetached("dbus-send --system --print-reply \ + --dest=org.freedesktop.login1 /org/freedesktop/login1 \ + org.freedesktop.login1.Manager.Reboot boolean:true"); } //Check for suspend support bool LOS::systemCanSuspend(){ - return false; + QProcess::startDetached("dbus-send --system --print-reply=literal \ + --type=method_call --dest=org.freedesktop.login1 \ + /org/freedesktop/login1 org.freedesktop.login1.Manager.CanSuspend"); } //Put the system into the suspend state void LOS::systemSuspend(){ - + QProcess::startDetached("dbus-send --system --print-reply \ + --dest=org.freedesktop.login1 /org/freedesktop/login1 \ + org.freedesktop.login1.Manager.Suspend boolean:true"); } //Battery Availability diff --git a/libLumina/LuminaOS-FreeBSD.cpp b/libLumina/LuminaOS-FreeBSD.cpp index 39eae307..7ef782d9 100644 --- a/libLumina/LuminaOS-FreeBSD.cpp +++ b/libLumina/LuminaOS-FreeBSD.cpp @@ -22,7 +22,7 @@ QString LOS::SysPrefix(){ return "/usr/"; } //Prefix for system //OS-specific application shortcuts (*.desktop files) QString LOS::ControlPanelShortcut(){ return "/usr/local/share/applications/pccontrol.desktop"; } //system control panel QString LOS::AppStoreShortcut(){ return "/usr/local/share/applications/softmanager.desktop"; } //graphical app/pkg manager -QString LOS::QtConfigShortcut(){ return "/usr/local/bin/qtconfig-qt4"; } //qtconfig binary (NOT *.desktop file) +QString LOS::QtConfigShortcut(){ return ""; } //qtconfig binary (NOT *.desktop file) // ==== ExternalDevicePaths() ==== QStringList LOS::ExternalDevicePaths(){ @@ -58,6 +58,7 @@ int LOS::ScreenBrightness(){ //Make sure we are not running in VirtualBox (does not work in a VM) QStringList info = LUtils::getCmdOutput("pciconf -lv"); if( !info.filter("VirtualBox", Qt::CaseInsensitive).isEmpty() ){ return -1; } + else if( !LUtils::isValidBinary("xbrightness") ){ return -1; } //incomplete install //Now perform the standard brightness checks if(screenbrightness==-1){ //memory value if(QFile::exists(QDir::homePath()+"/.lumina/.currentxbrightness")){ //saved file value @@ -70,6 +71,7 @@ int LOS::ScreenBrightness(){ //Set screen brightness void LOS::setScreenBrightness(int percent){ + if(percent == -1){ return; } //This is usually an invalid value passed directly to the setter //ensure bounds if(percent<0){percent=0;} else if(percent>100){ percent=100; } diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp index a09ab7bf..e2424fcd 100644 --- a/lumina-desktop/LSession.cpp +++ b/lumina-desktop/LSession.cpp @@ -111,15 +111,6 @@ void LSession::setupSession(){ appmenu = new AppMenu(); 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"; @@ -218,13 +209,7 @@ 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"); @@ -272,6 +257,23 @@ void LSession::launchStartupApps(){ LSession::processEvents(); } + //Re-load the screen brightness and volume settings from the previous session + // Wait until after the XDG-autostart functions, since the audio system might be started that way + 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 play the login music since we are finished + 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"); + } } void LSession::StartLogout(){ diff --git a/lumina-fm/MainUI.cpp b/lumina-fm/MainUI.cpp index d7e3b290..7f1e5fcc 100644 --- a/lumina-fm/MainUI.cpp +++ b/lumina-fm/MainUI.cpp @@ -953,12 +953,9 @@ void MainUI::OpenContextMenu(const QPoint &pt){ //Create the context menu contextMenu->clear(); if(!CItem.isEmpty()){ - if(info.isDir()){ - contextMenu->addAction(LXDG::findIcon("tab-new-background",""), tr("Open in new tab"), this, SLOT(OpenDir()) ); - }else{ - contextMenu->addAction(LXDG::findIcon("run-build-file",""), tr("Open"), this, SLOT(OpenItem()) ); - contextMenu->addAction(LXDG::findIcon("run-build-configure",""), tr("Open With..."), this, SLOT(OpenItemWith()) ); - } + contextMenu->addAction(LXDG::findIcon("run-build-file",""), tr("Open"), this, SLOT(OpenItem()) ); + contextMenu->addAction(LXDG::findIcon("run-build-configure",""), tr("Open With..."), this, SLOT(OpenItemWith()) ); + contextMenu->addAction(LXDG::findIcon("edit-rename",""), tr("Rename"), this, SLOT(RenameItem()) )->setEnabled(info.isWritable()); contextMenu->addAction(LXDG::findIcon("document-encrypted",""), tr("View Checksums"), this, SLOT(ChecksumItems()) ); contextMenu->addSeparator(); @@ -990,8 +987,8 @@ void MainUI::ItemSelectionChanged(){ 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_run->setEnabled(!sel.isEmpty()); + ui->tool_act_runwith->setEnabled(!sel.isEmpty()); ui->tool_act_rm->setEnabled(!sel.isEmpty() && isUserWritable); ui->tool_act_rename->setEnabled(sel.length()==1 && isUserWritable); ui->tool_act_cut->setEnabled(!sel.isEmpty() && isUserWritable); @@ -1293,30 +1290,32 @@ void MainUI::playerFileChanged(){ // Context Menu Actions //---------------------------------- void MainUI::OpenItem(){ - if(CItem.isEmpty()){ - QFileInfoList sel = getSelectedItems(); - if(sel.isEmpty()){ return; } - else{ CItem = sel[0].absoluteFilePath(); } - if(sel[0].isDir()){ OpenDir(); return; } //just in case - open it in a new tab + QFileInfoList sel = getSelectedItems(); + if(sel.isEmpty()){ return; } + + QStringList dirs; + for(int i=0; i<sel.length(); i++){ + if(sel[i].isDir()){ dirs << sel[i].absoluteFilePath(); } + else{ + qDebug() << "Opening File:" << sel[i].absoluteFilePath(); + QProcess::startDetached("lumina-open \""+sel[i].absoluteFilePath()+"\""); + } } - qDebug() << "Opening File:" << CItem; - QProcess::startDetached("lumina-open \""+CItem+"\""); + if(!dirs.isEmpty()){ OpenDirs(dirs); } CItem.clear(); } void MainUI::OpenItemWith(){ - if(CItem.isEmpty()){ - QFileInfoList sel = getSelectedItems(); - if(sel.isEmpty()){ return; } - else{ CItem = sel[0].absoluteFilePath(); } - if(sel[0].isDir()){ OpenDir(); return; } //just in case - open it in a new tab + QFileInfoList sel = getSelectedItems(); + if(sel.isEmpty()){ return; } + for(int i=0; i<sel.length(); i++){ + qDebug() << "Opening File With:" << sel[i].absoluteFilePath(); + QProcess::startDetached("lumina-open -select \""+sel[i].absoluteFilePath()+"\""); } - qDebug() << "Opening File:" << CItem; - QProcess::startDetached("lumina-open -select \""+CItem+"\""); CItem.clear(); } -void MainUI::OpenDir(){ +/*void MainUI::OpenDir(){ if(CItem.isEmpty()){ QFileInfoList sel = getSelectedItems(); if(sel.isEmpty()){ return; } @@ -1324,7 +1323,7 @@ void MainUI::OpenDir(){ } OpenDirs(QStringList() << CItem); CItem.clear(); -} +}*/ void MainUI::RemoveItem(){ //Only let this run if viewing the browser page @@ -1417,13 +1416,13 @@ void MainUI::FavoriteItem(){ } void MainUI::ViewPropertiesItem(){ - if(CItem.isEmpty()){ - QFileInfoList sel = getSelectedItems(); - if(sel.isEmpty()){ return; } - else{ CItem = sel[0].absoluteFilePath(); } + QFileInfoList sel = getSelectedItems(); + if(sel.isEmpty()){ return; } + for(int i=0; i<sel.length(); i++){ + if(sel[i].absoluteFilePath().endsWith(".desktop")){ + QProcess::startDetached("lumina-fileinfo \""+sel[i].absoluteFilePath()+"\""); + } } - QString file = CItem; - QProcess::startDetached("lumina-fileinfo \""+file+"\""); } void MainUI::CutItems(){ diff --git a/lumina-fm/MainUI.h b/lumina-fm/MainUI.h index 4e6fdf6b..b18d25a5 100644 --- a/lumina-fm/MainUI.h +++ b/lumina-fm/MainUI.h @@ -207,15 +207,15 @@ private slots: void playerFileChanged(); //Context Menu Actions - // - single item actions void OpenItem(); //run "lumina-open" on it void OpenItemWith(); //run "lumina-open -select" on it - void OpenDir(); //open the dir in a new tab + //void OpenDir(); //open the dir in a new tab void RemoveItem(); //Remove the item permanently + // - single item actions void RenameItem(); void FavoriteItem(); - void ViewPropertiesItem(); // - full selection actions + void ViewPropertiesItem(); void CutItems(); void CopyItems(); void PasteItems(); diff --git a/lumina-open/main.cpp b/lumina-open/main.cpp index d0d2ced1..70e5b2f7 100644 --- a/lumina-open/main.cpp +++ b/lumina-open/main.cpp @@ -258,7 +258,7 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat } } if(cmd.isEmpty()){ - if(extension=="binary"){ cmd = inFile; } + if(extension=="binary" && !showDLG){ cmd = inFile; } else{ //Find out the proper application to use this file/directory useInputFile=true; @@ -272,14 +272,21 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat // NOTE: lumina-open is only designed for a single input file, // so no need to distinguish between the list codes (uppercase) // and the single-file codes (lowercase) - if(isFile && (cmd.contains("%f") || cmd.contains("%F") ) ){ + //Special "inFile" format replacements for input codes + if( (cmd.contains("%f") || cmd.contains("%F") ) ){ + //Apply any special field replacements for the desired format + inFile.replace("%20"," "); + //Now replace the field codes cmd.replace("%f","\""+inFile+"\""); cmd.replace("%F","\""+inFile+"\""); - }else if(isUrl && (cmd.contains("%U") || cmd.contains("%u")) ){ + }else if( (cmd.contains("%U") || cmd.contains("%u")) ){ + //Apply any special field replacements for the desired format + inFile.replace(" ", "%20"); + //Now replace the field codes cmd.replace("%u","\""+inFile+"\""); cmd.replace("%U","\""+inFile+"\""); }else{ - //No field codes (or improper field codes given - which is quite common) + //No field codes (or improper field codes given in the file - which is quite common) // - Just tack the input file on the end and let the app handle it as necessary cmd.append(" \""+inFile+"\""); } |