00001
00002
00003
00004
00005
00006
00007 #include "CmdMediator.h"
00008 #include "CmdSettingsGridRemoval.h"
00009 #include "DlgSettingsGridRemoval.h"
00010 #include "EngaugeAssert.h"
00011 #include "Logger.h"
00012 #include "MainWindow.h"
00013 #include <QCheckBox>
00014 #include <QComboBox>
00015 #include <QDoubleValidator>
00016 #include <QGraphicsScene>
00017 #include <QGridLayout>
00018 #include <QGroupBox>
00019 #include <QHBoxLayout>
00020 #include <QLabel>
00021 #include <QLineEdit>
00022 #include "ViewPreview.h"
00023
00024 const double CLOSE_DISTANCE_MAX = 64;
00025 const double CLOSE_DISTANCE_MIN = 0;
00026 const int CLOSE_DECIMALS = 1;
00027 const int COUNT_MIN = 1;
00028 const int COUNT_MAX = 100;
00029 const int COUNT_DECIMALS = 0;
00030
00031 DlgSettingsGridRemoval::DlgSettingsGridRemoval(MainWindow &mainWindow) :
00032 DlgSettingsAbstractBase (tr ("Grid Removal"),
00033 "DlgSettingsGridRemoval",
00034 mainWindow),
00035 m_scenePreview (0),
00036 m_viewPreview (0),
00037 m_modelGridRemovalBefore (0),
00038 m_modelGridRemovalAfter (0)
00039 {
00040 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::DlgSettingsGridRemoval";
00041
00042 QWidget *subPanel = createSubPanel ();
00043 finishPanel (subPanel);
00044 }
00045
00046 DlgSettingsGridRemoval::~DlgSettingsGridRemoval()
00047 {
00048 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::~DlgSettingsGridRemoval";
00049 }
00050
00051 void DlgSettingsGridRemoval::createOptionalSaveDefault (QHBoxLayout * )
00052 {
00053 }
00054
00055 void DlgSettingsGridRemoval::createPreview (QGridLayout *layout, int &row)
00056 {
00057 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::createPreview";
00058
00059 QLabel *labelPreview = new QLabel (tr ("Preview"));
00060 layout->addWidget (labelPreview, row++, 0, 1, 5);
00061
00062 m_scenePreview = new QGraphicsScene (this);
00063 m_viewPreview = new ViewPreview (m_scenePreview,
00064 ViewPreview::VIEW_ASPECT_RATIO_VARIABLE,
00065 this);
00066 m_viewPreview->setWhatsThis (tr ("Preview window that shows how current settings affect grid removal"));
00067 m_viewPreview->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
00068 m_viewPreview->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
00069 m_viewPreview->setMinimumHeight (MINIMUM_PREVIEW_HEIGHT);
00070 layout->addWidget (m_viewPreview, row++, 0, 1, 5);
00071 }
00072
00073 void DlgSettingsGridRemoval::createRemoveGridLines (QGridLayout *layout, int &row)
00074 {
00075 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::createRemoveGridLines";
00076
00077 m_chkRemoveGridLines = new QCheckBox (tr ("Remove pixels close to defined grid lines"));
00078 m_chkRemoveGridLines->setWhatsThis (tr ("Check this box to have pixels close to regularly spaced gridlines removed.\n\n"
00079 "This option is only available when the axis points have all been defined."));
00080 connect (m_chkRemoveGridLines, SIGNAL (stateChanged (int)), this, SLOT (slotRemoveGridLines (int)));
00081 layout->addWidget (m_chkRemoveGridLines, row++, 1, 1, 3);
00082
00083 QLabel *labelCloseDistance = new QLabel (tr ("Close distance (pixels):"));
00084 layout->addWidget (labelCloseDistance, row, 2);
00085
00086 m_editCloseDistance = new QLineEdit;
00087 m_editCloseDistance->setWhatsThis (tr ("Set closeness distance in pixels.\n\n"
00088 "Pixels that are closer to the regularly spaced gridlines, than this distance, "
00089 "will be removed.\n\n"
00090 "This value cannot be negative. A zero value disables this feature. Decimal values are allowed"));
00091 m_validatorCloseDistance = new QDoubleValidator (CLOSE_DISTANCE_MIN, CLOSE_DISTANCE_MAX, CLOSE_DECIMALS);
00092 m_editCloseDistance->setValidator (m_validatorCloseDistance);
00093 connect (m_editCloseDistance, SIGNAL (textChanged (const QString &)), this, SLOT (slotCloseDistance (const QString &)));
00094 layout->addWidget (m_editCloseDistance, row++, 3);
00095
00096 createRemoveGridLinesX (layout, row);
00097 createRemoveGridLinesY (layout, row);
00098 }
00099
00100 void DlgSettingsGridRemoval::createRemoveGridLinesX (QGridLayout *layout, int &row)
00101 {
00102 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::createRemoveGridLinesX";
00103
00104 QString titleX = tr ("X Grid Lines");
00105 if (false) {
00106 titleX = QString (QChar (0x98, 0x03)) + QString (" %1").arg (tr ("Grid Lines"));
00107 }
00108 QGroupBox *groupX = new QGroupBox (titleX);
00109 layout->addWidget (groupX, row, 2);
00110
00111 QGridLayout *layoutGroup = new QGridLayout;
00112 groupX->setLayout (layoutGroup);
00113
00114 QLabel *labelDisable = new QLabel (tr ("Disable:"));
00115 layoutGroup->addWidget (labelDisable, 0, 0);
00116
00117 m_cmbDisableX = new QComboBox;
00118 m_cmbDisableX->setWhatsThis (tr ("Disabled value.\n\n"
00119 "The X grid lines are specified using only three values at a time. For flexibility, four values "
00120 "are offered so you must chose which value is disabled. Once disabled, that value is simply "
00121 "updated as the other values change"));
00122 m_cmbDisableX->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_COUNT),
00123 QVariant (GRID_COORD_DISABLE_COUNT));
00124 m_cmbDisableX->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_START),
00125 QVariant (GRID_COORD_DISABLE_START));
00126 m_cmbDisableX->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_STEP),
00127 QVariant (GRID_COORD_DISABLE_STEP));
00128 m_cmbDisableX->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_STOP),
00129 QVariant (GRID_COORD_DISABLE_STOP));
00130 connect (m_cmbDisableX, SIGNAL (activated (const QString &)), this, SLOT (slotDisableX (const QString &)));
00131 layoutGroup->addWidget (m_cmbDisableX, 0, 1);
00132
00133 QLabel *labelCount = new QLabel (tr ("Count:"));
00134 layoutGroup->addWidget (labelCount, 1, 0);
00135
00136 m_editCountX = new QLineEdit;
00137 m_editCountX->setWhatsThis (tr ("Number of X grid lines.\n\n"
00138 "The number of X grid lines must be entered as an integer greater than zero"));
00139 m_validatorCountX = new QDoubleValidator (COUNT_MIN, COUNT_MAX, COUNT_DECIMALS);
00140 m_editCountX->setValidator (m_validatorCountX);
00141 connect (m_editCountX, SIGNAL (textChanged (const QString &)), this, SLOT (slotCountX (const QString &)));
00142 layoutGroup->addWidget (m_editCountX, 1, 1);
00143
00144 QLabel *labelStart = new QLabel (tr ("Start:"));
00145 layoutGroup->addWidget (labelStart, 2, 0);
00146
00147 m_editStartX = new QLineEdit;
00148 m_editStartX->setWhatsThis (tr ("Value of the first X grid line.\n\n"
00149 "The start value cannot be greater than the stop value"));
00150 m_validatorStartX = new QDoubleValidator;
00151 m_editStartX->setValidator (m_validatorStartX);
00152 connect (m_editStartX, SIGNAL (textChanged (const QString &)), this, SLOT (slotStartX (const QString &)));
00153 layoutGroup->addWidget (m_editStartX, 2, 1);
00154
00155 QLabel *labelStep = new QLabel (tr ("Step:"));
00156 layoutGroup->addWidget (labelStep, 3, 0);
00157
00158 m_editStepX = new QLineEdit;
00159 m_editStepX->setWhatsThis (tr ("Difference in value between two successive X grid lines.\n\n"
00160 "The step value must be greater than zero"));
00161 m_validatorStepX = new QDoubleValidator;
00162 m_editStepX->setValidator (m_validatorStepX);
00163 connect (m_editStepX, SIGNAL (textChanged (const QString &)), this, SLOT (slotStepX (const QString &)));
00164 layoutGroup->addWidget (m_editStepX, 3, 1);
00165
00166 QLabel *labelStop = new QLabel (tr ("Stop:"));
00167 layoutGroup->addWidget (labelStop, 4, 0);
00168
00169 m_editStopX = new QLineEdit;
00170 m_editStopX->setWhatsThis (tr ("Value of the last X grid line.\n\n"
00171 "The stop value cannot be less than the start value"));
00172 m_validatorStopX = new QDoubleValidator;
00173 m_editStopX->setValidator (m_validatorStopX);
00174 connect (m_editStopX, SIGNAL (textChanged (const QString &)), this, SLOT (slotStopX (const QString &)));
00175 layoutGroup->addWidget (m_editStopX, 4, 1);
00176 }
00177
00178 void DlgSettingsGridRemoval::createRemoveGridLinesY (QGridLayout *layout, int &row)
00179 {
00180 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::createRemoveGridLinesY";
00181
00182 QString titleY = tr ("Y Grid Lines");
00183 if (false) {
00184 titleY = QString (tr ("R Grid Lines"));
00185 }
00186 QGroupBox *groupY = new QGroupBox (titleY);
00187 layout->addWidget (groupY, row++, 3);
00188
00189 QGridLayout *layoutGroup = new QGridLayout;
00190 groupY->setLayout (layoutGroup);
00191
00192 QLabel *labelDisable = new QLabel (tr ("Disable:"));
00193 layoutGroup->addWidget (labelDisable, 0, 0);
00194
00195 m_cmbDisableY = new QComboBox;
00196 m_cmbDisableY->setWhatsThis (tr ("Disabled value.\n\n"
00197 "The Y grid lines are specified using only three values at a time. For flexibility, four values "
00198 "are offered so you must chose which value is disabled. Once disabled, that value is simply "
00199 "updated as the other values change"));
00200 m_cmbDisableY->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_COUNT),
00201 QVariant (GRID_COORD_DISABLE_COUNT));
00202 m_cmbDisableY->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_START),
00203 QVariant (GRID_COORD_DISABLE_START));
00204 m_cmbDisableY->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_STEP),
00205 QVariant (GRID_COORD_DISABLE_STEP));
00206 m_cmbDisableY->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_STOP),
00207 QVariant (GRID_COORD_DISABLE_STOP));
00208 connect (m_cmbDisableY, SIGNAL (activated (const QString &)), this, SLOT (slotDisableY (const QString &)));
00209 layoutGroup->addWidget (m_cmbDisableY, 0, 1);
00210
00211 QLabel *labelCount = new QLabel (tr ("Count:"));
00212 layoutGroup->addWidget (labelCount, 1, 0);
00213
00214 m_editCountY = new QLineEdit;
00215 m_editCountY->setWhatsThis (tr ("Number of Y grid lines.\n\n"
00216 "The number of Y grid lines must be entered as an integer greater than zero"));
00217 m_validatorCountY = new QDoubleValidator (COUNT_MIN, COUNT_MAX, COUNT_DECIMALS);
00218 m_editCountY->setValidator (m_validatorCountY);
00219 connect (m_editCountY, SIGNAL (textChanged (const QString &)), this, SLOT (slotCountY (const QString &)));
00220 layoutGroup->addWidget (m_editCountY, 1, 1);
00221
00222 QLabel *labelStart = new QLabel (tr ("Start:"));
00223 layoutGroup->addWidget (labelStart, 2, 0);
00224
00225 m_editStartY = new QLineEdit;
00226 m_editStartY->setWhatsThis (tr ("Value of the first Y grid line.\n\n"
00227 "The start value cannot be greater than the stop value"));
00228 m_validatorStartY = new QDoubleValidator;
00229 m_editStartY->setValidator (m_validatorStartY);
00230 connect (m_editStartY, SIGNAL (textChanged (const QString &)), this, SLOT (slotStartY (const QString &)));
00231 layoutGroup->addWidget (m_editStartY, 2, 1);
00232
00233 QLabel *labelStep = new QLabel (tr ("Step:"));
00234 layoutGroup->addWidget (labelStep, 3, 0);
00235
00236 m_editStepY = new QLineEdit;
00237 m_editStepY->setWhatsThis (tr ("Difference in value between two successive Y grid lines.\n\n"
00238 "The step value must be greater than zero"));
00239 m_validatorStepY = new QDoubleValidator;
00240 m_editStepY->setValidator (m_validatorStepY);
00241 connect (m_editStepY, SIGNAL (textChanged (const QString &)), this, SLOT (slotStepY (const QString &)));
00242 layoutGroup->addWidget (m_editStepY, 3, 1);
00243
00244 QLabel *labelStop = new QLabel (tr ("Stop:"));
00245 layoutGroup->addWidget (labelStop, 4, 0);
00246
00247 m_editStopY = new QLineEdit;
00248 m_editStopY->setWhatsThis (tr ("Value of the last Y grid line.\n\n"
00249 "The stop value cannot be less than the start value"));
00250 m_validatorStopY = new QDoubleValidator;
00251 m_editStopY->setValidator (m_validatorStopY);
00252 connect (m_editStopY, SIGNAL (textChanged (const QString &)), this, SLOT (slotStopY (const QString &)));
00253 layoutGroup->addWidget (m_editStopY, 4, 1);
00254 }
00255
00256 QWidget *DlgSettingsGridRemoval::createSubPanel ()
00257 {
00258 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::createSubPanel";
00259
00260 const int COLUMN_CHECKBOX_WIDTH = 60;
00261
00262 QWidget *subPanel = new QWidget ();
00263 QGridLayout *layout = new QGridLayout (subPanel);
00264 subPanel->setLayout (layout);
00265
00266 layout->setColumnStretch(0, 1);
00267 layout->setColumnStretch(1, 0);
00268 layout->setColumnMinimumWidth(1, COLUMN_CHECKBOX_WIDTH);
00269 layout->setColumnStretch(2, 0);
00270 layout->setColumnStretch(3, 0);
00271 layout->setColumnStretch(4, 1);
00272
00273 int row = 0;
00274 createRemoveGridLines (layout, row);
00275 createPreview (layout, row);
00276
00277 return subPanel;
00278 }
00279
00280 void DlgSettingsGridRemoval::handleOk ()
00281 {
00282 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::handleOk";
00283
00284
00285 m_modelGridRemovalAfter->setStable ();
00286
00287 CmdSettingsGridRemoval *cmd = new CmdSettingsGridRemoval (mainWindow (),
00288 cmdMediator ().document(),
00289 *m_modelGridRemovalBefore,
00290 *m_modelGridRemovalAfter);
00291 cmdMediator ().push (cmd);
00292
00293 hide ();
00294 }
00295
00296 void DlgSettingsGridRemoval::load (CmdMediator &cmdMediator)
00297 {
00298 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::load";
00299
00300 setCmdMediator (cmdMediator);
00301
00302
00303 if (m_modelGridRemovalBefore != 0) {
00304 delete m_modelGridRemovalBefore;
00305 }
00306 if (m_modelGridRemovalAfter != 0) {
00307 delete m_modelGridRemovalAfter;
00308 }
00309
00310
00311 m_modelGridRemovalBefore = new DocumentModelGridRemoval (cmdMediator.document());
00312 m_modelGridRemovalAfter = new DocumentModelGridRemoval (cmdMediator.document());
00313
00314
00315 ENGAUGE_ASSERT (CLOSE_DISTANCE_MIN <= m_modelGridRemovalAfter->closeDistance());
00316 ENGAUGE_ASSERT (CLOSE_DISTANCE_MAX >= m_modelGridRemovalAfter->closeDistance());
00317
00318
00319 m_chkRemoveGridLines->setChecked (m_modelGridRemovalAfter->removeDefinedGridLines());
00320
00321 m_editCloseDistance->setText (QString::number (m_modelGridRemovalAfter->closeDistance()));
00322
00323 int indexDisableX = m_cmbDisableX->findData (QVariant (m_modelGridRemovalAfter->gridCoordDisableX()));
00324 m_cmbDisableX->setCurrentIndex (indexDisableX);
00325
00326 m_editCountX->setText(QString::number(m_modelGridRemovalAfter->countX()));
00327 m_editStartX->setText(QString::number(m_modelGridRemovalAfter->startX()));
00328 m_editStepX->setText(QString::number(m_modelGridRemovalAfter->stepX()));
00329 m_editStopX->setText(QString::number(m_modelGridRemovalAfter->stopX()));
00330
00331 int indexDisableY = m_cmbDisableY->findData (QVariant (m_modelGridRemovalAfter->gridCoordDisableY()));
00332 m_cmbDisableY->setCurrentIndex (indexDisableY);
00333
00334 m_editCountY->setText(QString::number(m_modelGridRemovalAfter->countY()));
00335 m_editStartY->setText(QString::number(m_modelGridRemovalAfter->startY()));
00336 m_editStepY->setText(QString::number(m_modelGridRemovalAfter->stepY()));
00337 m_editStopY->setText(QString::number(m_modelGridRemovalAfter->stopY()));
00338
00339 m_scenePreview->clear();
00340 m_scenePreview->addPixmap (cmdMediator.document().pixmap());
00341
00342 updateControls ();
00343 enableOk (false);
00344 updatePreview();
00345 }
00346
00347 void DlgSettingsGridRemoval::slotCloseDistance(const QString &)
00348 {
00349 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotCloseDistance";
00350
00351 m_modelGridRemovalAfter->setCloseDistance(m_editCloseDistance->text().toDouble());
00352 updateControls ();
00353 updatePreview();
00354 }
00355
00356 void DlgSettingsGridRemoval::slotCountX(const QString &count)
00357 {
00358 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotCountX";
00359
00360 m_modelGridRemovalAfter->setCountX(count.toInt());
00361 updateControls ();
00362 updatePreview();
00363 }
00364
00365 void DlgSettingsGridRemoval::slotCountY(const QString &count)
00366 {
00367 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotCountY";
00368
00369 m_modelGridRemovalAfter->setCountY(count.toInt());
00370 updateControls ();
00371 updatePreview();
00372 }
00373
00374 void DlgSettingsGridRemoval::slotDisableX(const QString &)
00375 {
00376 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotDisableX";
00377
00378 GridCoordDisable gridCoordDisable = (GridCoordDisable) m_cmbDisableX->currentData().toInt();
00379 m_modelGridRemovalAfter->setGridCoordDisableX(gridCoordDisable);
00380 updateControls();
00381 updatePreview();
00382 }
00383
00384 void DlgSettingsGridRemoval::slotDisableY(const QString &)
00385 {
00386 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotDisableY";
00387
00388 GridCoordDisable gridCoordDisable = (GridCoordDisable) m_cmbDisableY->currentData().toInt();
00389 m_modelGridRemovalAfter->setGridCoordDisableY(gridCoordDisable);
00390 updateControls();
00391 updatePreview();
00392 }
00393
00394 void DlgSettingsGridRemoval::slotRemoveGridLines (int state)
00395 {
00396 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotRemoveGridLines";
00397
00398 m_modelGridRemovalAfter->setRemoveDefinedGridLines(state == Qt::Checked);
00399 updateControls();
00400 updatePreview();
00401 }
00402
00403 void DlgSettingsGridRemoval::slotStartX(const QString &startX)
00404 {
00405 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStartX";
00406
00407 m_modelGridRemovalAfter->setStartX(startX.toDouble());
00408 updateControls();
00409 updatePreview();
00410 }
00411
00412 void DlgSettingsGridRemoval::slotStartY(const QString &startY)
00413 {
00414 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStartY";
00415
00416 m_modelGridRemovalAfter->setStartY(startY.toDouble());
00417 updateControls();
00418 updatePreview();
00419 }
00420
00421 void DlgSettingsGridRemoval::slotStepX(const QString &stepX)
00422 {
00423 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStepX";
00424
00425 m_modelGridRemovalAfter->setStepX(stepX.toDouble());
00426 updateControls();
00427 updatePreview();
00428 }
00429
00430 void DlgSettingsGridRemoval::slotStepY(const QString &stepY)
00431 {
00432 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStepY";
00433
00434 m_modelGridRemovalAfter->setStepY(stepY.toDouble());
00435 updateControls();
00436 updatePreview();
00437 }
00438
00439 void DlgSettingsGridRemoval::slotStopX(const QString &stopX)
00440 {
00441 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStopX";
00442
00443 m_modelGridRemovalAfter->setStopX(stopX.toDouble());
00444 updateControls();
00445 updatePreview();
00446 }
00447
00448 void DlgSettingsGridRemoval::slotStopY(const QString &stopY)
00449 {
00450 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStopY";
00451
00452 m_modelGridRemovalAfter->setStopY(stopY.toDouble());
00453 updateControls();
00454 updatePreview();
00455 }
00456
00457 void DlgSettingsGridRemoval::updateControls ()
00458 {
00459 m_editCloseDistance->setEnabled (m_chkRemoveGridLines->isChecked ());
00460
00461 m_cmbDisableX->setEnabled (m_chkRemoveGridLines->isChecked ());
00462
00463 GridCoordDisable disableX = (GridCoordDisable) m_cmbDisableX->currentData().toInt();
00464 m_editCountX->setEnabled (m_chkRemoveGridLines->isChecked () && (disableX != GRID_COORD_DISABLE_COUNT));
00465 m_editStartX->setEnabled (m_chkRemoveGridLines->isChecked () && (disableX != GRID_COORD_DISABLE_START));
00466 m_editStepX->setEnabled (m_chkRemoveGridLines->isChecked () && (disableX != GRID_COORD_DISABLE_STEP));
00467 m_editStopX->setEnabled (m_chkRemoveGridLines->isChecked () && (disableX != GRID_COORD_DISABLE_STOP));
00468
00469 m_cmbDisableY->setEnabled (m_chkRemoveGridLines->isChecked ());
00470
00471 GridCoordDisable disableY = (GridCoordDisable) m_cmbDisableY->currentData().toInt();
00472 m_editCountY->setEnabled (m_chkRemoveGridLines->isChecked () && (disableY != GRID_COORD_DISABLE_COUNT));
00473 m_editStartY->setEnabled (m_chkRemoveGridLines->isChecked () && (disableY != GRID_COORD_DISABLE_START));
00474 m_editStepY->setEnabled (m_chkRemoveGridLines->isChecked () && (disableY != GRID_COORD_DISABLE_STEP));
00475 m_editStopY->setEnabled (m_chkRemoveGridLines->isChecked () && (disableY != GRID_COORD_DISABLE_STOP));
00476
00477 QString textCloseDistance = m_editCloseDistance->text();
00478 QString textCountX = m_editCountX->text();
00479 QString textStartX = m_editStartX->text();
00480 QString textStepX = m_editStepX->text();
00481 QString textStopX = m_editStopX->text();
00482 QString textCountY = m_editCountY->text();
00483 QString textStartY = m_editStartY->text();
00484 QString textStepY = m_editStepY->text();
00485 QString textStopY = m_editStopY->text();
00486
00487 int pos;
00488 bool isOk = (m_validatorCloseDistance->validate (textCloseDistance, pos) == QValidator::Acceptable) &&
00489 (m_validatorCountX->validate (textCountX, pos) == QValidator::Acceptable) &&
00490 (m_validatorStartX->validate (textStartX, pos) == QValidator::Acceptable) &&
00491 (m_validatorStepX->validate (textStepX, pos) == QValidator::Acceptable) &&
00492 (m_validatorStopX->validate (textStopX, pos) == QValidator::Acceptable) &&
00493 (m_validatorCountY->validate (textCountY, pos) == QValidator::Acceptable) &&
00494 (m_validatorStartY->validate (textStartY, pos) == QValidator::Acceptable) &&
00495 (m_validatorStepY->validate (textStepY, pos) == QValidator::Acceptable) &&
00496 (m_validatorStopY->validate (textStopY, pos) == QValidator::Acceptable);
00497 enableOk (isOk);
00498 }
00499
00500 void DlgSettingsGridRemoval::updatePreview ()
00501 {
00502
00503 }