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 792 by s10k, Sat Apr 6 23:10:19 2013 UTC vs.
Revision 1058 by s10k, Sun Oct 30 14:42:39 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 "converter.h"
12 + #include "droptablewidget.h"
13 + #include "xmltoolsinterface.h"
14  
15   #include <QMainWindow>
12 #include <QSettings>
16   #include <QMessageBox>
17   #include <QProcess>
18   #include <QColor>
# Line 19 | Line 22
22   #include <QDesktopServices>
23   #include <QErrorMessage>
24   #include <QTextCodec>
22 #include <converter.h>
25   #include <QProgressBar>
24 #include <droptablewidget.h>
26   #include <QComboBox>
27   #include <QtNetwork/QNetworkAccessManager>
28   #include <QtNetwork/QNetworkRequest>
29   #include <QtNetwork/QNetworkReply>
29 #include <QDebug>
30   #include <QCloseEvent>
31   #include <QScriptEngine>
32   #include <QScriptValueIterator>
33 + #ifdef Q_OS_WIN
34 + #include <QWinTaskbarProgress>
35 + #include <QWinTaskbarButton>
36 + #endif
37 +
38 + #include "libs/pugixml/pugixml.hpp"
39  
40   namespace Ui {
41   class MainWindow;
# Line 38 | Line 44 | class MainWindow;
44   class MainWindow : public QMainWindow
45   {
46      Q_OBJECT
47 <    
47 >
48   public:
49      explicit MainWindow(QWidget *parent = 0);
50  
51      ~MainWindow();
52  
53   protected:
54 <     void closeEvent(QCloseEvent *event);
55 <    
54 >    void closeEvent(QCloseEvent *event);
55 >
56   private slots:
57 +    void applicationWasLoaded();
58 +
59      void on_actionExit_triggered();
60  
61      void on_actionAbout_triggered();
# Line 64 | Line 72 | private slots:
72  
73      void on_actionCheck_For_Updates_triggered();
74  
75 <    void on_pbAddSourceGeneral_clicked();
75 >    void on_pbAddSourceXML_clicked();
76  
77 <    void on_pbConvertGeneral_clicked();
77 >    void on_pbConvert_clicked();
78  
79      void TsetupProgressBar(int max);
80  
# Line 74 | Line 82 | private slots:
82  
83      void TresultConversion(QString result, int numErrors);
84  
85 <    void on_cbFromGeneral_currentIndexChanged(const QString &arg1);
85 >    void TconversionAborted();
86  
87      void on_actionWindows_triggered();
88  
89      void on_actionMac_Windows_demo_triggered();
90  
91 <    void on_pbClearSourcesGeneral_clicked();
91 >    void on_pbClearSourcesXML_clicked();
92  
93 <    void on_pbRemoveSourceGeneral_clicked();
93 >    void on_pbRemoveSourceXML_clicked();
94  
95      void on_pbAddSourceTextures_clicked();
96  
# Line 92 | Line 100 | private slots:
100  
101      void on_cbFromTextures_currentIndexChanged(const QString &arg1);
102  
103 <    void on_cbFromModels_currentIndexChanged(const QString &arg1);
103 >    void on_cbFromObjects_currentIndexChanged(const QString &arg1);
104  
105      void on_cbFromLevels_currentIndexChanged(const QString &arg1);
106  
107      void on_cbFromMisc_currentIndexChanged(const QString &arg1);
108  
109 <    void on_pbAddSourceModels_clicked();
109 >    void on_pbAddSourceObjects_clicked();
110  
111      void on_pbAddSourceLevels_clicked();
112  
113      void on_pbAddSourceMisc_clicked();
114  
115 <    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();
115 >    void on_pbRemoveSourceObjects_clicked();
116  
117      void on_pbRemoveSourceLevels_clicked();
118  
119      void on_pbRemoveSourceMisc_clicked();
120  
121 <    void on_pbClearSourcesModels_clicked();
121 >    void on_pbClearSourcesObjects_clicked();
122  
123      void on_pbClearSourcesLevels_clicked();
124  
# Line 126 | Line 126 | private slots:
126  
127      void on_actionPreferences_triggered();
128  
129    void on_cbToGeneral_currentIndexChanged(const QString &arg1);
130
129      void on_cbToLevels_currentIndexChanged(const QString &arg1);
130  
133    void on_cbDatGeneral_toggled(bool checked);
134
131      void on_cbDatLevels_toggled(bool checked);
132  
133      void on_actionCheck_OniSplit_version_triggered();
# Line 140 | Line 136 | private slots:
136  
137      void dtContextMenu(DropTableWidget* myTable, QContextMenuEvent *event); //Context menu options for table widgets
138  
143    void on_cbTRAMGeneral_toggled(bool checked);
144
145    void on_tabWidget_selected(const QString &arg1);
146
139      void checkVagoLastVersion(QNetworkReply *result); //check vago last version
140  
141      void on_cbBnvLevels_toggled(bool checked);
# Line 158 | Line 150 | private slots:
150  
151      void on_actionView_log_triggered();
152  
153 <    void on_cbToModels_currentIndexChanged(const QString &arg1);
153 >    void on_actionAE_Package_Creator_triggered();
154 >
155 >    void on_cbFromCharacters_currentIndexChanged(const QString &arg1);
156 >
157 >    void on_pbAddSourceCharacters_clicked();
158 >
159 >    void on_pbRemoveSourceCharacters_clicked();
160 >
161 >    void on_pbClearSourcesCharacters_clicked();
162 >
163 >    void on_actionSound_Wizard_triggered();
164 >
165 >    void on_actionCheck_xmlTools_version_triggered();
166 >
167 >    void on_actionOpen_AE_folder_triggered();
168 >
169 >    void on_cbWithTRBS_ONCC_toggled(bool checked);
170  
171      void on_cbWithAnimation_toggled(bool checked);
172  
173 <    void on_actionAE_Package_Creator_triggered();
173 >    void on_cbFromXML_currentIndexChanged(const QString &arg1);
174  
175 <    void on_cbFromAnimations_currentIndexChanged(const QString &arg1);
175 >    void on_cbSpecificFilesLevels_toggled(bool checked);
176  
177 <    void on_cbCamera_toggled(bool checked);
177 >    void on_tbAbortConversion_clicked();
178  
179 <    void on_cbGeometry_toggled(bool checked);
179 >    void on_tabWidget_currentChanged(int);
180  
181 <    void on_pbConvertAnimations_clicked();
181 >    void on_actionSave_Project_triggered();
182  
183 <    void on_pbAddSourceAnimations_clicked();
183 >    void on_actionSave_triggered();
184  
185 <    void on_pbRemoveSourceAnimations_clicked();
185 >    void on_actionLoad_Project_triggered();
186  
187 <    void on_pbClearSourcesAnimations_clicked();
187 >    void on_actionProject1_triggered();
188  
189 <    void on_actionSound_Wizard_triggered();
189 >    void on_actionProject2_triggered();
190  
191 <    void on_actionCheck_xmlTools_version_triggered();
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   private:
204      Ui::MainWindow *ui;
# Line 189 | Line 207 | private:
207      QString workspaceWizardsLocation; //Workspace wizard location
208      QString outputFolder; //Output folder
209      QString AeLocation; //Workspace location
210 +    QString lastProjectFilePath;
211 +    int startedWindowWidth;
212 +    int startedWindowHeight;
213 + #ifdef Q_OS_MAC
214 +    bool useYesAsDefaultWhenRemovingItems;
215 + #endif
216      QLabel *itemsLoaded;
217      QProgressBar *myBar; //Progress Bar
218      QHash<QString, QString> commandMap; //Map the commands for fast retreive
219 <    QStringList *listToProccess; //items to proccess
220 <    Converter *myConverter;
219 >    QStringList listToProccess; //items to proccess
220 >    Converter *myConverter = nullptr;
221      QSettings *vagoSettings;
222      static const QString VagoSettingsName;
223 +    static constexpr int recentProjectsMaxSize=5;
224 +    QList<QString> recentProjectsList;
225 + #ifdef Q_OS_WIN
226 +    // These are deleted automatically by the window (since button is attached to it)
227 +    QWinTaskbarProgress *win7TaskBarProgress;
228 +    QWinTaskbarButton *win7TaskBarButton;
229 + #endif
230 +    bool unsavedChangesExist = false;
231 +    // Indicates that the application is fully loaded which includes painting the main window
232 +    bool applicationIsFullyLoaded = false;
233 +    // This variable indicates that we have a project being loaded. It should only be set by MainWindow thread.
234 +    // It allow us to ignore certain gui slots like when checking checkbox that ask the user for input
235 +    bool projectIsLoading = false;
236 +
237 +    // anonymous enum
238 +    enum {XMLTabIndex, TexturesTabIndex, CharactersTabIndex, ObjectsTabIndex, LevelsTabIndex, MiscTabIndex};
239  
240      void connectSlots();
241      void showErrStatusMessage(QString message);
242      void showSuccessStatusMessage(QString message);
243      void mapCommands();
244 <    void addRowTable(DropTableWidget *myTable,QString file, QString fromTo, QString command);
244 >    void addRowTable(DropTableWidget *myTable, QString file, QString fromTo, QString command, bool isToDisabled=false);
245      void clearTableContents(DropTableWidget *myTable);
246 +    void clearTableNoPrompt(DropTableWidget *myTable);
247      void removeTableContents(DropTableWidget *myTable);
248 <    void updateComboBox(const QString &arg1, QComboBox *comboBox, const QString &identifier);
249 <    void startConversion(DropTableWidget *myTable);
248 >    void updateComboBox(const QString &arg1, QComboBox *comboBox);
249 >    void startConversion();
250      void updateItemsLoaded(DropTableWidget *currentTable);
251      void changeToCurrentSettings(QList<int> rows, DropTableWidget* myTable); //change some rows to the current settings
252      void changeItemsOutput(DropTableWidget* myTable, QList<int> rows, QString newOutput);
253      void setConverterButtonsSize();
254 +    void saveProjectState(const QString &filePath);
255 +    void saveProjectWidget(pugi::xml_node &rootNode, DropTableWidget* table);
256 +    void loadProjectState(const QString &filePath);
257 +    void setVagoWindowTitle();
258 +    void loadProjectWidget(pugi::xml_document &doc, DropTableWidget* table);
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 fileParsingGeneral(QString myOutputFolder, QString from, QString to , QString file);
267 <    QString fileParsingTextures(QString myOutputFolder, QString from, QString to , QString file);
268 <    QString fileParsingModels(QString myOutputFolder, QString from, QString to , QString file);
269 <    QString fileParsingAnimations(QString myOutputFolder, QString from, QString to , QString file);
270 <    QString fileParsingLevels(QString myOutputFolder, QString from, QString to , QString file);
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);
268 >    QString fileParsingObjects(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file);
269 >    QString fileParsingCharacters(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file);
270 >    QString fileParsingLevels(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file);
271      QString fileParsingMisc(QString myOutputFolder, QString from, QString to , QString file);
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 +
284 + signals:
285 +    void terminateCurrProcess();
286 +    void signalAppIsLoaded();
287   };
288  
289   #endif // MAINWINDOW_H

Diff Legend

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