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 QGridLayout;
16 class QPushButton;
17 class QSpinBox;
18 class MainWindowModel;
19 
22 {
23  Q_OBJECT;
24 
25 public:
28  virtual ~DlgSettingsMainWindow();
29 
30  virtual void createOptionalSaveDefault (QHBoxLayout *layout);
31  virtual QWidget *createSubPanel ();
32  virtual void load (CmdMediator &cmdMediator); // Not used. Use loadMainWindowModel instead
33 
35  void loadMainWindowModel (CmdMediator &cmdMediator,
36  const MainWindowModel &modelMainWindow);
37 
38 private slots:
39  void slotTitleBarFormat(bool);
40  void slotLocale (int index);
41  void slotRecentFileClear ();
42  void slotZoomControl (const QString);
43  void slotZoomFactor (const QString);
44 
45 protected:
46  virtual void handleOk ();
47 
48 private:
49 
50  void createControls (QGridLayout *layout,
51  int &row);
52  QString localeLabel (QLocale::Language lang,
53  QLocale::Country country) const;
54  void updateControls();
55 
56  QComboBox *m_cmbZoomFactor;
57  QComboBox *m_cmbZoomControl;
58  QComboBox *m_cmbLocale;
59  QPushButton *m_btnRecentClear;
60  QCheckBox *m_chkTitleBarFormat;
61 
62  MainWindowModel *m_modelMainWindowBefore;
63  MainWindowModel *m_modelMainWindowAfter;
64 };
65 
66 #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.
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:77
CmdMediator & cmdMediator()
Provide access to Document information wrapped inside CmdMediator.