ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/s10k/Vago/mainwindow.h
(Generate patch)

Comparing:
Vago/trunk/Vago/mainwindow.h (file contents), Revision 998 by s10k, Fri Apr 25 21:05:54 2014 UTC vs.
s10k/Vago/mainwindow.h (file contents), Revision 1093 by s10k, Sat Dec 30 13:57:32 2017 UTC

# Line 1 | Line 1
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"
8   #include "packagewizard.h"
9   #include "soundwizard.h"
10 + #include "bgimagewizard.h"
11 + #include "wmwizard.h"
12   #include "converter.h"
13 < #include "droptablewidget.h"
13 > #include "xmltoolsinterface.h"
14 > #include "wizardfactory.h"
15 > #include "xmlParsers/projectfilevago.h"
16  
17   #include <QMainWindow>
14 #include <QSettings>
18   #include <QMessageBox>
19   #include <QProcess>
20   #include <QColor>
# Line 29 | Line 32
32   #include <QCloseEvent>
33   #include <QScriptEngine>
34   #include <QScriptValueIterator>
35 < //#include <QDebug>
35 > #include <droptablewidget.h>
36 > #include <pugixml/pugixml.hpp>
37 > #ifdef Q_OS_WIN
38 > #include <QWinTaskbarProgress>
39 > #include <QWinTaskbarButton>
40 > #endif
41  
42   namespace Ui {
43   class MainWindow;
# Line 38 | Line 46 | class MainWindow;
46   class MainWindow : public QMainWindow
47   {
48      Q_OBJECT
49 <    
49 >
50   public:
51      explicit MainWindow(QWidget *parent = 0);
52  
# Line 46 | Line 54 | public:
54  
55   protected:
56      void closeEvent(QCloseEvent *event);
57 <    
57 >
58   private slots:
59 +    void applicationWasLoaded();
60 +
61      void on_actionExit_triggered();
62  
63      void on_actionAbout_triggered();
# Line 66 | Line 76 | private slots:
76  
77      void on_pbAddSourceXML_clicked();
78  
79 <    void on_pbConvertXML_clicked();
79 >    void on_pbConvert_clicked();
80  
81      void TsetupProgressBar(int max);
82  
# Line 104 | Line 114 | private slots:
114  
115      void on_pbAddSourceMisc_clicked();
116  
107    void on_pbConvertTextures_clicked();
108
109    void on_pbConvertObjects_clicked();
110
111    void on_pbConvertLevels_clicked();
112
113    void on_pbConvertMisc_clicked();
114
117      void on_pbRemoveSourceObjects_clicked();
118  
119      void on_pbRemoveSourceLevels_clicked();
# Line 154 | Line 156 | private slots:
156  
157      void on_cbFromCharacters_currentIndexChanged(const QString &arg1);
158  
157    void on_pbConvertCharacters_clicked();
158
159      void on_pbAddSourceCharacters_clicked();
160  
161      void on_pbRemoveSourceCharacters_clicked();
# Line 170 | Line 170 | private slots:
170  
171      void on_cbWithTRBS_ONCC_toggled(bool checked);
172  
173    void on_cbWithAnimation_toggled(bool checked);
174
173      void on_cbFromXML_currentIndexChanged(const QString &arg1);
174  
175      void on_cbSpecificFilesLevels_toggled(bool checked);
176  
177      void on_tbAbortConversion_clicked();
178  
179 <    void on_tabWidget_currentChanged(int index);
179 >    void on_tabWidget_currentChanged(int);
180 >
181 >    void on_actionSave_Project_triggered();
182 >
183 >    void on_actionSave_triggered();
184 >
185 >    void on_actionLoad_Project_triggered();
186 >
187 >    void on_actionProject1_triggered();
188 >
189 >    void on_actionProject2_triggered();
190 >
191 >    void on_actionProject3_triggered();
192 >
193 >    void on_actionProject4_triggered();
194 >
195 >    void on_actionProject5_triggered();
196 >
197 >    void on_actionBackground_Image_Wizard_triggered();
198 >
199 >    void on_actionNew_Project_triggered();
200 >
201 >    void on_tbXmlToolsInterface_clicked();
202 >
203 >    void on_actionWindow_Messages_Wizard_triggered();
204 >
205 >    void on_cbWithAnimation_toggled(bool checked);
206  
207   private:
208      Ui::MainWindow *ui;
185    Logger *myLogger;
186    QString AppDir;
209      QString workspaceLocation; //Workspace location
210      QString workspaceWizardsLocation; //Workspace wizard location
211      QString outputFolder; //Output folder
212      QString AeLocation; //Workspace location
213 +    QString lastProjectFilePath;
214      int startedWindowWidth;
215      int startedWindowHeight;
216   #ifdef Q_OS_MAC
217 <    bool useYesAsDefaultInClearButton;
217 >    bool useYesAsDefaultWhenRemovingItems;
218   #endif
219      QLabel *itemsLoaded;
220      QProgressBar *myBar; //Progress Bar
221      QHash<QString, QString> commandMap; //Map the commands for fast retreive
222 <    QStringList *listToProccess; //items to proccess
223 <    Converter *myConverter;
222 >    QStringList listToProccess; //items to proccess
223 >    Converter *myConverter = nullptr;
224      QSettings *vagoSettings;
225      static const QString VagoSettingsName;
226 +    static constexpr int recentProjectsMaxSize=5;
227 +    QList<QString> recentProjectsList;
228 + #ifdef Q_OS_WIN
229 +    // These are deleted automatically by the window (since button is attached to it)
230 +    QWinTaskbarProgress *win7TaskBarProgress;
231 +    QWinTaskbarButton *win7TaskBarButton;
232 + #endif
233 +    bool unsavedChangesExist = false;
234 +    // Indicates that the application is fully loaded which includes painting the main window
235 +    bool applicationIsFullyLoaded = false;
236 +    // This variable indicates that we have a project being loaded. It should only be set by MainWindow thread.
237 +    // It allow us to ignore certain gui slots like when checking checkbox that ask the user for input
238 +    bool projectIsLoading = false;
239 +
240 +    // anonymous enum
241 +    enum {XMLTabIndex, TexturesTabIndex, CharactersTabIndex, ObjectsTabIndex, LevelsTabIndex, MiscTabIndex};
242  
243 + private:
244      void connectSlots();
205    void showErrStatusMessage(QString message);
206    void showSuccessStatusMessage(QString message);
245      void mapCommands();
246 <    void addRowTable(DropTableWidget *myTable,QString file, QString fromTo, QString command);
246 >    void addRowTable(DropTableWidget *myTable, QString file, QString fromTo, QString command, bool isToDisabled=false);
247      void clearTableContents(DropTableWidget *myTable);
248 +    void clearTableNoPrompt(DropTableWidget *myTable);
249      void removeTableContents(DropTableWidget *myTable);
250      void updateComboBox(const QString &arg1, QComboBox *comboBox);
251 <    void startConversion(DropTableWidget *myTable);
251 >    void startConversion();
252      void updateItemsLoaded(DropTableWidget *currentTable);
253      void changeToCurrentSettings(QList<int> rows, DropTableWidget* myTable); //change some rows to the current settings
254      void changeItemsOutput(DropTableWidget* myTable, QList<int> rows, QString newOutput);
255      void setConverterButtonsSize();
256 +    void saveProjectState(const QString &filePath);
257 +    void loadProjectState(const QString &filePath);
258 +    void setVagoWindowTitle();
259 +    void saveRecentProjects();
260 +    void loadRecentProjects();
261 +    void addNewRecentProject(const QString &filePath);
262 +    void reloadRecentProjectsMenu();
263 +    void showEvent(QShowEvent *e);
264 +    void rowsWereChangedInDropTableWidget();
265      QString getFileOutputFolder(QString fromTo, QString myOutputFolder="");
266      QString fileParsingXML(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file);
267      QString fileParsingTextures(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file);
# Line 224 | Line 272 | private:
272      QString getCommand(DropTableWidget* myTable, QString myOutputFolder, QString from, QString to , QString file);
273      QString getTypeConversion(DropTableWidget *myTable); //get the current type for a table
274      QString getOSIndependentAppPath();
275 +    QString getTabNameByTableWidget(DropTableWidget* table);
276 +    QString getCurrentTabName();
277 +    QRadioButton* getTextureRBCheckedTypeTexture();
278 +    QRadioButton *getTextureRBTypeTextureByName(const QString &texType);
279 +    DropTableWidget *getCurrentTableWidget();
280 +    DropTableWidget* getTableWidgetByTabName(const QString &tabName);
281 +    QList<DropTableWidget*> getAllTableWidgets();
282 +    QMessageBox::StandardButton askToSaveCurrentProject();
283 +    ProjectFileVago::ProjectData fetchCurrentProjectData();
284  
285   signals:
286      void terminateCurrProcess();
287 +    void signalAppIsLoaded();
288   };
289  
290   #endif // MAINWINDOW_H

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)