ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/s10k/Vago/mainwindow.h
Revision: 1054
Committed: Wed Oct 12 21:35:13 2016 UTC (9 years ago) by s10k
Content type: text/x-chdr
Original Path: Vago/trunk/Vago/mainwindow.h
File size: 9077 byte(s)
Log Message:
Vago 1.1

File Contents

# Content
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3
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
14 #include <QMainWindow>
15 #include <QMessageBox>
16 #include <QProcess>
17 #include <QColor>
18 #include <QPalette>
19 #include <QFileDialog>
20 #include <QUrl>
21 #include <QDesktopServices>
22 #include <QErrorMessage>
23 #include <QTextCodec>
24 #include <QProgressBar>
25 #include <QComboBox>
26 #include <QtNetwork/QNetworkAccessManager>
27 #include <QtNetwork/QNetworkRequest>
28 #include <QtNetwork/QNetworkReply>
29 #include <QCloseEvent>
30 #include <QScriptEngine>
31 #include <QScriptValueIterator>
32 #ifdef Q_OS_WIN
33 #include <QWinTaskbarProgress>
34 #include <QWinTaskbarButton>
35 #endif
36
37 #include "libs/pugixml/pugixml.hpp"
38 //#include <QDebug>
39
40 namespace Ui {
41 class MainWindow;
42 }
43
44 class MainWindow : public QMainWindow
45 {
46 Q_OBJECT
47
48 public:
49 explicit MainWindow(QWidget *parent = 0);
50
51 ~MainWindow();
52
53 protected:
54 void closeEvent(QCloseEvent *event);
55
56 private slots:
57 void applicationWasLoaded();
58
59 void on_actionExit_triggered();
60
61 void on_actionAbout_triggered();
62
63 void on_tbOni_clicked();
64
65 void on_tbAE_clicked();
66
67 void on_tbOpenFolder_clicked();
68
69 void on_cbEnvMap_toggled(bool checked);
70
71 void on_cbTexture_toggled(bool checked);
72
73 void on_actionCheck_For_Updates_triggered();
74
75 void on_pbAddSourceXML_clicked();
76
77 void on_pbConvert_clicked();
78
79 void TsetupProgressBar(int max);
80
81 void TupdateProgressBar();
82
83 void TresultConversion(QString result, int numErrors);
84
85 void TconversionAborted();
86
87 void on_actionWindows_triggered();
88
89 void on_actionMac_Windows_demo_triggered();
90
91 void on_pbClearSourcesXML_clicked();
92
93 void on_pbRemoveSourceXML_clicked();
94
95 void on_pbAddSourceTextures_clicked();
96
97 void on_pbRemoveSourceTextures_clicked();
98
99 void on_pbClearSourcesTextures_clicked();
100
101 void on_cbFromTextures_currentIndexChanged(const QString &arg1);
102
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_pbAddSourceObjects_clicked();
110
111 void on_pbAddSourceLevels_clicked();
112
113 void on_pbAddSourceMisc_clicked();
114
115 void on_pbRemoveSourceObjects_clicked();
116
117 void on_pbRemoveSourceLevels_clicked();
118
119 void on_pbRemoveSourceMisc_clicked();
120
121 void on_pbClearSourcesObjects_clicked();
122
123 void on_pbClearSourcesLevels_clicked();
124
125 void on_pbClearSourcesMisc_clicked();
126
127 void on_actionPreferences_triggered();
128
129 void on_cbToLevels_currentIndexChanged(const QString &arg1);
130
131 void on_cbDatLevels_toggled(bool checked);
132
133 void on_actionCheck_OniSplit_version_triggered();
134
135 void addFilesSource(DropTableWidget *myTable, QStringList files); //for drag 'n drop
136
137 void dtContextMenu(DropTableWidget* myTable, QContextMenuEvent *event); //Context menu options for table widgets
138
139 void checkVagoLastVersion(QNetworkReply *result); //check vago last version
140
141 void on_cbBnvLevels_toggled(bool checked);
142
143 void on_cbAdditionalSourcesLevels_toggled(bool checked);
144
145 void on_tbCommand_clicked();
146
147 void on_actionWorkspace_triggered();
148
149 void on_actionOther_triggered();
150
151 void on_actionView_log_triggered();
152
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_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);
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 private:
202 Ui::MainWindow *ui;
203 Logger *myLogger;
204 QString workspaceLocation; //Workspace location
205 QString workspaceWizardsLocation; //Workspace wizard location
206 QString outputFolder; //Output folder
207 QString AeLocation; //Workspace location
208 QString lastProjectFilePath;
209 int startedWindowWidth;
210 int startedWindowHeight;
211 #ifdef Q_OS_MAC
212 bool useYesAsDefaultWhenRemovingItems;
213 #endif
214 QLabel *itemsLoaded;
215 QProgressBar *myBar; //Progress Bar
216 QHash<QString, QString> commandMap; //Map the commands for fast retreive
217 QStringList *listToProccess; //items to proccess
218 Converter *myConverter = nullptr;
219 QSettings *vagoSettings;
220 static const QString VagoSettingsName;
221 static constexpr int recentProjectsMaxSize=5;
222 QList<QString> recentProjectsList;
223 #ifdef Q_OS_WIN
224 // These are deleted automatically by the window (since button is attached to it)
225 QWinTaskbarProgress *win7TaskBarProgress;
226 QWinTaskbarButton *win7TaskBarButton;
227 #endif
228 bool unsavedChangesExist = false;
229 // Indicates that the application is fully loaded which includes painting the main window
230 bool applicationIsFullyLoaded = false;
231
232 // anonymous enum
233 enum {XMLTabIndex, TexturesTabIndex, CharactersTabIndex, ObjectsTabIndex, LevelsTabIndex, MiscTabIndex};
234
235 void connectSlots();
236 void showErrStatusMessage(QString message);
237 void showSuccessStatusMessage(QString message);
238 void mapCommands();
239 void addRowTable(DropTableWidget *myTable, QString file, QString fromTo, QString command, bool isToDisabled=false);
240 void clearTableContents(DropTableWidget *myTable);
241 void clearTableNoPrompt(DropTableWidget *myTable);
242 void removeTableContents(DropTableWidget *myTable);
243 void updateComboBox(const QString &arg1, QComboBox *comboBox);
244 void startConversion();
245 void updateItemsLoaded(DropTableWidget *currentTable);
246 void changeToCurrentSettings(QList<int> rows, DropTableWidget* myTable); //change some rows to the current settings
247 void changeItemsOutput(DropTableWidget* myTable, QList<int> rows, QString newOutput);
248 void setConverterButtonsSize();
249 void saveProjectState(const QString &filePath);
250 void saveProjectWidget(pugi::xml_node &rootNode, DropTableWidget* table);
251 void loadProjectState(const QString &filePath);
252 void setVagoWindowTitle();
253 void loadProjectWidget(pugi::xml_document &doc, DropTableWidget* table);
254 void saveRecentProjects();
255 void loadRecentProjects();
256 void addNewRecentProject(const QString &filePath);
257 void reloadRecentProjectsMenu();
258 void showEvent(QShowEvent *e);
259 void rowsWereChangedInDropTableWidget();
260 QString getFileOutputFolder(QString fromTo, QString myOutputFolder="");
261 QString fileParsingXML(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file);
262 QString fileParsingTextures(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file);
263 QString fileParsingObjects(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file);
264 QString fileParsingCharacters(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file);
265 QString fileParsingLevels(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file);
266 QString fileParsingMisc(QString myOutputFolder, QString from, QString to , QString file);
267 QString getCommand(DropTableWidget* myTable, QString myOutputFolder, QString from, QString to , QString file);
268 QString getTypeConversion(DropTableWidget *myTable); //get the current type for a table
269 QString getOSIndependentAppPath();
270 QString getTabNameByTableWidget(DropTableWidget* table);
271 QString getCurrentTabName();
272 QRadioButton* getTextureRBCheckedTypeTexture();
273 QRadioButton *getTextureRBTypeTextureByName(const QString &texType);
274 DropTableWidget *getCurrentTableWidget();
275 DropTableWidget* getTableWidgetByTabName(const QString &tabName);
276 QList<DropTableWidget*> getAllTableWidgets();
277 QMessageBox::StandardButton askToSaveCurrentProject();
278
279 signals:
280 void terminateCurrProcess();
281 void signalAppIsLoaded();
282 };
283
284 #endif // MAINWINDOW_H