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 QWidget *createSubPanel ();
31  virtual void load (CmdMediator &cmdMediator);
32 
33 private slots:
34  void slotDelimitersCommas();
35  void slotDelimitersSpaces();
36  void slotDelimitersTabs();
37  void slotExclude();
38  void slotFunctionsLayoutAllCurves();
39  void slotFunctionsLayoutOneCurve();
40  void slotFunctionsPointsAllCurves();
41  void slotFunctionsPointsEvenlySpaced();
42  void slotFunctionsPointsEvenlySpacedInterval(const QString &);
43  void slotFunctionsPointsEvenlySpacedIntervalUnits(const QString &);
44  void slotFunctionsPointsFirstCurve();
45  void slotFunctionsPointsRaw();
46  void slotHeaderGnuplot();
47  void slotHeaderNone();
48  void slotHeaderSimple();
49  void slotInclude();
50  void slotListExcluded();
51  void slotListIncluded();
52  void slotRelationsPointsEvenlySpaced();
53  void slotRelationsPointsEvenlySpacedInterval(const QString &);
54  void slotRelationsPointsEvenlySpacedIntervalUnits(const QString &);
55  void slotRelationsPointsRaw();
56  void slotTabChanged (int);
57  void slotXLabel (const QString &);
58 
59 protected:
60  virtual void handleOk ();
61 
62 private:
63 
64  void createCurveSelection (QGridLayout *layout, int &row);
65  void createDelimiters (QHBoxLayout *layoutMisc);
66  void createFileLayout (QHBoxLayout *layoutMisc);
67  void createFunctionsPointsSelection (QHBoxLayout *layout);
68  void createHeader (QHBoxLayout *layoutMisc);
69  void createPreview (QGridLayout *layout, int &row);
70  void createRelationsPointsSelection (QHBoxLayout *layout);
71  void createTabWidget (QGridLayout *layout,
72  int &row);
73  void createXLabel (QGridLayout *layoutHeader,
74  int colLabel);
75  bool goodIntervalFunctions() const;
76  bool goodIntervalRelations() const;
77  void initializeIntervalConstraints ();
78  void updateControls();
79  void updateIntervalConstraints(); // Update constraints on intervals to prevent overflows downstream (especially when value is temporarily 0)
80  void updatePreview();
81 
82  QTabWidget *m_tabWidget;
83 
84  QListWidget *m_listIncluded;
85  QListWidget *m_listExcluded;
86 
87  QPushButton *m_btnInclude;
88  QPushButton *m_btnExclude;
89 
90  QRadioButton *m_btnFunctionsPointsAllCurves;
91  QRadioButton *m_btnFunctionsPointsFirstCurve;
92  QRadioButton *m_btnFunctionsPointsEvenlySpaced;
93  QLineEdit *m_editFunctionsPointsEvenlySpacing;
94  QDoubleValidator *m_validatorFunctionsPointsEvenlySpacing;
95  QComboBox *m_cmbFunctionsPointsEvenlySpacingUnits;
96  QRadioButton *m_btnFunctionsPointsRaw;
97 
98  QRadioButton *m_btnFunctionsLayoutAllCurves;
99  QRadioButton *m_btnFunctionsLayoutOneCurve;
100 
101  QRadioButton *m_btnRelationsPointsEvenlySpaced;
102  QLineEdit *m_editRelationsPointsEvenlySpacing;
103  QDoubleValidator *m_validatorRelationsPointsEvenlySpacing;
104  QComboBox *m_cmbRelationsPointsEvenlySpacingUnits;
105  QRadioButton *m_btnRelationsPointsRaw;
106 
107  QRadioButton *m_btnDelimitersCommas;
108  QRadioButton *m_btnDelimitersSpaces;
109  QRadioButton *m_btnDelimitersTabs;
110 
111  QRadioButton *m_btnHeaderNone;
112  QRadioButton *m_btnHeaderSimple;
113  QRadioButton *m_btnHeaderGnuplot;
114 
115  QLineEdit *m_editXLabel;
116 
117  QTextEdit *m_editPreview;
118 
119  DocumentModelExportFormat *m_modelExportBefore;
120  DocumentModelExportFormat *m_modelExportAfter;
121 
122  // Safe values are computed for intervals and then applied according to the current settings. This prevents
123  // accidentally generating exports with thousands of points. That causes delays and can even overflow resources
124  // with a resulting crash
125  double m_minIntervalGraph;
126  double m_minIntervalScreen;
127 };
128 
129 #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 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:60
CmdMediator & cmdMediator()
Provide access to Document information wrapped inside CmdMediator.
DlgSettingsExportFormat(MainWindow &mainWindow)
Single constructor.