aboutsummaryrefslogtreecommitdiff
path: root/lumina-open
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-07-22 16:10:11 -0400
committerKen Moore <moorekou@gmail.com>2015-07-22 16:10:11 -0400
commitb38f4f6ce26fd50cc7fac1d1b0c09ab22ee4e3ea (patch)
tree38bdba92c2ebd4bf462810c7ae7b5b58e42a231d /lumina-open
parentAdd support into libLumina for additional "Actions" listed in *.desktop files. (diff)
downloadlumina-b38f4f6ce26fd50cc7fac1d1b0c09ab22ee4e3ea.tar.gz
lumina-b38f4f6ce26fd50cc7fac1d1b0c09ab22ee4e3ea.tar.bz2
lumina-b38f4f6ce26fd50cc7fac1d1b0c09ab22ee4e3ea.zip
Finish up the XDG "Actions" specification for *.desktop files, and integrate it into the AppMenu and UserButton. Also add a new flag to lumina-open so that we can specify which action to use when starting an app.
Diffstat (limited to 'lumina-open')
-rw-r--r--lumina-open/main.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lumina-open/main.cpp b/lumina-open/main.cpp
index dd2b1c93..3acc4ee3 100644
--- a/lumina-open/main.cpp
+++ b/lumina-open/main.cpp
@@ -148,7 +148,7 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat
//Get the input file
//Make sure to load the proper system encoding first
LUtils::LoadTranslation(0,""); //bypass application modification
- QString inFile;
+ QString inFile, ActionID;
bool showDLG = false; //flag to bypass any default application setting
if(argc > 1){
for(int i=1; i<argc; i++){
@@ -184,6 +184,9 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat
showOSD(argc,argv, QString(QObject::tr("Screen Brightness %1%")).arg(QString::number(bright)) );
}
return;
+ }else if( (QString(argv[i]).simplified() =="-action") && (argc>(i+1)) ){
+ ActionID = QString(argv[i+1]);
+ i++; //skip the next input
}else{
inFile = QString::fromLocal8Bit(argv[i]);
break;
@@ -224,7 +227,7 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat
switch(DF.type){
case XDGDesktop::APP:
if(!DF.exec.isEmpty()){
- cmd = LXDG::getDesktopExec(DF);
+ cmd = LXDG::getDesktopExec(DF,ActionID);
if(!DF.path.isEmpty()){ path = DF.path; }
watch = DF.startupNotify;
}else{
@@ -254,6 +257,7 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat
}
break;
default:
+ qDebug() << DF.type << DF.name << DF.icon << DF.exec;
ShowErrorDialog( argc, argv, QString(QObject::tr("Unknown type of shortcut : %1")).arg(inFile) );
}
}
bgstack15