ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/s10k/Vago/utilvago.cpp
(Generate patch)

Comparing Vago/trunk/Vago/utilvago.cpp (file contents):
Revision 1047 by s10k, Fri Sep 16 22:51:26 2016 UTC vs.
Revision 1054 by s10k, Wed Oct 12 21:35:13 2016 UTC

# Line 6 | Line 6 | void openLogFile(){
6      QDesktopServices::openUrl(QUrl("file:///"+getAppPath()+"/"+GlobalVars::AppLogName));
7   }
8  
9 + void showAndLogWarningPopUp(Logger *logger, const QString &message){
10 +    logger->writeString(message);
11 +
12 +    QMessageBox msgBox;
13 +    msgBox.setIcon(QMessageBox::Warning);
14 +    msgBox.setText(message);
15 +    msgBox.exec();
16 + }
17 +
18 + //Same of above but allow open log file (doesn't write in log file!!)
19 + void showWarningPopUpLogButton(const QString &message){
20 +    QMessageBox msgBox;
21 +    msgBox.setIcon(QMessageBox::Warning);
22 +    msgBox.setText(message);
23 +    QPushButton *viewb = msgBox.addButton("View log", QMessageBox::ActionRole);
24 +    msgBox.setStandardButtons(QMessageBox::Close);
25 +    msgBox.exec();
26 +    if(msgBox.clickedButton() == (QAbstractButton*)(viewb)){
27 +        openLogFile();
28 +    }
29 + }
30 +
31 + //Same of above but also writtes directly to the log file the error
32 + void showAndLogWarningPopUpLogButton(Logger *logger, const QString &message){
33 +
34 +    logger->writeString(message);
35 +
36 +    QMessageBox msgBox;
37 +    msgBox.setIcon(QMessageBox::Warning);
38 +    msgBox.setText(message);
39 +    QPushButton *viewb = msgBox.addButton("View log", QMessageBox::ActionRole);
40 +    msgBox.setStandardButtons(QMessageBox::Close);
41 +    msgBox.exec();
42 +    if(msgBox.clickedButton() == (QAbstractButton*)(viewb)){
43 +        openLogFile();
44 +    }
45 + }
46 +
47   void showAndLogErrorPopUp(Logger *logger, const QString &message){
48  
49      logger->writeString(message);
# Line 66 | Line 104 | QString getAppPath(){
104      return getOSIndependentAppPath();
105   }
106  
107 < QString getOniSplitExeAbsolutePath(){
107 > // Absolute paths
108 > QString getOniSplitExecutableAbsolutePath(){
109 >    return getAppPath() + "/" + GlobalVars::ToolsFolder + "/" + GlobalVars::OniSplitString;
110 > }
111 >
112 > QString getXmlToolsExecutableAbsolutePath(){
113 >    return getAppPath() + "/" + GlobalVars::ToolsFolder + "/" + GlobalVars::XmlToolsString;
114 > }
115 >
116 > // Executables (includes mono if necessary)
117 > QString getOniSplitExecutable(){
118  
119   #ifdef Q_OS_MAC
120 <    return getMonoExecutablePath() + " " + getAppPath() + "/" + GlobalVars::ToolsFolder + "/" + GlobalVars::OniSplitString;
120 >    return getMonoExecutablePath() + " " + Util::insertQuotes(getOniSplitExecutableAbsolutePath());
121   #else
122 <    return getAppPath() + "/" + GlobalVars::ToolsFolder + "/" + GlobalVars::OniSplitString;
122 >    return Util::insertQuotes(getOniSplitExecutableAbsolutePath());
123   #endif
124   }
125  
126 < QString getXmlToolsExeAbsolutePath(){
127 <    return getAppPath() + "/" + GlobalVars::ToolsFolder + "/" + GlobalVars::XmlToolsString;
126 > QString getXmlToolsExecutable(){
127 >    return Util::insertQuotes(getXmlToolsExecutableAbsolutePath());
128   }
129  
130   #ifdef Q_OS_MAC

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)