--- Vago/trunk/Vago/mainwindow.h 2014/04/26 12:40:47 999 +++ Vago/trunk/Vago/mainwindow.h 2016/09/17 13:32:34 1052 @@ -1,7 +1,7 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H -#include "util.h" +#include "utilvago.h" #include "preferences.h" #include "manualcommands.h" #include "about.h" @@ -11,7 +11,6 @@ #include "droptablewidget.h" #include -#include #include #include #include @@ -29,6 +28,12 @@ #include #include #include +#ifdef Q_OS_WIN +#include +#include +#endif + +#include "libs/pugixml/pugixml.hpp" //#include namespace Ui { @@ -38,7 +43,7 @@ class MainWindow; class MainWindow : public QMainWindow { Q_OBJECT - + public: explicit MainWindow(QWidget *parent = 0); @@ -46,7 +51,7 @@ public: protected: void closeEvent(QCloseEvent *event); - + private slots: void on_actionExit_triggered(); @@ -66,7 +71,7 @@ private slots: void on_pbAddSourceXML_clicked(); - void on_pbConvertXML_clicked(); + void on_pbConvert_clicked(); void TsetupProgressBar(int max); @@ -104,14 +109,6 @@ private slots: void on_pbAddSourceMisc_clicked(); - void on_pbConvertTextures_clicked(); - - void on_pbConvertObjects_clicked(); - - void on_pbConvertLevels_clicked(); - - void on_pbConvertMisc_clicked(); - void on_pbRemoveSourceObjects_clicked(); void on_pbRemoveSourceLevels_clicked(); @@ -154,8 +151,6 @@ private slots: void on_cbFromCharacters_currentIndexChanged(const QString &arg1); - void on_pbConvertCharacters_clicked(); - void on_pbAddSourceCharacters_clicked(); void on_pbRemoveSourceCharacters_clicked(); @@ -178,16 +173,32 @@ private slots: void on_tbAbortConversion_clicked(); - void on_tabWidget_currentChanged(int index); + void on_tabWidget_currentChanged(int); + + void on_actionSave_Project_triggered(); + + void on_actionSave_triggered(); + + void on_actionLoad_Project_triggered(); + + void on_actionProject1_triggered(); + + void on_actionProject2_triggered(); + + void on_actionProject3_triggered(); + + void on_actionProject4_triggered(); + + void on_actionProject5_triggered(); private: Ui::MainWindow *ui; Logger *myLogger; - QString AppDir; QString workspaceLocation; //Workspace location QString workspaceWizardsLocation; //Workspace wizard location QString outputFolder; //Output folder QString AeLocation; //Workspace location + QString lastProjectFilePath; int startedWindowWidth; int startedWindowHeight; #ifdef Q_OS_MAC @@ -200,20 +211,41 @@ private: Converter *myConverter; QSettings *vagoSettings; static const QString VagoSettingsName; + static constexpr int recentProjectsMaxSize=5; + QList recentProjectsList; +#ifdef Q_OS_WIN + // These are deleted automatically by the window (since button is attached to it) + QWinTaskbarProgress *win7TaskBarProgress; + QWinTaskbarButton *win7TaskBarButton; +#endif + + // anonymous enum + enum {XMLTabIndex, TexturesTabIndex, CharactersTabIndex, ObjectsTabIndex, LevelsTabIndex, MiscTabIndex}; void connectSlots(); void showErrStatusMessage(QString message); void showSuccessStatusMessage(QString message); void mapCommands(); - void addRowTable(DropTableWidget *myTable,QString file, QString fromTo, QString command); + void addRowTable(DropTableWidget *myTable, QString file, QString fromTo, QString command, bool isToDisabled=false); void clearTableContents(DropTableWidget *myTable); + void clearTableNoPrompt(DropTableWidget *myTable); void removeTableContents(DropTableWidget *myTable); void updateComboBox(const QString &arg1, QComboBox *comboBox); - void startConversion(DropTableWidget *myTable); + void startConversion(); void updateItemsLoaded(DropTableWidget *currentTable); void changeToCurrentSettings(QList rows, DropTableWidget* myTable); //change some rows to the current settings void changeItemsOutput(DropTableWidget* myTable, QList rows, QString newOutput); void setConverterButtonsSize(); + void saveProjectState(const QString &filePath); + void saveProjectWidget(pugi::xml_node &rootNode, DropTableWidget* table); + void loadProjectState(const QString &filePath); + void setVagoWindowTitle(); + void loadProjectWidget(pugi::xml_document &doc, DropTableWidget* table); + void saveRecentProjects(); + void loadRecentProjects(); + void addNewRecentProject(const QString &filePath); + void reloadRecentProjectsMenu(); + void showEvent(QShowEvent *e); QString getFileOutputFolder(QString fromTo, QString myOutputFolder=""); QString fileParsingXML(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file); QString fileParsingTextures(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file); @@ -224,6 +256,13 @@ private: QString getCommand(DropTableWidget* myTable, QString myOutputFolder, QString from, QString to , QString file); QString getTypeConversion(DropTableWidget *myTable); //get the current type for a table QString getOSIndependentAppPath(); + QString getTabNameByTableWidget(DropTableWidget* table); + QString getCurrentTabName(); + QRadioButton* getTextureRBCheckedTypeTexture(); + QRadioButton *getTextureRBTypeTextureByName(const QString &texType); + DropTableWidget *getCurrentTableWidget(); + DropTableWidget* getTableWidgetByTabName(const QString &tabName); + QList getAllTableWidgets(); signals: void terminateCurrProcess();