Engauge Digitizer  2
 All Classes Files Functions Variables Enumerations Enumerator Friends Pages
DlgSettingsExportFormat.h
1 #ifndef DLG_SETTINGS_EXPORT_FORMAT_H
2 #define DLG_SETTINGS_EXPORT_FORMAT_H
3 
4 #include "DlgSettingsAbstractBase.h"
5 
7 class QComboBox;
8 class QDoubleValidator;
9 class QGridLayout;
10 class QHBoxLayout;
11 class QLineEdit;
12 class QLabel;
13 class QListWidget;
14 class QPushButton;
15 class QRadioButton;
16 class QTabWidget;
17 class QTextEdit;
18 class QVBoxLayout;
19 
22 {
23  Q_OBJECT;
24 
25 public:
28  virtual ~DlgSettingsExportFormat();
29 
30  virtual void createOptionalSaveDefault (QHBoxLayout *layout);
31  virtual QWidget *createSubPanel ();
32  virtual void load (CmdMediator &cmdMediator);
33 
34 private slots:
35  void slotDelimitersCommas();
36  void slotDelimitersSpaces();
37  void slotDelimitersTabs();
38  void slotExclude();
39  void slotFunctionsLayoutAllCurves();
40  void slotFunctionsLayoutOneCurve();
41  void slotFunctionsPointsAllCurves();
42  void slotFunctionsPointsEvenlySpaced();
43  void slotFunctionsPointsEvenlySpacedInterval(const QString &);
44  void slotFunctionsPointsEvenlySpacedIntervalUnits(const QString &);
45  void slotFunctionsPointsFirstCurve();
46  void slotFunctionsPointsRaw();
47  void slotHeaderGnuplot();
48  void slotHeaderNone();
49  void slotHeaderSimple();
50  void slotInclude();
51  void slotListExcluded();
52  void slotListIncluded();
53  void slotRelationsPointsEvenlySpaced();
54  void slotRelationsPointsEvenlySpacedInterval(const QString &);
55  void slotRelationsPointsEvenlySpacedIntervalUnits(const QString &);
56  void slotRelationsPointsRaw();
57  void slotSaveDefault();
58  void slotTabChanged (int);
59  void slotXLabel (const QString &);
60 
61 protected:
62  virtual void handleOk ();
63 
64 private:
65 
66  void createCurveSelection (QGridLayout *layout, int &row);
67  void createDelimiters (QHBoxLayout *layoutMisc);
68  void createFileLayout (QHBoxLayout *layoutMisc);
69  void createFunctionsPointsSelection (QHBoxLayout *layout);
70  void createHeader (QHBoxLayout *layoutMisc);
71  void createPreview (QGridLayout *layout, int &row);
72  void createRelationsPointsSelection (QHBoxLayout *layout);
73  void createTabWidget (QGridLayout *layout,
74  int &row);
75  void createXLabel (QGridLayout *layoutHeader,
76  int colLabel);
77  bool goodIntervalFunctions() const;
78  bool goodIntervalRelations() const;
79  void initializeIntervalConstraints ();
80  void updateControls();
81  void updateIntervalConstraints(); // Update constraints on intervals to prevent overflows downstream (especially when value is temporarily 0)
82  void updatePreview();
83 
84  QTabWidget *m_tabWidget;
85 
86  QListWidget *m_listIncluded;
87  QListWidget *m_listExcluded;
88 
89  QPushButton *m_btnInclude;
90  QPushButton *m_btnExclude;
91 
92  QRadioButton *m_btnFunctionsPointsAllCurves;
93  QRadioButton *m_btnFunctionsPointsFirstCurve;
94  QRadioButton *m_btnFunctionsPointsEvenlySpaced;
95  QLineEdit *m_editFunctionsPointsEvenlySpacing;
96  QDoubleValidator *m_validatorFunctionsPointsEvenlySpacing;
97  QComboBox *m_cmbFunctionsPointsEvenlySpacingUnits;
98  QRadioButton *m_btnFunctionsPointsRaw;
99 
100  QRadioButton *m_btnFunctionsLayoutAllCurves;
101  QRadioButton *m_btnFunctionsLayoutOneCurve;
102 
103  QRadioButton *m_btnRelationsPointsEvenlySpaced;
104  QLineEdit *m_editRelationsPointsEvenlySpacing;
105  QDoubleValidator *m_validatorRelationsPointsEvenlySpacing;
106  QComboBox *m_cmbRelationsPointsEvenlySpacingUnits;
107  QRadioButton *m_btnRelationsPointsRaw;
108 
109  QRadioButton *m_btnDelimitersCommas;
110  QRadioButton *m_btnDelimitersSpaces;
111  QRadioButton *m_btnDelimitersTabs;
112 
113  QRadioButton *m_btnHeaderNone;
114  QRadioButton *m_btnHeaderSimple;
115  QRadioButton *m_btnHeaderGnuplot;
116 
117  QLineEdit *m_editXLabel;
118 
119  QTextEdit *m_editPreview;
120 
121  QPushButton *m_btnSaveDefault;
122 
123  DocumentModelExportFormat *m_modelExportBefore;
124  DocumentModelExportFormat *m_modelExportAfter;
125 
126  // Safe values are computed for intervals and then applied according to the current settings. This prevents
127  // accidentally generating exports with thousands of points. That causes delays and can even overflow resources
128  // with a resulting crash
129  double m_minIntervalGraph;
130  double m_minIntervalScreen;
131 };
132 
133 #endif // DLG_SETTINGS_EXPORT_FORMAT_H
virtual void handleOk()
Process slotOk.
Model for DlgSettingsExportFormat and CmdSettingsExportFormat.
virtual QWidget * createSubPanel()
Create dialog-specific panel to which base class will add Ok and Cancel buttons.
Dialog for editing exporting settings.
virtual void createOptionalSaveDefault(QHBoxLayout *layout)
Let subclass define an optional Save As Default button.
virtual void load(CmdMediator &cmdMediator)
Load settings from Document.
Command queue stack.
Definition: CmdMediator.h:16
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:66
CmdMediator & cmdMediator()
Provide access to Document information wrapped inside CmdMediator.
DlgSettingsExportFormat(MainWindow &mainWindow)
Single constructor.