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