| 16 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 17 | 
   | 
     setVagoWindowTitle(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 18 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 19 | 
 < | 
     if(!QFile::exists(UtilVago::getOniSplitExeAbsolutePath())){ | 
 
 
 
 
 
 
 
 
 
 | 19 | 
 > | 
     if(!QFile::exists(UtilVago::getOniSplitExecutableAbsolutePath())){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 20 | 
   | 
         UtilVago::showAndLogErrorPopUp(this->myLogger, "OniSplit not found. Please download it at "+GlobalVars::ModsDomain+" and put it the Vago's tools folder. \n\nProgram will now exit."); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 21 | 
   | 
         exit(1); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 22 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 23 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 24 | 
 < | 
     if(!QFile::exists(UtilVago::getXmlToolsExeAbsolutePath())){ | 
 
 
 
 
 
 
 
 
 
 | 24 | 
 > | 
     if(!QFile::exists(UtilVago::getXmlToolsExecutableAbsolutePath())){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 25 | 
   | 
         UtilVago::showAndLogErrorPopUp(this->myLogger, "XmlTools not found. Please download it at "+GlobalVars::ModsDomain+" and put it the Vago's tools folder. \n\nProgram will now exit."); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 26 | 
   | 
         exit(1); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 27 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 71 | 
   | 
         this->vagoSettings->setValue("SeparateInWorkspace",true); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 72 | 
   | 
         iniChanged=true; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 73 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 | 74 | 
 < | 
     if(!this->vagoSettings->contains("ConfirmExit")){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 75 | 
 < | 
         this->vagoSettings->setValue("ConfirmExit", false); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 74 | 
 > | 
     if(!this->vagoSettings->contains("AskSaveProject")){ | 
 
 
 
 
 
 | 75 | 
 > | 
         this->vagoSettings->setValue("AskSaveProject", true); | 
 
 
 
 
 
 | 76 | 
 > | 
         iniChanged=true; | 
 
 
 
 
 
 | 77 | 
 > | 
     } | 
 
 
 
 
 
 | 78 | 
 > | 
     if(!this->vagoSettings->contains("AskToOpenLastProject")){ | 
 
 
 
 
 
 | 79 | 
 > | 
         this->vagoSettings->setValue("AskToOpenLastProject", false); | 
 
 
 
 
 
 
 
 
 
 
 
 | 80 | 
   | 
         iniChanged=true; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 81 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 82 | 
   | 
     if(!this->vagoSettings->contains("LastProjectPath")){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 128 | 
   | 
     ui->statusBar->addPermanentWidget(this->myBar); //this adds automatically in right | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 129 | 
   | 
     ui->statusBar->addPermanentWidget(ui->tbAbortConversion); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 130 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 | 127 | 
 – | 
     //Initialize list pointers | 
 
 
 
 
 
 
 
 
 
 | 128 | 
 – | 
     this->listToProccess = new QStringList; | 
 
 
 
 
 
 
 
 
 
 | 129 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 131 | 
   | 
     // User interface | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 132 | 
   | 
     ui->mainToolBar->addWidget(ui->tbAE); //add ae installer launch button | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 133 | 
   | 
     ui->mainToolBar->addWidget(ui->emptySpacerLabel); //trick, we can't add directly a space so we add an empty | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 135 | 
   | 
     ui->mainToolBar->addWidget(ui->emptySpacerLabel2); //same as before | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 136 | 
   | 
     ui->mainToolBar->addWidget(ui->tbCommand); //add option to manual onisplit commands | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 137 | 
   | 
     ui->mainToolBar->addWidget(ui->emptySpacerLabel3); //same as before | 
 
 
 
 
 
 
 
 
 | 138 | 
 + | 
     ui->mainToolBar->addWidget(ui->tbXmlToolsInterface); //add option to manual onisplit commands | 
 
 
 
 
 
 
 
 
 | 139 | 
 + | 
     ui->mainToolBar->addWidget(ui->emptySpacerLabel4); //same as before | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 140 | 
   | 
     ui->mainToolBar->addWidget(ui->tbOpenFolder); //add option to open folder with files converted etc | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 141 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 142 | 
   | 
     ui->mainToolBar->setLayoutDirection(Qt::RightToLeft); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 182 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 183 | 
   | 
 void MainWindow::showEvent(QShowEvent *e) | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 184 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 | 185 | 
 < | 
     #ifdef Q_OS_WIN | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 185 | 
 > | 
     // If we don't have a converter yet, application wasn't started. | 
 
 
 
 
 
 | 186 | 
 > | 
     if(!this->applicationIsFullyLoaded) | 
 
 
 
 
 
 | 187 | 
 > | 
     { | 
 
 
 
 
 
 | 188 | 
 > | 
         // Apparently Qt doesn't contains a slot to when the application was fully load (mainwindow). So we do our own implementation instead. | 
 
 
 
 
 
 | 189 | 
 > | 
         connect(this, SIGNAL(signalAppIsLoaded()), this, SLOT(applicationWasLoaded()), Qt::ConnectionType::QueuedConnection); | 
 
 
 
 
 
 | 190 | 
 > | 
         emit signalAppIsLoaded(); | 
 
 
 
 
 
 | 191 | 
 > | 
     } | 
 
 
 
 
 
 | 192 | 
 > | 
  | 
 
 
 
 
 
 | 193 | 
 > | 
     e->accept(); | 
 
 
 
 
 
 | 194 | 
 > | 
 } | 
 
 
 
 
 
 | 195 | 
 > | 
  | 
 
 
 
 
 
 | 196 | 
 > | 
 // Called only when the MainWindow was fully loaded and painted on the screen. This slot is only called once. | 
 
 
 
 
 
 | 197 | 
 > | 
 void MainWindow::applicationWasLoaded(){ | 
 
 
 
 
 
 | 198 | 
 > | 
 #ifdef Q_OS_WIN | 
 
 
 
 
 
 
 
 
 
 
 
 | 199 | 
   | 
     // QProgressBar only works after the windows was shown | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 200 | 
   | 
     // http://stackoverflow.com/questions/24840941/qwintaskbarprogress-wont-show (Kervala answer) | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 201 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 206 | 
   | 
     this->win7TaskBarProgress = this->win7TaskBarButton->progress(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 207 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 208 | 
   | 
     //Create a thread for do the conversion in background | 
 
 
 
 
 
 
 
 
 
 
 
 | 209 | 
 < | 
     this->myConverter = new Converter(UtilVago::getAppPath(), this->myLogger, this->listToProccess, this->win7TaskBarProgress); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 210 | 
 < | 
     #else | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 211 | 
 < | 
     this->myConverter = new Converter(UtilVago::getAppPath(), this->myLogger, this->listToProccess); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 212 | 
 < | 
     #endif | 
 
 
 
 
 
 
 
 
 
 | 209 | 
 > | 
     this->myConverter = new Converter(UtilVago::getAppPath(), this->myLogger, &this->listToProccess, this->win7TaskBarProgress); | 
 
 
 
 
 
 | 210 | 
 > | 
 #else | 
 
 
 
 
 
 | 211 | 
 > | 
     this->myConverter = new Converter(UtilVago::getAppPath(), this->myLogger, &this->listToProccess); | 
 
 
 
 
 
 | 212 | 
 > | 
 #endif | 
 
 
 
 
 
 
 
 
 
 
 
 | 213 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 214 | 
   | 
     connectSlots(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 215 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 216 | 
   | 
     this->myLogger->writeString("Application started."); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 217 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 218 | 
 < | 
     e->accept(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 218 | 
 > | 
     this->applicationIsFullyLoaded = true; | 
 
 
 
 
 
 | 219 | 
 > | 
  | 
 
 
 
 
 
 | 220 | 
 > | 
     QString lastSavedProject = this->vagoSettings->value("RecentProject1").toString(); | 
 
 
 
 
 
 | 221 | 
 > | 
  | 
 
 
 
 
 
 | 222 | 
 > | 
     if(!lastSavedProject.isEmpty() && this->vagoSettings->value("AskToOpenLastProject").toBool()){ | 
 
 
 
 
 
 | 223 | 
 > | 
         if(Util::showQuestionPopUp(this,"Do you want to load latest project?\n\nLatest project was '" + Util::cutNameWithoutBackSlash(lastSavedProject) + "'.")){ | 
 
 
 
 
 
 | 224 | 
 > | 
             loadProjectState(lastSavedProject); | 
 
 
 
 
 
 | 225 | 
 > | 
         } | 
 
 
 
 
 
 | 226 | 
 > | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 | 227 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 228 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 229 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 241 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 242 | 
   | 
 void MainWindow::on_actionAE_Package_Creator_triggered() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 243 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 | 244 | 
 < | 
     PackageWizard myWizard = PackageWizard(this->workspaceWizardsLocation, this->vagoSettings, this->myLogger); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 245 | 
 < | 
     myWizard.exec(); | 
 
 
 
 
 
 
 
 
 
 | 244 | 
 > | 
     // it deletes itself once closed | 
 
 
 
 
 
 | 245 | 
 > | 
     WizardFactory<PackageWizard>::startInstance(UtilVago::getAppPath(), this->workspaceWizardsLocation, this->vagoSettings, this->myLogger); | 
 
 
 
 
 
 
 
 
 
 
 
 | 246 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 247 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 248 | 
   | 
 void MainWindow::on_actionSound_Wizard_triggered() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 249 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 | 250 | 
 < | 
     SoundWizard myWizard (UtilVago::getAppPath(), this->workspaceWizardsLocation, this->myLogger, &this->commandMap); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 251 | 
 < | 
     myWizard.exec(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 250 | 
 > | 
     // it deletes itself once closed | 
 
 
 
 
 
 | 251 | 
 > | 
     WizardFactory<SoundWizard>::startInstance(UtilVago::getAppPath(), this->workspaceWizardsLocation, this->vagoSettings, this->myLogger, &this->commandMap); | 
 
 
 
 
 
 | 252 | 
 > | 
 } | 
 
 
 
 
 
 | 253 | 
 > | 
  | 
 
 
 
 
 
 | 254 | 
 > | 
 void MainWindow::on_actionBackground_Image_Wizard_triggered() | 
 
 
 
 
 
 | 255 | 
 > | 
 { | 
 
 
 
 
 
 | 256 | 
 > | 
     // it deletes itself once closed | 
 
 
 
 
 
 | 257 | 
 > | 
     WizardFactory<BGImageWizard>::startInstance(UtilVago::getAppPath(), this->workspaceWizardsLocation, this->vagoSettings, this->myLogger); | 
 
 
 
 
 
 | 258 | 
 > | 
 } | 
 
 
 
 
 
 | 259 | 
 > | 
  | 
 
 
 
 
 
 | 260 | 
 > | 
 void MainWindow::on_actionWindow_Messages_Wizard_triggered() | 
 
 
 
 
 
 | 261 | 
 > | 
 { | 
 
 
 
 
 
 | 262 | 
 > | 
     // it deletes itself once closed | 
 
 
 
 
 
 | 263 | 
 > | 
     WizardFactory<WmWizard>::startInstance(UtilVago::getAppPath(), this->workspaceWizardsLocation, this->vagoSettings, this->myLogger); | 
 
 
 
 
 
 
 
 
 
 
 
 | 264 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 265 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 266 | 
   | 
 void MainWindow::on_tbOni_clicked() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 297 | 
   | 
     QDesktopServices::openUrl(QUrl("file:///"+this->outputFolder)); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 298 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 299 | 
   | 
  | 
 
 
 
 
 
 
 
 
 | 300 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 301 | 
 + | 
 void MainWindow::on_tbXmlToolsInterface_clicked() | 
 
 
 
 
 
 
 
 
 | 302 | 
 + | 
 { | 
 
 
 
 
 
 
 
 
 | 303 | 
 + | 
     //We pass no parent because we want to have an independent window for XmlToolsInterface, | 
 
 
 
 
 
 
 
 
 | 304 | 
 + | 
     //so we can minimize it or maximize indepently from the MainWindow | 
 
 
 
 
 
 
 
 
 | 305 | 
 + | 
     XmlToolsInterface *xmlToolsWindow = new XmlToolsInterface(this->myLogger); | 
 
 
 
 
 
 
 
 
 | 306 | 
 + | 
     xmlToolsWindow->show(); //it destroys itself when finished. | 
 
 
 
 
 
 
 
 
 | 307 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 308 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 309 | 
   | 
 void MainWindow::on_tbAbortConversion_clicked() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 310 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 311 | 
   | 
     if(Util::showQuestionPopUp(this,"Are you sure you want to abort the current conversion?")){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 478 | 
   | 
         addRowTable(myTable,lastFileName,fromTo,command); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 479 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 480 | 
   | 
     updateItemsLoaded(myTable); | 
 
 
 
 
 
 
 
 
 | 481 | 
 + | 
     rowsWereChangedInDropTableWidget(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 482 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 483 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 484 | 
   | 
 QString MainWindow::fileParsingXML(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 562 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 563 | 
   | 
     QString command=this->commandMap.value(tabTitle+"->"+from+"->"+to)+" "+myOutputFolder; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 564 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 | 519 | 
 – | 
     //TODO: This can be optimized. When some are not enable others are. | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 565 | 
   | 
     if(ui->cbTexture->isChecked()){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 566 | 
   | 
         if(ui->leTextureName->text().isEmpty()){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 567 | 
   | 
             showErrStatusMessage("Checkbox '"+ui->cbTexture->text()+"' is selected. The file source cannot be empty."); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 754 | 
   | 
     for(int i=0; i<currTable->rowCount(); i++){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 755 | 
   | 
         //Only process enabled items | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 756 | 
   | 
         if(currTable->item(i,2)->background()!=currTable->disabledBackStyle){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 757 | 
 < | 
             this->listToProccess->append(currTable->item(i,2)->text()); | 
 
 
 
 
 
 
 
 
 
 | 757 | 
 > | 
             this->listToProccess.append(currTable->item(i,2)->text()); | 
 
 
 
 
 
 
 
 
 
 
 
 | 758 | 
   | 
         } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 759 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 760 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 780 | 
   | 
     if(numErrors!=0){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 781 | 
   | 
         QString sNumErrors=QString::number(numErrors); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 782 | 
   | 
         if(numErrors>1){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 783 | 
 < | 
             UtilVago::showErrorPopUpLogButton(result+"\n This is the last of "+sNumErrors+" Errors."); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 784 | 
 < | 
             showErrStatusMessage("Something gone wrong. Check log file ("+sNumErrors+" Errors)."); | 
 
 
 
 
 
 
 
 
 
 | 783 | 
 > | 
             UtilVago::showErrorPopUpLogButton(result+"\n This is the last of "+sNumErrors+" errors."); | 
 
 
 
 
 
 | 784 | 
 > | 
             showErrStatusMessage("Something gone wrong. Check log file ("+sNumErrors+" errors)."); | 
 
 
 
 
 
 
 
 
 
 
 
 | 785 | 
   | 
         } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 786 | 
   | 
         else{ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 787 | 
   | 
             UtilVago::showErrorPopUpLogButton(result); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 788 | 
   | 
             showErrStatusMessage("Something gone wrong. Check log file."); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 789 | 
   | 
         } | 
 
 
 
 
 
 
 
 
 
 | 745 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 790 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 791 | 
   | 
     else{ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 792 | 
   | 
         showSuccessStatusMessage("Everything went well!"); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 983 | 
   | 
         ui->cbCellShading->setChecked(false); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 984 | 
   | 
         ui->cbNormals->setEnabled(false); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 985 | 
   | 
         ui->cbNormals->setChecked(false); | 
 
 
 
 
 
 
 
 
 
 
 
 | 986 | 
 < | 
  | 
 
 
 
 
 
 
 
 
 
 | 986 | 
 > | 
 //#error add drag and drop to Extract TRAM with TRBS/ONCC | 
 
 
 
 
 
 
 
 
 
 
 
 | 987 | 
   | 
         if(QString::compare(arg1,"TRAM ONI",Qt::CaseSensitive)==0){ //case sensitive is faster | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 988 | 
   | 
             ui->cbWithTRBS_ONCC->setEnabled(true); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 989 | 
   | 
         } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1151 | 
   | 
             myTable->removeRow(myTable->selectionModel()->selectedRows().at(size-i-1).row()); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1152 | 
   | 
         } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1153 | 
   | 
         updateItemsLoaded(myTable); | 
 
 
 
 
 
 
 
 
 | 1154 | 
 + | 
         rowsWereChangedInDropTableWidget(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1155 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1156 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1157 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1175 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1176 | 
   | 
     if(Util::showQuestionPopUp(this,"Are you sure you want to clear the content?",defaultButton)){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1177 | 
   | 
         clearTableNoPrompt(myTable); | 
 
 
 
 
 
 
 
 
 | 1178 | 
 + | 
         updateItemsLoaded(myTable); | 
 
 
 
 
 
 
 
 
 | 1179 | 
 + | 
         rowsWereChangedInDropTableWidget(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1180 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 | 1181 | 
 < | 
     updateItemsLoaded(myTable); | 
 
 
 
 
 
 
 
 
 
 | 1181 | 
 > | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 1182 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1183 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1184 | 
   | 
 void MainWindow::clearTableNoPrompt(DropTableWidget *myTable){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1195 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1196 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1197 | 
   | 
 void MainWindow::closeEvent(QCloseEvent *event){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 1198 | 
 < | 
     if(this->vagoSettings->value("ConfirmExit").toBool()){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1199 | 
 < | 
         if(!Util::showQuestionPopUp(this,"Exit Vago?")){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1198 | 
 > | 
     if(this->vagoSettings->value("AskSaveProject").toBool() && this->unsavedChangesExist){ | 
 
 
 
 
 
 | 1199 | 
 > | 
         QMessageBox::StandardButton result = askToSaveCurrentProject(); | 
 
 
 
 
 
 | 1200 | 
 > | 
         if(result == QMessageBox::StandardButton::Cancel){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 1201 | 
   | 
             event->ignore(); | 
 
 
 
 
 
 
 
 
 | 1202 | 
 + | 
             return; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1203 | 
   | 
         } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1204 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 | 1205 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1206 | 
 + | 
     // Exit application (this will also close all other windows which don't have parent, for instance ManualCommands) | 
 
 
 
 
 
 
 
 
 | 1207 | 
 + | 
     QApplication::quit(); | 
 
 
 
 
 
 
 
 
 | 1208 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 1209 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1210 | 
 + | 
 QMessageBox::StandardButton MainWindow::askToSaveCurrentProject(){ | 
 
 
 
 
 
 
 
 
 | 1211 | 
 + | 
     QMessageBox::StandardButton result = | 
 
 
 
 
 
 
 
 
 | 1212 | 
 + | 
             Util::showQuestionPopUpWithCancel(this,"There are unsaved changes. Do you want to save the current project?", QMessageBox::StandardButton::Yes); | 
 
 
 
 
 
 
 
 
 | 1213 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1214 | 
 + | 
     if(result == QMessageBox::StandardButton::Yes){ | 
 
 
 
 
 
 
 
 
 | 1215 | 
 + | 
         on_actionSave_triggered(); | 
 
 
 
 
 
 
 
 
 | 1216 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1217 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1218 | 
 + | 
     return result; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1219 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1220 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1221 | 
   | 
 void MainWindow::on_cbToLevels_currentIndexChanged(const QString &arg1) | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1241 | 
   | 
     ui->leBnvLevels->setEnabled(checked); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1242 | 
   | 
     ui->cbGridsLevels->setEnabled(checked); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1243 | 
   | 
     ui->cbGridsLevels->setChecked(checked); | 
 
 
 
 
 
 
 
 
 
 
 
 | 1244 | 
 < | 
     if(checked){ | 
 
 
 
 
 
 
 
 
 
 | 1244 | 
 > | 
     if(checked && !projectIsLoading){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 1245 | 
   | 
         QString file=QFileDialog::getOpenFileName(this,"Choose the BNV.dae file...","./" , "All Files (*.*)"); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1246 | 
   | 
         if(!file.isEmpty()){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1247 | 
   | 
             ui->leBnvLevels->setText(file); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1253 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1254 | 
   | 
     ui->leAdditSourcesLevels->setEnabled(checked); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1255 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 1256 | 
 < | 
     if(checked){ | 
 
 
 
 
 
 
 
 
 
 | 1256 | 
 > | 
     if(checked && !projectIsLoading){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 1257 | 
   | 
         QStringList filesSelected=QFileDialog::getOpenFileNames(this,"Choose the additional .dae files...","./" , "All Files (*.*)"); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1258 | 
   | 
         QString filesJoined; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1259 | 
   | 
         int size=filesSelected.size(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1278 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1279 | 
   | 
     QProcess myProcess; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1280 | 
   | 
     myProcess.setWorkingDirectory(UtilVago::getAppPath()); | 
 
 
 
 
 
 
 
 
 
 
 
 | 1281 | 
 < | 
     myProcess.start(UtilVago::getOniSplitExeAbsolutePath()+" -version"); | 
 
 
 
 
 
 
 
 
 
 | 1281 | 
 > | 
     myProcess.start(UtilVago::getOniSplitExecutable()+" -version"); | 
 
 
 
 
 
 
 
 
 
 
 
 | 1282 | 
   | 
     myProcess.waitForFinished(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1283 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1284 | 
   | 
     QString result=myProcess.readAllStandardOutput(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1290 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1291 | 
   | 
     QProcess myProcess; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1292 | 
   | 
     myProcess.setWorkingDirectory(UtilVago::getAppPath()); | 
 
 
 
 
 
 
 
 
 
 
 
 | 1293 | 
 < | 
     myProcess.start(UtilVago::getXmlToolsExeAbsolutePath()+" --version"); | 
 
 
 
 
 
 
 
 
 
 | 1293 | 
 > | 
     myProcess.start(UtilVago::getXmlToolsExecutable()+" --version"); | 
 
 
 
 
 
 
 
 
 
 
 
 | 1294 | 
   | 
     myProcess.waitForFinished(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1295 | 
   | 
     QString result=myProcess.readLine(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1296 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1312 | 
   | 
     this->itemsLoaded->setText(QString().setNum(numItems)+ (numItems==1?" item ":" items ") +"loaded"); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1313 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1314 | 
   | 
  | 
 
 
 
 
 
 
 
 
 | 1315 | 
 + | 
 void MainWindow::rowsWereChangedInDropTableWidget(){ | 
 
 
 
 
 
 
 
 
 | 1316 | 
 + | 
     // We have changed rows, we have now unsaved changes. | 
 
 
 
 
 
 
 
 
 | 1317 | 
 + | 
     if(!this->unsavedChangesExist){ | 
 
 
 
 
 
 
 
 
 | 1318 | 
 + | 
         this->unsavedChangesExist = true; | 
 
 
 
 
 
 
 
 
 | 1319 | 
 + | 
         setVagoWindowTitle(); | 
 
 
 
 
 
 
 
 
 | 1320 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1321 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 1322 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1323 | 
   | 
 void MainWindow::on_tbCommand_clicked() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1324 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 | 1325 | 
 < | 
     //Show preferences | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1326 | 
 < | 
     ManualCommands *commandsWindow = new ManualCommands(this); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1325 | 
 > | 
     //We pass no parent because we want to have an independent window for ManualCommands, | 
 
 
 
 
 
 | 1326 | 
 > | 
     //so we can minimize it or maximize indepently from the MainWindow | 
 
 
 
 
 
 | 1327 | 
 > | 
     ManualCommands *commandsWindow = new ManualCommands(); | 
 
 
 
 
 
 
 
 
 
 
 
 | 1328 | 
   | 
     commandsWindow->show(); //it destroys itself when finished. | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1329 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1330 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1385 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1386 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1387 | 
   | 
  | 
 
 
 
 
 
 
 
 
 | 1388 | 
 + | 
 // New Project | 
 
 
 
 
 
 
 
 
 | 1389 | 
 + | 
 void MainWindow::on_actionNew_Project_triggered() | 
 
 
 
 
 
 
 
 
 | 1390 | 
 + | 
 { | 
 
 
 
 
 
 
 
 
 | 1391 | 
 + | 
     if(this->vagoSettings->value("AskSaveProject").toBool() && this->unsavedChangesExist){ | 
 
 
 
 
 
 
 
 
 | 1392 | 
 + | 
         QMessageBox::StandardButton result = askToSaveCurrentProject(); | 
 
 
 
 
 
 
 
 
 | 1393 | 
 + | 
         if(result == QMessageBox::StandardButton::Cancel){ | 
 
 
 
 
 
 
 
 
 | 1394 | 
 + | 
             return; | 
 
 
 
 
 
 
 
 
 | 1395 | 
 + | 
         } | 
 
 
 
 
 
 
 
 
 | 1396 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1397 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1398 | 
 + | 
     QList<DropTableWidget*> myTables = getAllTableWidgets(); | 
 
 
 
 
 
 
 
 
 | 1399 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1400 | 
 + | 
     for(DropTableWidget* const currTable : myTables){ | 
 
 
 
 
 
 
 
 
 | 1401 | 
 + | 
         clearTableNoPrompt(currTable); | 
 
 
 
 
 
 
 
 
 | 1402 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1403 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1404 | 
 + | 
     this->lastProjectFilePath=""; // clear last project file path | 
 
 
 
 
 
 
 
 
 | 1405 | 
 + | 
     this->unsavedChangesExist = false; | 
 
 
 
 
 
 
 
 
 | 1406 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1407 | 
 + | 
     setVagoWindowTitle(); // update vago title | 
 
 
 
 
 
 
 
 
 | 1408 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 1409 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1410 | 
   | 
 void MainWindow::on_actionSave_triggered() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1411 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1412 | 
   | 
     if(this->lastProjectFilePath.isEmpty()){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1571 | 
   | 
     else if(selectedOption==moveUp.get()){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1572 | 
   | 
         qSort(selectedRows); //let's order the selections by the row number, so we know exactly how to swap it | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1573 | 
   | 
         myTable->swapPositions(selectedRows,-1); | 
 
 
 
 
 
 
 
 
 | 1574 | 
 + | 
         rowsWereChangedInDropTableWidget(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1575 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1576 | 
   | 
     else if(selectedOption==moveDown.get()){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1577 | 
   | 
         qSort(selectedRows); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1578 | 
   | 
         myTable->swapPositions(selectedRows,+1); | 
 
 
 
 
 
 
 
 
 | 1579 | 
 + | 
         rowsWereChangedInDropTableWidget(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1580 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1581 | 
   | 
     else if(selectedOption==changeOptions.get()){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1582 | 
   | 
         changeToCurrentSettings(selectedRows,myTable); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1635 | 
   | 
             result+=QString::number(disabledCount) + (disabledCount==1?" item ":" items ") + "Disabled"; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1636 | 
   | 
         } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1637 | 
   | 
  | 
 
 
 
 
 
 
 
 
 | 1638 | 
 + | 
         rowsWereChangedInDropTableWidget(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1639 | 
   | 
         showSuccessStatusMessage(result); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1640 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1641 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1661 | 
   | 
         myTable->updateTableToolTips(row); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1662 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1663 | 
   | 
  | 
 
 
 
 
 
 
 
 
 | 1664 | 
 + | 
     rowsWereChangedInDropTableWidget(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1665 | 
   | 
     showSuccessStatusMessage(QString::number(rows.size()) + (rows.size()==1?" item ":" items ")+ "changed to the current settings"); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1666 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1667 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1685 | 
   | 
         myTable->updateTableToolTips(row); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1686 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1687 | 
   | 
  | 
 
 
 
 
 
 
 
 
 | 1688 | 
 + | 
     rowsWereChangedInDropTableWidget(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1689 | 
   | 
     showSuccessStatusMessage(QString::number(rows.size()) + (rows.size()==1?" item ":" items ")+ "changed the output to "+(newOutput!=this->workspaceLocation?Util::cutName(newOutput):"Vago workspace")); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1690 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1691 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1776 | 
   | 
     pugi::xml_document doc; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1777 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1778 | 
   | 
     pugi::xml_node rootNode = doc.append_child("VagoProject"); | 
 
 
 
 
 
 
 
 
 
 
 
 | 1779 | 
 < | 
     rootNode.append_attribute("vagoVersion").set_value(GlobalVars::AppVersion.toUtf8().constData()); | 
 
 
 
 
 
 
 
 
 
 | 1779 | 
 > | 
     rootNode.append_attribute("vagoVersion").set_value(GlobalVars::LastCompatibleVersion.toUtf8().constData()); | 
 
 
 
 
 
 
 
 
 
 
 
 | 1780 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1781 | 
   | 
     foreach(DropTableWidget* const &myTable, tableWidgets){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1782 | 
   | 
         saveProjectWidget(rootNode, myTable); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1790 | 
   | 
     this->vagoSettings->setValue("LastProjectPath",QFileInfo(filePath).absoluteDir().path()); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1791 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1792 | 
   | 
     this->lastProjectFilePath = filePath; | 
 
 
 
 
 
 
 
 
 | 1793 | 
 + | 
     this->unsavedChangesExist = false; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1794 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1795 | 
   | 
     addNewRecentProject(filePath); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1796 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1797 | 
   | 
     setVagoWindowTitle(); | 
 
 
 
 
 
 
 
 
 | 1798 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1799 | 
 + | 
     showSuccessStatusMessage("Project saved sucessfully."); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1800 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1801 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1802 | 
   | 
 void MainWindow::saveProjectWidget(pugi::xml_node &rootNode, DropTableWidget* table) | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1943 | 
   | 
         vagoTitle += Util::cutNameWithoutBackSlash(this->lastProjectFilePath); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1944 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1945 | 
   | 
  | 
 
 
 
 
 
 
 
 
 | 1946 | 
 + | 
     if(this->unsavedChangesExist){ | 
 
 
 
 
 
 
 
 
 | 1947 | 
 + | 
         vagoTitle += "*"; | 
 
 
 
 
 
 
 
 
 | 1948 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1949 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1950 | 
   | 
     setWindowTitle(vagoTitle); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1951 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1952 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2019 | 
   | 
 void MainWindow::loadProjectState(const QString &filePath) | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2020 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2021 | 
   | 
  | 
 
 
 
 
 
 
 
 
 | 2022 | 
 + | 
     this->projectIsLoading = true; | 
 
 
 
 
 
 
 
 
 | 2023 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2024 | 
 + | 
     if(this->vagoSettings->value("AskSaveProject").toBool() && this->unsavedChangesExist){ | 
 
 
 
 
 
 
 
 
 | 2025 | 
 + | 
         QMessageBox::StandardButton result = askToSaveCurrentProject(); | 
 
 
 
 
 
 
 
 
 | 2026 | 
 + | 
         if(result == QMessageBox::StandardButton::Cancel){ | 
 
 
 
 
 
 
 
 
 | 2027 | 
 + | 
             this->projectIsLoading = false; | 
 
 
 
 
 
 
 
 
 | 2028 | 
 + | 
             return; | 
 
 
 
 
 
 
 
 
 | 2029 | 
 + | 
         } | 
 
 
 
 
 
 
 
 
 | 2030 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 2031 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2032 | 
   | 
     QString statusError = "Couldn't load project."; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2033 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2034 | 
   | 
     pugi::xml_document doc; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2038 | 
   | 
     if(result.status!=pugi::status_ok){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2039 | 
   | 
         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "An error ocurred while loading project file.\n" + QString(result.description())); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2040 | 
   | 
         showErrStatusMessage(statusError); | 
 
 
 
 
 
 
 
 
 | 2041 | 
 + | 
         this->projectIsLoading = false; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2042 | 
   | 
         return; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2043 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2044 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2046 | 
   | 
     if(QString(doc.root().first_child().name()) != "VagoProject"){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2047 | 
   | 
         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, QString(doc.root().name()) + "The file opened is not a valid VagoProject file. Load aborted."); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2048 | 
   | 
         showErrStatusMessage(statusError); | 
 
 
 
 
 
 
 
 
 | 2049 | 
 + | 
         this->projectIsLoading = false; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2050 | 
   | 
         return; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2051 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2052 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2059 | 
   | 
     { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2060 | 
   | 
         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "Couldn't find the vagoVersion of the current project. Load aborted.\n" + QString(e.what())); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2061 | 
   | 
         showErrStatusMessage(statusError); | 
 
 
 
 
 
 
 
 
 | 2062 | 
 + | 
         this->projectIsLoading = false; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2063 | 
   | 
         return; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2064 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2065 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2066 | 
   | 
     if(!projVagoVersion.startsWith(GlobalVars::LastCompatibleVersion)){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2067 | 
   | 
         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "The project that you are trying to load seems it is not compatible with your Vago Version. Please update Vago and try again."); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2068 | 
   | 
         showErrStatusMessage(statusError); | 
 
 
 
 
 
 
 
 
 | 2069 | 
 + | 
         this->projectIsLoading = false; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2070 | 
   | 
         return; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2071 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2072 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2082 | 
   | 
     catch(const std::exception& e){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2083 | 
   | 
         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "Couldn't load the vago project. Error: " + QString(e.what())); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2084 | 
   | 
         showErrStatusMessage(statusError); | 
 
 
 
 
 
 
 
 
 | 2085 | 
 + | 
         this->projectIsLoading = false; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2086 | 
   | 
         return; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2087 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2088 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2089 | 
   | 
     this->vagoSettings->setValue("LastProjectPath",QFileInfo(filePath).absoluteDir().path()); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2090 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2091 | 
   | 
     this->lastProjectFilePath = filePath; | 
 
 
 
 
 
 
 
 
 | 2092 | 
 + | 
     this->unsavedChangesExist = false; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2093 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2094 | 
   | 
     addNewRecentProject(filePath); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2095 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2096 | 
   | 
     setVagoWindowTitle(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2097 | 
   | 
  | 
 
 
 
 
 
 
 
 
 | 2098 | 
 + | 
     this->projectIsLoading = false; | 
 
 
 
 
 
 
 
 
 | 2099 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2100 | 
   | 
     showSuccessStatusMessage("Project loaded sucessfully."); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2101 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2102 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2159 | 
   | 
         ui->leBnvLevels->setText(QString(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@bnvSourceValue")).attribute().value())); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2160 | 
   | 
         ui->cbGridsLevels->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@generateGrids")).attribute().as_bool()); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2161 | 
   | 
         ui->cbAdditionalSourcesLevels->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@additionalSources")).attribute().as_bool()); | 
 
 
 
 
 
 
 
 
 
 
 
 | 2162 | 
 < | 
         ui->leAdditSourcesLevels->setText(QString(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@bnvSource")).attribute().value())); | 
 
 
 
 
 
 
 
 
 
 | 2162 | 
 > | 
         ui->leAdditSourcesLevels->setText(QString(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@additionalSourcesValue")).attribute().value())); | 
 
 
 
 
 
 
 
 
 
 
 
 | 2163 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2164 | 
   | 
     else{ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2165 | 
   | 
         ui->cbFromMisc->setCurrentText(from); |