| 1 |  | #ifndef MAINWINDOW_H | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2 |  | #define MAINWINDOW_H | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 3 |  |  | 
 
 
 
 
 
 
 
 
 
 
 | 4 | < | #include "util.h" | 
 
 
 
 
 
 
 
 
 | 4 | > | #include "utilvago.h" | 
 
 
 
 
 
 
 
 
 
 
 | 5 |  | #include "preferences.h" | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 6 |  | #include "manualcommands.h" | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 7 |  | #include "about.h" | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 11 |  | #include "droptablewidget.h" | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 12 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 13 |  | #include <QMainWindow> | 
 
 
 
 
 
 
 
 
 | 14 | – | #include <QSettings> | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 14 |  | #include <QMessageBox> | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 15 |  | #include <QProcess> | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 16 |  | #include <QColor> | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 28 |  | #include <QCloseEvent> | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 29 |  | #include <QScriptEngine> | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 30 |  | #include <QScriptValueIterator> | 
 
 
 
 
 
 
 
 | 31 | + | #include <QWinTaskbarProgress> | 
 
 
 
 
 
 
 
 | 32 | + | #include <QWinTaskbarButton> | 
 
 
 
 
 
 
 
 | 33 | + |  | 
 
 
 
 
 
 
 
 | 34 | + | #include "libs/pugixml/pugixml.hpp" | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 35 |  | //#include <QDebug> | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 36 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 37 |  | namespace Ui { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 41 |  | class MainWindow : public QMainWindow | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 42 |  | { | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 43 |  | Q_OBJECT | 
 
 
 
 
 
 
 
 
 
 
 | 44 | < |  | 
 
 
 
 
 
 
 
 
 | 44 | > |  | 
 
 
 
 
 
 
 
 
 
 
 | 45 |  | public: | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 46 |  | explicit MainWindow(QWidget *parent = 0); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 47 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 49 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 50 |  | protected: | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 51 |  | void closeEvent(QCloseEvent *event); | 
 
 
 
 
 
 
 
 
 
 
 | 52 | < |  | 
 
 
 
 
 
 
 
 
 | 52 | > |  | 
 
 
 
 
 
 
 
 
 
 
 | 53 |  | private slots: | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 54 |  | void on_actionExit_triggered(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 55 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 69 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 70 |  | void on_pbAddSourceXML_clicked(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 71 |  |  | 
 
 
 
 
 
 
 
 
 
 
 | 72 | < | void on_pbConvertXML_clicked(); | 
 
 
 
 
 
 
 
 
 | 72 | > | void on_pbConvert_clicked(); | 
 
 
 
 
 
 
 
 
 
 
 | 73 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 74 |  | void TsetupProgressBar(int max); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 75 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 107 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 108 |  | void on_pbAddSourceMisc_clicked(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 109 |  |  | 
 
 
 
 
 
 
 
 
 | 107 | – | void on_pbConvertTextures_clicked(); | 
 
 
 
 
 
 
 
 
 | 108 | – |  | 
 
 
 
 
 
 
 
 
 | 109 | – | void on_pbConvertObjects_clicked(); | 
 
 
 
 
 
 
 
 
 | 110 | – |  | 
 
 
 
 
 
 
 
 
 | 111 | – | void on_pbConvertLevels_clicked(); | 
 
 
 
 
 
 
 
 
 | 112 | – |  | 
 
 
 
 
 
 
 
 
 | 113 | – | void on_pbConvertMisc_clicked(); | 
 
 
 
 
 
 
 
 
 | 114 | – |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 110 |  | void on_pbRemoveSourceObjects_clicked(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 111 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 112 |  | void on_pbRemoveSourceLevels_clicked(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 149 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 150 |  | void on_cbFromCharacters_currentIndexChanged(const QString &arg1); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 151 |  |  | 
 
 
 
 
 
 
 
 
 | 157 | – | void on_pbConvertCharacters_clicked(); | 
 
 
 
 
 
 
 
 
 | 158 | – |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 152 |  | void on_pbAddSourceCharacters_clicked(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 153 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 154 |  | void on_pbRemoveSourceCharacters_clicked(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 171 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 172 |  | void on_tbAbortConversion_clicked(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 173 |  |  | 
 
 
 
 
 
 
 
 
 
 
 | 174 | < | void on_tabWidget_currentChanged(int index); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 174 | > | void on_tabWidget_currentChanged(int); | 
 
 
 
 
 | 175 | > |  | 
 
 
 
 
 | 176 | > | void on_actionSave_Project_triggered(); | 
 
 
 
 
 | 177 | > |  | 
 
 
 
 
 | 178 | > | void on_actionSave_triggered(); | 
 
 
 
 
 | 179 | > |  | 
 
 
 
 
 | 180 | > | void on_actionLoad_Project_triggered(); | 
 
 
 
 
 | 181 | > |  | 
 
 
 
 
 | 182 | > | void on_actionProject1_triggered(); | 
 
 
 
 
 | 183 | > |  | 
 
 
 
 
 | 184 | > | void on_actionProject2_triggered(); | 
 
 
 
 
 | 185 | > |  | 
 
 
 
 
 | 186 | > | void on_actionProject3_triggered(); | 
 
 
 
 
 | 187 | > |  | 
 
 
 
 
 | 188 | > | void on_actionProject4_triggered(); | 
 
 
 
 
 | 189 | > |  | 
 
 
 
 
 | 190 | > | void on_actionProject5_triggered(); | 
 
 
 
 
 
 
 
 
 
 
 | 191 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 192 |  | private: | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 193 |  | Ui::MainWindow *ui; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 196 |  | QString workspaceWizardsLocation; //Workspace wizard location | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 197 |  | QString outputFolder; //Output folder | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 198 |  | QString AeLocation; //Workspace location | 
 
 
 
 
 
 
 
 | 199 | + | QString lastProjectFilePath; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 200 |  | int startedWindowWidth; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 201 |  | int startedWindowHeight; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 202 |  | #ifdef Q_OS_MAC | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 209 |  | Converter *myConverter; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 210 |  | QSettings *vagoSettings; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 211 |  | static const QString VagoSettingsName; | 
 
 
 
 
 
 
 
 | 212 | + | static constexpr int recentProjectsMaxSize=5; | 
 
 
 
 
 
 
 
 | 213 | + | QList<QString> recentProjectsList; | 
 
 
 
 
 
 
 
 | 214 | + | #ifdef Q_OS_WIN | 
 
 
 
 
 
 
 
 | 215 | + | // These are deleted automatically by the window (since button is attached to it) | 
 
 
 
 
 
 
 
 | 216 | + | QWinTaskbarProgress *win7TaskBarProgress; | 
 
 
 
 
 
 
 
 | 217 | + | QWinTaskbarButton *win7TaskBarButton; | 
 
 
 
 
 
 
 
 | 218 | + | #endif | 
 
 
 
 
 
 
 
 | 219 | + |  | 
 
 
 
 
 
 
 
 | 220 | + | // anonymous enum | 
 
 
 
 
 
 
 
 | 221 | + | enum {XMLTabIndex, TexturesTabIndex, CharactersTabIndex, ObjectsTabIndex, LevelsTabIndex, MiscTabIndex}; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 222 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 223 |  | void connectSlots(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 224 |  | void showErrStatusMessage(QString message); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 225 |  | void showSuccessStatusMessage(QString message); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 226 |  | void mapCommands(); | 
 
 
 
 
 
 
 
 
 
 
 | 227 | < | void addRowTable(DropTableWidget *myTable,QString file, QString fromTo, QString command); | 
 
 
 
 
 
 
 
 
 | 227 | > | void addRowTable(DropTableWidget *myTable, QString file, QString fromTo, QString command, bool isToDisabled=false); | 
 
 
 
 
 
 
 
 
 
 
 | 228 |  | void clearTableContents(DropTableWidget *myTable); | 
 
 
 
 
 
 
 
 | 229 | + | void clearTableNoPrompt(DropTableWidget *myTable); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 230 |  | void removeTableContents(DropTableWidget *myTable); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 231 |  | void updateComboBox(const QString &arg1, QComboBox *comboBox); | 
 
 
 
 
 
 
 
 
 
 
 | 232 | < | void startConversion(DropTableWidget *myTable); | 
 
 
 
 
 
 
 
 
 | 232 | > | void startConversion(); | 
 
 
 
 
 
 
 
 
 
 
 | 233 |  | void updateItemsLoaded(DropTableWidget *currentTable); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 234 |  | void changeToCurrentSettings(QList<int> rows, DropTableWidget* myTable); //change some rows to the current settings | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 235 |  | void changeItemsOutput(DropTableWidget* myTable, QList<int> rows, QString newOutput); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 236 |  | void setConverterButtonsSize(); | 
 
 
 
 
 
 
 
 | 237 | + | void saveProjectState(const QString &filePath); | 
 
 
 
 
 
 
 
 | 238 | + | void saveProjectWidget(pugi::xml_node &rootNode, DropTableWidget* table); | 
 
 
 
 
 
 
 
 | 239 | + | void loadProjectState(const QString &filePath); | 
 
 
 
 
 
 
 
 | 240 | + | void setVagoWindowTitle(); | 
 
 
 
 
 
 
 
 | 241 | + | void loadProjectWidget(pugi::xml_document &doc, DropTableWidget* table); | 
 
 
 
 
 
 
 
 | 242 | + | void saveRecentProjects(); | 
 
 
 
 
 
 
 
 | 243 | + | void loadRecentProjects(); | 
 
 
 
 
 
 
 
 | 244 | + | void addNewRecentProject(const QString &filePath); | 
 
 
 
 
 
 
 
 | 245 | + | void reloadRecentProjectsMenu(); | 
 
 
 
 
 
 
 
 | 246 | + | void showEvent(QShowEvent *e); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 247 |  | QString getFileOutputFolder(QString fromTo, QString myOutputFolder=""); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 248 |  | QString fileParsingXML(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 249 |  | QString fileParsingTextures(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 254 |  | QString getCommand(DropTableWidget* myTable, QString myOutputFolder, QString from, QString to , QString file); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 255 |  | QString getTypeConversion(DropTableWidget *myTable); //get the current type for a table | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 256 |  | QString getOSIndependentAppPath(); | 
 
 
 
 
 
 
 
 | 257 | + | QString getTabNameByTableWidget(DropTableWidget* table); | 
 
 
 
 
 
 
 
 | 258 | + | QString getCurrentTabName(); | 
 
 
 
 
 
 
 
 | 259 | + | QRadioButton* getTextureRBCheckedTypeTexture(); | 
 
 
 
 
 
 
 
 | 260 | + | QRadioButton *getTextureRBTypeTextureByName(const QString &texType); | 
 
 
 
 
 
 
 
 | 261 | + | DropTableWidget *getCurrentTableWidget(); | 
 
 
 
 
 
 
 
 | 262 | + | DropTableWidget* getTableWidgetByTabName(const QString &tabName); | 
 
 
 
 
 
 
 
 | 263 | + | QList<DropTableWidget*> getAllTableWidgets(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 264 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 265 |  | signals: | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 266 |  | void terminateCurrProcess(); |