forked from simulationcraft/simc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.hpp
156 lines (136 loc) · 4.28 KB
/
MainWindow.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
// ==========================================================================
// Dedmonwakeen's Raid DPS/TPS Simulator.
// Send questions to [email protected]
// ==========================================================================
#pragma once
#include <QString>
#include <QtWidgets/QtWidgets>
#include <memory>
#include <string>
class BattleNetImportWindow;
class SC_MainTab;
class SC_ImportTab;
class SC_ResultTab;
class SC_WebView;
class SC_TextEdit;
class SC_QueueItemModel;
class SC_MainWindowCommandLine;
class SC_OptionsTab;
class SC_SpellQueryTab;
class SC_SimulateTab;
class SC_RecentlyClosedTabItemModel;
class SC_RecentlyClosedTabWidget;
class SC_ImportThread;
class SC_SimulateThread;
struct sim_t;
class SC_MainWindow : public QWidget
{
Q_OBJECT
public:
QWidget* customGearTab;
QWidget* customTalentsTab;
SC_MainTab* mainTab;
SC_OptionsTab* optionsTab;
SC_ImportTab* importTab;
SC_SimulateTab* simulateTab;
SC_ResultTab* resultsTab;
SC_SpellQueryTab* spellQueryTab;
QTabWidget* createCustomProfileDock;
BattleNetImportWindow* newBattleNetView;
SC_WebView* helpView;
SC_WebView* visibleWebView;
SC_TextEdit* overridesText;
SC_TextEdit* logText;
QPushButton* backButton;
QPushButton* forwardButton;
SC_MainWindowCommandLine* cmdLine;
QLineEdit* apikey;
QGroupBox* cmdLineGroupBox;
QGroupBox* createCustomCharData;
SC_RecentlyClosedTabItemModel* recentlyClosedTabModel;
SC_RecentlyClosedTabWidget* recentlyClosedTabImport;
QTimer* timer;
QTimer* soloChar;
SC_ImportThread* importThread;
SC_SimulateThread* simulateThread;
QSignalMapper mainTabSignalMapper;
QList<QShortcut*> shortcuts;
std::shared_ptr<sim_t> sim;
std::shared_ptr<sim_t> import_sim;
std::string simPhase;
std::string importSimPhase;
int simProgress;
int importSimProgress;
int soloimport;
int simResults;
QString AppDataDir; // output goes here
QString ResultsDestDir; // user documents dir, default location offered to persitently save reports
QString TmpDir; // application specific temporary dir
QString cmdLineText;
QString logFileText;
QString resultsFileText;
SC_QueueItemModel* simulationQueue;
int consecutiveSimulationsRun;
void startImport( int tab, const QString& url );
bool importRunning();
void startSim();
bool simRunning();
std::shared_ptr<sim_t> initSim();
void deleteSim( std::shared_ptr<sim_t>& sim, SC_TextEdit* append_error_message = 0 );
void loadHistory();
void saveHistory();
void createCmdLine();
void createWelcomeTab();
void createImportTab();
void createOptionsTab();
void createSimulateTab();
void createResultsTab();
void createOverridesTab();
void createHelpTab();
void createLogTab();
void createSpellQueryTab();
void createTabShortcuts();
void createCustomTab();
void updateWebView( SC_WebView* );
void toggle_pause();
protected:
void closeEvent( QCloseEvent* ) override;
private slots:
void updatetimer();
void itemWasEnqueuedTryToSim();
void importFinished();
void simulateFinished( std::shared_ptr<sim_t> );
void updateSimProgress();
void cmdLineReturnPressed();
void cmdLineTextEdited( const QString& );
void backButtonClicked( bool checked = false );
void forwardButtonClicked( bool checked = false );
void reloadButtonClicked( bool checked = false );
void mainButtonClicked( bool checked = false );
void pauseButtonClicked( bool checked = false );
void cancelButtonClicked();
void queueButtonClicked();
void importButtonClicked();
void queryButtonClicked();
void mainTabChanged( int index );
void importTabChanged( int index );
void resultsTabChanged( int index );
void resultsTabCloseRequest( int index );
void bisDoubleClicked( QTreeWidgetItem* item, int col );
void armoryRegionChanged( const QString& region );
void simulateTabRestored( QWidget* tab, const QString& title, const QString& tooltip, const QIcon& icon );
void switchToASubTab( int direction );
void switchToLeftSubTab();
void switchToRightSubTab();
void currentlyViewedTabCloseRequest();
public slots:
void enqueueSim();
void saveLog();
void saveResults();
void stopImport();
void stopSim();
void stopAllSim();
void startNewImport( const QString&, const QString&, const QString&, const QString& );
public:
SC_MainWindow( QWidget* parent = nullptr );
};