aboutsummaryrefslogtreecommitdiff
path: root/lumina-open/main.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-01-05 15:22:35 -0500
committerKen Moore <ken@pcbsd.org>2015-01-05 15:22:35 -0500
commit02f6eeef005f2ebd59edc7e18a12099c2e179e87 (patch)
treeaee5faa8492e39d40ab9f86a12e12487d4acb4c0 /lumina-open/main.cpp
parentUpdate the Lumina-default theme template to work properly with Qt5. (diff)
downloadlumina-02f6eeef005f2ebd59edc7e18a12099c2e179e87.tar.gz
lumina-02f6eeef005f2ebd59edc7e18a12099c2e179e87.tar.bz2
lumina-02f6eeef005f2ebd59edc7e18a12099c2e179e87.zip
Put another couple quick fixes in:
1) Do not adjust the width of new windows (even if they go off the right side of the screen, they still have some part of them on the main screen) 2) Add better crash handling to lumina-open (put the standard error text or standard output text of the application in the "details" for the message box).
Diffstat (limited to 'lumina-open/main.cpp')
-rw-r--r--lumina-open/main.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lumina-open/main.cpp b/lumina-open/main.cpp
index 7ce59e63..5bc37dd4 100644
--- a/lumina-open/main.cpp
+++ b/lumina-open/main.cpp
@@ -197,6 +197,7 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat
}
else if(isUrl && inFile.startsWith("mailto:")){ extension = "email"; }
else if(isUrl){ extension = "webbrowser"; }
+ //qDebug() << "Input:" << inFile << isFile << isUrl << extension;
//if not an application - find the right application to open the file
QString cmd;
bool useInputFile = false;
@@ -318,11 +319,15 @@ int main(int argc, char **argv){
//if(retcode!=0 ){
if(p->exitStatus() == QProcess::CrashExit){
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::critical(0,QObject::tr("Application Error"), QObject::tr("The following application experienced an error and needed to close:")+"\n\n"+cmd);
+ 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;
}
bgstack15