From af44cb451c2f570c009cac3e1ae5a63be8e0a911 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 23 Apr 2015 10:17:20 -0400 Subject: Make the open/openwith functionality in lumina-fm multi-selection aware. Also so the same for the "properties" option (although it only operates on *.desktop files at the moment). --- lumina-fm/MainUI.cpp | 59 ++++++++++++++++++++++++++-------------------------- lumina-fm/MainUI.h | 6 +++--- 2 files changed, 32 insertions(+), 33 deletions(-) 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 Date: Thu, 23 Apr 2015 10:34:05 -0400 Subject: A couple updates for lumina-open: 1) Apply the "%20" <--> " " conversion on the input file/path depending on the URL/File input specified by the application about to be launched. 2) Ensure that "binaries" passed in with the "-select" flag properly get passed to the app selection dialog. --- lumina-open/main.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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+"\""); } -- cgit From 2e1dcf74f71388594592b503cdb91237e08a607f Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 23 Apr 2015 12:16:27 -0400 Subject: Re-arrange the startup procedures a bit: *Run the audio/brightness setting routines *after* doing the XDG autostart stuff. This catches situations where the audio system (such as pulseaudio) is getting started by the XDG autostart routines. *Run the login chimes at the end of the startup procedures, instead of right before the autostart functionality. This ensures that the audio volume was already reset to the previous value before playing the music. --- lumina-desktop/LSession.cpp | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp index 8b05b5ef..6d0079f0 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(){ -- cgit From 73879413e0b9b232a0db60f07f9a4d72ca18fdd0 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Thu, 23 Apr 2015 20:21:10 +0200 Subject: shutdown/reboot/suspend via systemd on Debian --- libLumina/LuminaOS-Debian.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) 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 -- cgit From 045b991a77002e4a98e3a7f9eeacac4892dd62b0 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Thu, 23 Apr 2015 20:27:32 +0200 Subject: new snapshot --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) 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 Thu, 23 Apr 2015 20:27:23 +0200 + lumina-desktop (0.8.4.533-1nano) unstable; urgency=low * New git snapshot -- cgit From 51079157d542679c3b4812963f91ad6f7ac7263b Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 24 Apr 2015 08:22:54 -0400 Subject: Make sure to check for the existance of the "xbrightness" utility when doing the screen brightness checks on FreeBSD. This prevents issues with incomplete installations (it will just skip brightness controls). --- libLumina/LuminaOS-FreeBSD.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- cgit