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
12class ButtonWhatsThis;
14class QCheckBox;
15class QComboBox;
16class QDoubleValidator;
17class QGridLayout;
18class QHBoxLayout;
19class QLineEdit;
20class QLabel;
21class QListWidget;
22class QPushButton;
23class QRadioButton;
24class QTabWidget;
25class QTextEdit;
26class QVBoxLayout;
27
30{
31 Q_OBJECT;
32
33public:
37
38 virtual void createOptionalSaveDefault (QHBoxLayout *layout);
39 virtual QWidget *createSubPanel ();
40 virtual void load (CmdMediator &cmdMediator);
41 virtual void setSmallDialogs (bool smallDialogs);
42
43private slots:
44 void slotDelimitersCommas();
45 void slotDelimitersSemicolons();
46 void slotDelimitersSpaces();
47 void slotDelimitersTabs();
48 void slotExclude();
49 void slotFileExtension(const QString &);
50 void slotFunctionsExtrapolateOutsideEndpoints(int);
51 void slotFunctionsLayoutAllCurves();
52 void slotFunctionsLayoutOneCurve();
53 void slotFunctionsPointsAllCurves();
54 void slotFunctionsPointsEvenlySpaced();
55 void slotFunctionsPointsEvenlySpacedInterval(const QString &);
56 void slotFunctionsPointsEvenlySpacedIntervalUnits(const QString &);
57 void slotFunctionsPointsFirstCurve();
58 void slotFunctionsPointsGridLines();
59 void slotFunctionsPointsRaw();
60 void slotHeaderGnuplot();
61 void slotHeaderNone();
62 void slotHeaderSimple();
63 void slotInclude();
64 void slotListExcluded();
65 void slotListIncluded();
66 void slotLoadDefault();
67 void slotOverrideCsvTsv(int);
68 void slotRelationsPointsEvenlySpaced();
69 void slotRelationsPointsEvenlySpacedInterval(const QString &);
70 void slotRelationsPointsEvenlySpacedIntervalUnits(const QString &);
71 void slotRelationsPointsRaw();
72 void slotSaveDefault();
73 void slotTabChanged (int);
74 void slotWhatsThis();
75 void slotXLabel (const QString &);
76
77protected:
78 virtual void handleOk ();
79
80private:
81
82 void createCurveSelection (QGridLayout *layout, int &row);
83 void createDelimiters (QHBoxLayout *layoutMisc);
84 void createFileLayout (QHBoxLayout *layoutMisc);
85 void createFunctionsPointsSelection (QHBoxLayout *layout);
86 void createHeader (QHBoxLayout *layoutMisc);
87 void createPreview (QGridLayout *layout, int &row);
88 void createRelationsPointsSelection (QHBoxLayout *layout);
89 void createTabWidget (QGridLayout *layout,
90 int &row);
91 void createXLabel (QGridLayout *layoutHeader,
92 int colLabel);
93 QString exportedTextToExportedHtml (const QString &text,
94 const QString &color) const;
95 bool goodIntervalFunctions() const;
96 bool goodIntervalRelations() const;
97 void initializeIntervalConstraints ();
98 void updateControls();
99 void updateControlsUponLoad();
100 void updateIntervalConstraints(); // Update constraints on intervals to prevent overflows downstream (especially when value is temporarily 0)
101 void updatePreview();
102
103 ButtonWhatsThis *m_btnWhatsThis;
104
105 QTabWidget *m_tabWidget;
106
107 QListWidget *m_listIncluded;
108 QListWidget *m_listExcluded;
109
110 QPushButton *m_btnInclude;
111 QPushButton *m_btnExclude;
112
113 QRadioButton *m_btnFunctionsPointsAllCurves;
114 QRadioButton *m_btnFunctionsPointsFirstCurve;
115 QRadioButton *m_btnFunctionsPointsEvenlySpaced;
116 QLineEdit *m_editFunctionsPointsEvenlySpacing;
117 QDoubleValidator *m_validatorFunctionsPointsEvenlySpacing;
118 QComboBox *m_cmbFunctionsPointsEvenlySpacingUnits;
119 QLabel *m_lblOverflowFunctions;
120 QRadioButton *m_btnFunctionsPointsGridLines;
121 QRadioButton *m_btnFunctionsPointsRaw;
122 QCheckBox *m_chkExtrapolateOutsideEndpoints;
123
124 QRadioButton *m_btnCurvesLayoutAllCurves;
125 QRadioButton *m_btnCurvesLayoutOneCurve;
126
127 QRadioButton *m_btnRelationsPointsEvenlySpaced;
128 QLineEdit *m_editRelationsPointsEvenlySpacing;
129 QDoubleValidator *m_validatorRelationsPointsEvenlySpacing;
130 QComboBox *m_cmbRelationsPointsEvenlySpacingUnits;
131 QLabel *m_lblOverflowRelations;
132 QRadioButton *m_btnRelationsPointsRaw;
133
134 QRadioButton *m_btnDelimitersCommas;
135 QRadioButton *m_btnDelimitersSemicolons;
136 QRadioButton *m_btnDelimitersSpaces;
137 QRadioButton *m_btnDelimitersTabs;
138 QCheckBox *m_chkOverrideCsvTsv;
139
140 QRadioButton *m_btnHeaderNone;
141 QRadioButton *m_btnHeaderSimple;
142 QRadioButton *m_btnHeaderGnuplot;
143
144 QLineEdit *m_editXLabel;
145
146 QTextEdit *m_editPreview;
147
148 QComboBox *m_cmbFileExtension;
149
150 QPushButton *m_btnSaveDefault;
151 QPushButton *m_btnLoadDefault;
152
153 DocumentModelExportFormat *m_modelExportBefore;
154 DocumentModelExportFormat *m_modelExportAfter;
155
156 // Safe values are computed for intervals and then applied according to the current settings. This prevents
157 // accidentally generating exports with thousands of points. That causes delays and can even overflow resources
158 // with a resulting crash
159 double m_minIntervalGraph;
160 double m_minIntervalScreen;
161
162 bool m_haveFunction;
163 bool m_haveRelation;
164};
165
166#endif // DLG_SETTINGS_EXPORT_FORMAT_H
Unobtrusive button to trigger QWhatsThis since some operating systems (Linux Mint) do not show WhatsT...
Command queue stack.
Definition CmdMediator.h:24
DlgSettingsAbstractBase(const QString &title, const QString &dialogName, MainWindow &mainWindow)
Single constructor.
CmdMediator & cmdMediator()
Provide access to Document information wrapped inside CmdMediator.
MainWindow & mainWindow()
Get method for MainWindow.
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:95