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 801 by s10k, Sun Apr 7 15:36:17 2013 UTC vs.
Revision 1061 by s10k, Fri Dec 9 19:04:18 2016 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 "xmltoolsinterface.h"
14 + #include "wizardfactory.h"
15  
16   #include <QMainWindow>
12 #include <QSettings>
17   #include <QMessageBox>
18   #include <QProcess>
19   #include <QColor>
# Line 19 | Line 23
23   #include <QDesktopServices>
24   #include <QErrorMessage>
25   #include <QTextCodec>
22 #include <converter.h>
26   #include <QProgressBar>
24 #include <droptablewidget.h>
27   #include <QComboBox>
28   #include <QtNetwork/QNetworkAccessManager>
29   #include <QtNetwork/QNetworkRequest>
30   #include <QtNetwork/QNetworkReply>
29 #include <QDebug>
31   #include <QCloseEvent>
32   #include <QScriptEngine>
33   #include <QScriptValueIterator>
34 + #include <droptablewidget.h>
35 + #include <pugixml.hpp>
36 + #ifdef Q_OS_WIN
37 + #include <QWinTaskbarProgress>
38 + #include <QWinTaskbarButton>
39 + #endif
40  
41   namespace Ui {
42   class MainWindow;
# Line 38 | Line 45 | class MainWindow;
45   class MainWindow : public QMainWindow
46   {
47      Q_OBJECT
48 <    
48 >
49   public:
50      explicit MainWindow(QWidget *parent = 0);
51  
# Line 46 | Line 53 | public:
53  
54   protected:
55      void closeEvent(QCloseEvent *event);
56 <    
56 >
57   private slots:
58 +    void applicationWasLoaded();
59 +
60      void on_actionExit_triggered();
61  
62      void on_actionAbout_triggered();
# Line 64 | Line 73 | private slots:
73  
74      void on_actionCheck_For_Updates_triggered();
75  
76 <    void on_pbAddSourceGeneral_clicked();
76 >    void on_pbAddSourceXML_clicked();
77  
78 <    void on_pbConvertGeneral_clicked();
78 >    void on_pbConvert_clicked();
79  
80      void TsetupProgressBar(int max);
81  
# Line 74 | Line 83 | private slots:
83  
84      void TresultConversion(QString result, int numErrors);
85  
86 <    void on_cbFromGeneral_currentIndexChanged(const QString &arg1);
86 >    void TconversionAborted();
87  
88      void on_actionWindows_triggered();
89  
90      void on_actionMac_Windows_demo_triggered();
91  
92 <    void on_pbClearSourcesGeneral_clicked();
92 >    void on_pbClearSourcesXML_clicked();
93  
94 <    void on_pbRemoveSourceGeneral_clicked();
94 >    void on_pbRemoveSourceXML_clicked();
95  
96      void on_pbAddSourceTextures_clicked();
97  
# Line 92 | Line 101 | private slots:
101  
102      void on_cbFromTextures_currentIndexChanged(const QString &arg1);
103  
104 <    void on_cbFromModels_currentIndexChanged(const QString &arg1);
104 >    void on_cbFromObjects_currentIndexChanged(const QString &arg1);
105  
106      void on_cbFromLevels_currentIndexChanged(const QString &arg1);
107  
108      void on_cbFromMisc_currentIndexChanged(const QString &arg1);
109  
110 <    void on_pbAddSourceModels_clicked();
110 >    void on_pbAddSourceObjects_clicked();
111  
112      void on_pbAddSourceLevels_clicked();
113  
114      void on_pbAddSourceMisc_clicked();
115  
116 <    void on_pbConvertTextures_clicked();
108 <
109 <    void on_pbConvertModels_clicked();
110 <
111 <    void on_pbConvertLevels_clicked();
112 <
113 <    void on_pbConvertMisc_clicked();
114 <
115 <    void on_pbRemoveSourceModels_clicked();
116 >    void on_pbRemoveSourceObjects_clicked();
117  
118      void on_pbRemoveSourceLevels_clicked();
119  
120      void on_pbRemoveSourceMisc_clicked();
121  
122 <    void on_pbClearSourcesModels_clicked();
122 >    void on_pbClearSourcesObjects_clicked();
123  
124      void on_pbClearSourcesLevels_clicked();
125  
# Line 126 | Line 127 | private slots:
127  
128      void on_actionPreferences_triggered();
129  
129    void on_cbToGeneral_currentIndexChanged(const QString &arg1);
130
130      void on_cbToLevels_currentIndexChanged(const QString &arg1);
131  
133    void on_cbDatGeneral_toggled(bool checked);
134
132      void on_cbDatLevels_toggled(bool checked);
133  
134      void on_actionCheck_OniSplit_version_triggered();
# Line 140 | Line 137 | private slots:
137  
138      void dtContextMenu(DropTableWidget* myTable, QContextMenuEvent *event); //Context menu options for table widgets
139  
143    void on_cbTRAMGeneral_toggled(bool checked);
144
145    void on_tabWidget_selected(const QString &arg1);
146
140      void checkVagoLastVersion(QNetworkReply *result); //check vago last version
141  
142      void on_cbBnvLevels_toggled(bool checked);
# Line 158 | Line 151 | private slots:
151  
152      void on_actionView_log_triggered();
153  
154 <    void on_cbToModels_currentIndexChanged(const QString &arg1);
154 >    void on_actionAE_Package_Creator_triggered();
155 >
156 >    void on_cbFromCharacters_currentIndexChanged(const QString &arg1);
157 >
158 >    void on_pbAddSourceCharacters_clicked();
159 >
160 >    void on_pbRemoveSourceCharacters_clicked();
161 >
162 >    void on_pbClearSourcesCharacters_clicked();
163 >
164 >    void on_actionSound_Wizard_triggered();
165 >
166 >    void on_actionCheck_xmlTools_version_triggered();
167 >
168 >    void on_actionOpen_AE_folder_triggered();
169 >
170 >    void on_cbWithTRBS_ONCC_toggled(bool checked);
171  
172      void on_cbWithAnimation_toggled(bool checked);
173  
174 <    void on_actionAE_Package_Creator_triggered();
174 >    void on_cbFromXML_currentIndexChanged(const QString &arg1);
175  
176 <    void on_cbFromAnimations_currentIndexChanged(const QString &arg1);
176 >    void on_cbSpecificFilesLevels_toggled(bool checked);
177  
178 <    void on_cbCamera_toggled(bool checked);
178 >    void on_tbAbortConversion_clicked();
179  
180 <    void on_cbGeometry_toggled(bool checked);
180 >    void on_tabWidget_currentChanged(int);
181  
182 <    void on_pbConvertAnimations_clicked();
182 >    void on_actionSave_Project_triggered();
183  
184 <    void on_pbAddSourceAnimations_clicked();
184 >    void on_actionSave_triggered();
185  
186 <    void on_pbRemoveSourceAnimations_clicked();
186 >    void on_actionLoad_Project_triggered();
187  
188 <    void on_pbClearSourcesAnimations_clicked();
188 >    void on_actionProject1_triggered();
189  
190 <    void on_actionSound_Wizard_triggered();
190 >    void on_actionProject2_triggered();
191  
192 <    void on_actionCheck_xmlTools_version_triggered();
192 >    void on_actionProject3_triggered();
193 >
194 >    void on_actionProject4_triggered();
195 >
196 >    void on_actionProject5_triggered();
197 >
198 >    void on_actionBackground_Image_Wizard_triggered();
199 >
200 >    void on_actionNew_Project_triggered();
201 >
202 >    void on_tbXmlToolsInterface_clicked();
203 >
204 >    void on_actionWindow_Messages_Wizard_triggered();
205  
206   private:
207      Ui::MainWindow *ui;
208      Logger *myLogger;
188    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 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      void connectSlots();
244      void showErrStatusMessage(QString message);
245      void showSuccessStatusMessage(QString message);
246      void mapCommands();
247 <    void addRowTable(DropTableWidget *myTable,QString file, QString fromTo, QString command);
247 >    void addRowTable(DropTableWidget *myTable, QString file, QString fromTo, QString command, bool isToDisabled=false);
248      void clearTableContents(DropTableWidget *myTable);
249 +    void clearTableNoPrompt(DropTableWidget *myTable);
250      void removeTableContents(DropTableWidget *myTable);
251 <    void updateComboBox(const QString &arg1, QComboBox *comboBox, const QString &identifier);
252 <    void startConversion(DropTableWidget *myTable);
251 >    void updateComboBox(const QString &arg1, QComboBox *comboBox);
252 >    void startConversion();
253      void updateItemsLoaded(DropTableWidget *currentTable);
254      void changeToCurrentSettings(QList<int> rows, DropTableWidget* myTable); //change some rows to the current settings
255      void changeItemsOutput(DropTableWidget* myTable, QList<int> rows, QString newOutput);
256      void setConverterButtonsSize();
257 +    void saveProjectState(const QString &filePath);
258 +    void saveProjectWidget(pugi::xml_node &rootNode, DropTableWidget* table);
259 +    void loadProjectState(const QString &filePath);
260 +    void setVagoWindowTitle();
261 +    void loadProjectWidget(pugi::xml_document &doc, DropTableWidget* table);
262 +    void saveRecentProjects();
263 +    void loadRecentProjects();
264 +    void addNewRecentProject(const QString &filePath);
265 +    void reloadRecentProjectsMenu();
266 +    void showEvent(QShowEvent *e);
267 +    void rowsWereChangedInDropTableWidget();
268      QString getFileOutputFolder(QString fromTo, QString myOutputFolder="");
269 <    QString fileParsingGeneral(QString myOutputFolder, QString from, QString to , QString file);
270 <    QString fileParsingTextures(QString myOutputFolder, QString from, QString to , QString file);
271 <    QString fileParsingModels(QString myOutputFolder, QString from, QString to , QString file);
272 <    QString fileParsingAnimations(QString myOutputFolder, QString from, QString to , QString file);
273 <    QString fileParsingLevels(QString myOutputFolder, QString from, QString to , QString file);
269 >    QString fileParsingXML(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file);
270 >    QString fileParsingTextures(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file);
271 >    QString fileParsingObjects(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file);
272 >    QString fileParsingCharacters(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file);
273 >    QString fileParsingLevels(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file);
274      QString fileParsingMisc(QString myOutputFolder, QString from, QString to , QString file);
275      QString getCommand(DropTableWidget* myTable, QString myOutputFolder, QString from, QString to , QString file);
276      QString getTypeConversion(DropTableWidget *myTable); //get the current type for a table
277      QString getOSIndependentAppPath();
278 +    QString getTabNameByTableWidget(DropTableWidget* table);
279 +    QString getCurrentTabName();
280 +    QRadioButton* getTextureRBCheckedTypeTexture();
281 +    QRadioButton *getTextureRBTypeTextureByName(const QString &texType);
282 +    DropTableWidget *getCurrentTableWidget();
283 +    DropTableWidget* getTableWidgetByTabName(const QString &tabName);
284 +    QList<DropTableWidget*> getAllTableWidgets();
285 +    QMessageBox::StandardButton askToSaveCurrentProject();
286 +
287 + signals:
288 +    void terminateCurrProcess();
289 +    void signalAppIsLoaded();
290   };
291  
292   #endif // MAINWINDOW_H

Diff Legend

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