comparison ui/mainwindow.h @ 654:129e611eaf50

Merge branch trustbridge-refactor
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 25 Jun 2014 15:16:24 +0200
parents 292c590ba9cb f65503c1833b
children a2e94e88d304
comparison
equal deleted inserted replaced
648:e41a2537b84d 654:129e611eaf50
20 #include <QListWidget> 20 #include <QListWidget>
21 #include <QTextEdit> 21 #include <QTextEdit>
22 #include <QPushButton> 22 #include <QPushButton>
23 #include <QLabel> 23 #include <QLabel>
24 #include <QCheckBox> 24 #include <QCheckBox>
25 #include <QScrollArea>
25 26
26 #include "downloader.h" 27 #include "downloader.h"
27 #include "certificatelist.h" 28 #include "certificatelist.h"
29 #include "certificatelistwidget.h"
28 class QMenu; 30 class QMenu;
29 class QAction; 31 class QAction;
30 class QTimer; 32 class QTimer;
31 33
32 Q_DECLARE_METATYPE(Certificate);
33 34
34 class MainWindow : public QMainWindow 35 class MainWindow : public QMainWindow
35 { 36 {
36 Q_OBJECT 37 Q_OBJECT
37 38
68 void handleNewList(const QString& fileName, const QDateTime& modDate); 69 void handleNewList(const QString& fileName, const QDateTime& modDate);
69 void handleNewSW(const QString& fileName, const QDateTime& modDate); 70 void handleNewSW(const QString& fileName, const QDateTime& modDate);
70 void downloaderError(const QString &message, SSLConnection::ErrorCode error); 71 void downloaderError(const QString &message, SSLConnection::ErrorCode error);
71 /** @brief Trigger the appropiate action depending on the state */ 72 /** @brief Trigger the appropiate action depending on the state */
72 void messageClicked(); 73 void messageClicked();
73 void showHelp();
74 void showAbout();
75 void showDetails(QListWidgetItem*);
76 void resizeButtons();
77 void installerError(const QString& errMsg); 74 void installerError(const QString& errMsg);
78 void installerSuccess(); 75 void installerSuccess();
79 void installCerts(); 76 void installCerts();
80 77 void toggleInManual(bool state, const Certificate &cert);
81 void saveAutoUpdate(int state); 78 void removeFromManual(bool state, const Certificate &cert);
82 void saveAutoStart(int state); 79
80 void togglePages(int button);
81 void toggleUpdatesNew();
82 void toggleUpdatesRemove();
83 void toggleUpdatesManual();
84 void listChanged(int selected);
83 85
84 /** @brief check for running software that needs to close before installing 86 /** @brief check for running software that needs to close before installing
85 * 87 *
86 * This function calls installCerts if no software is running otherwise 88 * This function calls installCerts if no software is running otherwise
87 * it informs the user about the software that still needs to be closed. 89 * it informs the user about the software that still needs to be closed.
115 * Unselected are certificates that are unchecked 117 * Unselected are certificates that are unchecked
116 * in the certListWidget 118 * in the certListWidget
117 * 119 *
118 * Returns false on error. 120 * Returns false on error.
119 */ 121 */
120 bool saveUnselectedCertificates(); 122 bool saveUnselectedCertificates(QStringList unselected);
121 123
122 /** @brief loads previously unselected certificates from settings 124 /** @brief loads previously unselected certificates from settings
123 * 125 *
124 * The certificates are strored in the list mPreviouslyUnselected. 126 * The certificates are strored in the list mPreviouslyUnselected.
125 * 127 *
160 */ 162 */
161 void verifySWData(); 163 void verifySWData();
162 164
163 void createTrayIcon(); 165 void createTrayIcon();
164 void createActions(); 166 void createActions();
165 void createMenuBar();
166 void createContent(); 167 void createContent();
167 void loadCertificateList(); 168 void loadCertificateList();
168
169 /** @brief Create a separator item for the certificate list.
170 *
171 * The item uses a SeparatorItemDelegate for layout and styling at the given
172 * index.
173 *
174 * @param[in] text The text for the item.
175 * @param[in] index The index of the item.
176 *
177 * @return The new separator item.
178 */
179 QListWidgetItem* createSeparator(const QString &text, int index);
180
181 /** @brief Create a certificate list item for the list.
182 *
183 * The item uses a CertificateItemDelegate for layout and styling.
184 *
185 * @param[in] text The certificate to display.
186 * @param[in] status The certificate status.
187 * @param[in] index The index of the item.
188 *
189 * @return The new separator item.
190 */
191 QListWidgetItem* createListItem(const Certificate &certificate,
192 Certificate::Status status, int index);
193 169
194 /* Are we running in tray mode ?*/ 170 /* Are we running in tray mode ?*/
195 const bool mTrayMode; 171 const bool mTrayMode;
196 /* The message currently shown at intervals */ 172 /* The message currently shown at intervals */
197 QString mCurMessage; 173 QString mCurMessage;
214 CertificateList mInstalledList; 190 CertificateList mInstalledList;
215 /* Previously made "unselect" choices in the form of 191 /* Previously made "unselect" choices in the form of
216 * base64lines with I:/R: prefix */ 192 * base64lines with I:/R: prefix */
217 QStringList mPreviouslyUnselected; 193 QStringList mPreviouslyUnselected;
218 194
219 QListWidget *mCertListWidget;
220
221 QLabel *mSubjectCN;
222 QLabel *mSubjectO;
223 QLabel *mIssuerCN;
224 QLabel *mIssuerO;
225 QLabel *mValidFrom;
226 QLabel *mValidTo;
227 QLabel *mFingerprint;
228
229 QLabel *mCurrentListDate; 195 QLabel *mCurrentListDate;
230 QLabel *mNewListDate; 196 QLabel *mNewListDate;
231 197
232 QCheckBox *mAutoUpdateOption; 198 QButtonGroup *mButtonGroup;
233 QCheckBox *mAutoStartOption; 199 QScrollArea *mUpdatesPanel;
234 200 QWidget *mUpdatesWidget;
235 QPushButton *installButton; 201 QScrollArea *mInstallPanel;
236 QPushButton *quitButton; 202 QScrollArea *mRemovePanel;
203 QScrollArea *mInfoPanel;
204
205 QLabel *mUpdatesHeader;
206 QLabel *mLastCertUpdate;
207 QLabel *mLastSWupdate;
208 QLabel *mUpdatesNewCertificates;
209 QLabel *mUpdatesRemoveCertificates;
210 QLabel *mUpdatesManualCertificates;
211
212 CertificateListWidget *mUpdatesNew;
213 CertificateListWidget *mUpdatesRemove;
214 CertificateListWidget *mUpdatesManual;
215 CertificateListWidget *mInstallList;
216 CertificateListWidget *mRemoveList;
217
218 QPushButton *mUpdatesDetailsNew;
219 QPushButton *mUpdatesDetailsRemove;
220 QPushButton *mUpdatesDetailsManual;
237 }; 221 };
238 222
239 #endif // MAINWINDOW_H 223 #endif // MAINWINDOW_H

http://wald.intevation.org/projects/trustbridge/