--- Vago/trunk/Vago/utilvago.cpp 2016/09/17 13:32:34 1052 +++ Vago/trunk/Vago/utilvago.cpp 2016/10/12 21:35:13 1054 @@ -6,6 +6,44 @@ void openLogFile(){ QDesktopServices::openUrl(QUrl("file:///"+getAppPath()+"/"+GlobalVars::AppLogName)); } +void showAndLogWarningPopUp(Logger *logger, const QString &message){ + logger->writeString(message); + + QMessageBox msgBox; + msgBox.setIcon(QMessageBox::Warning); + msgBox.setText(message); + msgBox.exec(); +} + +//Same of above but allow open log file (doesn't write in log file!!) +void showWarningPopUpLogButton(const QString &message){ + QMessageBox msgBox; + msgBox.setIcon(QMessageBox::Warning); + msgBox.setText(message); + QPushButton *viewb = msgBox.addButton("View log", QMessageBox::ActionRole); + msgBox.setStandardButtons(QMessageBox::Close); + msgBox.exec(); + if(msgBox.clickedButton() == (QAbstractButton*)(viewb)){ + openLogFile(); + } +} + +//Same of above but also writtes directly to the log file the error +void showAndLogWarningPopUpLogButton(Logger *logger, const QString &message){ + + logger->writeString(message); + + QMessageBox msgBox; + msgBox.setIcon(QMessageBox::Warning); + msgBox.setText(message); + QPushButton *viewb = msgBox.addButton("View log", QMessageBox::ActionRole); + msgBox.setStandardButtons(QMessageBox::Close); + msgBox.exec(); + if(msgBox.clickedButton() == (QAbstractButton*)(viewb)){ + openLogFile(); + } +} + void showAndLogErrorPopUp(Logger *logger, const QString &message){ logger->writeString(message); @@ -79,14 +117,14 @@ QString getXmlToolsExecutableAbsolutePat QString getOniSplitExecutable(){ #ifdef Q_OS_MAC - return getMonoExecutablePath() + " " + getOniSplitExecutableAbsolutePath(); + return getMonoExecutablePath() + " " + Util::insertQuotes(getOniSplitExecutableAbsolutePath()); #else - return getOniSplitExecutableAbsolutePath(); + return Util::insertQuotes(getOniSplitExecutableAbsolutePath()); #endif } QString getXmlToolsExecutable(){ - return getXmlToolsExecutableAbsolutePath(); + return Util::insertQuotes(getXmlToolsExecutableAbsolutePath()); } #ifdef Q_OS_MAC