|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: QT C++ based Class. |
|
15 * frmMain is a QT based Window. |
|
16 * Used to display STF executor main GUI. |
|
17 * |
|
18 */ |
|
19 #ifndef FRMMAIN_H |
|
20 #define FRMMAIN_H |
|
21 |
|
22 #include <QMainWindow> |
|
23 #include "istfqtuicontroller.h" |
|
24 #include "istfqtuimodel.h" |
|
25 #include "dlgoutput.h" |
|
26 #include "uisetting.h" |
|
27 #include "dlgsetting.h" |
|
28 |
|
29 QT_BEGIN_NAMESPACE |
|
30 class QAction; |
|
31 class QLabel; |
|
32 class QMenu; |
|
33 class QTabWidget; |
|
34 class QWidget; |
|
35 class QPushButton; |
|
36 class QComboBox; |
|
37 class QPlainTextEdit; |
|
38 class QTreeWidget; |
|
39 class QTreeWidgetItem; |
|
40 class QListWidget; |
|
41 class QCheckBox; |
|
42 class QMessageBox; |
|
43 class QFileDialog; |
|
44 QT_END_NAMESPACE |
|
45 |
|
46 const QString QtUIVersion = "StfQtUI v1.0.1"; |
|
47 |
|
48 class frmMain : public QMainWindow, public IStfEventListener, public IStifModelEventListener |
|
49 { |
|
50 Q_OBJECT |
|
51 |
|
52 public: |
|
53 frmMain(); |
|
54 ~frmMain(); |
|
55 |
|
56 |
|
57 public: //Implement IStfEventListener |
|
58 void OnGetMessage(const QString& aMessage); |
|
59 void OnSetListChanged(); |
|
60 void OnCaseOutputChanged(const IStfEventListener::CaseOutputCommand& cmd, const QString& index, const QString& msg); |
|
61 |
|
62 |
|
63 public: //Implement IStifModelEventListener |
|
64 void OnCaseStatisticChanged() ; |
|
65 void OnRunningCaseChanged() ; |
|
66 |
|
67 protected slots: |
|
68 void onTabWidgetSelectIndexChanged(); |
|
69 |
|
70 |
|
71 private: |
|
72 void createMenus(); |
|
73 void LoadSubMenu(); |
|
74 void load(); |
|
75 void loadContent(); |
|
76 void loadModuleList(); |
|
77 void loadSetList(); |
|
78 void loadStatistic(); |
|
79 QList<CSTFCase> getSelectedCases(); |
|
80 void reloadStatisticItem(QString name, QTreeWidgetItem* item, TSTFCaseStatusType type); |
|
81 void setSetting(); |
|
82 |
|
83 private: |
|
84 IStfQtUIController* controller; |
|
85 IStfQtUIModel* model; |
|
86 DlgOutput* dlgOutput; |
|
87 UiSetting* uiSetting; |
|
88 |
|
89 |
|
90 private: //UI Components |
|
91 QWidget *MainWidget; |
|
92 //menus and actions |
|
93 QMenu *operateMenu; |
|
94 //output panel |
|
95 QPlainTextEdit *txtOutput; |
|
96 //tab control. |
|
97 QTabWidget *tabWidget; |
|
98 QWidget *tabCase; |
|
99 QWidget *tabSet; |
|
100 QWidget *tabStarted; |
|
101 QWidget *tabStatistic; |
|
102 |
|
103 //Cases Tab |
|
104 QTreeWidget *treeModuleList; |
|
105 |
|
106 //Statistic Tab |
|
107 QTreeWidget *treeStatistic; |
|
108 QTreeWidgetItem *executedItems; |
|
109 QTreeWidgetItem *passedItems; |
|
110 QTreeWidgetItem *failedItems; |
|
111 QTreeWidgetItem *abortedItems; |
|
112 QTreeWidgetItem *crashedItems; |
|
113 |
|
114 |
|
115 //Set Tab |
|
116 QComboBox *cboSetList; |
|
117 QListWidget *lstSetCases; |
|
118 |
|
119 //Started Tab |
|
120 QListWidget *lstStartedCases; |
|
121 QPushButton *btnPauseCase; |
|
122 QPushButton *btnAbortCase; |
|
123 QPlainTextEdit *txtCaseOutput; |
|
124 |
|
125 //menu actions |
|
126 QAction *actExit; |
|
127 QAction *actAbout; |
|
128 |
|
129 //cases actoins |
|
130 QAction *actOpenFile; |
|
131 QAction *actRunCaseSeq; |
|
132 QAction *actRunCasePar; |
|
133 QAction *actAddtoSet; |
|
134 QAction *actSelectAll; |
|
135 QAction *actExpandAll; |
|
136 QAction *actCollapseAll; |
|
137 QAction *actSetting; |
|
138 //sets actions |
|
139 QAction *actRunSetSeq; |
|
140 QAction *actRunSetPar; |
|
141 QAction *actNewSet; |
|
142 QAction *actDelSet; |
|
143 //running actions. |
|
144 QAction *actPause; |
|
145 QAction *actAbort; |
|
146 //statistics actions |
|
147 QAction *actClearStatistics; |
|
148 |
|
149 private slots: |
|
150 void on_cboSetList_currentIndexChanged(QString ); |
|
151 |
|
152 void on_actAbout_triggered(); |
|
153 void on_actOpenFile_triggered(); |
|
154 void on_actRunCaseSeq_triggered(); |
|
155 void on_actRunCasePar_triggered(); |
|
156 void on_actAddtoSet_triggered(); |
|
157 void on_actSelectAll_triggered(); |
|
158 void on_actExpandAll_triggered(); |
|
159 void on_actCollapseAll_triggered(); |
|
160 void on_actSetting_triggered(); |
|
161 |
|
162 void on_actRunSetSeq_triggered(); |
|
163 void on_actRunSetPar_triggered(); |
|
164 void on_actNewSet_triggered(); |
|
165 void on_actDelSet_triggered(); |
|
166 void on_actPause_triggered(); |
|
167 void on_actAbort_triggered(); |
|
168 void on_actClearStatistics_triggered(); |
|
169 void on_treeModuleList_itemClicked(QTreeWidgetItem* item, int column); |
|
170 |
|
171 |
|
172 |
|
173 |
|
174 |
|
175 |
|
176 |
|
177 }; |
|
178 |
|
179 #endif // FRMMAIN_H |