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_GENERAL_H
8 #define DLG_SETTINGS_GENERAL_H
9 
10 #include "DlgSettingsAbstractBase.h"
11 
12 class DocumentModelGeneral;
13 class QGridLayout;
14 class QPushButton;
15 class QSpinBox;
16 
17 /// Dialog for editing general settings.
18 class DlgSettingsGeneral : public DlgSettingsAbstractBase
19 {
20   Q_OBJECT;
21 
22 public:
23   /// Single constructor.
24   DlgSettingsGeneral(MainWindow &mainWindow);
25   virtual ~DlgSettingsGeneral();
26 
27   virtual void createOptionalSaveDefault (QHBoxLayout *layout);
28   virtual QWidget *createSubPanel ();
29   virtual void load (CmdMediator &cmdMediator);
30   virtual void setSmallDialogs (bool smallDialogs);
31 
32 private slots:
33   void slotCursorSize (int);
34   void slotExtraPrecision (int);
35   void slotSaveDefault();
36 
37 protected:
38   virtual void handleOk ();
39 
40 private:
41 
42   void createControls (QGridLayout *layout,
43                        int &row);
44   void updateControls();
45 
46   QSpinBox *m_spinCursorSize;
47   QSpinBox *m_spinExtraPrecision;
48 
49   QPushButton *m_btnSaveDefault;
50 
51   DocumentModelGeneral *m_modelGeneralBefore;
52   DocumentModelGeneral *m_modelGeneralAfter;
53 };
54 
55 #endif // DLG_SETTINGS_GENERAL_H
56