| 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 |
|
|
| 16 |
|
#include <QMainWindow> |
| 14 |
– |
#include <QSettings> |
| 17 |
|
#include <QMessageBox> |
| 18 |
|
#include <QProcess> |
| 19 |
|
#include <QColor> |
| 31 |
|
#include <QCloseEvent> |
| 32 |
|
#include <QScriptEngine> |
| 33 |
|
#include <QScriptValueIterator> |
| 34 |
< |
//#include <QDebug> |
| 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; |
| 45 |
|
class MainWindow : public QMainWindow |
| 46 |
|
{ |
| 47 |
|
Q_OBJECT |
| 48 |
< |
|
| 48 |
> |
|
| 49 |
|
public: |
| 50 |
|
explicit MainWindow(QWidget *parent = 0); |
| 51 |
|
|
| 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(); |
| 75 |
|
|
| 76 |
|
void on_pbAddSourceXML_clicked(); |
| 77 |
|
|
| 78 |
< |
void on_pbConvertXML_clicked(); |
| 78 |
> |
void on_pbConvert_clicked(); |
| 79 |
|
|
| 80 |
|
void TsetupProgressBar(int max); |
| 81 |
|
|
| 113 |
|
|
| 114 |
|
void on_pbAddSourceMisc_clicked(); |
| 115 |
|
|
| 107 |
– |
void on_pbConvertTextures_clicked(); |
| 108 |
– |
|
| 109 |
– |
void on_pbConvertObjects_clicked(); |
| 110 |
– |
|
| 111 |
– |
void on_pbConvertLevels_clicked(); |
| 112 |
– |
|
| 113 |
– |
void on_pbConvertMisc_clicked(); |
| 114 |
– |
|
| 116 |
|
void on_pbRemoveSourceObjects_clicked(); |
| 117 |
|
|
| 118 |
|
void on_pbRemoveSourceLevels_clicked(); |
| 137 |
|
|
| 138 |
|
void dtContextMenu(DropTableWidget* myTable, QContextMenuEvent *event); //Context menu options for table widgets |
| 139 |
|
|
| 139 |
– |
void on_tabWidget_selected(const QString &arg1); |
| 140 |
– |
|
| 140 |
|
void checkVagoLastVersion(QNetworkReply *result); //check vago last version |
| 141 |
|
|
| 142 |
|
void on_cbBnvLevels_toggled(bool checked); |
| 155 |
|
|
| 156 |
|
void on_cbFromCharacters_currentIndexChanged(const QString &arg1); |
| 157 |
|
|
| 159 |
– |
void on_pbConvertCharacters_clicked(); |
| 160 |
– |
|
| 158 |
|
void on_pbAddSourceCharacters_clicked(); |
| 159 |
|
|
| 160 |
|
void on_pbRemoveSourceCharacters_clicked(); |
| 177 |
|
|
| 178 |
|
void on_tbAbortConversion_clicked(); |
| 179 |
|
|
| 180 |
+ |
void on_tabWidget_currentChanged(int); |
| 181 |
+ |
|
| 182 |
+ |
void on_actionSave_Project_triggered(); |
| 183 |
+ |
|
| 184 |
+ |
void on_actionSave_triggered(); |
| 185 |
+ |
|
| 186 |
+ |
void on_actionLoad_Project_triggered(); |
| 187 |
+ |
|
| 188 |
+ |
void on_actionProject1_triggered(); |
| 189 |
+ |
|
| 190 |
+ |
void on_actionProject2_triggered(); |
| 191 |
+ |
|
| 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; |
| 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 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); |
| 252 |
< |
void startConversion(DropTableWidget *myTable); |
| 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 fileParsingXML(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file); |
| 270 |
|
QString fileParsingTextures(QString tabTitle, 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 |