Engauge Digitizer 2
Loading...
Searching...
No Matches
DlgSettingsExportFormat.h
Go to the documentation of this file.
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_EXPORT_FORMAT_H
8#define DLG_SETTINGS_EXPORT_FORMAT_H
9
11
13class QCheckBox;
14class QComboBox;
15class QDoubleValidator;
16class QGridLayout;
17class QHBoxLayout;
18class QLineEdit;
19class QLabel;
20class QListWidget;
21class QPushButton;
22class QRadioButton;
23class QTabWidget;
24class QTextEdit;
25class QVBoxLayout;
26
29{
31
32public:
36
38 virtual QWidget *createSubPanel ();
39 virtual void load (CmdMediator &cmdMediator);
40 virtual void setSmallDialogs (bool smallDialogs);
41
42private slots:
43 void slotDelimitersCommas();
44 void slotDelimitersSemicolons();
45 void slotDelimitersSpaces();
46 void slotDelimitersTabs();
47 void slotExclude();
48 void slotFileExtension(const QString &);
49 void slotFunctionsExtrapolateOutsideEndpoints(int);
50 void slotFunctionsLayoutAllCurves();
51 void slotFunctionsLayoutOneCurve();
52 void slotFunctionsPointsAllCurves();
53 void slotFunctionsPointsEvenlySpaced();
54 void slotFunctionsPointsEvenlySpacedInterval(const QString &);
55 void slotFunctionsPointsEvenlySpacedIntervalUnits(const QString &);
56 void slotFunctionsPointsFirstCurve();
57 void slotFunctionsPointsGridLines();
58 void slotFunctionsPointsRaw();
59 void slotHeaderGnuplot();
60 void slotHeaderNone();
61 void slotHeaderSimple();
62 void slotInclude();
63 void slotListExcluded();
64 void slotListIncluded();
65 void slotLoadDefault();
66 void slotOverrideCsvTsv(int);
67 void slotRelationsPointsEvenlySpaced();
68 void slotRelationsPointsEvenlySpacedInterval(const QString &);
69 void slotRelationsPointsEvenlySpacedIntervalUnits(const QString &);
70 void slotRelationsPointsRaw();
71 void slotSaveDefault();
72 void slotTabChanged (int);
73 void slotXLabel (const QString &);
74
75protected:
76 virtual void handleOk ();
77
78private:
79
80 void createCurveSelection (QGridLayout *layout, int &row);
81 void createDelimiters (QHBoxLayout *layoutMisc);
82 void createFileLayout (QHBoxLayout *layoutMisc);
83 void createFunctionsPointsSelection (QHBoxLayout *layout);
84 void createHeader (QHBoxLayout *layoutMisc);
85 void createPreview (QGridLayout *layout, int &row);
86 void createRelationsPointsSelection (QHBoxLayout *layout);
87 void createTabWidget (QGridLayout *layout,
88 int &row);
89 void createXLabel (QGridLayout *layoutHeader,
90 int colLabel);
91 QString exportedTextToExportedHtml (const QString &text,
92 const QString &color) const;
93 bool goodIntervalFunctions() const;
94 bool goodIntervalRelations() const;
95 void initializeIntervalConstraints ();
96 void updateControls();
97 void updateControlsUponLoad();
98 void updateIntervalConstraints(); // Update constraints on intervals to prevent overflows downstream (especially when value is temporarily 0)
99 void updatePreview();
100
101 QTabWidget *m_tabWidget;
102
103 QListWidget *m_listIncluded;
104 QListWidget *m_listExcluded;
105
106 QPushButton *m_btnInclude;
107 QPushButton *m_btnExclude;
108
109 QRadioButton *m_btnFunctionsPointsAllCurves;
110 QRadioButton *m_btnFunctionsPointsFirstCurve;
111 QRadioButton *m_btnFunctionsPointsEvenlySpaced;
112 QLineEdit *m_editFunctionsPointsEvenlySpacing;
113 QDoubleValidator *m_validatorFunctionsPointsEvenlySpacing;
114 QComboBox *m_cmbFunctionsPointsEvenlySpacingUnits;
115 QLabel *m_lblOverflowFunctions;
116 QRadioButton *m_btnFunctionsPointsGridLines;
117 QRadioButton *m_btnFunctionsPointsRaw;
118 QCheckBox *m_chkExtrapolateOutsideEndpoints;
119
120 QRadioButton *m_btnCurvesLayoutAllCurves;
121 QRadioButton *m_btnCurvesLayoutOneCurve;
122
123 QRadioButton *m_btnRelationsPointsEvenlySpaced;
124 QLineEdit *m_editRelationsPointsEvenlySpacing;
125 QDoubleValidator *m_validatorRelationsPointsEvenlySpacing;
126 QComboBox *m_cmbRelationsPointsEvenlySpacingUnits;
127 QLabel *m_lblOverflowRelations;
128 QRadioButton *m_btnRelationsPointsRaw;
129
130 QRadioButton *m_btnDelimitersCommas;
131 QRadioButton *m_btnDelimitersSemicolons;
132 QRadioButton *m_btnDelimitersSpaces;
133 QRadioButton *m_btnDelimitersTabs;
134 QCheckBox *m_chkOverrideCsvTsv;
135
136 QRadioButton *m_btnHeaderNone;
137 QRadioButton *m_btnHeaderSimple;
138 QRadioButton *m_btnHeaderGnuplot;
139
140 QLineEdit *m_editXLabel;
141
142 QTextEdit *m_editPreview;
143
144 QComboBox *m_cmbFileExtension;
145
146 QPushButton *m_btnSaveDefault;
147 QPushButton *m_btnLoadDefault;
148
149 DocumentModelExportFormat *m_modelExportBefore;
150 DocumentModelExportFormat *m_modelExportAfter;
151
152 // Safe values are computed for intervals and then applied according to the current settings. This prevents
153 // accidentally generating exports with thousands of points. That causes delays and can even overflow resources
154 // with a resulting crash
155 double m_minIntervalGraph;
156 double m_minIntervalScreen;
157
158 bool m_haveFunction;
159 bool m_haveRelation;
160};
161
162#endif // DLG_SETTINGS_EXPORT_FORMAT_H
const int INNER_RADIUS_MIN
Command queue stack.
Definition CmdMediator.h:24
Abstract base class for all Settings dialogs.
CmdMediator & cmdMediator()
Provide access to Document information wrapped inside CmdMediator.
MainWindow & mainWindow()
Get method for MainWindow.
Dialog for editing exporting settings.
virtual void load(CmdMediator &cmdMediator)
Load settings from Document.
DlgSettingsExportFormat(MainWindow &mainWindow)
Single constructor.
virtual void setSmallDialogs(bool smallDialogs)
If false then dialogs have a minimum size so all controls are visible.
virtual QWidget * createSubPanel()
Create dialog-specific panel to which base class will add Ok and Cancel buttons.
virtual void createOptionalSaveDefault(QHBoxLayout *layout)
Let subclass define an optional Save As Default button.
virtual void handleOk()
Process slotOk.
Model for DlgSettingsExportFormat and CmdSettingsExportFormat.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition MainWindow.h:96