Engauge Digitizer  2
 All Classes Functions Variables Typedefs Enumerations Friends Pages
DlgSettingsMainWindow.cpp
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 #include "DlgSettingsMainWindow.h"
8 #include "EngaugeAssert.h"
9 #include "ImportCropping.h"
10 #include "ImportCroppingUtilBase.h"
11 #include "Logger.h"
12 #include "MainWindow.h"
13 #include "MainWindowModel.h"
14 #include <QCheckBox>
15 #include <QComboBox>
16 #include <QDoubleSpinBox>
17 #include <QGraphicsScene>
18 #include <QGridLayout>
19 #include <QGroupBox>
20 #include <QLabel>
21 #include <qmath.h>
22 #include <QPushButton>
23 #include <QSpinBox>
24 #include "QtToString.h"
25 #include "ZoomControl.h"
26 #include "ZoomFactorInitial.h"
27 #include "ZoomLabels.h"
28 
29 // Curve fitting number of significant figures should be much greater than 1 to prevent
30 // gratuitous triggering of 'matrix is inconsistent' errors, but not too much greater than
31 // the precision of floating point values which is about 7
32 const int MIN_SIGNIFICANT_DIGITS = 4;
33 const int MAX_SIGNIFICANT_DIGITS = 9;
34 
35 const int MAX_GRID_LINES_MIN = 2;
36 const int MAX_GRID_LINES_MAX = 1000;
37 const int MINIMUM_DIALOG_WIDTH_MAIN_WINDOW = 550;
38 
40  DlgSettingsAbstractBase (tr ("Main Window"),
41  "DlgSettingsMainWindow",
42  mainWindow),
43  m_modelMainWindowBefore (nullptr),
44  m_modelMainWindowAfter (nullptr)
45 {
46  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsMainWindow::DlgSettingsMainWindow";
47 
48  QWidget *subPanel = createSubPanel ();
49  finishPanel (subPanel,
50  MINIMUM_DIALOG_WIDTH_MAIN_WINDOW);
51 }
52 
53 DlgSettingsMainWindow::~DlgSettingsMainWindow()
54 {
55  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsMainWindow::~DlgSettingsMainWindow";
56 }
57 
58 void DlgSettingsMainWindow::createControls (QGridLayout *layout,
59  int &row)
60 {
61  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsMainWindow::createControls";
62 
63  const int COLUMN0 = 0;
64 
65  QLabel *labelZoomFactor = new QLabel (QString ("%1:").arg (tr ("Initial zoom")));
66  layout->addWidget (labelZoomFactor, row, 1);
67 
68  m_cmbZoomFactor = new QComboBox;
69  m_cmbZoomFactor->addItem (LABEL_ZOOM_16_TO_1 , QVariant (ZOOM_INITIAL_16_TO_1));
70  m_cmbZoomFactor->addItem (LABEL_ZOOM_8_TO_1 , QVariant (ZOOM_INITIAL_8_TO_1));
71  m_cmbZoomFactor->addItem (LABEL_ZOOM_4_TO_1 , QVariant (ZOOM_INITIAL_4_TO_1));
72  m_cmbZoomFactor->addItem (LABEL_ZOOM_2_TO_1 , QVariant (ZOOM_INITIAL_2_TO_1));
73  m_cmbZoomFactor->addItem (LABEL_ZOOM_1_TO_1 , QVariant (ZOOM_INITIAL_1_TO_1));
74  m_cmbZoomFactor->addItem (LABEL_ZOOM_1_TO_2 , QVariant (ZOOM_INITIAL_1_TO_2));
75  m_cmbZoomFactor->addItem (LABEL_ZOOM_1_TO_4 , QVariant (ZOOM_INITIAL_1_TO_4));
76  m_cmbZoomFactor->addItem (LABEL_ZOOM_1_TO_8 , QVariant (ZOOM_INITIAL_1_TO_8));
77  m_cmbZoomFactor->addItem (LABEL_ZOOM_1_TO_16 , QVariant (ZOOM_INITIAL_1_TO_16));
78  m_cmbZoomFactor->addItem (LABEL_ZOOM_FILL , QVariant (ZOOM_INITIAL_FILL));
79  m_cmbZoomFactor->addItem (LABEL_ZOOM_PREVIOUS , QVariant (ZOOM_INITIAL_PREVIOUS));
80  m_cmbZoomFactor->setWhatsThis(tr ("Initial Zoom\n\n"
81  "Select the initial zoom factor when a new document is loaded. Either the previous "
82  "zoom can be kept, or the specified zoom can be applied."));
83  connect (m_cmbZoomFactor, SIGNAL (currentTextChanged (const QString)), this, SLOT (slotZoomFactor(const QString)));
84  layout->addWidget (m_cmbZoomFactor, row++, 2);
85 
86  QLabel *labelZoomControl = new QLabel (QString ("%1:").arg (tr ("Zoom control")));
87  layout->addWidget (labelZoomControl, row, 1);
88 
89  m_cmbZoomControl = new QComboBox;
90  m_cmbZoomControl->addItem (tr ("Menu only" ), QVariant (ZOOM_CONTROL_MENU_ONLY));
91  m_cmbZoomControl->addItem (tr ("Menu and mouse wheel" ), QVariant (ZOOM_CONTROL_MENU_WHEEL));
92  m_cmbZoomControl->addItem (tr ("Menu and +/- keys" ), QVariant (ZOOM_CONTROL_MENU_PLUSMINUS));
93  m_cmbZoomControl->addItem (tr ("Menu, mouse wheel and +/- keys"), QVariant (ZOOM_CONTROL_MENU_WHEEL_PLUSMINUS));
94  m_cmbZoomControl->setWhatsThis (tr ("Zoom Control\n\n"
95  "Select which inputs are used to zoom in and out."));
96  connect (m_cmbZoomControl, SIGNAL (currentTextChanged (const QString)), this, SLOT (slotZoomControl(const QString)));
97  layout->addWidget (m_cmbZoomControl, row++, 2);
98 
99  QLabel *labelLocale = new QLabel (QString ("%1:").arg (tr ("Locale")));
100  layout->addWidget (labelLocale, row, 1);
101 
102  // Initialization of combobox is liberated from Qt Calendar example
103  m_cmbLocale = new QComboBox;
104  m_cmbLocale->setWhatsThis(tr ("Locale\n\n"
105  "Select the locale that will be used in numbers (immediately), and the language in the user "
106  "interface (after restart).\n\n"
107  "The locale determines how numbers are formatted. Specifically, either commas or "
108  "periods will be used as group delimiters in each number entered "
109  "by the user, displayed in the user interface, or exported to a file."));
110  for (int indexLang = QLocale::C; indexLang <= QLocale::LastLanguage; indexLang++) {
111  QLocale::Language lang = static_cast<QLocale::Language> (indexLang);
112  QList<QLocale::Country> countries = QLocale::countriesForLanguage(lang);
113  for (int indexCountry = 0; indexCountry < countries.count(); indexCountry++) {
114  QLocale::Country country = countries.at(indexCountry);
115  QLocale locale (lang, country);
116  QString label = QLocaleToString (locale);
117  m_cmbLocale->addItem (label, locale);
118  }
119  }
120  m_cmbLocale->model()->sort(COLUMN0); // Sort the new entries
121  connect (m_cmbLocale, SIGNAL (currentIndexChanged (int)), this, SLOT (slotLocale (int)));
122  layout->addWidget (m_cmbLocale, row++, 2);
123 
124  QLabel *labelImportCropping = new QLabel (QString ("%1:").arg (tr ("Import cropping")));
125  layout->addWidget (labelImportCropping, row, 1);
126 
127  m_cmbImportCropping = new QComboBox;
128  m_cmbImportCropping->setWhatsThis (tr ("Import Cropping\n\n"
129  "Enables or disables cropping of the imported image when importing. Cropping the image is useful "
130  "for removing unimportant information around a graph, but less useful when the graph already fills "
131  "the entire image.\n\n"
132  "This setting only has an effect when Engauge has been built with support for pdf files."));
133  ImportCroppingUtilBase importCroppingUtil;
134  m_cmbImportCropping->addItem (importCroppingUtil.importCroppingToString (IMPORT_CROPPING_NEVER), IMPORT_CROPPING_NEVER);
135  m_cmbImportCropping->addItem (importCroppingUtil.importCroppingToString (IMPORT_CROPPING_MULTIPAGE_PDFS), IMPORT_CROPPING_MULTIPAGE_PDFS);
136  m_cmbImportCropping->addItem (importCroppingUtil.importCroppingToString (IMPORT_CROPPING_ALWAYS), IMPORT_CROPPING_ALWAYS);
137  connect (m_cmbImportCropping, SIGNAL (currentIndexChanged (int)), this, SLOT (slotImportCropping (int)));
138  layout->addWidget (m_cmbImportCropping, row++, 2);
139 
140 #ifdef ENGAUGE_PDF
141  QLabel *labelPdfResolution = new QLabel (QString ("%1:").arg (tr ("Import PDF resolution (dots per inch)")));
142  layout->addWidget (labelPdfResolution, row, 1);
143 
144  m_cmbPdfResolution = new QComboBox;
145  m_cmbPdfResolution->setWhatsThis (tr ("Import PDF Resolution\n\n"
146  "Imported Portable Document Format (PDF) files will be converted to this pixel resolution "
147  "in dots per inch (DPI), where each pixel is one dot. A higher value increases the picture resolution "
148  "and may also improve numeric digitizing accuracy. However, a very high value can make the image so "
149  "large that Engauge will slow down."));
150  m_cmbPdfResolution->addItem ("75", 75);
151  m_cmbPdfResolution->addItem ("100", 100);
152  m_cmbPdfResolution->addItem ("150", 150);
153  m_cmbPdfResolution->addItem ("200", 200);
154  m_cmbPdfResolution->addItem ("250", 250);
155  m_cmbPdfResolution->addItem ("300", 300);
156  connect (m_cmbPdfResolution, SIGNAL (currentTextChanged (QString)), this, SLOT (slotPdfResolution (QString)));
157  layout->addWidget (m_cmbPdfResolution, row++, 2);
158 #endif
159 
160  QLabel *labelMaximumGridLines = new QLabel (QString ("%1:").arg (tr ("Maximum grid lines")));
161  layout->addWidget (labelMaximumGridLines, row, 1);
162 
163  m_spinMaximumGridLines = new QSpinBox;
164  m_spinMaximumGridLines->setRange (MAX_GRID_LINES_MIN, MAX_GRID_LINES_MAX);
165  m_spinMaximumGridLines->setWhatsThis (tr ("Maximum Grid Lines\n\n"
166  "Maximum number of grid lines to be processed. This limit is applied when the step value is too "
167  "small for the start and stop values, which would result in too many grid lines visually and "
168  "possibly extremely long processing time (since each grid line would have to be processed)"));
169  connect (m_spinMaximumGridLines, SIGNAL (valueChanged (int)), this, (SLOT (slotMaximumGridLines (int))));
170  layout->addWidget (m_spinMaximumGridLines, row++, 2);
171 
172  QLabel *labelHighlightOpacity = new QLabel (QString ("%1:").arg (tr ("Highlight opacity")));
173  layout->addWidget (labelHighlightOpacity, row, 1);
174 
175  m_spinHighlightOpacity = new QDoubleSpinBox;
176  m_spinHighlightOpacity->setRange (0, 1);
177  m_spinHighlightOpacity->setSingleStep (0.1);
178  m_spinHighlightOpacity->setWhatsThis (tr ("Highlight Opacity\n\n"
179  "Opacity to be applied when the cursor is over a curve or axis point in Select mode. The change in "
180  "appearance shows when the point can be selected."));
181  connect (m_spinHighlightOpacity, SIGNAL (valueChanged (double)), this, SLOT (slotHighlightOpacity(double)));
182  layout->addWidget (m_spinHighlightOpacity, row++, 2);
183 
184  QLabel *labelRecent = new QLabel (QString ("%1:").arg (tr ("Recent file list")));
185  layout->addWidget (labelRecent, row, 1);
186 
187  m_btnRecentClear = new QPushButton (tr ("Clear"));
188  m_btnRecentClear->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed);
189  m_btnRecentClear->setWhatsThis (tr ("Recent File List Clear\n\n"
190  "Clear the recent file list in the File menu."));
191  connect (m_btnRecentClear, SIGNAL (pressed ()), &mainWindow(), SLOT (slotRecentFileClear ()));
192  connect (m_btnRecentClear, SIGNAL (pressed ()), this, SLOT (slotRecentFileClear()));
193  layout->addWidget (m_btnRecentClear, row++, 2);
194 
195  QLabel *labelTitleBarFormat = new QLabel (QString ("%1:").arg (tr ("Include title bar path")));
196  layout->addWidget (labelTitleBarFormat, row, 1);
197 
198  m_chkTitleBarFormat = new QCheckBox;
199  m_chkTitleBarFormat->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed);
200  m_chkTitleBarFormat->setWhatsThis (tr ("Title Bar Filename\n\n"
201  "Includes or excludes the path and file extension from the filename in the title bar."));
202  connect (m_chkTitleBarFormat, SIGNAL (toggled (bool)), this, SLOT (slotTitleBarFormat(bool)));
203  layout->addWidget (m_chkTitleBarFormat, row++, 2);
204 
205  QLabel *labelSmallDialogs = new QLabel (QString ("%1:").arg (tr ("Allow small dialogs")));
206  layout->addWidget (labelSmallDialogs, row, 1);
207 
208  m_chkSmallDialogs = new QCheckBox;
209  m_chkSmallDialogs->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed);
210  m_chkSmallDialogs->setWhatsThis (tr ("Allow Small Dialogs\n\n"
211  "Allows settings dialogs to be made very small so they fit on small computer screens."));
212  connect (m_chkSmallDialogs, SIGNAL (toggled (bool)), this, SLOT (slotSmallDialogs (bool)));
213  layout->addWidget (m_chkSmallDialogs, row++, 2);
214 
215  QLabel *labelDragDropExport = new QLabel (QString ("%1:").arg (tr ("Allow drag and drop export")));
216  layout->addWidget (labelDragDropExport, row, 1);
217 
218  m_chkDragDropExport = new QCheckBox;
219  m_chkDragDropExport->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed);
220  m_chkDragDropExport->setWhatsThis (tr ("Allow Drag and Drop Export\n\n"
221  "Allows drag and drop export from the Curve Fitting Window and Geometry Window tables.\n\n"
222  "When drag and drop is disabled, a rectangular set of table cells can be selected using click and "
223  "drag. When drag and drop is enabled, a rectangular set of table cells can be selected using Click "
224  "then Shift+Click, since click and drag starts the drag operation."));
225  connect (m_chkDragDropExport, SIGNAL (toggled (bool)), this, SLOT (slotDragDropExport (bool)));
226  layout->addWidget (m_chkDragDropExport, row++, 2);
227 
228  QLabel *labelSignificantDigits = new QLabel (QString ("%1:").arg (tr ("Significant digits")));
229  layout->addWidget (labelSignificantDigits, row, 1);
230 
231  m_spinSignificantDigits = new QSpinBox;
232  m_spinSignificantDigits->setRange (MIN_SIGNIFICANT_DIGITS, MAX_SIGNIFICANT_DIGITS);
233  m_spinSignificantDigits->setWhatsThis (tr ("Significant Digits\n\n"
234  "Number of digits of precision in floating point numbers. This value affects "
235  "calculations for curve fits, since intermediate results smaller than a "
236  "threshold T indicate that a polynomial curve with a specific order cannot be "
237  "fitted to the data. The threshold T is computed from the maximum matrix "
238  "element M and significant digits S as T = M / 10^S."));
239  connect (m_spinSignificantDigits, SIGNAL (valueChanged (int)), this, SLOT (slotSignificantDigits (int)));
240  layout->addWidget (m_spinSignificantDigits, row++, 2);
241 }
242 
243 void DlgSettingsMainWindow::createOptionalSaveDefault (QHBoxLayout * /* layout */)
244 {
245  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsMainWindow::createOptionalSaveDefault";
246 }
247 
249 {
250  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsMainWindow::createSubPanel";
251 
252  QWidget *subPanel = new QWidget ();
253  QGridLayout *layout = new QGridLayout (subPanel);
254  subPanel->setLayout (layout);
255 
256  layout->setColumnStretch(0, 1); // Empty first column
257  layout->setColumnStretch(1, 0); // Labels
258  layout->setColumnStretch(2, 0); // Values
259  layout->setColumnStretch(3, 1); // Empty first column
260 
261  int row = 0;
262  createControls (layout, row);
263 
264  return subPanel;
265 }
266 
268 {
269  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsMainWindow::handleOk";
270 
271  mainWindow().updateSettingsMainWindow (*m_modelMainWindowAfter);
272 
273  hide ();
274 }
275 void DlgSettingsMainWindow::load (CmdMediator & /* cmdMediator */)
276 {
277  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsMainWindow::load";
278 
279  ENGAUGE_ASSERT (false);
280 }
281 
283  const MainWindowModel &modelMainWindow)
284 {
285  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsMainWindow::loadMainWindowModel";
286 
287  setCmdMediator (cmdMediator);
288 
289  // Flush old data
290  delete m_modelMainWindowBefore;
291  delete m_modelMainWindowAfter;
292 
293  // Save new data
294  m_modelMainWindowBefore = new MainWindowModel (modelMainWindow);
295  m_modelMainWindowAfter = new MainWindowModel (modelMainWindow);
296 
297  // Populate controls
298  int index = m_cmbZoomFactor->findData (m_modelMainWindowAfter->zoomFactorInitial());
299  m_cmbZoomFactor->setCurrentIndex (index);
300  index = m_cmbZoomControl->findData (m_modelMainWindowAfter->zoomControl());
301  m_cmbZoomControl->setCurrentIndex (index);
302  QString locLabel = QLocaleToString (m_modelMainWindowAfter->locale());
303  index = m_cmbLocale->findText (locLabel);
304  m_cmbLocale->setCurrentIndex(index);
305  index = m_cmbImportCropping->findData (m_modelMainWindowAfter->importCropping());
306  m_cmbImportCropping->setCurrentIndex (index);
307  m_chkTitleBarFormat->setChecked (m_modelMainWindowAfter->mainTitleBarFormat() == MAIN_TITLE_BAR_FORMAT_PATH);
308 #ifdef ENGAUGE_PDF
309  index = m_cmbPdfResolution->findData (m_modelMainWindowAfter->pdfResolution());
310  m_cmbPdfResolution->setCurrentIndex(index);
311 #endif
312  m_spinMaximumGridLines->setValue (m_modelMainWindowAfter->maximumGridLines());
313  m_spinHighlightOpacity->setValue (m_modelMainWindowAfter->highlightOpacity());
314  m_chkSmallDialogs->setChecked (m_modelMainWindowAfter->smallDialogs());
315  m_chkDragDropExport->setChecked (m_modelMainWindowAfter->dragDropExport());
316  m_spinSignificantDigits->setValue (m_modelMainWindowAfter->significantDigits ());
317 
318  updateControls ();
319  enableOk (false); // Disable Ok button since there not yet any changes
320 }
321 
322 void DlgSettingsMainWindow::setSmallDialogs(bool /* smallDialogs */)
323 {
324 }
325 
326 void DlgSettingsMainWindow::slotDragDropExport (bool)
327 {
328  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsMainWindow::slotDragDropExport";
329 
330  m_modelMainWindowAfter->setDragDropExport (m_chkDragDropExport->isChecked());
331  updateControls ();
332 }
333 
334 void DlgSettingsMainWindow::slotHighlightOpacity(double)
335 {
336  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsMainWindow::slotHighlightOpacity";
337 
338  m_modelMainWindowAfter->setHighlightOpacity (m_spinHighlightOpacity->value());
339  updateControls();
340 }
341 
342 void DlgSettingsMainWindow::slotImportCropping (int index)
343 {
344  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsMainWindow::slotImportCropping";
345 
346  m_modelMainWindowAfter->setImportCropping (static_cast<ImportCropping> (m_cmbImportCropping->itemData (index).toInt ()));
347  updateControls();
348 }
349 
350 void DlgSettingsMainWindow::slotLocale (int index)
351 {
352  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsMainWindow::slotLocale";
353 
354  m_modelMainWindowAfter->setLocale (m_cmbLocale->itemData (index).toLocale());
355  updateControls();
356 }
357 
358 void DlgSettingsMainWindow::slotMaximumGridLines (int limit)
359 {
360  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsMainWIndow::slotMaximumGridLines";
361 
362  m_modelMainWindowAfter->setMaximumGridLines (limit);
363  updateControls ();
364 }
365 
366 void DlgSettingsMainWindow::slotPdfResolution(const QString)
367 {
368  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsMainWIndow::slotPdfResolution";
369 
370 #ifdef ENGAUGE_PDF
371  m_modelMainWindowAfter->setPdfResolution(m_cmbPdfResolution->currentData().toInt());
372  updateControls();
373 #endif
374 }
375 
376 void DlgSettingsMainWindow::slotRecentFileClear()
377 {
378  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsMainWindow::slotRecentFileClear";
379 
380  // The signal that triggered the call to this method was also sent to MainWindow to clear the list there
381  updateControls();
382 }
383 
384 void DlgSettingsMainWindow::slotSignificantDigits(int)
385 {
386  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsMainWindow::slotSignificantDigits";
387 
388  m_modelMainWindowAfter->setSignificantDigits(m_spinSignificantDigits->value ());
389  updateControls ();
390 }
391 
392 void DlgSettingsMainWindow::slotSmallDialogs (bool)
393 {
394  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsMainWindow::slotSmallDialogs";
395 
396  m_modelMainWindowAfter->setSmallDialogs (m_chkSmallDialogs->isChecked());
397  updateControls ();
398 }
399 
400 void DlgSettingsMainWindow::slotTitleBarFormat(bool)
401 {
402  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsMainWindow::slotTitleBarFormat";
403 
404  m_modelMainWindowAfter->setMainTitleBarFormat(m_chkTitleBarFormat->isChecked() ?
405  MAIN_TITLE_BAR_FORMAT_PATH :
406  MAIN_TITLE_BAR_FORMAT_NO_PATH);
407  updateControls();
408 }
409 
410 void DlgSettingsMainWindow::slotZoomControl(const QString)
411 {
412  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsMainWindow::slotZoomControl";
413 
414  m_modelMainWindowAfter->setZoomControl (static_cast<ZoomControl> (m_cmbZoomControl->currentData().toInt()));
415  updateControls();
416 }
417 
418 void DlgSettingsMainWindow::slotZoomFactor(const QString)
419 {
420  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsMainWIndow::slotZoomFactor";
421 
422  m_modelMainWindowAfter->setZoomFactorInitial(static_cast<ZoomFactorInitial> (m_cmbZoomFactor->currentData().toInt()));
423  updateControls();
424 }
425 
426 void DlgSettingsMainWindow::updateControls ()
427 {
428  enableOk (true);
429 }
static QString importCroppingToString(ImportCropping importCropping)
Option as string for display to user.
virtual void createOptionalSaveDefault(QHBoxLayout *layout)
Let subclass define an optional Save As Default button.
void updateSettingsMainWindow(const MainWindowModel &modelMainWindow)
Update with new main window properties.
void setDragDropExport(bool dragDropExport)
Set method for drag and drop export.
void setSignificantDigits(int significantDigits)
Set method for significant digits.
virtual void handleOk()
Process slotOk.
MainTitleBarFormat mainTitleBarFormat() const
Get method for MainWindow titlebar filename format.
void setCmdMediator(CmdMediator &cmdMediator)
Store CmdMediator for easy access by the leaf class.
void setHighlightOpacity(double highlightOpacity)
Set method for highlight opacity.
void finishPanel(QWidget *subPanel, int minimumWidth=MINIMUM_DIALOG_WIDTH, int minimumHeightOrZero=0)
Add Ok and Cancel buttons to subpanel to get the whole dialog.
void setLocale(QLocale::Language language, QLocale::Country country)
Set method for locale given attributes.
int maximumGridLines() const
Maximum number of grid lines.
bool dragDropExport() const
Get method for drag and drop export.
void loadMainWindowModel(CmdMediator &cmdMediator, const MainWindowModel &modelMainWindow)
Replaced load method since the main window settings are independent of document, unlike other DlgSett...
bool smallDialogs() const
Get method for small dialogs flag.
virtual void load(CmdMediator &cmdMediator)
Load settings from Document.
DlgSettingsMainWindow(MainWindow &mainWindow)
Single constructor.
int significantDigits() const
Get method for significant digits.
ZoomControl zoomControl() const
Get method for zoom control.
Model for DlgSettingsMainWindow.
void setMaximumGridLines(int maximumGridLines)
Set method for maximum number of grid lines.
double highlightOpacity() const
Get method for highlight opacity.
virtual QWidget * createSubPanel()
Create dialog-specific panel to which base class will add Ok and Cancel buttons.
int pdfResolution() const
Get method for resolution of imported PDF files, in dots per inch.
Utility class for import cropping options.
virtual void setSmallDialogs(bool smallDialogs)
If false then dialogs have a minimum size so all controls are visible.
void enableOk(bool enable)
Let leaf subclass control the Ok button.
void setZoomControl(ZoomControl zoomControl)
Set method for zoom control.
void setMainTitleBarFormat(MainTitleBarFormat mainTitleBarFormat)
Set method for MainWindow titlebar filename format.
Command queue stack.
Definition: CmdMediator.h:23
void setZoomFactorInitial(ZoomFactorInitial zoomFactorInitial)
Set method for initial zoom factor.
Abstract base class for all Settings dialogs.
ZoomFactorInitial zoomFactorInitial() const
Get method for initial zoom factor.
void setSmallDialogs(bool smallDialogs)
Set method for small dialogs flag.
ImportCropping importCropping() const
Get method for import cropping.
QLocale locale() const
Get method for locale.
MainWindow & mainWindow()
Get method for MainWindow.
void setPdfResolution(int resolution)
Set method for resolution of imported PDF files, in dots per inch.
void setImportCropping(ImportCropping importCropping)
Set method for import cropping.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition: MainWindow.h:91