--- Vago/trunk/Vago/mainwindow.h 2016/09/16 22:51:26 1047 +++ s10k/Vago/mainwindow.h 2017/12/30 13:57:32 1093 @@ -7,8 +7,12 @@ #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 @@ -28,11 +32,12 @@ #include #include #include +#include +#include +#ifdef Q_OS_WIN #include #include - -#include "libs/pugixml/pugixml.hpp" -//#include +#endif namespace Ui { class MainWindow; @@ -51,6 +56,8 @@ protected: void closeEvent(QCloseEvent *event); private slots: + void applicationWasLoaded(); + void on_actionExit_triggered(); void on_actionAbout_triggered(); @@ -163,8 +170,6 @@ 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); @@ -189,9 +194,18 @@ private slots: 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 workspaceLocation; //Workspace location QString workspaceWizardsLocation; //Workspace wizard location QString outputFolder; //Output folder @@ -205,8 +219,8 @@ 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; @@ -216,13 +230,18 @@ private: 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, bool isToDisabled=false); void clearTableContents(DropTableWidget *myTable); @@ -235,15 +254,14 @@ private: 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); + 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); @@ -261,9 +279,12 @@ private: DropTableWidget *getCurrentTableWidget(); DropTableWidget* getTableWidgetByTabName(const QString &tabName); QList getAllTableWidgets(); + QMessageBox::StandardButton askToSaveCurrentProject(); + ProjectFileVago::ProjectData fetchCurrentProjectData(); signals: void terminateCurrProcess(); + void signalAppIsLoaded(); }; #endif // MAINWINDOW_H