Engauge Digitizer  2
DlgSettingsGridRemoval.cpp
1 #include "CmdMediator.h"
2 #include "CmdSettingsGridRemoval.h"
3 #include "DlgSettingsGridRemoval.h"
4 #include "EngaugeAssert.h"
5 #include "Logger.h"
6 #include "MainWindow.h"
7 #include <QCheckBox>
8 #include <QComboBox>
9 #include <QDoubleValidator>
10 #include <QGraphicsScene>
11 #include <QGridLayout>
12 #include <QGroupBox>
13 #include <QHBoxLayout>
14 #include <QLabel>
15 #include <QLineEdit>
16 #include "ViewPreview.h"
17 
18 const double CLOSE_DISTANCE_MAX = 64;
19 const double CLOSE_DISTANCE_MIN = 0;
20 const int CLOSE_DECIMALS = 1;
21 const int COUNT_MIN = 1;
22 const int COUNT_MAX = 100;
23 const int COUNT_DECIMALS = 0;
24 
26  DlgSettingsAbstractBase ("Grid Removal",
27  "DlgSettingsGridRemoval",
28  mainWindow),
29  m_scenePreview (0),
30  m_viewPreview (0),
31  m_modelGridRemovalBefore (0),
32  m_modelGridRemovalAfter (0)
33 {
34  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::DlgSettingsGridRemoval";
35 
36  QWidget *subPanel = createSubPanel ();
37  finishPanel (subPanel);
38 }
39 
40 DlgSettingsGridRemoval::~DlgSettingsGridRemoval()
41 {
42  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::~DlgSettingsGridRemoval";
43 }
44 
45 void DlgSettingsGridRemoval::createPreview (QGridLayout *layout, int &row)
46 {
47  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::createPreview";
48 
49  QLabel *labelPreview = new QLabel ("Preview");
50  layout->addWidget (labelPreview, row++, 0, 1, 5);
51 
52  m_scenePreview = new QGraphicsScene (this);
53  m_viewPreview = new ViewPreview (m_scenePreview, this);
54  m_viewPreview->setWhatsThis (tr ("Preview window that shows how current settings affect grid removal"));
55  m_viewPreview->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
56  m_viewPreview->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
57  m_viewPreview->setMinimumHeight (MINIMUM_PREVIEW_HEIGHT);
58  layout->addWidget (m_viewPreview, row++, 0, 1, 5);
59 }
60 
61 void DlgSettingsGridRemoval::createRemoveGridLines (QGridLayout *layout, int &row)
62 {
63  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::createRemoveGridLines";
64 
65  m_chkRemoveGridLines = new QCheckBox ("Remove pixels close to defined grid lines");
66  m_chkRemoveGridLines->setWhatsThis ("Check this box to have pixels close to regularly spaced gridlines removed.\n\n"
67  "This option is only available when the axis points have all been defined.");
68  connect (m_chkRemoveGridLines, SIGNAL (stateChanged (int)), this, SLOT (slotRemoveGridLines (int)));
69  layout->addWidget (m_chkRemoveGridLines, row++, 1, 1, 3);
70 
71  QLabel *labelCloseDistance = new QLabel ("Close distance (pixels):");
72  layout->addWidget (labelCloseDistance, row, 2);
73 
74  m_editCloseDistance = new QLineEdit;
75  m_editCloseDistance->setWhatsThis ("Set closeness distance in pixels.\n\n"
76  "Pixels that are closer to the regularly spaced gridlines, than this distance, "
77  "will be removed.\n\n"
78  "This value cannot be negative. A zero value disables this feature. Decimal values are allowed");
79  m_validatorCloseDistance = new QDoubleValidator (CLOSE_DISTANCE_MIN, CLOSE_DISTANCE_MAX, CLOSE_DECIMALS);
80  m_editCloseDistance->setValidator (m_validatorCloseDistance);
81  connect (m_editCloseDistance, SIGNAL (textChanged (const QString &)), this, SLOT (slotCloseDistance (const QString &)));
82  layout->addWidget (m_editCloseDistance, row++, 3);
83 
84  createRemoveGridLinesX (layout, row);
85  createRemoveGridLinesY (layout, row);
86 }
87 
88 void DlgSettingsGridRemoval::createRemoveGridLinesX (QGridLayout *layout, int &row)
89 {
90  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::createRemoveGridLinesX";
91 
92  QString titleX = "X Grid Lines";
93  if (false) {
94  titleX = QString (QChar (0x98, 0x03)) + QString (" Grid Lines");
95  }
96  QGroupBox *groupX = new QGroupBox (titleX);
97  layout->addWidget (groupX, row, 2);
98 
99  QGridLayout *layoutGroup = new QGridLayout;
100  groupX->setLayout (layoutGroup);
101 
102  QLabel *labelDisable = new QLabel ("Disable:");
103  layoutGroup->addWidget (labelDisable, 0, 0);
104 
105  m_cmbDisableX = new QComboBox;
106  m_cmbDisableX->setWhatsThis ("Disabled value.\n\n"
107  "The X grid lines are specified using only three values at a time. For flexibility, four values "
108  "are offered so you must chose which value is disabled. Once disabled, that value is simply "
109  "updated as the other values change");
110  m_cmbDisableX->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_COUNT),
111  QVariant (GRID_COORD_DISABLE_COUNT));
112  m_cmbDisableX->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_START),
113  QVariant (GRID_COORD_DISABLE_START));
114  m_cmbDisableX->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_STEP),
115  QVariant (GRID_COORD_DISABLE_STEP));
116  m_cmbDisableX->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_STOP),
117  QVariant (GRID_COORD_DISABLE_STOP));
118  connect (m_cmbDisableX, SIGNAL (activated (const QString &)), this, SLOT (slotDisableX (const QString &))); // activated() ignores code changes
119  layoutGroup->addWidget (m_cmbDisableX, 0, 1);
120 
121  QLabel *labelCount = new QLabel ("Count:");
122  layoutGroup->addWidget (labelCount, 1, 0);
123 
124  m_editCountX = new QLineEdit;
125  m_editCountX->setWhatsThis ("Number of X grid lines.\n\n"
126  "The number of X grid lines must be entered as an integer greater than zero");
127  m_validatorCountX = new QDoubleValidator (COUNT_MIN, COUNT_MAX, COUNT_DECIMALS);
128  m_editCountX->setValidator (m_validatorCountX);
129  connect (m_editCountX, SIGNAL (textChanged (const QString &)), this, SLOT (slotCountX (const QString &)));
130  layoutGroup->addWidget (m_editCountX, 1, 1);
131 
132  QLabel *labelStart = new QLabel ("Start:");
133  layoutGroup->addWidget (labelStart, 2, 0);
134 
135  m_editStartX = new QLineEdit;
136  m_editStartX->setWhatsThis ("Value of the first X grid line.\n\n"
137  "The start value cannot be greater than the stop value");
138  m_validatorStartX = new QDoubleValidator;
139  m_editStartX->setValidator (m_validatorStartX);
140  connect (m_editStartX, SIGNAL (textChanged (const QString &)), this, SLOT (slotStartX (const QString &)));
141  layoutGroup->addWidget (m_editStartX, 2, 1);
142 
143  QLabel *labelStep = new QLabel ("Step:");
144  layoutGroup->addWidget (labelStep, 3, 0);
145 
146  m_editStepX = new QLineEdit;
147  m_editStepX->setWhatsThis ("Difference in value between two successive X grid lines.\n\n"
148  "The step value must be greater than zero");
149  m_validatorStepX = new QDoubleValidator;
150  m_editStepX->setValidator (m_validatorStepX);
151  connect (m_editStepX, SIGNAL (textChanged (const QString &)), this, SLOT (slotStepX (const QString &)));
152  layoutGroup->addWidget (m_editStepX, 3, 1);
153 
154  QLabel *labelStop = new QLabel ("Stop:");
155  layoutGroup->addWidget (labelStop, 4, 0);
156 
157  m_editStopX = new QLineEdit;
158  m_editStopX->setWhatsThis ("Value of the last X grid line.\n\n"
159  "The stop value cannot be less than the start value");
160  m_validatorStopX = new QDoubleValidator;
161  m_editStopX->setValidator (m_validatorStopX);
162  connect (m_editStopX, SIGNAL (textChanged (const QString &)), this, SLOT (slotStopX (const QString &)));
163  layoutGroup->addWidget (m_editStopX, 4, 1);
164 }
165 
166 void DlgSettingsGridRemoval::createRemoveGridLinesY (QGridLayout *layout, int &row)
167 {
168  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::createRemoveGridLinesY";
169 
170  QString titleY = "Y Grid Lines";
171  if (false) {
172  titleY = QString ("R Grid Lines");
173  }
174  QGroupBox *groupY = new QGroupBox (titleY);
175  layout->addWidget (groupY, row++, 3);
176 
177  QGridLayout *layoutGroup = new QGridLayout;
178  groupY->setLayout (layoutGroup);
179 
180  QLabel *labelDisable = new QLabel ("Disable:");
181  layoutGroup->addWidget (labelDisable, 0, 0);
182 
183  m_cmbDisableY = new QComboBox;
184  m_cmbDisableY->setWhatsThis ("Disabled value.\n\n"
185  "The Y grid lines are specified using only three values at a time. For flexibility, four values "
186  "are offered so you must chose which value is disabled. Once disabled, that value is simply "
187  "updated as the other values change");
188  m_cmbDisableY->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_COUNT),
189  QVariant (GRID_COORD_DISABLE_COUNT));
190  m_cmbDisableY->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_START),
191  QVariant (GRID_COORD_DISABLE_START));
192  m_cmbDisableY->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_STEP),
193  QVariant (GRID_COORD_DISABLE_STEP));
194  m_cmbDisableY->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_STOP),
195  QVariant (GRID_COORD_DISABLE_STOP));
196  connect (m_cmbDisableY, SIGNAL (activated (const QString &)), this, SLOT (slotDisableY (const QString &))); // activated() ignores code changes
197  layoutGroup->addWidget (m_cmbDisableY, 0, 1);
198 
199  QLabel *labelCount = new QLabel ("Count:");
200  layoutGroup->addWidget (labelCount, 1, 0);
201 
202  m_editCountY = new QLineEdit;
203  m_editCountY->setWhatsThis ("Number of Y grid lines.\n\n"
204  "The number of Y grid lines must be entered as an integer greater than zero");
205  m_validatorCountY = new QDoubleValidator (COUNT_MIN, COUNT_MAX, COUNT_DECIMALS);
206  m_editCountY->setValidator (m_validatorCountY);
207  connect (m_editCountY, SIGNAL (textChanged (const QString &)), this, SLOT (slotCountY (const QString &)));
208  layoutGroup->addWidget (m_editCountY, 1, 1);
209 
210  QLabel *labelStart = new QLabel ("Start:");
211  layoutGroup->addWidget (labelStart, 2, 0);
212 
213  m_editStartY = new QLineEdit;
214  m_editStartY->setWhatsThis ("Value of the first Y grid line.\n\n"
215  "The start value cannot be greater than the stop value");
216  m_validatorStartY = new QDoubleValidator;
217  m_editStartY->setValidator (m_validatorStartY);
218  connect (m_editStartY, SIGNAL (textChanged (const QString &)), this, SLOT (slotStartY (const QString &)));
219  layoutGroup->addWidget (m_editStartY, 2, 1);
220 
221  QLabel *labelStep = new QLabel ("Step:");
222  layoutGroup->addWidget (labelStep, 3, 0);
223 
224  m_editStepY = new QLineEdit;
225  m_editStepY->setWhatsThis ("Difference in value between two successive Y grid lines.\n\n"
226  "The step value must be greater than zero");
227  m_validatorStepY = new QDoubleValidator;
228  m_editStepY->setValidator (m_validatorStepY);
229  connect (m_editStepY, SIGNAL (textChanged (const QString &)), this, SLOT (slotStepY (const QString &)));
230  layoutGroup->addWidget (m_editStepY, 3, 1);
231 
232  QLabel *labelStop = new QLabel ("Stop:");
233  layoutGroup->addWidget (labelStop, 4, 0);
234 
235  m_editStopY = new QLineEdit;
236  m_editStopY->setWhatsThis ("Value of the last Y grid line.\n\n"
237  "The stop value cannot be less than the start value");
238  m_validatorStopY = new QDoubleValidator;
239  m_editStopY->setValidator (m_validatorStopY);
240  connect (m_editStopY, SIGNAL (textChanged (const QString &)), this, SLOT (slotStopY (const QString &)));
241  layoutGroup->addWidget (m_editStopY, 4, 1);
242 }
243 
245 {
246  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::createSubPanel";
247 
248  const int COLUMN_CHECKBOX_WIDTH = 60;
249 
250  QWidget *subPanel = new QWidget ();
251  QGridLayout *layout = new QGridLayout (subPanel);
252  subPanel->setLayout (layout);
253 
254  layout->setColumnStretch(0, 1); // Empty first column
255  layout->setColumnStretch(1, 0); // Checkbox part of "section" checkboxes. In other rows this has empty space as indentation
256  layout->setColumnMinimumWidth(1, COLUMN_CHECKBOX_WIDTH);
257  layout->setColumnStretch(2, 0); // X
258  layout->setColumnStretch(3, 0); // Y
259  layout->setColumnStretch(4, 1); // Empty last column
260 
261  int row = 0;
262  createRemoveGridLines (layout, row);
263  createPreview (layout, row);
264 
265  return subPanel;
266 }
267 
269 {
270  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::handleOk";
271 
272  // Set the stable flag
273  m_modelGridRemovalAfter->setStable ();
274 
276  cmdMediator ().document(),
277  *m_modelGridRemovalBefore,
278  *m_modelGridRemovalAfter);
279  cmdMediator ().push (cmd);
280 
281  hide ();
282 }
283 
285 {
286  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::load";
287 
288  setCmdMediator (cmdMediator);
289 
290  // Flush old data
291  if (m_modelGridRemovalBefore != 0) {
292  delete m_modelGridRemovalBefore;
293  }
294  if (m_modelGridRemovalAfter != 0) {
295  delete m_modelGridRemovalAfter;
296  }
297 
298  // Save new data
299  m_modelGridRemovalBefore = new DocumentModelGridRemoval (cmdMediator.document());
300  m_modelGridRemovalAfter = new DocumentModelGridRemoval (cmdMediator.document());
301 
302  // Sanity checks. Incoming defaults must be acceptable to the local limits
303  ENGAUGE_ASSERT (CLOSE_DISTANCE_MIN <= m_modelGridRemovalAfter->closeDistance());
304  ENGAUGE_ASSERT (CLOSE_DISTANCE_MAX >= m_modelGridRemovalAfter->closeDistance());
305 
306  // Populate controls
307  m_chkRemoveGridLines->setChecked (m_modelGridRemovalAfter->removeDefinedGridLines());
308 
309  m_editCloseDistance->setText (QString::number (m_modelGridRemovalAfter->closeDistance()));
310 
311  int indexDisableX = m_cmbDisableX->findData (QVariant (m_modelGridRemovalAfter->gridCoordDisableX()));
312  m_cmbDisableX->setCurrentIndex (indexDisableX);
313 
314  m_editCountX->setText(QString::number(m_modelGridRemovalAfter->countX()));
315  m_editStartX->setText(QString::number(m_modelGridRemovalAfter->startX()));
316  m_editStepX->setText(QString::number(m_modelGridRemovalAfter->stepX()));
317  m_editStopX->setText(QString::number(m_modelGridRemovalAfter->stopX()));
318 
319  int indexDisableY = m_cmbDisableX->findData (QVariant (m_modelGridRemovalAfter->gridCoordDisableY()));
320  m_cmbDisableY->setCurrentIndex (indexDisableY);
321 
322  m_editCountY->setText(QString::number(m_modelGridRemovalAfter->countY()));
323  m_editStartY->setText(QString::number(m_modelGridRemovalAfter->startY()));
324  m_editStepY->setText(QString::number(m_modelGridRemovalAfter->stepY()));
325  m_editStopY->setText(QString::number(m_modelGridRemovalAfter->stopY()));
326 
327  m_scenePreview->clear();
328  m_scenePreview->addPixmap (cmdMediator.document().pixmap());
329 
330  updateControls ();
331  enableOk (false); // Disable Ok button since there not yet any changes
332  updatePreview();
333 }
334 
335 void DlgSettingsGridRemoval::slotCloseDistance(const QString &)
336 {
337  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotCloseDistance";
338 
339  m_modelGridRemovalAfter->setCloseDistance(m_editCloseDistance->text().toDouble());
340  updateControls ();
341  updatePreview();
342 }
343 
344 void DlgSettingsGridRemoval::slotCountX(const QString &count)
345 {
346  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotCountX";
347 
348  m_modelGridRemovalAfter->setCountX(count.toInt());
349  updateControls ();
350  updatePreview();
351 }
352 
353 void DlgSettingsGridRemoval::slotCountY(const QString &count)
354 {
355  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotCountY";
356 
357  m_modelGridRemovalAfter->setCountY(count.toInt());
358  updateControls ();
359  updatePreview();
360 }
361 
362 void DlgSettingsGridRemoval::slotDisableX(const QString &)
363 {
364  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotDisableX";
365 
366  GridCoordDisable gridCoordDisable = (GridCoordDisable) m_cmbDisableX->currentData().toInt();
367  m_modelGridRemovalAfter->setGridCoordDisableX(gridCoordDisable);
368  updateControls();
369  updatePreview();
370 }
371 
372 void DlgSettingsGridRemoval::slotDisableY(const QString &)
373 {
374  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotDisableY";
375 
376  GridCoordDisable gridCoordDisable = (GridCoordDisable) m_cmbDisableY->currentData().toInt();
377  m_modelGridRemovalAfter->setGridCoordDisableY(gridCoordDisable);
378  updateControls();
379  updatePreview();
380 }
381 
382 void DlgSettingsGridRemoval::slotRemoveGridLines (int state)
383 {
384  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotRemoveGridLines";
385 
386  m_modelGridRemovalAfter->setRemoveDefinedGridLines(state == Qt::Checked);
387  updateControls();
388  updatePreview();
389 }
390 
391 void DlgSettingsGridRemoval::slotStartX(const QString &startX)
392 {
393  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStartX";
394 
395  m_modelGridRemovalAfter->setStartX(startX.toDouble());
396  updateControls();
397  updatePreview();
398 }
399 
400 void DlgSettingsGridRemoval::slotStartY(const QString &startY)
401 {
402  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStartY";
403 
404  m_modelGridRemovalAfter->setStartY(startY.toDouble());
405  updateControls();
406  updatePreview();
407 }
408 
409 void DlgSettingsGridRemoval::slotStepX(const QString &stepX)
410 {
411  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStepX";
412 
413  m_modelGridRemovalAfter->setStepX(stepX.toDouble());
414  updateControls();
415  updatePreview();
416 }
417 
418 void DlgSettingsGridRemoval::slotStepY(const QString &stepY)
419 {
420  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStepY";
421 
422  m_modelGridRemovalAfter->setStepY(stepY.toDouble());
423  updateControls();
424  updatePreview();
425 }
426 
427 void DlgSettingsGridRemoval::slotStopX(const QString &stopX)
428 {
429  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStopX";
430 
431  m_modelGridRemovalAfter->setStopX(stopX.toDouble());
432  updateControls();
433  updatePreview();
434 }
435 
436 void DlgSettingsGridRemoval::slotStopY(const QString &stopY)
437 {
438  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStopY";
439 
440  m_modelGridRemovalAfter->setStopY(stopY.toDouble());
441  updateControls();
442  updatePreview();
443 }
444 
445 void DlgSettingsGridRemoval::updateControls ()
446 {
447  m_editCloseDistance->setEnabled (m_chkRemoveGridLines->isChecked ());
448 
449  m_cmbDisableX->setEnabled (m_chkRemoveGridLines->isChecked ());
450 
451  GridCoordDisable disableX = (GridCoordDisable) m_cmbDisableX->currentData().toInt();
452  m_editCountX->setEnabled (m_chkRemoveGridLines->isChecked () && (disableX != GRID_COORD_DISABLE_COUNT));
453  m_editStartX->setEnabled (m_chkRemoveGridLines->isChecked () && (disableX != GRID_COORD_DISABLE_START));
454  m_editStepX->setEnabled (m_chkRemoveGridLines->isChecked () && (disableX != GRID_COORD_DISABLE_STEP));
455  m_editStopX->setEnabled (m_chkRemoveGridLines->isChecked () && (disableX != GRID_COORD_DISABLE_STOP));
456 
457  m_cmbDisableY->setEnabled (m_chkRemoveGridLines->isChecked ());
458 
459  GridCoordDisable disableY = (GridCoordDisable) m_cmbDisableY->currentData().toInt();
460  m_editCountY->setEnabled (m_chkRemoveGridLines->isChecked () && (disableY != GRID_COORD_DISABLE_COUNT));
461  m_editStartY->setEnabled (m_chkRemoveGridLines->isChecked () && (disableY != GRID_COORD_DISABLE_START));
462  m_editStepY->setEnabled (m_chkRemoveGridLines->isChecked () && (disableY != GRID_COORD_DISABLE_STEP));
463  m_editStopY->setEnabled (m_chkRemoveGridLines->isChecked () && (disableY != GRID_COORD_DISABLE_STOP));
464 
465  QString textCloseDistance = m_editCloseDistance->text();
466  QString textCountX = m_editCountX->text();
467  QString textStartX = m_editStartX->text();
468  QString textStepX = m_editStepX->text();
469  QString textStopX = m_editStopX->text();
470  QString textCountY = m_editCountY->text();
471  QString textStartY = m_editStartY->text();
472  QString textStepY = m_editStepY->text();
473  QString textStopY = m_editStopY->text();
474 
475  int pos;
476  bool isOk = (m_validatorCloseDistance->validate (textCloseDistance, pos) == QValidator::Acceptable) &&
477  (m_validatorCountX->validate (textCountX, pos) == QValidator::Acceptable) &&
478  (m_validatorStartX->validate (textStartX, pos) == QValidator::Acceptable) &&
479  (m_validatorStepX->validate (textStepX, pos) == QValidator::Acceptable) &&
480  (m_validatorStopX->validate (textStopX, pos) == QValidator::Acceptable) &&
481  (m_validatorCountY->validate (textCountY, pos) == QValidator::Acceptable) &&
482  (m_validatorStartY->validate (textStartY, pos) == QValidator::Acceptable) &&
483  (m_validatorStepY->validate (textStepY, pos) == QValidator::Acceptable) &&
484  (m_validatorStopY->validate (textStopY, pos) == QValidator::Acceptable);
485  enableOk (isOk);
486 }
487 
488 void DlgSettingsGridRemoval::updatePreview ()
489 {
490 
491 }
double closeDistance() const
Get method for close distance.
bool removeDefinedGridLines() const
Get method for removing defined grid lines.
void setCloseDistance(double closeDistance)
Set method for close distance.
double startY() const
Get method for y start.
void setCountX(int countX)
Set method for x count.
void setStopY(double stopY)
Set method for y stop.
void setCmdMediator(CmdMediator &cmdMediator)
Store CmdMediator for easy access by the leaf class.
virtual void load(CmdMediator &cmdMediator)
Load settings from Document.
void setStartY(double startY)
Set method for y start.
GridCoordDisable gridCoordDisableX() const
Get method for x coord parameter to disable.
void setStepY(double stepY)
Set method for y step.
QPixmap pixmap() const
Return the image that is being digitized.
Definition: Document.cpp:695
Document & document()
Provide the Document to commands, primarily for undo/redo processing.
Definition: CmdMediator.cpp:61
double stepY() const
Get method for y step.
GridCoordDisable gridCoordDisableY() const
Get method for y coord parameter to disable.
void setStartX(double startX)
Set method for x start.
virtual void handleOk()
Process slotOk.
void setCountY(int countY)
Set method for y count.
DlgSettingsGridRemoval(MainWindow &mainWindow)
Single constructor.
Class that modifies QGraphicsView to automatically expand/shrink the view to fit the window...
Definition: ViewPreview.h:8
void setStepX(double stepX)
Set method for x step.
double stopX() const
Get method for x stop.
void setRemoveDefinedGridLines(bool removeDefinedGridLines)
Set method for removing defined grid lines.
double startX() const
Get method for x start.
double stopY() const
Get method for y stop.
void setGridCoordDisableY(GridCoordDisable gridCoordDisable)
Set method for y coord parameter to disable.
Command for DlgSettingsGridRemoval.
void setGridCoordDisableX(GridCoordDisable gridCoordDisable)
Set method for x coord parameter to disable.
void finishPanel(QWidget *subPanel)
Add Ok and Cancel buttons to subpanel to get the whole dialog.
int countX() const
Get method for x count.
int countY() const
Get method for y count.
static int MINIMUM_PREVIEW_HEIGHT
Dialog layout constant that guarantees preview has sufficent room.
double stepX() const
Get method for x step.
void setStable()
Set the stable flag to true. This public version has no argument since it cannot be undone...
void enableOk(bool enable)
Let leaf subclass control the Ok button.
Command queue stack.
Definition: CmdMediator.h:16
Abstract base class for all Settings dialogs.
virtual QWidget * createSubPanel()
Create dialog-specific panel to which base class will add Ok and Cancel buttons.
Model for DlgSettingsGridRemoval and CmdSettingsGridRemoval. The settings are unstable until the user...
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.
void setStopX(double stopX)
Set method for x stop.