18 */ |
18 */ |
19 #ifndef FRMMAIN_H |
19 #ifndef FRMMAIN_H |
20 #define FRMMAIN_H |
20 #define FRMMAIN_H |
21 |
21 |
22 #include <QMainWindow> |
22 #include <QMainWindow> |
|
23 #include <QtGui> |
23 #include "istfqtuicontroller.h" |
24 #include "istfqtuicontroller.h" |
24 #include "istfqtuimodel.h" |
25 #include "istfqtuimodel.h" |
25 #include "dlgoutput.h" |
26 #include "dlgoutput.h" |
26 #include "uisetting.h" |
27 #include "uisetting.h" |
27 #include "dlgsetting.h" |
28 #include "dlgsetting.h" |
|
29 #include "dlgsetselector.h" |
|
30 #include "uiversion.h" |
28 |
31 |
29 QT_BEGIN_NAMESPACE |
32 QT_BEGIN_NAMESPACE |
30 class QAction; |
33 class QAction; |
31 class QLabel; |
34 class QLabel; |
32 class QMenu; |
35 class QMenu; |
41 class QCheckBox; |
44 class QCheckBox; |
42 class QMessageBox; |
45 class QMessageBox; |
43 class QFileDialog; |
46 class QFileDialog; |
44 QT_END_NAMESPACE |
47 QT_END_NAMESPACE |
45 |
48 |
46 const QString QtUIVersion = "StfQtUI v1.0.1"; |
|
47 |
49 |
48 class frmMain : public QMainWindow, public IStfEventListener, public IStifModelEventListener |
50 |
|
51 class FrmMain : public QMainWindow, public IStfEventListener, public IStifModelEventListener |
49 { |
52 { |
50 Q_OBJECT |
53 Q_OBJECT |
51 |
54 |
52 public: |
55 public: |
53 frmMain(); |
56 FrmMain(); |
54 ~frmMain(); |
57 ~FrmMain(); |
55 |
58 |
56 |
59 |
57 public: //Implement IStfEventListener |
60 public: //Implement IStfEventListener |
58 void OnGetMessage(const QString& aMessage); |
61 void OnGetMessage(const QString& aMessage); |
59 void OnSetListChanged(); |
62 void OnSetListChanged(); |
77 void loadSetList(); |
83 void loadSetList(); |
78 void loadStatistic(); |
84 void loadStatistic(); |
79 QList<CSTFCase> getSelectedCases(); |
85 QList<CSTFCase> getSelectedCases(); |
80 void reloadStatisticItem(QString name, QTreeWidgetItem* item, TSTFCaseStatusType type); |
86 void reloadStatisticItem(QString name, QTreeWidgetItem* item, TSTFCaseStatusType type); |
81 void setSetting(); |
87 void setSetting(); |
|
88 void startRunning(); |
82 |
89 |
83 private: |
90 private: |
84 IStfQtUIController* controller; |
91 IStfQtUIController* controller; |
85 IStfQtUIModel* model; |
92 IStfQtUIModel* model; |
86 DlgOutput* dlgOutput; |
93 DlgOutput* dlgOutput; |
87 UiSetting* uiSetting; |
94 UiSetting* uiSetting; |
88 |
95 bool layoutType; |
89 |
96 |
90 private: //UI Components |
97 private: //UI Components |
91 QWidget *MainWidget; |
98 QWidget* centerWidget; |
|
99 QGridLayout *mainLayout; |
|
100 QGroupBox *groupBox; |
|
101 |
92 //menus and actions |
102 //menus and actions |
93 QMenu *operateMenu; |
103 QMenu *operateMenu; |
94 //output panel |
104 //output panel |
95 QPlainTextEdit *txtOutput; |
105 QPlainTextEdit *txtOutput; |
96 //tab control. |
106 //tab control. |
133 QAction *actAddtoSet; |
143 QAction *actAddtoSet; |
134 QAction *actSelectAll; |
144 QAction *actSelectAll; |
135 QAction *actExpandAll; |
145 QAction *actExpandAll; |
136 QAction *actCollapseAll; |
146 QAction *actCollapseAll; |
137 QAction *actSetting; |
147 QAction *actSetting; |
|
148 QMenu *menuRunCase; |
138 //sets actions |
149 //sets actions |
139 QAction *actRunSetSeq; |
150 QAction *actRunSetSeq; |
140 QAction *actRunSetPar; |
151 QAction *actRunSetPar; |
141 QAction *actNewSet; |
152 QAction *actNewSet; |
142 QAction *actDelSet; |
153 QAction *actDelSet; |
|
154 QMenu *menuRunSet; |
143 //running actions. |
155 //running actions. |
144 QAction *actPause; |
156 QAction *actPause; |
145 QAction *actAbort; |
157 QAction *actAbort; |
|
158 QAction *actOutput; |
|
159 |
146 //statistics actions |
160 //statistics actions |
147 QAction *actClearStatistics; |
161 QAction *actClearStatistics; |
148 |
162 |
149 private slots: |
163 private slots: |
150 void on_cboSetList_currentIndexChanged(QString ); |
164 void on_cboSetList_currentIndexChanged(QString ); |
155 void on_actRunCasePar_triggered(); |
169 void on_actRunCasePar_triggered(); |
156 void on_actAddtoSet_triggered(); |
170 void on_actAddtoSet_triggered(); |
157 void on_actSelectAll_triggered(); |
171 void on_actSelectAll_triggered(); |
158 void on_actExpandAll_triggered(); |
172 void on_actExpandAll_triggered(); |
159 void on_actCollapseAll_triggered(); |
173 void on_actCollapseAll_triggered(); |
|
174 void on_actExpand_triggered(); |
|
175 void on_actCollapse_triggered(); |
160 void on_actSetting_triggered(); |
176 void on_actSetting_triggered(); |
161 |
177 |
162 void on_actRunSetSeq_triggered(); |
178 void on_actRunSetSeq_triggered(); |
163 void on_actRunSetPar_triggered(); |
179 void on_actRunSetPar_triggered(); |
164 void on_actNewSet_triggered(); |
180 void on_actNewSet_triggered(); |
165 void on_actDelSet_triggered(); |
181 void on_actDelSet_triggered(); |
166 void on_actPause_triggered(); |
182 void on_actPause_triggered(); |
167 void on_actAbort_triggered(); |
183 void on_actAbort_triggered(); |
|
184 void on_actOutput_triggered(); |
168 void on_actClearStatistics_triggered(); |
185 void on_actClearStatistics_triggered(); |
169 void on_treeModuleList_itemClicked(QTreeWidgetItem* item, int column); |
186 void on_treeModuleList_itemClicked(QTreeWidgetItem* item, int column); |
170 |
187 |
171 |
188 |
172 |
189 |