comparison src/mainwindow.h @ 50:36ee5dd46fd3

Add GUI New Mainwindow that allows to set output formats and input files through a GUI.
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 19 Jul 2016 12:19:45 +0200
parents
children
comparison
equal deleted inserted replaced
49:a849b1de248f 50:36ee5dd46fd3
1 /* Copyright (C) 2016 by ETH Zürich
2 * Software engineering by Intevation GmbH
3 *
4 * This file is Free Software under the GNU GPL (v>=2)
5 * and comes with ABSOLUTELY NO WARRANTY!
6 * See LICENSE.txt for details.
7 */
8
9
10 /** @file The Main UI class.
11 *
12 * Parent class of all dialogs and graphical user interaction.
13 */
14 #include <QMainWindow>
15 #include <QSettings>
16
17 class QPushButton;
18 class QLineEdit;
19 class QCheckBox;
20 class FileNameRequester;
21
22 /**
23 * @class MainWindow
24 * @brief The mainwindow of the application.
25 * @details Holds the input fields and export options.
26 */
27 class MainWindow : public QMainWindow
28 {
29 Q_OBJECT
30
31 public:
32 MainWindow();
33
34 protected:
35 /** @brief UI setup */
36 void setupGUI();
37
38 /** @brief Cleanup and save the current state */
39 virtual void closeEvent(QCloseEvent *event);
40
41 /** @brief Restores the last window state */
42 void readSettings();
43
44 public slots:
45 /** @brief directly set an input file. */
46 void setInputFile(const QString& file);
47
48 /** @brief Prefill title with @title. */
49 void setTitle(const QString& title);
50
51 protected slots:
52 /** @brief Show an error dialog to the user. */
53 void showErrorMessage(const QString& errMsg);
54
55 /** @brief check if all mandataory fields are set. */
56 void checkCompleted();
57
58 /** @brief Do the actual conversion. */
59 void doConvert();
60
61 private:
62 QSettings mSettings;
63
64 FileNameRequester* mInputRequester;
65 FileNameRequester* mOutRequester;
66 QLineEdit *mTitleEdit;
67 QPushButton *mConvertBtn;
68 QCheckBox *mPdfChk,
69 *mXlsxChk,
70 *mHtmlChk;
71 };
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)