1 #ifndef SAVEFORM_HPP
2 #define SAVEFORM_HPP
3 /*
4     Copyright © 2008-13 Qtrac Ltd. All rights reserved.
5     This program or module is free software: you can redistribute it
6     and/or modify it under the terms of the GNU General Public License
7     as published by the Free Software Foundation, either version 2 of
8     the License, or (at your option) any later version. This program is
9     distributed in the hope that it will be useful, but WITHOUT ANY
10     WARRANTY; without even the implied warranty of MERCHANTABILITY or
11     FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12     for more details.
13 */
14 
15 #include <QBrush>
16 #include <QDialog>
17 #include <QPen>
18 
19 class QDialogButtonBox;
20 class QGroupBox;
21 class QLabel;
22 class QLineEdit;
23 class QPushButton;
24 class QRadioButton;
25 
26 enum SavePages {SaveLeftPages, SaveRightPages, SaveBothPages};
27 
28 class SaveForm : public QDialog
29 {
30     Q_OBJECT
31 
32 public:
33     SaveForm(const QString &path, QString *filename, bool *saveAll,
34              SavePages *savePages, QWidget *parent=0);
35 
36 private slots:
37     void accept();
38     void updateUi();
39     void chooseFile();
40 
41 private:
42     void createWidgets();
43     void createLayout();
44     void createConnections();
45 
46     QGroupBox *saveGroupBox;
47     QRadioButton *saveCurrentRadioButton;
48     QRadioButton *saveAllRadioButton;
49     QGroupBox *pagesGroupBox;
50     QRadioButton *leftPagesRadioButton;
51     QRadioButton *rightPagesRadioButton;
52     QRadioButton *bothPagesRadioButton;
53     QLabel *filenameLabel;
54     QLineEdit *filenameLineEdit;
55     QPushButton *chooseFileButton;
56     QDialogButtonBox *buttonBox;
57 
58     const QString m_path;
59     QString *m_filename;
60     bool *m_saveAll;
61     SavePages *m_savePages;
62 };
63 
64 #endif // SAVEFORM_HPP
65