Engauge Digitizer  2
DlgSettingsMainWindow.h
1 /******************************************************************************************************
2  * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3  * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4  * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5  ******************************************************************************************************/
6 
7 #ifndef DLG_SETTINGS_MAIN_WINDOW_H
8 #define DLG_SETTINGS_MAIN_WINDOW_H
9 
10 #include "DlgSettingsAbstractBase.h"
11 #include <QLocale>
12 
13 class QCheckBox;
14 class QComboBox;
15 class QDoubleSpinBox;
16 class QGridLayout;
17 class QPushButton;
18 class QSpinBox;
19 class MainWindowModel;
20 
23 {
24  Q_OBJECT;
25 
26 public:
29  virtual ~DlgSettingsMainWindow();
30 
31  virtual void createOptionalSaveDefault (QHBoxLayout *layout);
32  virtual QWidget *createSubPanel ();
33  virtual void load (CmdMediator &cmdMediator); // Not used. Use loadMainWindowModel instead
34 
36  void loadMainWindowModel (CmdMediator &cmdMediator,
37  const MainWindowModel &modelMainWindow);
38  virtual void setSmallDialogs (bool smallDialogs);
39 
40 private slots:
41  void slotDragDropExport (bool);
42  void slotHighlightOpacity (double);
43  void slotImportCropping (int index);
44  void slotLocale (int index);
45  void slotMaximumGridLines (int limit);
46  void slotPdfResolution (const QString);
47  void slotRecentFileClear ();
48  void slotSmallDialogs(bool);
49  void slotTitleBarFormat(bool);
50  void slotZoomControl (const QString);
51  void slotZoomFactor (const QString);
52 
53 protected:
54  virtual void handleOk ();
55 
56 private:
57 
58  void createControls (QGridLayout *layout,
59  int &row);
60  void updateControls();
61 
62  QComboBox *m_cmbZoomFactor;
63  QComboBox *m_cmbZoomControl;
64  QComboBox *m_cmbLocale;
65  QComboBox *m_cmbImportCropping;
66  QPushButton *m_btnRecentClear;
67  QCheckBox *m_chkTitleBarFormat;
68  QComboBox *m_cmbPdfResolution;
69  QSpinBox *m_spinMaximumGridLines;
70  QDoubleSpinBox *m_spinHighlightOpacity;
71  QCheckBox *m_chkSmallDialogs;
72  QCheckBox *m_chkDragDropExport;
73 
74  MainWindowModel *m_modelMainWindowBefore;
75  MainWindowModel *m_modelMainWindowAfter;
76 };
77 
78 #endif // DLG_SETTINGS_MAIN_WINDOW_H
virtual void createOptionalSaveDefault(QHBoxLayout *layout)
Let subclass define an optional Save As Default button.
virtual void handleOk()
Process slotOk.
void loadMainWindowModel(CmdMediator &cmdMediator, const MainWindowModel &modelMainWindow)
Replaced load method since the main window settings are independent of document, unlike other DlgSett...
virtual void load(CmdMediator &cmdMediator)
Load settings from Document.
DlgSettingsMainWindow(MainWindow &mainWindow)
Single constructor.
Model for DlgSettingsMainWindow.
virtual QWidget * createSubPanel()
Create dialog-specific panel to which base class will add Ok and Cancel buttons.
Dialog for editing main window settings, which are entirely independent of all documents.
virtual void setSmallDialogs(bool smallDialogs)
If false then dialogs have a minimum size so all controls are visible.
Command queue stack.
Definition: CmdMediator.h:23
Abstract base class for all Settings dialogs.
MainWindow & mainWindow()
Get method for MainWindow.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition: MainWindow.h:89
CmdMediator & cmdMediator()
Provide access to Document information wrapped inside CmdMediator.