--- Vago/trunk/Vago/mainwindow.h 2014/04/26 12:40:47 999 +++ s10k/Vago/mainwindow.h 2017/12/30 13:57:32 1093 @@ -1,17 +1,20 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H -#include "util.h" +#include "utilvago.h" #include "preferences.h" #include "manualcommands.h" #include "about.h" #include "packagewizard.h" #include "soundwizard.h" +#include "bgimagewizard.h" +#include "wmwizard.h" #include "converter.h" -#include "droptablewidget.h" +#include "xmltoolsinterface.h" +#include "wizardfactory.h" +#include "xmlParsers/projectfilevago.h" #include -#include #include #include #include @@ -29,7 +32,12 @@ #include #include #include -//#include +#include +#include +#ifdef Q_OS_WIN +#include +#include +#endif namespace Ui { class MainWindow; @@ -38,7 +46,7 @@ class MainWindow; class MainWindow : public QMainWindow { Q_OBJECT - + public: explicit MainWindow(QWidget *parent = 0); @@ -46,8 +54,10 @@ public: protected: void closeEvent(QCloseEvent *event); - + private slots: + void applicationWasLoaded(); + void on_actionExit_triggered(); void on_actionAbout_triggered(); @@ -66,7 +76,7 @@ private slots: void on_pbAddSourceXML_clicked(); - void on_pbConvertXML_clicked(); + void on_pbConvert_clicked(); void TsetupProgressBar(int max); @@ -104,14 +114,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 +156,6 @@ private slots: void on_cbFromCharacters_currentIndexChanged(const QString &arg1); - void on_pbConvertCharacters_clicked(); - void on_pbAddSourceCharacters_clicked(); void on_pbRemoveSourceCharacters_clicked(); @@ -170,24 +170,47 @@ private slots: void on_cbWithTRBS_ONCC_toggled(bool checked); - void on_cbWithAnimation_toggled(bool checked); - void on_cbFromXML_currentIndexChanged(const QString &arg1); void on_cbSpecificFilesLevels_toggled(bool checked); 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(); + + void on_actionBackground_Image_Wizard_triggered(); + + void on_actionNew_Project_triggered(); + + void on_tbXmlToolsInterface_clicked(); + + void on_actionWindow_Messages_Wizard_triggered(); + + void on_cbWithAnimation_toggled(bool checked); 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 @@ -196,24 +219,49 @@ private: QLabel *itemsLoaded; QProgressBar *myBar; //Progress Bar QHash commandMap; //Map the commands for fast retreive - QStringList *listToProccess; //items to proccess - Converter *myConverter; + QStringList listToProccess; //items to proccess + Converter *myConverter = nullptr; 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 + bool unsavedChangesExist = false; + // Indicates that the application is fully loaded which includes painting the main window + bool applicationIsFullyLoaded = false; + // This variable indicates that we have a project being loaded. It should only be set by MainWindow thread. + // It allow us to ignore certain gui slots like when checking checkbox that ask the user for input + bool projectIsLoading = false; + + // anonymous enum + enum {XMLTabIndex, TexturesTabIndex, CharactersTabIndex, ObjectsTabIndex, LevelsTabIndex, MiscTabIndex}; +private: 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 loadProjectState(const QString &filePath); + void setVagoWindowTitle(); + void saveRecentProjects(); + void loadRecentProjects(); + void addNewRecentProject(const QString &filePath); + void reloadRecentProjectsMenu(); + void showEvent(QShowEvent *e); + void rowsWereChangedInDropTableWidget(); 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,9 +272,19 @@ 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(); + QMessageBox::StandardButton askToSaveCurrentProject(); + ProjectFileVago::ProjectData fetchCurrentProjectData(); signals: void terminateCurrProcess(); + void signalAppIsLoaded(); }; #endif // MAINWINDOW_H