| 9 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 10 | 
   | 
     ui->setupUi(this); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 11 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 12 | 
 < | 
     this->myLogger = new Logger(Util::getAppPath()); //start logger | 
 
 
 
 
 
 
 
 
 
 | 12 | 
 > | 
     this->myLogger = new Logger(UtilVago::getAppPath(), GlobalVars::AppLogName); //start logger | 
 
 
 
 
 
 
 
 
 
 
 
 | 13 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 14 | 
 < | 
     this->myLogger->writeString("Detected AppDir: "+Util::getAppPath()); | 
 
 
 
 
 
 
 
 
 
 | 14 | 
 > | 
     this->myLogger->writeString("Detected AppDir: "+UtilVago::getAppPath()); | 
 
 
 
 
 
 
 
 
 
 
 
 | 15 | 
   | 
     this->myLogger->writeString("True app dir: "+QDir::currentPath()); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 16 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 17 | 
 < | 
     this->setWindowTitle("Vago v"+GlobalVars::AppVersion); | 
 
 
 
 
 
 
 
 
 
 | 17 | 
 > | 
     setVagoWindowTitle(); | 
 
 
 
 
 
 
 
 
 
 
 
 | 18 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 19 | 
 < | 
     if(!QFile::exists(Util::getAppPath()+"/"+GlobalVars::OniSplitString)){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 20 | 
 < | 
         Util::showErrorPopUp("OniSplit not found. Please download it at "+GlobalVars::ModsDomain+" and put it in the same folder of Vago. \n\nProgram will now exit."); | 
 
 
 
 
 
 
 
 
 
 | 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(Util::getAppPath()+"/"+GlobalVars::XmlToolsString)){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 25 | 
 < | 
         Util::showErrorPopUp("xmlTools not found. Please download it at "+GlobalVars::ModsDomain+" and put it in the same folder of Vago. \n\nProgram will now exit."); | 
 
 
 
 
 
 
 
 
 
 | 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 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 28 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 29 | 
 < | 
     this->vagoSettings = new QSettings(Util::getAppPath() + "/" + this->VagoSettingsName, QSettings::IniFormat); | 
 
 
 
 
 
 
 
 
 
 | 29 | 
 > | 
     this->vagoSettings = new QSettings(UtilVago::getAppPath() + "/" + this->VagoSettingsName, QSettings::IniFormat); | 
 
 
 
 
 
 
 
 
 
 
 
 | 30 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 31 | 
   | 
     //First Execution? Old configuration? Settings missed? | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 32 | 
   | 
     bool iniChanged=false; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 35 | 
   | 
         iniChanged=true; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 36 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 37 | 
   | 
     if(!this->vagoSettings->contains("Workspace")){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 38 | 
 < | 
         this->vagoSettings->setValue("Workspace", Util::getAppPath()+"/VagoWorkspace"); | 
 
 
 
 
 
 
 
 
 
 | 38 | 
 > | 
         this->vagoSettings->setValue("Workspace", UtilVago::getAppPath()+"/VagoWorkspace"); | 
 
 
 
 
 
 
 
 
 
 
 
 | 39 | 
   | 
         iniChanged=true; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 40 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 41 | 
   | 
     if(!this->vagoSettings->contains("AeFolder")){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 44 | 
   | 
         QString aefolder=Util::normalizePath(QFileDialog::getExistingDirectory(this,"Choose Anniversary Edition (AE) folder...")); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 45 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 46 | 
   | 
         if(aefolder.isEmpty()){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 47 | 
 < | 
             Util::showErrorPopUp("AE folder is mandatory. Application will now exit."); | 
 
 
 
 
 
 
 
 
 
 | 47 | 
 > | 
             UtilVago::showAndLogErrorPopUp(this->myLogger, "AE folder is mandatory. Application will now exit."); | 
 
 
 
 
 
 
 
 
 
 
 
 | 48 | 
   | 
             exit(1); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 49 | 
   | 
         } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 50 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 75 | 
   | 
         this->vagoSettings->setValue("ConfirmExit", false); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 76 | 
   | 
         iniChanged=true; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 77 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 | 78 | 
 + | 
     if(!this->vagoSettings->contains("LastProjectPath")){ | 
 
 
 
 
 
 
 
 
 | 79 | 
 + | 
         this->vagoSettings->setValue("LastProjectPath", this->vagoSettings->value("Workspace")); | 
 
 
 
 
 
 
 
 
 | 80 | 
 + | 
         iniChanged=true; | 
 
 
 
 
 
 
 
 
 | 81 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 82 | 
 + | 
     for(int i=0; i<this->recentProjectsMaxSize; i++){ | 
 
 
 
 
 
 
 
 
 | 83 | 
 + | 
         if(!this->vagoSettings->contains("RecentProject" + QString::number(i+1))){ | 
 
 
 
 
 
 
 
 
 | 84 | 
 + | 
             this->vagoSettings->setValue("RecentProject" + QString::number(i+1), ""); | 
 
 
 
 
 
 
 
 
 | 85 | 
 + | 
             iniChanged=true; | 
 
 
 
 
 
 
 
 
 | 86 | 
 + | 
         } | 
 
 
 
 
 
 
 
 
 | 87 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 88 | 
   | 
 #ifdef Q_OS_MAC | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 89 | 
   | 
     if(!this->vagoSettings->contains("useYesAsDefaultWhenRemovingItems")){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 90 | 
   | 
         this->vagoSettings->setValue("useYesAsDefaultWhenRemovingItems", false); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 127 | 
   | 
     //Initialize list pointers | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 128 | 
   | 
     this->listToProccess = new QStringList; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 129 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 | 120 | 
 – | 
     //Create a thread for do the conversion in background | 
 
 
 
 
 
 
 
 
 
 | 121 | 
 – | 
     this->myConverter = new Converter(Util::getAppPath(),this->myLogger,this->listToProccess); | 
 
 
 
 
 
 
 
 
 
 | 122 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 130 | 
   | 
     // User interface | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 131 | 
   | 
     ui->mainToolBar->addWidget(ui->tbAE); //add ae installer launch button | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 132 | 
   | 
     ui->mainToolBar->addWidget(ui->emptySpacerLabel); //trick, we can't add directly a space so we add an empty | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 138 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 139 | 
   | 
     ui->mainToolBar->setLayoutDirection(Qt::RightToLeft); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 140 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 141 | 
 < | 
     setConverterButtonsSize(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 141 | 
 > | 
     ui->pbConvert->setMinimumHeight(ui->pbConvert->sizeHint().height()*1.5); // This is OS indepented. It maintain size ratio over the Windows and Mac. | 
 
 
 
 
 
 | 142 | 
 > | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 143 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 144 | 
   | 
 #ifdef Q_OS_MAC | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 145 | 
   | 
     // setUnifiedTitleAndToolBarOnMac(true); // Qt suggests to use it on mac | http://www.slideshare.net/qtbynokia/how-to-make-your-qt-app-look-native // align on left doesn't work if active | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 151 | 
   | 
     ui->actionMac_Windows_demo->setChecked(true); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 152 | 
   | 
     // resize(800,600); // Mac OS pcs should be able to render this resolution without any problem. It's also better | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 153 | 
   | 
     //// because the components on mac use more space | 
 
 
 
 
 
 
 
 
 
 | 146 | 
 – | 
 #else | 
 
 
 
 
 
 
 
 
 
 | 147 | 
 – | 
     //resize(640,480); // windows stuff | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 154 | 
   | 
 #endif | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 155 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 156 | 
   | 
     resize(this->startedWindowWidth,this->startedWindowHeight); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 157 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 158 | 
 < | 
     connectSlots(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 158 | 
 > | 
 #ifdef Q_OS_MAC | 
 
 
 
 
 
 | 159 | 
 > | 
     ui->pbConvert->setToolTip(ui->pbConvert->toolTip() + " (⌘ + Enter)"); | 
 
 
 
 
 
 | 160 | 
 > | 
 #else | 
 
 
 
 
 
 | 161 | 
 > | 
     ui->pbConvert->setToolTip(ui->pbConvert->toolTip() + " (Ctrl + Enter)"); | 
 
 
 
 
 
 | 162 | 
 > | 
 #endif | 
 
 
 
 
 
 
 
 
 
 
 
 | 163 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 164 | 
   | 
     //Commands Mapping | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 165 | 
   | 
     this->commandMap = QHash<QString, QString>(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 167 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 168 | 
   | 
     updateItemsLoaded(ui->twSourcesXML); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 169 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 170 | 
 < | 
     this->myLogger->writeString("Application started."); | 
 
 
 
 
 
 
 
 
 
 | 170 | 
 > | 
     loadRecentProjects(); | 
 
 
 
 
 
 
 
 
 
 
 
 | 171 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 172 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 173 | 
   | 
 MainWindow::~MainWindow() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 176 | 
   | 
     this->myLogger->writeString("Application Exited."); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 177 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 178 | 
   | 
  | 
 
 
 
 
 
 
 
 
 | 179 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 180 | 
 + | 
 void MainWindow::showEvent(QShowEvent *e) | 
 
 
 
 
 
 
 
 
 | 181 | 
 + | 
 { | 
 
 
 
 
 
 
 
 
 | 182 | 
 + | 
     #ifdef Q_OS_WIN | 
 
 
 
 
 
 
 
 
 | 183 | 
 + | 
     // QProgressBar only works after the windows was shown | 
 
 
 
 
 
 
 
 
 | 184 | 
 + | 
     // http://stackoverflow.com/questions/24840941/qwintaskbarprogress-wont-show (Kervala answer) | 
 
 
 
 
 
 
 
 
 | 185 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 186 | 
 + | 
     this->win7TaskBarButton = new QWinTaskbarButton(); | 
 
 
 
 
 
 
 
 
 | 187 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 188 | 
 + | 
     this->win7TaskBarButton->setWindow(this->windowHandle()); | 
 
 
 
 
 
 
 
 
 | 189 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 190 | 
 + | 
     this->win7TaskBarProgress = this->win7TaskBarButton->progress(); | 
 
 
 
 
 
 
 
 
 | 191 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 192 | 
 + | 
     //Create a thread for do the conversion in background | 
 
 
 
 
 
 
 
 
 | 193 | 
 + | 
     this->myConverter = new Converter(UtilVago::getAppPath(), this->myLogger, this->listToProccess, this->win7TaskBarProgress); | 
 
 
 
 
 
 
 
 
 | 194 | 
 + | 
     #else | 
 
 
 
 
 
 
 
 
 | 195 | 
 + | 
     this->myConverter = new Converter(UtilVago::getAppPath(), this->myLogger, this->listToProccess); | 
 
 
 
 
 
 
 
 
 | 196 | 
 + | 
     #endif | 
 
 
 
 
 
 
 
 
 | 197 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 198 | 
 + | 
     connectSlots(); | 
 
 
 
 
 
 
 
 
 | 199 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 200 | 
 + | 
     this->myLogger->writeString("Application started."); | 
 
 
 
 
 
 
 
 
 | 201 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 202 | 
 + | 
     e->accept(); | 
 
 
 
 
 
 
 
 
 | 203 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 204 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 205 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 206 | 
   | 
 void MainWindow::on_actionExit_triggered() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 207 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 208 | 
   | 
     close(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 223 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 224 | 
   | 
 void MainWindow::on_actionSound_Wizard_triggered() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 225 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 | 226 | 
 < | 
     SoundWizard myWizard (Util::getAppPath(), this->workspaceWizardsLocation, this->myLogger, &this->commandMap); | 
 
 
 
 
 
 
 
 
 
 | 226 | 
 > | 
     SoundWizard myWizard (UtilVago::getAppPath(), this->workspaceWizardsLocation, this->myLogger, &this->commandMap); | 
 
 
 
 
 
 
 
 
 
 
 
 | 227 | 
   | 
     myWizard.exec(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 228 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 229 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 319 | 
   | 
         } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 320 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 321 | 
   | 
     else{ | 
 
 
 
 
 
 
 
 
 
 
 
 | 322 | 
 < | 
         Util::showErrorPopUp("An error occurred checking last version:\n\n"+result->errorString()); | 
 
 
 
 
 
 
 
 
 
 | 322 | 
 > | 
         UtilVago::showAndLogErrorPopUp(this->myLogger, "An error occurred checking last version:\n\n"+result->errorString()); | 
 
 
 
 
 
 
 
 
 
 
 
 | 323 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 324 | 
   | 
     result->deleteLater(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 325 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 346 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 347 | 
   | 
 void MainWindow::on_pbAddSourceLevels_clicked() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 348 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 | 349 | 
 < | 
     if(QString::compare(ui->cbFromXML->currentText(),"ONI FILES",Qt::CaseSensitive)==0 && QString::compare(ui->cbToXML->currentText(),"DAT",Qt::CaseSensitive)==0){ //CaseSensitive is faster) | 
 
 
 
 
 
 
 
 
 
 | 349 | 
 > | 
     if(QString::compare(ui->cbFromLevels->currentText(),"ONI FILES",Qt::CaseSensitive)==0 && QString::compare(ui->cbToLevels->currentText(),"DAT",Qt::CaseSensitive)==0){ //CaseSensitive is faster) | 
 
 
 
 
 
 
 
 
 
 
 
 | 350 | 
   | 
         addFilesSource(ui->twSourcesLevels,Util::multipleDirDialog("Choose folders with ONIs...")); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 351 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 352 | 
   | 
     else{ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 472 | 
   | 
             command+=" "+this->commandMap.value(tabTitle+"->"+ui->cbLarge->text()); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 473 | 
   | 
         } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 474 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 475 | 
 < | 
         if(ui->rbBGR32->isChecked()){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 439 | 
 < | 
             command+=" "+this->commandMap.value(tabTitle+"->"+ui->rbBGR32->text()); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 440 | 
 < | 
         } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 441 | 
 < | 
         else if(ui->rbBGRA32->isChecked()){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 442 | 
 < | 
             command+=" "+this->commandMap.value(tabTitle+"->"+ui->rbBGRA32->text()); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 443 | 
 < | 
         } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 444 | 
 < | 
         else if(ui->rbBGR555->isChecked()){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 445 | 
 < | 
             command+=" "+this->commandMap.value(tabTitle+"->"+ui->rbBGR555->text()); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 446 | 
 < | 
         } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 447 | 
 < | 
         else if(ui->rbBGRA5551->isChecked()){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 448 | 
 < | 
             command+=" "+this->commandMap.value(tabTitle+"->"+ui->rbBGRA5551->text()); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 449 | 
 < | 
         } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 450 | 
 < | 
         else if(ui->rbBGRA444->isChecked()){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 451 | 
 < | 
             command+=" "+this->commandMap.value(tabTitle+"->"+ui->rbBGRA444->text()); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 452 | 
 < | 
         } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 453 | 
 < | 
         else{ //dxt1 checked | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 454 | 
 < | 
             command+=" "+this->commandMap.value(tabTitle+"->"+ui->rbDxt1->text()); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 455 | 
 < | 
         } | 
 
 
 
 
 
 
 
 
 
 | 475 | 
 > | 
         command+=" "+this->commandMap.value(tabTitle+"->"+getTextureRBCheckedTypeTexture()->text()); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 476 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 477 | 
   | 
         if(ui->cbEnvMap->isChecked()){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 478 | 
   | 
             if(ui->leEnvMapTexture->text().isEmpty()){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 654 | 
   | 
     return this->commandMap.value("misc->"+from+"->"+to)+" "+myOutputFolder+" "+file; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 655 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 656 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 657 | 
 < | 
 void MainWindow::addRowTable(DropTableWidget *myTable, QString fileName, QString fromTo, QString command){ | 
 
 
 
 
 
 
 
 
 
 | 657 | 
 > | 
 void MainWindow::addRowTable(DropTableWidget *myTable, QString fileName, QString fromTo, QString command, bool isToDisabled){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 658 | 
   | 
     //Get actual number rows | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 659 | 
   | 
     int twSize=myTable->rowCount(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 660 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 666 | 
   | 
     QTableWidgetItem *newConversion = new QTableWidgetItem(fromTo); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 667 | 
   | 
     QTableWidgetItem *newCommand = new QTableWidgetItem(command); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 668 | 
   | 
  | 
 
 
 
 
 
 
 
 
 | 669 | 
 + | 
     if(isToDisabled){ | 
 
 
 
 
 
 
 
 
 | 670 | 
 + | 
         myTable->setDisableStyleWidgetItem(newFile); | 
 
 
 
 
 
 
 
 
 | 671 | 
 + | 
         myTable->setDisableStyleWidgetItem(newConversion); | 
 
 
 
 
 
 
 
 
 | 672 | 
 + | 
         myTable->setDisableStyleWidgetItem(newCommand); | 
 
 
 
 
 
 
 
 
 | 673 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 674 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 675 | 
   | 
     myTable->setItem(twSize,0,newFile); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 676 | 
   | 
     myTable->setItem(twSize,1,newConversion); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 677 | 
   | 
     myTable->setItem(twSize,2,newCommand); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 679 | 
   | 
     myTable->updateTableToolTips(twSize); //Update tool tips | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 680 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 681 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 682 | 
 < | 
 void MainWindow::on_pbConvertXML_clicked() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 657 | 
 < | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 658 | 
 < | 
     startConversion(ui->twSourcesXML); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 659 | 
 < | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 660 | 
 < | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 661 | 
 < | 
 void MainWindow::on_pbConvertTextures_clicked() | 
 
 
 
 
 
 
 
 
 
 | 682 | 
 > | 
 void MainWindow::on_pbConvert_clicked() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 683 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 | 684 | 
 < | 
     startConversion(ui->twSourcesTextures); | 
 
 
 
 
 
 
 
 
 
 | 684 | 
 > | 
     startConversion(); | 
 
 
 
 
 
 
 
 
 
 
 
 | 685 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 686 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 687 | 
 < | 
 void MainWindow::on_pbConvertObjects_clicked() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 667 | 
 < | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 668 | 
 < | 
     startConversion(ui->twSourcesObjects); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 669 | 
 < | 
 } | 
 
 
 
 
 
 
 
 
 
 | 687 | 
 > | 
 void MainWindow::startConversion(){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 688 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 689 | 
 < | 
 void MainWindow::on_pbConvertCharacters_clicked() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 672 | 
 < | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 673 | 
 < | 
     startConversion(ui->twSourcesCharacters); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 674 | 
 < | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 675 | 
 < | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 676 | 
 < | 
 void MainWindow::on_pbConvertLevels_clicked() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 677 | 
 < | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 678 | 
 < | 
     startConversion(ui->twSourcesLevels); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 679 | 
 < | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 680 | 
 < | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 681 | 
 < | 
 void MainWindow::on_pbConvertMisc_clicked() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 682 | 
 < | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 683 | 
 < | 
     startConversion(ui->twSourcesMisc); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 684 | 
 < | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 685 | 
 < | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 686 | 
 < | 
 void MainWindow::startConversion(DropTableWidget *myTable){ | 
 
 
 
 
 
 
 
 
 
 | 689 | 
 > | 
     DropTableWidget* currTable = getCurrentTableWidget(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 690 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 691 | 
   | 
     bool ready=false; | 
 
 
 
 
 
 
 
 
 
 
 
 | 692 | 
 < | 
     for(int i=0; i<myTable->rowCount(); i++){ //There are items to process? | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 693 | 
 < | 
         if(myTable->item(i,2)->background()!=myTable->disabledBackStyle){ | 
 
 
 
 
 
 
 
 
 
 | 692 | 
 > | 
     for(int i=0; i<currTable->rowCount(); i++){ //There are items to process? | 
 
 
 
 
 
 | 693 | 
 > | 
         if(currTable->item(i,2)->background()!=currTable->disabledBackStyle){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 694 | 
   | 
             ready=true; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 695 | 
   | 
             break; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 696 | 
   | 
         } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 706 | 
   | 
         return; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 707 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 708 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 709 | 
 < | 
     for(int i=0; i<myTable->rowCount(); i++){ | 
 
 
 
 
 
 
 
 
 
 | 709 | 
 > | 
     for(int i=0; i<currTable->rowCount(); i++){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 710 | 
   | 
         //Only process enabled items | 
 
 
 
 
 
 
 
 
 
 
 
 | 711 | 
 < | 
         if(myTable->item(i,2)->background()!=myTable->disabledBackStyle){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 712 | 
 < | 
             this->listToProccess->append(myTable->item(i,2)->text()); | 
 
 
 
 
 
 
 
 
 
 | 711 | 
 > | 
         if(currTable->item(i,2)->background()!=currTable->disabledBackStyle){ | 
 
 
 
 
 
 | 712 | 
 > | 
             this->listToProccess->append(currTable->item(i,2)->text()); | 
 
 
 
 
 
 
 
 
 
 
 
 | 713 | 
   | 
         } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 714 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 715 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 735 | 
   | 
     if(numErrors!=0){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 736 | 
   | 
         QString sNumErrors=QString::number(numErrors); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 737 | 
   | 
         if(numErrors>1){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 738 | 
 < | 
             Util::showErrorLogPopUp(result+"\n This is the last of "+sNumErrors+" Errors."); | 
 
 
 
 
 
 
 
 
 
 | 738 | 
 > | 
             UtilVago::showErrorPopUpLogButton(result+"\n This is the last of "+sNumErrors+" Errors."); | 
 
 
 
 
 
 
 
 
 
 
 
 | 739 | 
   | 
             showErrStatusMessage("Something gone wrong. Check log file ("+sNumErrors+" Errors)."); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 740 | 
   | 
         } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 741 | 
   | 
         else{ | 
 
 
 
 
 
 
 
 
 
 
 
 | 742 | 
 < | 
             Util::showErrorLogPopUp(result); | 
 
 
 
 
 
 
 
 
 
 | 742 | 
 > | 
             UtilVago::showErrorPopUpLogButton(result); | 
 
 
 
 
 
 
 
 
 
 
 
 | 743 | 
   | 
             showErrStatusMessage("Something gone wrong. Check log file."); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 744 | 
   | 
         } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 745 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 889 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 890 | 
   | 
 void MainWindow::on_cbFromTextures_currentIndexChanged(const QString &arg1) | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 891 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 | 889 | 
 – | 
     //Options are only used for DAT/ONI -> Image | 
 
 
 
 
 
 
 
 
 
 | 890 | 
 – | 
     if(QString::compare(arg1,"DAT / ONI",Qt::CaseSensitive)==0){ //case sensitive is faster | 
 
 
 
 
 
 
 
 
 
 | 891 | 
 – | 
         ui->gbTextures->setEnabled(false); | 
 
 
 
 
 
 
 
 
 
 | 892 | 
 – | 
     } | 
 
 
 
 
 
 
 
 
 
 | 893 | 
 – | 
     else{ | 
 
 
 
 
 
 
 
 
 
 | 894 | 
 – | 
         ui->gbTextures->setEnabled(true); | 
 
 
 
 
 
 
 
 
 
 | 895 | 
 – | 
     } | 
 
 
 
 
 
 
 
 
 
 | 896 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 892 | 
   | 
     updateComboBox(arg1, ui->cbToTextures); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 893 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 894 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 895 | 
   | 
 void MainWindow::on_cbFromObjects_currentIndexChanged(const QString &arg1) | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 896 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 | 902 | 
 – | 
     ui->cbTexture->setEnabled(false); | 
 
 
 
 
 
 
 
 
 
 | 903 | 
 – | 
     ui->cbTexture->setChecked(false); | 
 
 
 
 
 
 
 
 
 
 | 904 | 
 – | 
     ui->cbWithAnimation->setEnabled(false); | 
 
 
 
 
 
 
 
 
 
 | 905 | 
 – | 
     ui->cbWithAnimation->setChecked(false); | 
 
 
 
 
 
 
 
 
 
 | 906 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 | 907 | 
 – | 
     if(QString::compare(arg1,"M3GM ONI",Qt::CaseSensitive)==0){ //case sensitive is faster | 
 
 
 
 
 
 
 
 
 
 | 908 | 
 – | 
         ui->cbWithAnimation->setEnabled(true); | 
 
 
 
 
 
 
 
 
 
 | 909 | 
 – | 
     } | 
 
 
 
 
 
 
 
 
 
 | 910 | 
 – | 
     else if(QString::compare(arg1,"OBJ",Qt::CaseSensitive)==0){ | 
 
 
 
 
 
 
 
 
 
 | 911 | 
 – | 
         ui->cbTexture->setEnabled(true); | 
 
 
 
 
 
 
 
 
 
 | 912 | 
 – | 
     } | 
 
 
 
 
 
 
 
 
 
 | 913 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 897 | 
   | 
     updateComboBox(arg1, ui->cbToObjects); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 898 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 899 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 900 | 
   | 
 void MainWindow::on_cbFromCharacters_currentIndexChanged(const QString &arg1) | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 901 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 | 919 | 
 – | 
     ui->cbWithTRBS_ONCC->setEnabled(false); | 
 
 
 
 
 
 
 
 
 
 | 920 | 
 – | 
     ui->cbWithTRBS_ONCC->setChecked(false); | 
 
 
 
 
 
 
 
 
 
 | 921 | 
 – | 
     ui->cbCellShading->setEnabled(false); | 
 
 
 
 
 
 
 
 
 
 | 922 | 
 – | 
     ui->cbCellShading->setChecked(false); | 
 
 
 
 
 
 
 
 
 
 | 923 | 
 – | 
     ui->cbNormals->setEnabled(false); | 
 
 
 
 
 
 
 
 
 
 | 924 | 
 – | 
     ui->cbNormals->setChecked(false); | 
 
 
 
 
 
 
 
 
 
 | 925 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 | 926 | 
 – | 
     if(QString::compare(arg1,"TRAM ONI",Qt::CaseSensitive)==0){ //case sensitive is faster | 
 
 
 
 
 
 
 
 
 
 | 927 | 
 – | 
         ui->cbWithTRBS_ONCC->setEnabled(true); | 
 
 
 
 
 
 
 
 
 
 | 928 | 
 – | 
     } | 
 
 
 
 
 
 
 
 
 
 | 929 | 
 – | 
     else if(QString::compare(arg1,"TRBS DAE",Qt::CaseSensitive)==0){ | 
 
 
 
 
 
 
 
 
 
 | 930 | 
 – | 
         ui->cbNormals->setEnabled(true); | 
 
 
 
 
 
 
 
 
 
 | 931 | 
 – | 
         ui->cbCellShading->setEnabled(true); | 
 
 
 
 
 
 
 
 
 
 | 932 | 
 – | 
     } | 
 
 
 
 
 
 
 
 
 
 | 933 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 902 | 
   | 
     updateComboBox(arg1, ui->cbToCharacters); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 903 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 904 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 905 | 
   | 
 void MainWindow::on_cbFromLevels_currentIndexChanged(const QString &arg1) | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 906 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 | 939 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 | 940 | 
 – | 
     ui->cbSpecificFilesLevels->setEnabled(false); | 
 
 
 
 
 
 
 
 
 
 | 941 | 
 – | 
     ui->cbSpecificFilesLevels->setChecked(false); | 
 
 
 
 
 
 
 
 
 
 | 942 | 
 – | 
     ui->cbDatLevels->setEnabled(false); | 
 
 
 
 
 
 
 
 
 
 | 943 | 
 – | 
     ui->cbDatLevels->setChecked(false); | 
 
 
 
 
 
 
 
 
 
 | 944 | 
 – | 
     ui->cbBnvLevels->setEnabled(false); | 
 
 
 
 
 
 
 
 
 
 | 945 | 
 – | 
     ui->cbBnvLevels->setChecked(false); | 
 
 
 
 
 
 
 
 
 
 | 946 | 
 – | 
     ui->cbAdditionalSourcesLevels->setEnabled(false); | 
 
 
 
 
 
 
 
 
 
 | 947 | 
 – | 
     ui->cbAdditionalSourcesLevels->setChecked(false); | 
 
 
 
 
 
 
 
 
 
 | 948 | 
 – | 
     ui->cbGridsLevels->setEnabled(false); | 
 
 
 
 
 
 
 
 
 
 | 949 | 
 – | 
     ui->cbGridsLevels->setChecked(false); | 
 
 
 
 
 
 
 
 
 
 | 950 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 | 951 | 
 – | 
     if(arg1=="DAT"){ //case sensitive is faster | 
 
 
 
 
 
 
 
 
 
 | 952 | 
 – | 
         ui->cbSpecificFilesLevels->setEnabled(true); | 
 
 
 
 
 
 
 
 
 
 | 953 | 
 – | 
     } | 
 
 
 
 
 
 
 
 
 
 | 954 | 
 – | 
     else if(arg1=="ONI FILES"){ //case sensitive is faster | 
 
 
 
 
 
 
 
 
 
 | 955 | 
 – | 
         ui->cbDatLevels->setEnabled(true); | 
 
 
 
 
 
 
 
 
 
 | 956 | 
 – | 
     } | 
 
 
 
 
 
 
 
 
 
 | 957 | 
 – | 
     else if(arg1=="DAE"){ | 
 
 
 
 
 
 
 
 
 
 | 958 | 
 – | 
         ui->cbBnvLevels->setEnabled(true); | 
 
 
 
 
 
 
 
 
 
 | 959 | 
 – | 
         ui->cbAdditionalSourcesLevels->setEnabled(true); | 
 
 
 
 
 
 
 
 
 
 | 960 | 
 – | 
     } | 
 
 
 
 
 
 
 
 
 
 | 961 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 907 | 
   | 
     updateComboBox(arg1, ui->cbToLevels); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 908 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 909 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 913 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 914 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 915 | 
   | 
 void MainWindow::updateComboBox(const QString &arg1, QComboBox *comboBox){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 916 | 
 < | 
     QString identifier=ui->tabWidget->tabText(ui->tabWidget->currentIndex()).toLower(); // get current tab title text (lower case) | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 916 | 
 > | 
  | 
 
 
 
 
 
 | 917 | 
 > | 
     QString identifier; | 
 
 
 
 
 
 | 918 | 
 > | 
  | 
 
 
 
 
 
 | 919 | 
 > | 
     if(comboBox == ui->cbToXML){ | 
 
 
 
 
 
 | 920 | 
 > | 
         identifier = ui->tabWidget->tabText(XMLTabIndex); | 
 
 
 
 
 
 | 921 | 
 > | 
     } | 
 
 
 
 
 
 | 922 | 
 > | 
     else if(comboBox == ui->cbToTextures){ | 
 
 
 
 
 
 | 923 | 
 > | 
         identifier = ui->tabWidget->tabText(TexturesTabIndex); | 
 
 
 
 
 
 | 924 | 
 > | 
  | 
 
 
 
 
 
 | 925 | 
 > | 
         //Options are only used for DAT/ONI -> Image | 
 
 
 
 
 
 | 926 | 
 > | 
         if(QString::compare(arg1,"DAT / ONI",Qt::CaseSensitive)==0){ //case sensitive is faster | 
 
 
 
 
 
 | 927 | 
 > | 
             ui->gbTextures->setEnabled(false); | 
 
 
 
 
 
 | 928 | 
 > | 
         } | 
 
 
 
 
 
 | 929 | 
 > | 
         else{ | 
 
 
 
 
 
 | 930 | 
 > | 
             ui->gbTextures->setEnabled(true); | 
 
 
 
 
 
 | 931 | 
 > | 
         } | 
 
 
 
 
 
 | 932 | 
 > | 
     } | 
 
 
 
 
 
 | 933 | 
 > | 
     else if(comboBox == ui->cbToCharacters){ | 
 
 
 
 
 
 | 934 | 
 > | 
         identifier = ui->tabWidget->tabText(CharactersTabIndex); | 
 
 
 
 
 
 | 935 | 
 > | 
  | 
 
 
 
 
 
 | 936 | 
 > | 
         ui->cbWithTRBS_ONCC->setEnabled(false); | 
 
 
 
 
 
 | 937 | 
 > | 
         ui->cbWithTRBS_ONCC->setChecked(false); | 
 
 
 
 
 
 | 938 | 
 > | 
         ui->cbCellShading->setEnabled(false); | 
 
 
 
 
 
 | 939 | 
 > | 
         ui->cbCellShading->setChecked(false); | 
 
 
 
 
 
 | 940 | 
 > | 
         ui->cbNormals->setEnabled(false); | 
 
 
 
 
 
 | 941 | 
 > | 
         ui->cbNormals->setChecked(false); | 
 
 
 
 
 
 | 942 | 
 > | 
  | 
 
 
 
 
 
 | 943 | 
 > | 
         if(QString::compare(arg1,"TRAM ONI",Qt::CaseSensitive)==0){ //case sensitive is faster | 
 
 
 
 
 
 | 944 | 
 > | 
             ui->cbWithTRBS_ONCC->setEnabled(true); | 
 
 
 
 
 
 | 945 | 
 > | 
         } | 
 
 
 
 
 
 | 946 | 
 > | 
         else if(QString::compare(arg1,"TRBS DAE",Qt::CaseSensitive)==0){ | 
 
 
 
 
 
 | 947 | 
 > | 
             ui->cbNormals->setEnabled(true); | 
 
 
 
 
 
 | 948 | 
 > | 
             ui->cbCellShading->setEnabled(true); | 
 
 
 
 
 
 | 949 | 
 > | 
         } | 
 
 
 
 
 
 | 950 | 
 > | 
  | 
 
 
 
 
 
 | 951 | 
 > | 
     } | 
 
 
 
 
 
 | 952 | 
 > | 
     else if(comboBox == ui->cbToObjects){ | 
 
 
 
 
 
 | 953 | 
 > | 
         identifier = ui->tabWidget->tabText(ObjectsTabIndex); | 
 
 
 
 
 
 | 954 | 
 > | 
  | 
 
 
 
 
 
 | 955 | 
 > | 
         ui->cbTexture->setEnabled(false); | 
 
 
 
 
 
 | 956 | 
 > | 
         ui->cbTexture->setChecked(false); | 
 
 
 
 
 
 | 957 | 
 > | 
         ui->cbWithAnimation->setEnabled(false); | 
 
 
 
 
 
 | 958 | 
 > | 
         ui->cbWithAnimation->setChecked(false); | 
 
 
 
 
 
 | 959 | 
 > | 
  | 
 
 
 
 
 
 | 960 | 
 > | 
         if(QString::compare(arg1,"M3GM ONI",Qt::CaseSensitive)==0){ //case sensitive is faster | 
 
 
 
 
 
 | 961 | 
 > | 
             ui->cbWithAnimation->setEnabled(true); | 
 
 
 
 
 
 | 962 | 
 > | 
         } | 
 
 
 
 
 
 | 963 | 
 > | 
         else if(QString::compare(arg1,"OBJ",Qt::CaseSensitive)==0){ | 
 
 
 
 
 
 | 964 | 
 > | 
             ui->cbTexture->setEnabled(true); | 
 
 
 
 
 
 | 965 | 
 > | 
         } | 
 
 
 
 
 
 | 966 | 
 > | 
     } | 
 
 
 
 
 
 | 967 | 
 > | 
     else if(comboBox == ui->cbToLevels){ | 
 
 
 
 
 
 | 968 | 
 > | 
         identifier = ui->tabWidget->tabText(LevelsTabIndex); | 
 
 
 
 
 
 | 969 | 
 > | 
  | 
 
 
 
 
 
 | 970 | 
 > | 
         ui->cbSpecificFilesLevels->setEnabled(false); | 
 
 
 
 
 
 | 971 | 
 > | 
         ui->cbSpecificFilesLevels->setChecked(false); | 
 
 
 
 
 
 | 972 | 
 > | 
         ui->cbDatLevels->setEnabled(false); | 
 
 
 
 
 
 | 973 | 
 > | 
         ui->cbDatLevels->setChecked(false); | 
 
 
 
 
 
 | 974 | 
 > | 
         ui->cbBnvLevels->setEnabled(false); | 
 
 
 
 
 
 | 975 | 
 > | 
         ui->cbBnvLevels->setChecked(false); | 
 
 
 
 
 
 | 976 | 
 > | 
         ui->cbAdditionalSourcesLevels->setEnabled(false); | 
 
 
 
 
 
 | 977 | 
 > | 
         ui->cbAdditionalSourcesLevels->setChecked(false); | 
 
 
 
 
 
 | 978 | 
 > | 
         ui->cbGridsLevels->setEnabled(false); | 
 
 
 
 
 
 | 979 | 
 > | 
         ui->cbGridsLevels->setChecked(false); | 
 
 
 
 
 
 | 980 | 
 > | 
  | 
 
 
 
 
 
 | 981 | 
 > | 
         if(arg1=="DAT"){ //case sensitive is faster | 
 
 
 
 
 
 | 982 | 
 > | 
             ui->cbSpecificFilesLevels->setEnabled(true); | 
 
 
 
 
 
 | 983 | 
 > | 
         } | 
 
 
 
 
 
 | 984 | 
 > | 
         else if(arg1=="ONI FILES"){ //case sensitive is faster | 
 
 
 
 
 
 | 985 | 
 > | 
             ui->cbDatLevels->setEnabled(true); | 
 
 
 
 
 
 | 986 | 
 > | 
         } | 
 
 
 
 
 
 | 987 | 
 > | 
         else if(arg1=="DAE"){ | 
 
 
 
 
 
 | 988 | 
 > | 
             ui->cbBnvLevels->setEnabled(true); | 
 
 
 
 
 
 | 989 | 
 > | 
             ui->cbAdditionalSourcesLevels->setEnabled(true); | 
 
 
 
 
 
 | 990 | 
 > | 
         } | 
 
 
 
 
 
 | 991 | 
 > | 
     } | 
 
 
 
 
 
 | 992 | 
 > | 
     else{ // Misc | 
 
 
 
 
 
 | 993 | 
 > | 
         identifier = ui->tabWidget->tabText(MiscTabIndex); | 
 
 
 
 
 
 | 994 | 
 > | 
     } | 
 
 
 
 
 
 | 995 | 
 > | 
  | 
 
 
 
 
 
 | 996 | 
 > | 
     identifier = identifier.toLower(); // get current tab title text (lower case) | 
 
 
 
 
 
 
 
 
 
 
 
 | 997 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 998 | 
   | 
     comboBox->clear(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 999 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1129 | 
   | 
 #endif | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1130 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1131 | 
   | 
     if(Util::showQuestionPopUp(this,"Are you sure you want to clear the content?",defaultButton)){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 1132 | 
 < | 
         myTable->clearContents(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1108 | 
 < | 
         myTable->setRowCount(0); | 
 
 
 
 
 
 
 
 
 
 | 1132 | 
 > | 
         clearTableNoPrompt(myTable); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1133 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1134 | 
   | 
     updateItemsLoaded(myTable); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1135 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1136 | 
   | 
  | 
 
 
 
 
 
 
 
 
 | 1137 | 
 + | 
 void MainWindow::clearTableNoPrompt(DropTableWidget *myTable){ | 
 
 
 
 
 
 
 
 
 | 1138 | 
 + | 
     myTable->clearContents(); | 
 
 
 
 
 
 
 
 
 | 1139 | 
 + | 
     myTable->setRowCount(0); | 
 
 
 
 
 
 
 
 
 | 1140 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1141 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1142 | 
   | 
 void MainWindow::on_actionPreferences_triggered() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1143 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1213 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1214 | 
   | 
 void MainWindow::on_actionCheck_OniSplit_version_triggered() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1215 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 | 1216 | 
 < | 
     QProcess *myProcess = new QProcess(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1217 | 
 < | 
     myProcess->setWorkingDirectory(Util::getAppPath()); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1218 | 
 < | 
     myProcess->start(Util::getOniSplitExeName()+" -version"); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1219 | 
 < | 
     myProcess->waitForFinished(-1); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1220 | 
 < | 
     QString result=myProcess->readAllStandardOutput(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1221 | 
 < | 
     delete myProcess; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1222 | 
 < | 
     Util::showPopUp("This Vago version was built with base in OniSplit version "+GlobalVars::BuiltOniSplitVersion+"\n\nActual version is:\n"+result); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1216 | 
 > | 
     QProcess myProcess; | 
 
 
 
 
 
 | 1217 | 
 > | 
     myProcess.setWorkingDirectory(UtilVago::getAppPath()); | 
 
 
 
 
 
 | 1218 | 
 > | 
     myProcess.start(UtilVago::getOniSplitExecutable()+" -version"); | 
 
 
 
 
 
 | 1219 | 
 > | 
     myProcess.waitForFinished(); | 
 
 
 
 
 
 | 1220 | 
 > | 
  | 
 
 
 
 
 
 | 1221 | 
 > | 
     QString result=myProcess.readAllStandardOutput(); | 
 
 
 
 
 
 | 1222 | 
 > | 
  | 
 
 
 
 
 
 | 1223 | 
 > | 
     Util::showPopUp("This Vago version was built with base in OniSplit version "+GlobalVars::BuiltOniSplitVersion+"\n\nCurrent version is:\n"+result.trimmed()); | 
 
 
 
 
 
 
 
 
 
 
 
 | 1224 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1225 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1226 | 
   | 
 void MainWindow::on_actionCheck_xmlTools_version_triggered() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1227 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 | 1228 | 
 < | 
     QProcess *myProcess = new QProcess(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1229 | 
 < | 
     myProcess->setWorkingDirectory(Util::getAppPath()); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1230 | 
 < | 
     myProcess->start(Util::getXmlToolsExeName()+" version"); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1231 | 
 < | 
     myProcess->waitForFinished(-1); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1232 | 
 < | 
     QString result=myProcess->readLine(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1233 | 
 < | 
     delete myProcess; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1234 | 
 < | 
     Util::showPopUp("This Vago version was built with base in xmlTools version "+GlobalVars::BuiltXmlToolsVersion+"\n\nActual version is:\n"+result); | 
 
 
 
 
 
 
 
 
 
 | 1228 | 
 > | 
     QProcess myProcess; | 
 
 
 
 
 
 | 1229 | 
 > | 
     myProcess.setWorkingDirectory(UtilVago::getAppPath()); | 
 
 
 
 
 
 | 1230 | 
 > | 
     myProcess.start(UtilVago::getXmlToolsExecutable()+" --version"); | 
 
 
 
 
 
 | 1231 | 
 > | 
     myProcess.waitForFinished(); | 
 
 
 
 
 
 | 1232 | 
 > | 
     QString result=myProcess.readLine(); | 
 
 
 
 
 
 | 1233 | 
 > | 
  | 
 
 
 
 
 
 | 1234 | 
 > | 
     Util::showPopUp("This Vago version was built with base in XmlTools version "+GlobalVars::BuiltXmlToolsVersion+"\n\nCurrent version is:\n"+result.trimmed()); | 
 
 
 
 
 
 
 
 
 
 
 
 | 1235 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1236 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1237 | 
   | 
 /** | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1238 | 
   | 
   Update items loaded | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1239 | 
   | 
 **/ | 
 
 
 
 
 
 
 
 
 
 
 
 | 1240 | 
 < | 
 void MainWindow::on_tabWidget_currentChanged(int index) | 
 
 
 
 
 
 
 
 
 
 | 1240 | 
 > | 
 void MainWindow::on_tabWidget_currentChanged(int) | 
 
 
 
 
 
 
 
 
 
 
 
 | 1241 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 | 1242 | 
 < | 
     QString tabtext = ui->tabWidget->tabText(index); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1214 | 
 < | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1215 | 
 < | 
     if(tabtext.compare("XML",Qt::CaseSensitive)==0){ //case sentive is faster | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1216 | 
 < | 
         updateItemsLoaded(ui->twSourcesXML); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1217 | 
 < | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1218 | 
 < | 
     else if(tabtext.compare("Textures",Qt::CaseSensitive)==0){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1219 | 
 < | 
         updateItemsLoaded(ui->twSourcesTextures); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1220 | 
 < | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1221 | 
 < | 
     else if(tabtext.compare("Characters",Qt::CaseSensitive)==0){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1222 | 
 < | 
         updateItemsLoaded(ui->twSourcesCharacters); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1223 | 
 < | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1224 | 
 < | 
     else if(tabtext.compare("Objects",Qt::CaseSensitive)==0){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1225 | 
 < | 
         updateItemsLoaded(ui->twSourcesObjects); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1226 | 
 < | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1227 | 
 < | 
     else if(tabtext.compare("Levels",Qt::CaseSensitive)==0){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1228 | 
 < | 
         updateItemsLoaded(ui->twSourcesLevels); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1229 | 
 < | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1230 | 
 < | 
     else{ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1231 | 
 < | 
         updateItemsLoaded(ui->twSourcesMisc); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1232 | 
 < | 
     } | 
 
 
 
 
 
 
 
 
 
 | 1242 | 
 > | 
     updateItemsLoaded(getCurrentTableWidget()); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1243 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1244 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1245 | 
   | 
 void MainWindow::updateItemsLoaded(DropTableWidget *currentTable){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1292 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1293 | 
   | 
 void MainWindow::on_actionView_log_triggered() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1294 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 | 1295 | 
 < | 
     Util::openLogFile(); | 
 
 
 
 
 
 
 
 
 
 | 1295 | 
 > | 
     UtilVago::openLogFile(); | 
 
 
 
 
 
 
 
 
 
 
 
 | 1296 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1297 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1298 | 
   | 
 void MainWindow::on_actionOpen_AE_folder_triggered() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1300 | 
   | 
     QDesktopServices::openUrl(QUrl("file:///"+this->AeLocation)); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1301 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1302 | 
   | 
  | 
 
 
 
 
 
 
 
 
 | 1303 | 
 + | 
 void MainWindow::on_actionSave_Project_triggered() | 
 
 
 
 
 
 
 
 
 | 1304 | 
 + | 
 { | 
 
 
 
 
 
 
 
 
 | 1305 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1306 | 
 + | 
     QString filePath = QFileDialog::getSaveFileName(this, tr("Save File"), | 
 
 
 
 
 
 
 
 
 | 1307 | 
 + | 
                                                     this->vagoSettings->value("LastProjectPath").toString(), | 
 
 
 
 
 
 
 
 
 | 1308 | 
 + | 
                                                     tr("Vago project files (*.vgp)")); | 
 
 
 
 
 
 
 
 
 | 1309 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1310 | 
 + | 
     if(!filePath.isEmpty()){ | 
 
 
 
 
 
 
 
 
 | 1311 | 
 + | 
         saveProjectState(filePath); | 
 
 
 
 
 
 
 
 
 | 1312 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1313 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1314 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 1315 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1316 | 
 + | 
 void MainWindow::on_actionSave_triggered() | 
 
 
 
 
 
 
 
 
 | 1317 | 
 + | 
 { | 
 
 
 
 
 
 
 
 
 | 1318 | 
 + | 
     if(this->lastProjectFilePath.isEmpty()){ | 
 
 
 
 
 
 
 
 
 | 1319 | 
 + | 
         on_actionSave_Project_triggered(); | 
 
 
 
 
 
 
 
 
 | 1320 | 
 + | 
         return; | 
 
 
 
 
 
 
 
 
 | 1321 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1322 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1323 | 
 + | 
     saveProjectState(this->lastProjectFilePath); | 
 
 
 
 
 
 
 
 
 | 1324 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 1325 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1326 | 
 + | 
 void MainWindow::on_actionLoad_Project_triggered() | 
 
 
 
 
 
 
 
 
 | 1327 | 
 + | 
 { | 
 
 
 
 
 
 
 
 
 | 1328 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1329 | 
 + | 
     QString filePath = QFileDialog::getOpenFileName(this, tr("Load File"), | 
 
 
 
 
 
 
 
 
 | 1330 | 
 + | 
                                                     this->vagoSettings->value("LastProjectPath").toString(), | 
 
 
 
 
 
 
 
 
 | 1331 | 
 + | 
                                                     tr("Vago project files (*.vgp)")); | 
 
 
 
 
 
 
 
 
 | 1332 | 
 + | 
     if(!filePath.isEmpty()){ | 
 
 
 
 
 
 
 
 
 | 1333 | 
 + | 
         loadProjectState(filePath); | 
 
 
 
 
 
 
 
 
 | 1334 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1335 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 1336 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1337 | 
 + | 
 void MainWindow::on_actionProject1_triggered() | 
 
 
 
 
 
 
 
 
 | 1338 | 
 + | 
 { | 
 
 
 
 
 
 
 
 
 | 1339 | 
 + | 
     loadProjectState(this->ui->actionProject1->text()); | 
 
 
 
 
 
 
 
 
 | 1340 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 1341 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1342 | 
 + | 
 void MainWindow::on_actionProject2_triggered() | 
 
 
 
 
 
 
 
 
 | 1343 | 
 + | 
 { | 
 
 
 
 
 
 
 
 
 | 1344 | 
 + | 
     loadProjectState(this->ui->actionProject2->text()); | 
 
 
 
 
 
 
 
 
 | 1345 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 1346 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1347 | 
 + | 
 void MainWindow::on_actionProject3_triggered() | 
 
 
 
 
 
 
 
 
 | 1348 | 
 + | 
 { | 
 
 
 
 
 
 
 
 
 | 1349 | 
 + | 
     loadProjectState(this->ui->actionProject3->text()); | 
 
 
 
 
 
 
 
 
 | 1350 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 1351 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1352 | 
 + | 
 void MainWindow::on_actionProject4_triggered() | 
 
 
 
 
 
 
 
 
 | 1353 | 
 + | 
 { | 
 
 
 
 
 
 
 
 
 | 1354 | 
 + | 
     loadProjectState(this->ui->actionProject4->text()); | 
 
 
 
 
 
 
 
 
 | 1355 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 1356 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1357 | 
 + | 
 void MainWindow::on_actionProject5_triggered() | 
 
 
 
 
 
 
 
 
 | 1358 | 
 + | 
 { | 
 
 
 
 
 
 
 
 
 | 1359 | 
 + | 
     loadProjectState(this->ui->actionProject5->text()); | 
 
 
 
 
 
 
 
 
 | 1360 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 1361 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1362 | 
   | 
 QString MainWindow::getTypeConversion(DropTableWidget *myTable){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1363 | 
   | 
     QString from,to; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1364 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1408 | 
   | 
         selectedRows << rowItem.row(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1409 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1410 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 1411 | 
 < | 
     QMenu *menu = new QMenu(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1412 | 
 < | 
     QAction *copy = new QAction("Copy",myTable); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1413 | 
 < | 
     QAction *moveUp = new QAction("Move Up",myTable); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1414 | 
 < | 
     QAction *moveDown = new QAction("Move Down",myTable); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1415 | 
 < | 
     QAction *changeOptions = new QAction("Change To Current Options",myTable); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1416 | 
 < | 
     QMenu *changeOutput = new QMenu("Change Output for:"); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1417 | 
 < | 
     QAction *outWorkspace = new QAction("Workspace",myTable); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1418 | 
 < | 
     QAction *outCurrOutput = new QAction("Current Output Folder",myTable); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1419 | 
 < | 
     QAction *outOther = new QAction("Other...",myTable); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1420 | 
 < | 
     QAction *edisable = new QAction("Enable/Disable",myTable); | 
 
 
 
 
 
 
 
 
 
 | 1411 | 
 > | 
     std::unique_ptr<QMenu> menu = std::make_unique<QMenu>(); | 
 
 
 
 
 
 | 1412 | 
 > | 
     std::unique_ptr<QAction> copy =  std::make_unique<QAction>("Copy",myTable); | 
 
 
 
 
 
 | 1413 | 
 > | 
     std::unique_ptr<QAction> moveUp = std::make_unique<QAction>("Move Up",myTable); | 
 
 
 
 
 
 | 1414 | 
 > | 
     std::unique_ptr<QAction> moveDown = std::make_unique<QAction>("Move Down",myTable); | 
 
 
 
 
 
 | 1415 | 
 > | 
     std::unique_ptr<QAction> changeOptions = std::make_unique<QAction>("Change To Current Options",myTable); | 
 
 
 
 
 
 | 1416 | 
 > | 
     std::unique_ptr<QMenu> changeOutput = std::make_unique<QMenu>("Change Output for:"); | 
 
 
 
 
 
 | 1417 | 
 > | 
     std::unique_ptr<QAction> outWorkspace = std::make_unique<QAction>("Workspace",myTable); | 
 
 
 
 
 
 | 1418 | 
 > | 
     std::unique_ptr<QAction> outCurrOutput = std::make_unique<QAction>("Current Output Folder",myTable); | 
 
 
 
 
 
 | 1419 | 
 > | 
     std::unique_ptr<QAction> outOther = std::make_unique<QAction>("Other...",myTable); | 
 
 
 
 
 
 | 1420 | 
 > | 
     std::unique_ptr<QAction> edisable = std::make_unique<QAction>("Enable/Disable",myTable); | 
 
 
 
 
 
 
 
 
 
 
 
 | 1421 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 1422 | 
 < | 
     menu->addAction(copy); | 
 
 
 
 
 
 
 
 
 
 | 1422 | 
 > | 
     menu->addAction(copy.get()); | 
 
 
 
 
 
 
 
 
 
 
 
 | 1423 | 
   | 
     menu->addSeparator(); | 
 
 
 
 
 
 
 
 
 
 
 
 | 1424 | 
 < | 
     menu->addAction(moveUp); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1425 | 
 < | 
     menu->addAction(moveDown); | 
 
 
 
 
 
 
 
 
 
 | 1424 | 
 > | 
     menu->addAction(moveUp.get()); | 
 
 
 
 
 
 | 1425 | 
 > | 
     menu->addAction(moveDown.get()); | 
 
 
 
 
 
 
 
 
 
 
 
 | 1426 | 
   | 
     menu->addSeparator(); | 
 
 
 
 
 
 
 
 
 
 
 
 | 1427 | 
 < | 
     menu->addAction(changeOptions); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1428 | 
 < | 
     menu->addMenu(changeOutput); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1429 | 
 < | 
     changeOutput->addActions(QList<QAction*>() << outWorkspace << outCurrOutput << outOther); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1430 | 
 < | 
     menu->addAction(edisable); | 
 
 
 
 
 
 
 
 
 
 | 1427 | 
 > | 
     menu->addAction(changeOptions.get()); | 
 
 
 
 
 
 | 1428 | 
 > | 
     menu->addMenu(changeOutput.get()); | 
 
 
 
 
 
 | 1429 | 
 > | 
     changeOutput->addActions(QList<QAction*>() << outWorkspace.get() << outCurrOutput.get() << outOther.get()); | 
 
 
 
 
 
 | 1430 | 
 > | 
     menu->addAction(edisable.get()); | 
 
 
 
 
 
 
 
 
 
 
 
 | 1431 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1432 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1433 | 
   | 
     //if it's in the first row it can't be setted up | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1451 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1452 | 
   | 
     QAction* selectedOption = menu->exec(event->globalPos()); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1453 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 1454 | 
 < | 
     if(selectedOption==copy){ | 
 
 
 
 
 
 
 
 
 
 | 1454 | 
 > | 
     if(selectedOption==copy.get()){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 1455 | 
   | 
         //Let's copy the contents to the clipboard | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1456 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1457 | 
   | 
         QString toCopy; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1474 | 
   | 
         QApplication::clipboard()->setText(toCopy); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1475 | 
   | 
         showSuccessStatusMessage(QString::number(size) + (size==1?" item ":" items ")+ "copied to the clipboard"); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1476 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 | 1477 | 
 < | 
     else if(selectedOption==moveUp){ | 
 
 
 
 
 
 
 
 
 
 | 1477 | 
 > | 
     else if(selectedOption==moveUp.get()){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 1478 | 
   | 
         qSort(selectedRows); //let's order the selections by the row number, so we know exactly how to swap it | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1479 | 
   | 
         myTable->swapPositions(selectedRows,-1); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1480 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 | 1481 | 
 < | 
     else if(selectedOption==moveDown){ | 
 
 
 
 
 
 
 
 
 
 | 1481 | 
 > | 
     else if(selectedOption==moveDown.get()){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 1482 | 
   | 
         qSort(selectedRows); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1483 | 
   | 
         myTable->swapPositions(selectedRows,+1); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1484 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 | 1485 | 
 < | 
     else if(selectedOption==changeOptions){ | 
 
 
 
 
 
 
 
 
 
 | 1485 | 
 > | 
     else if(selectedOption==changeOptions.get()){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 1486 | 
   | 
         changeToCurrentSettings(selectedRows,myTable); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1487 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 | 1488 | 
 < | 
     else if(selectedOption==outWorkspace){ | 
 
 
 
 
 
 
 
 
 
 | 1488 | 
 > | 
     else if(selectedOption==outWorkspace.get()){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 1489 | 
   | 
         changeItemsOutput(myTable,selectedRows,this->workspaceLocation); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1490 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 | 1491 | 
 < | 
     else if(selectedOption==outCurrOutput){ | 
 
 
 
 
 
 
 
 
 
 | 1491 | 
 > | 
     else if(selectedOption==outCurrOutput.get()){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 1492 | 
   | 
         changeItemsOutput(myTable,selectedRows,this->outputFolder); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1493 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 | 1494 | 
 < | 
     else if(selectedOption==outOther){ | 
 
 
 
 
 
 
 
 
 
 | 1494 | 
 > | 
     else if(selectedOption==outOther.get()){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 1495 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1496 | 
   | 
         QString newDir=QFileDialog::getExistingDirectory(this,"Choose the folder for the output of the files selected...",this->AeLocation+"/GameDataFolder"); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1497 | 
   | 
         newDir=Util::normalizePath(newDir); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1503 | 
   | 
         changeItemsOutput(myTable,selectedRows,newDir); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1504 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1505 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 | 1506 | 
 < | 
     else if(selectedOption==edisable){ | 
 
 
 
 
 
 
 
 
 
 | 1506 | 
 > | 
     else if(selectedOption==edisable.get()){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 1507 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1508 | 
   | 
         int enabledCount=0, disabledCount=0; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1509 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1541 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1542 | 
   | 
         showSuccessStatusMessage(result); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1543 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 | 1475 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 | 1476 | 
 – | 
     delete copy; | 
 
 
 
 
 
 
 
 
 
 | 1477 | 
 – | 
     delete moveUp; | 
 
 
 
 
 
 
 
 
 
 | 1478 | 
 – | 
     delete moveDown; | 
 
 
 
 
 
 
 
 
 
 | 1479 | 
 – | 
     delete changeOptions; | 
 
 
 
 
 
 
 
 
 
 | 1480 | 
 – | 
     delete outWorkspace; | 
 
 
 
 
 
 
 
 
 
 | 1481 | 
 – | 
     delete outCurrOutput; | 
 
 
 
 
 
 
 
 
 
 | 1482 | 
 – | 
     delete outOther; | 
 
 
 
 
 
 
 
 
 
 | 1483 | 
 – | 
     delete changeOutput; | 
 
 
 
 
 
 
 
 
 
 | 1484 | 
 – | 
     delete edisable; | 
 
 
 
 
 
 
 
 
 
 | 1485 | 
 – | 
     delete menu; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1544 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1545 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1546 | 
   | 
 void MainWindow::changeToCurrentSettings(QList<int> rows, DropTableWidget* myTable){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1615 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1616 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1617 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 | 1560 | 
 – | 
 /** | 
 
 
 
 
 
 
 
 
 
 | 1561 | 
 – | 
   This is OS indepented. It maintain size ratio over the Windows and Mac. | 
 
 
 
 
 
 
 
 
 
 | 1562 | 
 – | 
   **/ | 
 
 
 
 
 
 
 
 
 
 | 1563 | 
 – | 
 void MainWindow::setConverterButtonsSize(){ | 
 
 
 
 
 
 
 
 
 
 | 1564 | 
 – | 
     int height=ui->pbConvertXML->sizeHint().height()*1.3; | 
 
 
 
 
 
 
 
 
 
 | 1565 | 
 – | 
     ui->pbConvertXML->setMinimumHeight(height); | 
 
 
 
 
 
 
 
 
 
 | 1566 | 
 – | 
     ui->pbConvertTextures->setMinimumHeight(height); | 
 
 
 
 
 
 
 
 
 
 | 1567 | 
 – | 
     ui->pbConvertObjects->setMinimumHeight(height); | 
 
 
 
 
 
 
 
 
 
 | 1568 | 
 – | 
     ui->pbConvertCharacters->setMinimumHeight(height); | 
 
 
 
 
 
 
 
 
 
 | 1569 | 
 – | 
     ui->pbConvertLevels->setMinimumHeight(height); | 
 
 
 
 
 
 
 
 
 
 | 1570 | 
 – | 
     ui->pbConvertMisc->setMinimumHeight(height); | 
 
 
 
 
 
 
 
 
 
 | 1571 | 
 – | 
 } | 
 
 
 
 
 
 
 
 
 
 | 1572 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1618 | 
   | 
 void MainWindow::connectSlots(){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1619 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1620 | 
   | 
     //This signal is for thread that is working setup the progress bar (make it visible and set it's min-max) | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1668 | 
   | 
     //Context menu for Misc table | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1669 | 
   | 
     connect(ui->twSourcesMisc, SIGNAL(dtContextMenu(DropTableWidget*,QContextMenuEvent*)), this, SLOT(dtContextMenu(DropTableWidget*,QContextMenuEvent*))); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1670 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 | 1671 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1672 | 
 + | 
 void MainWindow::saveProjectState(const QString &filePath) | 
 
 
 
 
 
 
 
 
 | 1673 | 
 + | 
 { | 
 
 
 
 
 
 
 
 
 | 1674 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1675 | 
 + | 
     QList<DropTableWidget*> tableWidgets = getAllTableWidgets(); | 
 
 
 
 
 
 
 
 
 | 1676 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1677 | 
 + | 
     pugi::xml_document doc; | 
 
 
 
 
 
 
 
 
 | 1678 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1679 | 
 + | 
     pugi::xml_node rootNode = doc.append_child("VagoProject"); | 
 
 
 
 
 
 
 
 
 | 1680 | 
 + | 
     rootNode.append_attribute("vagoVersion").set_value(GlobalVars::AppVersion.toUtf8().constData()); | 
 
 
 
 
 
 
 
 
 | 1681 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1682 | 
 + | 
     foreach(DropTableWidget* const &myTable, tableWidgets){ | 
 
 
 
 
 
 
 
 
 | 1683 | 
 + | 
         saveProjectWidget(rootNode, myTable); | 
 
 
 
 
 
 
 
 
 | 1684 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1685 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1686 | 
 + | 
     if(!doc.save_file(filePath.toUtf8().constData(), PUGIXML_TEXT("\t"), pugi::format_default | pugi::format_write_bom, pugi::xml_encoding::encoding_utf8)){ | 
 
 
 
 
 
 
 
 
 | 1687 | 
 + | 
         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "An error ocurred while trying to save the project file. Please try another path."); | 
 
 
 
 
 
 
 
 
 | 1688 | 
 + | 
         return; | 
 
 
 
 
 
 
 
 
 | 1689 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1690 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1691 | 
 + | 
     this->vagoSettings->setValue("LastProjectPath",QFileInfo(filePath).absoluteDir().path()); | 
 
 
 
 
 
 
 
 
 | 1692 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1693 | 
 + | 
     this->lastProjectFilePath = filePath; | 
 
 
 
 
 
 
 
 
 | 1694 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1695 | 
 + | 
     addNewRecentProject(filePath); | 
 
 
 
 
 
 
 
 
 | 1696 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1697 | 
 + | 
     setVagoWindowTitle(); | 
 
 
 
 
 
 
 
 
 | 1698 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1699 | 
 + | 
     showSuccessStatusMessage("Project saved sucessfully."); | 
 
 
 
 
 
 
 
 
 | 1700 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 1701 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1702 | 
 + | 
 void MainWindow::saveProjectWidget(pugi::xml_node &rootNode, DropTableWidget* table) | 
 
 
 
 
 
 
 
 
 | 1703 | 
 + | 
 { | 
 
 
 
 
 
 
 
 
 | 1704 | 
 + | 
     QString from; | 
 
 
 
 
 
 
 
 
 | 1705 | 
 + | 
     QString to; | 
 
 
 
 
 
 
 
 
 | 1706 | 
 + | 
     QString tabName = getTabNameByTableWidget(table); | 
 
 
 
 
 
 
 
 
 | 1707 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1708 | 
 + | 
     pugi::xml_node currentNodeTable = rootNode.append_child("tempName"); | 
 
 
 
 
 
 
 
 
 | 1709 | 
 + | 
     pugi::xml_node options; | 
 
 
 
 
 
 
 
 
 | 1710 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1711 | 
 + | 
     if(table==ui->twSourcesXML){ //So we only need to parse one command. | 
 
 
 
 
 
 
 
 
 | 1712 | 
 + | 
         from = ui->cbFromXML->currentText().toUtf8().constData(); | 
 
 
 
 
 
 
 
 
 | 1713 | 
 + | 
         to = ui->cbToXML->currentText().toUtf8().constData(); | 
 
 
 
 
 
 
 
 
 | 1714 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1715 | 
 + | 
     else if(table==ui->twSourcesTextures){ | 
 
 
 
 
 
 
 
 
 | 1716 | 
 + | 
         from = ui->cbFromTextures->currentText().toUtf8().constData(); | 
 
 
 
 
 
 
 
 
 | 1717 | 
 + | 
         to = ui->cbToTextures->currentText().toUtf8().constData(); | 
 
 
 
 
 
 
 
 
 | 1718 | 
 + | 
         options = currentNodeTable.append_child("Options"); | 
 
 
 
 
 
 
 
 
 | 1719 | 
 + | 
         options.append_attribute("type").set_value(Util::qStrToCstr(getTextureRBCheckedTypeTexture()->text())); | 
 
 
 
 
 
 
 
 
 | 1720 | 
 + | 
         options.append_attribute("genMipMaps").set_value(Util::boolToCstr(ui->cbMipMapsTextures->isChecked())); | 
 
 
 
 
 
 
 
 
 | 1721 | 
 + | 
         options.append_attribute("noUwrap").set_value(Util::boolToCstr(ui->cbNoUwrap->isChecked())); | 
 
 
 
 
 
 
 
 
 | 1722 | 
 + | 
         options.append_attribute("noVwrap").set_value(Util::boolToCstr(ui->cbNoVwrap->isChecked())); | 
 
 
 
 
 
 
 
 
 | 1723 | 
 + | 
         options.append_attribute("large").set_value(Util::boolToCstr(ui->cbLarge->isChecked())); | 
 
 
 
 
 
 
 
 
 | 1724 | 
 + | 
         options.append_attribute("envMap").set_value(Util::boolToCstr(ui->cbEnvMap->isChecked())); | 
 
 
 
 
 
 
 
 
 | 1725 | 
 + | 
         options.append_attribute("envMapValue").set_value(Util::qStrToCstr(ui->leEnvMapTexture->text())); | 
 
 
 
 
 
 
 
 
 | 1726 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1727 | 
 + | 
     else if(table==ui->twSourcesCharacters){ | 
 
 
 
 
 
 
 
 
 | 1728 | 
 + | 
         from = ui->cbFromCharacters->currentText().toUtf8().constData(); | 
 
 
 
 
 
 
 
 
 | 1729 | 
 + | 
         to = ui->cbToCharacters->currentText().toUtf8().constData(); | 
 
 
 
 
 
 
 
 
 | 1730 | 
 + | 
         options = currentNodeTable.append_child("Options"); | 
 
 
 
 
 
 
 
 
 | 1731 | 
 + | 
         options.append_attribute("cellShading").set_value(Util::boolToCstr(ui->cbCellShading->isChecked())); | 
 
 
 
 
 
 
 
 
 | 1732 | 
 + | 
         options.append_attribute("normals").set_value(Util::boolToCstr(ui->cbNormals->isChecked())); | 
 
 
 
 
 
 
 
 
 | 1733 | 
 + | 
         options.append_attribute("extractTRBSONCC").set_value(Util::boolToCstr(ui->cbWithTRBS_ONCC->isChecked())); | 
 
 
 
 
 
 
 
 
 | 1734 | 
 + | 
         options.append_attribute("extractTRBSONCCValue").set_value(Util::qStrToCstr(ui->leTRBS_ONCC->text())); | 
 
 
 
 
 
 
 
 
 | 1735 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1736 | 
 + | 
     else if(table==ui->twSourcesObjects){ | 
 
 
 
 
 
 
 
 
 | 1737 | 
 + | 
         from = ui->cbFromObjects->currentText().toUtf8().constData(); | 
 
 
 
 
 
 
 
 
 | 1738 | 
 + | 
         to = ui->cbToObjects->currentText().toUtf8().constData(); | 
 
 
 
 
 
 
 
 
 | 1739 | 
 + | 
         options = currentNodeTable.append_child("Options"); | 
 
 
 
 
 
 
 
 
 | 1740 | 
 + | 
         options.append_attribute("texture").set_value(Util::boolToCstr(ui->cbTexture->isChecked())); | 
 
 
 
 
 
 
 
 
 | 1741 | 
 + | 
         options.append_attribute("textureValue").set_value(Util::qStrToCstr(ui->leTextureName->text())); | 
 
 
 
 
 
 
 
 
 | 1742 | 
 + | 
         options.append_attribute("withAnimation").set_value(Util::boolToCstr(ui->cbWithAnimation->isChecked())); | 
 
 
 
 
 
 
 
 
 | 1743 | 
 + | 
         options.append_attribute("withAnimationValue").set_value(Util::qStrToCstr(ui->leAnimationName->text())); | 
 
 
 
 
 
 
 
 
 | 1744 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1745 | 
 + | 
     else if(table==ui->twSourcesLevels){ | 
 
 
 
 
 
 
 
 
 | 1746 | 
 + | 
         from = ui->cbFromLevels->currentText().toUtf8().constData(); | 
 
 
 
 
 
 
 
 
 | 1747 | 
 + | 
         to = ui->cbToLevels->currentText().toUtf8().constData(); | 
 
 
 
 
 
 
 
 
 | 1748 | 
 + | 
         options = currentNodeTable.append_child("Options"); | 
 
 
 
 
 
 
 
 
 | 1749 | 
 + | 
         options.append_attribute("extractWithFiles").set_value(Util::boolToCstr(ui->cbSpecificFilesLevels->isChecked())); | 
 
 
 
 
 
 
 
 
 | 1750 | 
 + | 
         options.append_attribute("extractWithFilesValue").set_value(Util::qStrToCstr(ui->leSpecificFilesLevels->text())); | 
 
 
 
 
 
 
 
 
 | 1751 | 
 + | 
         options.append_attribute("datFilename").set_value(Util::boolToCstr(ui->cbDatLevels->isChecked())); | 
 
 
 
 
 
 
 
 
 | 1752 | 
 + | 
         options.append_attribute("datFilenameValue").set_value(Util::qStrToCstr(ui->leTargetDatLevels->text())); | 
 
 
 
 
 
 
 
 
 | 1753 | 
 + | 
         options.append_attribute("bnvSource").set_value(Util::boolToCstr(ui->cbBnvLevels->isChecked())); | 
 
 
 
 
 
 
 
 
 | 1754 | 
 + | 
         options.append_attribute("bnvSourceValue").set_value(Util::qStrToCstr(ui->leBnvLevels->text())); | 
 
 
 
 
 
 
 
 
 | 1755 | 
 + | 
         options.append_attribute("generateGrids").set_value(Util::boolToCstr(ui->cbGridsLevels->isChecked())); | 
 
 
 
 
 
 
 
 
 | 1756 | 
 + | 
         options.append_attribute("additionalSources").set_value(Util::boolToCstr(ui->cbAdditionalSourcesLevels->isChecked())); | 
 
 
 
 
 
 
 
 
 | 1757 | 
 + | 
         options.append_attribute("additionalSourcesValue").set_value(Util::qStrToCstr(ui->leAdditSourcesLevels->text())); | 
 
 
 
 
 
 
 
 
 | 1758 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1759 | 
 + | 
     else{ | 
 
 
 
 
 
 
 
 
 | 1760 | 
 + | 
         from = ui->cbFromMisc->currentText().toUtf8().constData(); | 
 
 
 
 
 
 
 
 
 | 1761 | 
 + | 
         to = ui->cbToMisc->currentText().toUtf8().constData(); | 
 
 
 
 
 
 
 
 
 | 1762 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1763 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1764 | 
 + | 
     currentNodeTable.set_name(tabName.toUtf8().constData()); | 
 
 
 
 
 
 
 
 
 | 1765 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1766 | 
 + | 
     currentNodeTable.append_attribute("from").set_value(from.toUtf8().constData()); | 
 
 
 
 
 
 
 
 
 | 1767 | 
 + | 
     currentNodeTable.append_attribute("to").set_value(to.toUtf8().constData()); | 
 
 
 
 
 
 
 
 
 | 1768 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1769 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1770 | 
 + | 
     for(int i=0; i<table->rowCount(); i++){ | 
 
 
 
 
 
 
 
 
 | 1771 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1772 | 
 + | 
         QString currFileFolder = table->item(i,0)->text(); | 
 
 
 
 
 
 
 
 
 | 1773 | 
 + | 
         QString currFromTo = table->item(i,1)->text(); | 
 
 
 
 
 
 
 
 
 | 1774 | 
 + | 
         QString currCommand = table->item(i,2)->text(); | 
 
 
 
 
 
 
 
 
 | 1775 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1776 | 
 + | 
         pugi::xml_node currentRow = currentNodeTable.append_child("Row"); | 
 
 
 
 
 
 
 
 
 | 1777 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1778 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1779 | 
 + | 
         currentRow.append_attribute("fileFolder").set_value(Util::qStrToCstr(currFileFolder)); | 
 
 
 
 
 
 
 
 
 | 1780 | 
 + | 
         currentRow.append_attribute("fromTo").set_value(Util::qStrToCstr(currFromTo)); | 
 
 
 
 
 
 
 
 
 | 1781 | 
 + | 
         currentRow.append_attribute("command").set_value(Util::qStrToCstr(currCommand)); | 
 
 
 
 
 
 
 
 
 | 1782 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1783 | 
 + | 
         if(table->item(i,2)->background()==table->disabledBackStyle){ | 
 
 
 
 
 
 
 
 
 | 1784 | 
 + | 
             currentRow.append_attribute("disabled").set_value(true); | 
 
 
 
 
 
 
 
 
 | 1785 | 
 + | 
         } | 
 
 
 
 
 
 
 
 
 | 1786 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1787 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1788 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 1789 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1790 | 
 + | 
 QRadioButton* MainWindow::getTextureRBCheckedTypeTexture() | 
 
 
 
 
 
 
 
 
 | 1791 | 
 + | 
 { | 
 
 
 
 
 
 
 
 
 | 1792 | 
 + | 
     if(ui->rbBGR32->isChecked()){ | 
 
 
 
 
 
 
 
 
 | 1793 | 
 + | 
         return ui->rbBGR32; | 
 
 
 
 
 
 
 
 
 | 1794 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1795 | 
 + | 
     else if(ui->rbBGRA32->isChecked()){ | 
 
 
 
 
 
 
 
 
 | 1796 | 
 + | 
         return ui->rbBGRA32; | 
 
 
 
 
 
 
 
 
 | 1797 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1798 | 
 + | 
     else if(ui->rbBGR555->isChecked()){ | 
 
 
 
 
 
 
 
 
 | 1799 | 
 + | 
         return ui->rbBGR555; | 
 
 
 
 
 
 
 
 
 | 1800 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1801 | 
 + | 
     else if(ui->rbBGRA5551->isChecked()){ | 
 
 
 
 
 
 
 
 
 | 1802 | 
 + | 
         return ui->rbBGRA5551; | 
 
 
 
 
 
 
 
 
 | 1803 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1804 | 
 + | 
     else if(ui->rbBGRA444->isChecked()){ | 
 
 
 
 
 
 
 
 
 | 1805 | 
 + | 
         return ui->rbBGRA444; | 
 
 
 
 
 
 
 
 
 | 1806 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1807 | 
 + | 
     else{ //dxt1 checked | 
 
 
 
 
 
 
 
 
 | 1808 | 
 + | 
         return ui->rbDxt1; | 
 
 
 
 
 
 
 
 
 | 1809 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1810 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 1811 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1812 | 
 + | 
 QRadioButton* MainWindow::getTextureRBTypeTextureByName(const QString &texType) | 
 
 
 
 
 
 
 
 
 | 1813 | 
 + | 
 { | 
 
 
 
 
 
 
 
 
 | 1814 | 
 + | 
     if(QString::compare(texType,ui->rbBGR32->text(),Qt::CaseSensitive)==0){ | 
 
 
 
 
 
 
 
 
 | 1815 | 
 + | 
         return ui->rbBGR32; | 
 
 
 
 
 
 
 
 
 | 1816 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1817 | 
 + | 
     else if(QString::compare(texType,ui->rbBGRA32->text(),Qt::CaseSensitive)==0){ | 
 
 
 
 
 
 
 
 
 | 1818 | 
 + | 
         return ui->rbBGRA32; | 
 
 
 
 
 
 
 
 
 | 1819 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1820 | 
 + | 
     else if(QString::compare(texType, ui->rbBGR555->text(),Qt::CaseSensitive)==0){ | 
 
 
 
 
 
 
 
 
 | 1821 | 
 + | 
         return ui->rbBGR555; | 
 
 
 
 
 
 
 
 
 | 1822 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1823 | 
 + | 
     else if(QString::compare(texType,ui->rbBGRA5551->text(),Qt::CaseSensitive)==0){ | 
 
 
 
 
 
 
 
 
 | 1824 | 
 + | 
         return ui->rbBGRA5551; | 
 
 
 
 
 
 
 
 
 | 1825 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1826 | 
 + | 
     else if(QString::compare(texType,ui->rbBGRA444->text(),Qt::CaseSensitive)==0){ | 
 
 
 
 
 
 
 
 
 | 1827 | 
 + | 
         return ui->rbBGRA444; | 
 
 
 
 
 
 
 
 
 | 1828 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1829 | 
 + | 
     else{ //dxt1 | 
 
 
 
 
 
 
 
 
 | 1830 | 
 + | 
         return ui->rbDxt1; | 
 
 
 
 
 
 
 
 
 | 1831 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1832 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1833 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 1834 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1835 | 
 + | 
 void MainWindow::setVagoWindowTitle(){ | 
 
 
 
 
 
 
 
 
 | 1836 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1837 | 
 + | 
     QString vagoTitle = "Vago v"+GlobalVars::AppVersion + " - "; | 
 
 
 
 
 
 
 
 
 | 1838 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1839 | 
 + | 
     if(this->lastProjectFilePath.isEmpty()){ | 
 
 
 
 
 
 
 
 
 | 1840 | 
 + | 
         vagoTitle += "Untitled"; | 
 
 
 
 
 
 
 
 
 | 1841 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1842 | 
 + | 
     else{ | 
 
 
 
 
 
 
 
 
 | 1843 | 
 + | 
         vagoTitle += Util::cutNameWithoutBackSlash(this->lastProjectFilePath); | 
 
 
 
 
 
 
 
 
 | 1844 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1845 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1846 | 
 + | 
     setWindowTitle(vagoTitle); | 
 
 
 
 
 
 
 
 
 | 1847 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 1848 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1849 | 
 + | 
 DropTableWidget* MainWindow::getCurrentTableWidget(){ | 
 
 
 
 
 
 
 
 
 | 1850 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1851 | 
 + | 
     return getTableWidgetByTabName(ui->tabWidget->tabText(ui->tabWidget->currentIndex())); | 
 
 
 
 
 
 
 
 
 | 1852 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1853 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 1854 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1855 | 
 + | 
 DropTableWidget* MainWindow::getTableWidgetByTabName(const QString &tabName){ | 
 
 
 
 
 
 
 
 
 | 1856 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1857 | 
 + | 
     if(tabName.compare("XML",Qt::CaseSensitive)==0){ //case sentive is faster | 
 
 
 
 
 
 
 
 
 | 1858 | 
 + | 
         return ui->twSourcesXML; | 
 
 
 
 
 
 
 
 
 | 1859 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1860 | 
 + | 
     else if(tabName.compare("Textures",Qt::CaseSensitive)==0){ | 
 
 
 
 
 
 
 
 
 | 1861 | 
 + | 
         return ui->twSourcesTextures; | 
 
 
 
 
 
 
 
 
 | 1862 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1863 | 
 + | 
     else if(tabName.compare("Characters",Qt::CaseSensitive)==0){ | 
 
 
 
 
 
 
 
 
 | 1864 | 
 + | 
         return ui->twSourcesCharacters; | 
 
 
 
 
 
 
 
 
 | 1865 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1866 | 
 + | 
     else if(tabName.compare("Objects",Qt::CaseSensitive)==0){ | 
 
 
 
 
 
 
 
 
 | 1867 | 
 + | 
         return ui->twSourcesObjects; | 
 
 
 
 
 
 
 
 
 | 1868 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1869 | 
 + | 
     else if(tabName.compare("Levels",Qt::CaseSensitive)==0){ | 
 
 
 
 
 
 
 
 
 | 1870 | 
 + | 
         return ui->twSourcesLevels; | 
 
 
 
 
 
 
 
 
 | 1871 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1872 | 
 + | 
     else{ | 
 
 
 
 
 
 
 
 
 | 1873 | 
 + | 
         return ui->twSourcesMisc; | 
 
 
 
 
 
 
 
 
 | 1874 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1875 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1876 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 1877 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1878 | 
 + | 
 QString MainWindow::getCurrentTabName(){ | 
 
 
 
 
 
 
 
 
 | 1879 | 
 + | 
     return ui->tabWidget->tabText(ui->tabWidget->currentIndex()); | 
 
 
 
 
 
 
 
 
 | 1880 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 1881 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1882 | 
 + | 
 QString MainWindow::getTabNameByTableWidget(DropTableWidget* table){ | 
 
 
 
 
 
 
 
 
 | 1883 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1884 | 
 + | 
     if(table == ui->twSourcesXML){ | 
 
 
 
 
 
 
 
 
 | 1885 | 
 + | 
         return ui->tabWidget->tabText(XMLTabIndex); | 
 
 
 
 
 
 
 
 
 | 1886 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1887 | 
 + | 
     else if(table == ui->twSourcesTextures){ | 
 
 
 
 
 
 
 
 
 | 1888 | 
 + | 
         return ui->tabWidget->tabText(TexturesTabIndex); | 
 
 
 
 
 
 
 
 
 | 1889 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1890 | 
 + | 
     else if(table == ui->twSourcesCharacters){ | 
 
 
 
 
 
 
 
 
 | 1891 | 
 + | 
         return ui->tabWidget->tabText(CharactersTabIndex); | 
 
 
 
 
 
 
 
 
 | 1892 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1893 | 
 + | 
     else if(table == ui->twSourcesObjects){ | 
 
 
 
 
 
 
 
 
 | 1894 | 
 + | 
         return ui->tabWidget->tabText(ObjectsTabIndex); | 
 
 
 
 
 
 
 
 
 | 1895 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1896 | 
 + | 
     else if(table == ui->twSourcesLevels){ | 
 
 
 
 
 
 
 
 
 | 1897 | 
 + | 
         return ui->tabWidget->tabText(LevelsTabIndex); | 
 
 
 
 
 
 
 
 
 | 1898 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1899 | 
 + | 
     else{ | 
 
 
 
 
 
 
 
 
 | 1900 | 
 + | 
         return ui->tabWidget->tabText(MiscTabIndex); | 
 
 
 
 
 
 
 
 
 | 1901 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1902 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1903 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 1904 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1905 | 
 + | 
 QList<DropTableWidget*> MainWindow::getAllTableWidgets() | 
 
 
 
 
 
 
 
 
 | 1906 | 
 + | 
 { | 
 
 
 
 
 
 
 
 
 | 1907 | 
 + | 
     QList<DropTableWidget*> tableWidgets; | 
 
 
 
 
 
 
 
 
 | 1908 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1909 | 
 + | 
     tableWidgets << ui->twSourcesXML << ui->twSourcesTextures << ui->twSourcesCharacters | 
 
 
 
 
 
 
 
 
 | 1910 | 
 + | 
                  << ui->twSourcesObjects << ui->twSourcesLevels << ui->twSourcesMisc; | 
 
 
 
 
 
 
 
 
 | 1911 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1912 | 
 + | 
     return tableWidgets; | 
 
 
 
 
 
 
 
 
 | 1913 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 1914 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1915 | 
 + | 
 void MainWindow::loadProjectState(const QString &filePath) | 
 
 
 
 
 
 
 
 
 | 1916 | 
 + | 
 { | 
 
 
 
 
 
 
 
 
 | 1917 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1918 | 
 + | 
     QString statusError = "Couldn't load project."; | 
 
 
 
 
 
 
 
 
 | 1919 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1920 | 
 + | 
     pugi::xml_document doc; | 
 
 
 
 
 
 
 
 
 | 1921 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1922 | 
 + | 
     pugi::xml_parse_result result = doc.load_file(Util::qStrToCstr(filePath)); | 
 
 
 
 
 
 
 
 
 | 1923 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1924 | 
 + | 
     if(result.status!=pugi::status_ok){ | 
 
 
 
 
 
 
 
 
 | 1925 | 
 + | 
         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "An error ocurred while loading project file.\n" + QString(result.description())); | 
 
 
 
 
 
 
 
 
 | 1926 | 
 + | 
         showErrStatusMessage(statusError); | 
 
 
 
 
 
 
 
 
 | 1927 | 
 + | 
         return; | 
 
 
 
 
 
 
 
 
 | 1928 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1929 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1930 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1931 | 
 + | 
     if(QString(doc.root().first_child().name()) != "VagoProject"){ | 
 
 
 
 
 
 
 
 
 | 1932 | 
 + | 
         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, QString(doc.root().name()) + "The file opened is not a valid VagoProject file. Load aborted."); | 
 
 
 
 
 
 
 
 
 | 1933 | 
 + | 
         showErrStatusMessage(statusError); | 
 
 
 
 
 
 
 
 
 | 1934 | 
 + | 
         return; | 
 
 
 
 
 
 
 
 
 | 1935 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1936 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1937 | 
 + | 
     QString projVagoVersion; | 
 
 
 
 
 
 
 
 
 | 1938 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1939 | 
 + | 
     try{ | 
 
 
 
 
 
 
 
 
 | 1940 | 
 + | 
         projVagoVersion = QString(doc.select_node("/VagoProject/@vagoVersion").attribute().value()); | 
 
 
 
 
 
 
 
 
 | 1941 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1942 | 
 + | 
     catch (const pugi::xpath_exception& e) | 
 
 
 
 
 
 
 
 
 | 1943 | 
 + | 
     { | 
 
 
 
 
 
 
 
 
 | 1944 | 
 + | 
         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "Couldn't find the vagoVersion of the current project. Load aborted.\n" + QString(e.what())); | 
 
 
 
 
 
 
 
 
 | 1945 | 
 + | 
         showErrStatusMessage(statusError); | 
 
 
 
 
 
 
 
 
 | 1946 | 
 + | 
         return; | 
 
 
 
 
 
 
 
 
 | 1947 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1948 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1949 | 
 + | 
     if(!projVagoVersion.startsWith(GlobalVars::LastCompatibleVersion)){ | 
 
 
 
 
 
 
 
 
 | 1950 | 
 + | 
         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."); | 
 
 
 
 
 
 
 
 
 | 1951 | 
 + | 
         showErrStatusMessage(statusError); | 
 
 
 
 
 
 
 
 
 | 1952 | 
 + | 
         return; | 
 
 
 
 
 
 
 
 
 | 1953 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1954 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1955 | 
 + | 
     // After the initial validations begin loading the project data | 
 
 
 
 
 
 
 
 
 | 1956 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1957 | 
 + | 
     QList<DropTableWidget*> tableWidgets = getAllTableWidgets(); | 
 
 
 
 
 
 
 
 
 | 1958 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1959 | 
 + | 
     try{ | 
 
 
 
 
 
 
 
 
 | 1960 | 
 + | 
         foreach(DropTableWidget* const &myTable, tableWidgets){ | 
 
 
 
 
 
 
 
 
 | 1961 | 
 + | 
             loadProjectWidget(doc, myTable); | 
 
 
 
 
 
 
 
 
 | 1962 | 
 + | 
         } | 
 
 
 
 
 
 
 
 
 | 1963 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1964 | 
 + | 
     catch(const std::exception& e){ | 
 
 
 
 
 
 
 
 
 | 1965 | 
 + | 
         UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "Couldn't load the vago project. Error: " + QString(e.what())); | 
 
 
 
 
 
 
 
 
 | 1966 | 
 + | 
         showErrStatusMessage(statusError); | 
 
 
 
 
 
 
 
 
 | 1967 | 
 + | 
         return; | 
 
 
 
 
 
 
 
 
 | 1968 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1969 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1970 | 
 + | 
     this->vagoSettings->setValue("LastProjectPath",QFileInfo(filePath).absoluteDir().path()); | 
 
 
 
 
 
 
 
 
 | 1971 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1972 | 
 + | 
     this->lastProjectFilePath = filePath; | 
 
 
 
 
 
 
 
 
 | 1973 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1974 | 
 + | 
     addNewRecentProject(filePath); | 
 
 
 
 
 
 
 
 
 | 1975 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1976 | 
 + | 
     setVagoWindowTitle(); | 
 
 
 
 
 
 
 
 
 | 1977 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1978 | 
 + | 
     showSuccessStatusMessage("Project loaded sucessfully."); | 
 
 
 
 
 
 
 
 
 | 1979 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 1980 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1981 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1982 | 
 + | 
 void MainWindow::loadProjectWidget(pugi::xml_document &doc, DropTableWidget* table) | 
 
 
 
 
 
 
 
 
 | 1983 | 
 + | 
 { | 
 
 
 
 
 
 
 
 
 | 1984 | 
 + | 
     QString tabName = getTabNameByTableWidget(table); | 
 
 
 
 
 
 
 
 
 | 1985 | 
 + | 
     QString from (doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/@from")).attribute().value()); | 
 
 
 
 
 
 
 
 
 | 1986 | 
 + | 
     QString to (doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/@to")).attribute().value()); | 
 
 
 
 
 
 
 
 
 | 1987 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1988 | 
 + | 
     if(table==ui->twSourcesXML){ | 
 
 
 
 
 
 
 
 
 | 1989 | 
 + | 
         ui->cbFromXML->setCurrentText(from); | 
 
 
 
 
 
 
 
 
 | 1990 | 
 + | 
         on_cbFromXML_currentIndexChanged(from); | 
 
 
 
 
 
 
 
 
 | 1991 | 
 + | 
         ui->cbToXML->setCurrentText(to); | 
 
 
 
 
 
 
 
 
 | 1992 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 1993 | 
 + | 
     else if(table==ui->twSourcesTextures){ | 
 
 
 
 
 
 
 
 
 | 1994 | 
 + | 
         //ui->cbFromTextures->setCurrentText(from); | 
 
 
 
 
 
 
 
 
 | 1995 | 
 + | 
         on_cbFromTextures_currentIndexChanged(from); | 
 
 
 
 
 
 
 
 
 | 1996 | 
 + | 
         ui->cbToTextures->setCurrentText(to); | 
 
 
 
 
 
 
 
 
 | 1997 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 1998 | 
 + | 
         getTextureRBTypeTextureByName((doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@type")).attribute().value()))->setChecked(true); | 
 
 
 
 
 
 
 
 
 | 1999 | 
 + | 
         ui->cbMipMapsTextures->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@genMipMaps")).attribute().as_bool()); | 
 
 
 
 
 
 
 
 
 | 2000 | 
 + | 
         ui->cbNoUwrap->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@noUwrap")).attribute().as_bool()); | 
 
 
 
 
 
 
 
 
 | 2001 | 
 + | 
         ui->cbNoVwrap->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@noVwrap")).attribute().as_bool()); | 
 
 
 
 
 
 
 
 
 | 2002 | 
 + | 
         ui->cbLarge->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@large")).attribute().as_bool()); | 
 
 
 
 
 
 
 
 
 | 2003 | 
 + | 
         ui->cbEnvMap->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@envMap")).attribute().as_bool()); | 
 
 
 
 
 
 
 
 
 | 2004 | 
 + | 
         ui->leEnvMapTexture->setText(QString(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@envMapValue")).attribute().value())); | 
 
 
 
 
 
 
 
 
 | 2005 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 2006 | 
 + | 
     else if(table==ui->twSourcesCharacters){ | 
 
 
 
 
 
 
 
 
 | 2007 | 
 + | 
         ui->cbFromCharacters->setCurrentText(from); | 
 
 
 
 
 
 
 
 
 | 2008 | 
 + | 
         on_cbFromCharacters_currentIndexChanged(from); | 
 
 
 
 
 
 
 
 
 | 2009 | 
 + | 
         ui->cbToCharacters->setCurrentText(to); | 
 
 
 
 
 
 
 
 
 | 2010 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2011 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2012 | 
 + | 
         ui->cbCellShading->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@cellShading")).attribute().as_bool()); | 
 
 
 
 
 
 
 
 
 | 2013 | 
 + | 
         ui->cbNormals->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@normals")).attribute().as_bool()); | 
 
 
 
 
 
 
 
 
 | 2014 | 
 + | 
         ui->cbWithTRBS_ONCC->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@extractTRBSONCC")).attribute().as_bool()); | 
 
 
 
 
 
 
 
 
 | 2015 | 
 + | 
         ui->leTRBS_ONCC->setText(QString(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@extractTRBSONCCValue")).attribute().value())); | 
 
 
 
 
 
 
 
 
 | 2016 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 2017 | 
 + | 
     else if(table==ui->twSourcesObjects){ | 
 
 
 
 
 
 
 
 
 | 2018 | 
 + | 
         ui->cbFromObjects->setCurrentText(from); | 
 
 
 
 
 
 
 
 
 | 2019 | 
 + | 
         on_cbFromObjects_currentIndexChanged(from); | 
 
 
 
 
 
 
 
 
 | 2020 | 
 + | 
         ui->cbToObjects->setCurrentText(to); | 
 
 
 
 
 
 
 
 
 | 2021 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2022 | 
 + | 
         ui->cbTexture->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@texture")).attribute().as_bool()); | 
 
 
 
 
 
 
 
 
 | 2023 | 
 + | 
         ui->leTextureName->setText(QString(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@textureValue")).attribute().value())); | 
 
 
 
 
 
 
 
 
 | 2024 | 
 + | 
         ui->cbWithAnimation->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@withAnimation")).attribute().as_bool()); | 
 
 
 
 
 
 
 
 
 | 2025 | 
 + | 
         ui->leAnimationName->setText(QString(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@withAnimationValue")).attribute().value())); | 
 
 
 
 
 
 
 
 
 | 2026 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 2027 | 
 + | 
     else if(table==ui->twSourcesLevels){ | 
 
 
 
 
 
 
 
 
 | 2028 | 
 + | 
         ui->cbFromLevels->setCurrentText(from); | 
 
 
 
 
 
 
 
 
 | 2029 | 
 + | 
         on_cbFromLevels_currentIndexChanged(from); | 
 
 
 
 
 
 
 
 
 | 2030 | 
 + | 
         ui->cbToLevels->setCurrentText(to); | 
 
 
 
 
 
 
 
 
 | 2031 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2032 | 
 + | 
         ui->cbSpecificFilesLevels->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@extractWithFiles")).attribute().as_bool()); | 
 
 
 
 
 
 
 
 
 | 2033 | 
 + | 
         ui->leSpecificFilesLevels->setText(QString(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@extractWithFilesValue")).attribute().value())); | 
 
 
 
 
 
 
 
 
 | 2034 | 
 + | 
         ui->cbDatLevels->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@datFilename")).attribute().as_bool()); | 
 
 
 
 
 
 
 
 
 | 2035 | 
 + | 
         ui->leTargetDatLevels->setText(QString(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@datFilenameValue")).attribute().value())); | 
 
 
 
 
 
 
 
 
 | 2036 | 
 + | 
         ui->cbBnvLevels->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@bnvSource")).attribute().as_bool()); | 
 
 
 
 
 
 
 
 
 | 2037 | 
 + | 
         ui->leBnvLevels->setText(QString(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@bnvSourceValue")).attribute().value())); | 
 
 
 
 
 
 
 
 
 | 2038 | 
 + | 
         ui->cbGridsLevels->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@generateGrids")).attribute().as_bool()); | 
 
 
 
 
 
 
 
 
 | 2039 | 
 + | 
         ui->cbAdditionalSourcesLevels->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@additionalSources")).attribute().as_bool()); | 
 
 
 
 
 
 
 
 
 | 2040 | 
 + | 
         ui->leAdditSourcesLevels->setText(QString(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@bnvSource")).attribute().value())); | 
 
 
 
 
 
 
 
 
 | 2041 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 2042 | 
 + | 
     else{ | 
 
 
 
 
 
 
 
 
 | 2043 | 
 + | 
         ui->cbFromMisc->setCurrentText(from); | 
 
 
 
 
 
 
 
 
 | 2044 | 
 + | 
         on_cbFromMisc_currentIndexChanged(from); | 
 
 
 
 
 
 
 
 
 | 2045 | 
 + | 
         ui->cbToMisc->setCurrentText(to); | 
 
 
 
 
 
 
 
 
 | 2046 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 2047 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2048 | 
 + | 
     // Clean previous rows | 
 
 
 
 
 
 
 
 
 | 2049 | 
 + | 
     clearTableNoPrompt(table); | 
 
 
 
 
 
 
 
 
 | 2050 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2051 | 
 + | 
     for(const pugi::xpath_node &xPathNode : doc.select_nodes(Util::qStrToCstr("/VagoProject/"+tabName+"/Row"))){ | 
 
 
 
 
 
 
 
 
 | 2052 | 
 + | 
         pugi::xml_node currNode = xPathNode.node(); | 
 
 
 
 
 
 
 
 
 | 2053 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2054 | 
 + | 
         QString currFileFolder = currNode.attribute("fileFolder").value(); | 
 
 
 
 
 
 
 
 
 | 2055 | 
 + | 
         QString currFromTo = currNode.attribute("fromTo").value(); | 
 
 
 
 
 
 
 
 
 | 2056 | 
 + | 
         QString currCommand = currNode.attribute("command").value(); | 
 
 
 
 
 
 
 
 
 | 2057 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2058 | 
 + | 
         bool isToDisable = false; | 
 
 
 
 
 
 
 
 
 | 2059 | 
 + | 
         pugi::xml_attribute disabledAttr = currNode.attribute("disabled"); | 
 
 
 
 
 
 
 
 
 | 2060 | 
 + | 
         isToDisable = disabledAttr.empty() ? false : disabledAttr.as_bool(); | 
 
 
 
 
 
 
 
 
 | 2061 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2062 | 
 + | 
         addRowTable(table,currFileFolder,currFromTo,currCommand, isToDisable); | 
 
 
 
 
 
 
 
 
 | 2063 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 2064 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 2065 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2066 | 
 + | 
 void MainWindow::saveRecentProjects(){ | 
 
 
 
 
 
 
 
 
 | 2067 | 
 + | 
     for(int i=0; i<this->recentProjectsList.size(); i++){ | 
 
 
 
 
 
 
 
 
 | 2068 | 
 + | 
         this->vagoSettings->setValue("RecentProject" + QString::number(i+1), recentProjectsList[i]); | 
 
 
 
 
 
 
 
 
 | 2069 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 2070 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 2071 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2072 | 
 + | 
 void MainWindow::loadRecentProjects(){ | 
 
 
 
 
 
 
 
 
 | 2073 | 
 + | 
     for(int i=0; i<this->recentProjectsMaxSize; i++){ | 
 
 
 
 
 
 
 
 
 | 2074 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2075 | 
 + | 
         QString currProj = this->vagoSettings->value("RecentProject" + QString::number(i+1)).toString(); | 
 
 
 
 
 
 
 
 
 | 2076 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2077 | 
 + | 
         if(!currProj.isEmpty()){ | 
 
 
 
 
 
 
 
 
 | 2078 | 
 + | 
             recentProjectsList.append(currProj); | 
 
 
 
 
 
 
 
 
 | 2079 | 
 + | 
         } | 
 
 
 
 
 
 
 
 
 | 2080 | 
 + | 
         else{ | 
 
 
 
 
 
 
 
 
 | 2081 | 
 + | 
             break; | 
 
 
 
 
 
 
 
 
 | 2082 | 
 + | 
         } | 
 
 
 
 
 
 
 
 
 | 2083 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 2084 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2085 | 
 + | 
     reloadRecentProjectsMenu(); | 
 
 
 
 
 
 
 
 
 | 2086 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2087 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 2088 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2089 | 
 + | 
 void MainWindow::addNewRecentProject(const QString &filePath){ | 
 
 
 
 
 
 
 
 
 | 2090 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2091 | 
 + | 
     // If the new project is equal to the last one simply ignore | 
 
 
 
 
 
 
 
 
 | 2092 | 
 + | 
     if(filePath == this->vagoSettings->value("RecentProject1").toString()){ | 
 
 
 
 
 
 
 
 
 | 2093 | 
 + | 
         return; | 
 
 
 
 
 
 
 
 
 | 2094 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 2095 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2096 | 
 + | 
     // If the item already exists in our list remove it, so it can go to the top again | 
 
 
 
 
 
 
 
 
 | 2097 | 
 + | 
     for(auto it = this->recentProjectsList.begin(); it != this->recentProjectsList.end();){ | 
 
 
 
 
 
 
 
 
 | 2098 | 
 + | 
         if(*it == filePath){ | 
 
 
 
 
 
 
 
 
 | 2099 | 
 + | 
             it = this->recentProjectsList.erase(it); | 
 
 
 
 
 
 
 
 
 | 2100 | 
 + | 
         } | 
 
 
 
 
 
 
 
 
 | 2101 | 
 + | 
         else{ | 
 
 
 
 
 
 
 
 
 | 2102 | 
 + | 
             it++; | 
 
 
 
 
 
 
 
 
 | 2103 | 
 + | 
         } | 
 
 
 
 
 
 
 
 
 | 2104 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 2105 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2106 | 
 + | 
     // if we gonna overflow our list, remove the older item to reserve space to the new one | 
 
 
 
 
 
 
 
 
 | 2107 | 
 + | 
     if(this->recentProjectsList.size()==this->recentProjectsMaxSize){ | 
 
 
 
 
 
 
 
 
 | 2108 | 
 + | 
         this->recentProjectsList.removeLast(); | 
 
 
 
 
 
 
 
 
 | 2109 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 2110 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2111 | 
 + | 
     this->vagoSettings->setValue("LastProjectPath",QFileInfo(filePath).absoluteDir().path()); | 
 
 
 
 
 
 
 
 
 | 2112 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2113 | 
 + | 
     // add new recent file | 
 
 
 
 
 
 
 
 
 | 2114 | 
 + | 
     this->recentProjectsList.prepend(filePath); | 
 
 
 
 
 
 
 
 
 | 2115 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2116 | 
 + | 
     reloadRecentProjectsMenu(); | 
 
 
 
 
 
 
 
 
 | 2117 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2118 | 
 + | 
     saveRecentProjects(); | 
 
 
 
 
 
 
 
 
 | 2119 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 2120 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2121 | 
 + | 
 void MainWindow::reloadRecentProjectsMenu(){ | 
 
 
 
 
 
 
 
 
 | 2122 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2123 | 
 + | 
     ui->menuRecent_Projects->setEnabled(false); | 
 
 
 
 
 
 
 
 
 | 2124 | 
 + | 
     ui->actionProject1->setVisible(false); | 
 
 
 
 
 
 
 
 
 | 2125 | 
 + | 
     ui->actionProject2->setVisible(false); | 
 
 
 
 
 
 
 
 
 | 2126 | 
 + | 
     ui->actionProject3->setVisible(false); | 
 
 
 
 
 
 
 
 
 | 2127 | 
 + | 
     ui->actionProject4->setVisible(false); | 
 
 
 
 
 
 
 
 
 | 2128 | 
 + | 
     ui->actionProject5->setVisible(false); | 
 
 
 
 
 
 
 
 
 | 2129 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2130 | 
 + | 
     { | 
 
 
 
 
 
 
 
 
 | 2131 | 
 + | 
         QList<QString>::const_iterator it; | 
 
 
 
 
 
 
 
 
 | 2132 | 
 + | 
         int i; | 
 
 
 
 
 
 
 
 
 | 2133 | 
 + | 
         for(it = recentProjectsList.cbegin(), i=0; it != recentProjectsList.cend(); it++, i++){ | 
 
 
 
 
 
 
 
 
 | 2134 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2135 | 
 + | 
             QAction* currAction = nullptr; | 
 
 
 
 
 
 
 
 
 | 2136 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2137 | 
 + | 
             switch (i){ | 
 
 
 
 
 
 
 
 
 | 2138 | 
 + | 
             case 0: | 
 
 
 
 
 
 
 
 
 | 2139 | 
 + | 
                 currAction = ui->actionProject1; | 
 
 
 
 
 
 
 
 
 | 2140 | 
 + | 
                 break; | 
 
 
 
 
 
 
 
 
 | 2141 | 
 + | 
             case 1: | 
 
 
 
 
 
 
 
 
 | 2142 | 
 + | 
                 currAction = ui->actionProject2; | 
 
 
 
 
 
 
 
 
 | 2143 | 
 + | 
                 break; | 
 
 
 
 
 
 
 
 
 | 2144 | 
 + | 
             case 2: | 
 
 
 
 
 
 
 
 
 | 2145 | 
 + | 
                 currAction = ui->actionProject3; | 
 
 
 
 
 
 
 
 
 | 2146 | 
 + | 
                 break; | 
 
 
 
 
 
 
 
 
 | 2147 | 
 + | 
             case 3: | 
 
 
 
 
 
 
 
 
 | 2148 | 
 + | 
                 currAction = ui->actionProject4; | 
 
 
 
 
 
 
 
 
 | 2149 | 
 + | 
                 break; | 
 
 
 
 
 
 
 
 
 | 2150 | 
 + | 
             case 4: | 
 
 
 
 
 
 
 
 
 | 2151 | 
 + | 
                 currAction = ui->actionProject5; | 
 
 
 
 
 
 
 
 
 | 2152 | 
 + | 
                 break; | 
 
 
 
 
 
 
 
 
 | 2153 | 
 + | 
             } | 
 
 
 
 
 
 
 
 
 | 2154 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2155 | 
 + | 
             if(currAction){ | 
 
 
 
 
 
 
 
 
 | 2156 | 
 + | 
                 ui->menuRecent_Projects->setEnabled(true); | 
 
 
 
 
 
 
 
 
 | 2157 | 
 + | 
                 currAction->setText(*it); | 
 
 
 
 
 
 
 
 
 | 2158 | 
 + | 
                 currAction->setVisible(true); | 
 
 
 
 
 
 
 
 
 | 2159 | 
 + | 
             } | 
 
 
 
 
 
 
 
 
 | 2160 | 
 + | 
         } | 
 
 
 
 
 
 
 
 
 | 2161 | 
 + | 
     } | 
 
 
 
 
 
 
 
 
 | 2162 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 2163 | 
 + | 
 } |