aboutsummaryrefslogtreecommitdiff
path: root/lumina-open
diff options
context:
space:
mode:
authorwilliam <william.os4y@gmail.com>2015-03-20 08:02:04 +0100
committerwilliam <william.os4y@gmail.com>2015-03-20 08:02:04 +0100
commitd9ff9adac5b379cd9d96277dd48d0259b8545921 (patch)
treed7ba249ca026a1f1680df717caa5248d30a4b222 /lumina-open
parentMerge remote-tracking branch 'upstream/master' into fmNumbers (diff)
parentUpdate some panel plugins so that they minimize empty space when only an icon... (diff)
downloadlumina-d9ff9adac5b379cd9d96277dd48d0259b8545921.tar.gz
lumina-d9ff9adac5b379cd9d96277dd48d0259b8545921.tar.bz2
lumina-d9ff9adac5b379cd9d96277dd48d0259b8545921.zip
Merge remote-tracking branch 'upstream/master' into fmNumbers
Diffstat (limited to 'lumina-open')
-rw-r--r--lumina-open/LFileDialog.cpp4
-rw-r--r--lumina-open/main.cpp27
2 files changed, 18 insertions, 13 deletions
diff --git a/lumina-open/LFileDialog.cpp b/lumina-open/LFileDialog.cpp
index d648925b..361cd99f 100644
--- a/lumina-open/LFileDialog.cpp
+++ b/lumina-open/LFileDialog.cpp
@@ -239,7 +239,7 @@ void LFileDialog::on_tool_ok_clicked(){
bool ok = false;
XDGDesktop app = LXDG::loadDesktopFile(PREFAPPS[ui->combo_rec->currentIndex()], ok);
//Set the output variables
- appExec = app.exec;
+ appExec = LXDG::getDesktopExec(app);
appPath = app.path;
appFile = app.filePath;
setPreferredApplication(app.filePath); //bump this to the top of the preferred list for next time
@@ -248,7 +248,7 @@ void LFileDialog::on_tool_ok_clicked(){
bool ok = false;
XDGDesktop app = LXDG::loadDesktopFile(ui->tree_apps->currentItem()->whatsThis(0), ok);
//Set the output variables
- appExec = app.exec;
+ appExec = LXDG::getDesktopExec(app);
appPath = app.path;
appFile = app.filePath;
setPreferredApplication(app.filePath); //save this app to this extension as a recommendation
diff --git a/lumina-open/main.cpp b/lumina-open/main.cpp
index 4a9f7639..657ffc07 100644
--- a/lumina-open/main.cpp
+++ b/lumina-open/main.cpp
@@ -43,6 +43,16 @@ void printUsageInfo(){
exit(1);
}
+void ShowErrorDialog(int argc, char **argv, QString message){
+ //Setup the application
+ QApplication App(argc, argv);
+ LuminaThemeEngine theme(&App);
+ LUtils::LoadTranslation(&App,"lumina-open");
+ QMessageBox dlg(QMessageBox::Critical, QObject::tr("File Error"), message );
+ dlg.exec();
+ exit(1);
+}
+
void showOSD(int argc, char **argv, QString message){
//Setup the application
QApplication App(argc, argv);
@@ -187,7 +197,7 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat
if(QFile::exists(inFile)){ isFile=true; }
else if(QFile::exists(QDir::currentPath()+"/"+inFile)){isFile=true; inFile = QDir::currentPath()+"/"+inFile;} //account for relative paths
else if(QUrl(inFile).isValid() && !inFile.startsWith("/") ){ isUrl=true; }
- if( !isFile && !isUrl ){ qDebug() << "Error: Invalid file or URL"; return;}
+ if( !isFile && !isUrl ){ ShowErrorDialog( argc, argv, QString(QObject::tr("Invalid file or URL: %1")).arg(inFile) ); }
//Determing the type of file (extension)
QString extension;
//qDebug() << "File Type:" << isFile << isUrl;
@@ -209,8 +219,7 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat
bool ok = false;
XDGDesktop DF = LXDG::loadDesktopFile(inFile, ok);
if(!ok){
- qDebug() << "[ERROR] Input *.desktop file could not be read:" << inFile;
- exit(1);
+ ShowErrorDialog( argc, argv, QString(QObject::tr("File could not be opened: %1")).arg(inFile) );
}
switch(DF.type){
case XDGDesktop::APP:
@@ -218,8 +227,7 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat
cmd = LXDG::getDesktopExec(DF);
if(!DF.path.isEmpty()){ path = DF.path; }
}else{
- qDebug() << "[ERROR] Input *.desktop application file is missing the Exec line:" << inFile;
- exit(1);
+ ShowErrorDialog( argc, argv, QString(QObject::tr("Application shortcut is missing the launching information (malformed shortcut): %1")).arg(inFile) );
}
break;
case XDGDesktop::LINK:
@@ -229,8 +237,7 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat
cmd.clear();
extension = inFile.section(":",0,0);
}else{
- qDebug() << "[ERROR] Input *.desktop link file is missing the URL line:" << inFile;
- exit(1);
+ ShowErrorDialog( argc, argv, QString(QObject::tr("URL shortcut is missing the URL: %1")).arg(inFile) );
}
break;
case XDGDesktop::DIR:
@@ -240,13 +247,11 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat
cmd.clear();
extension = "directory";
}else{
- qDebug() << "[ERROR] Input *.desktop directory file is missing the Path line:" << inFile;
- exit(1);
+ ShowErrorDialog( argc, argv, QString(QObject::tr("Directory shortcut is missing the path to the directory: %1")).arg(inFile) );
}
break;
default:
- qDebug() << "[ERROR] Unknown *.desktop file type:" << inFile;
- exit(1);
+ ShowErrorDialog( argc, argv, QString(QObject::tr("Unknown type of shortcut : %1")).arg(inFile) );
}
}
if(cmd.isEmpty()){
bgstack15