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 const int COLUMN_CHECKBOX_WIDTH = 60;
00262
00263 QWidget *subPanel = new QWidget ();
00264 QGridLayout *layout = new QGridLayout (subPanel);
00265 subPanel->setLayout (layout);
00266
00267 layout->setColumnStretch(0, 1);
00268 layout->setColumnStretch(1, 0);
00269 layout->setColumnMinimumWidth(1, COLUMN_CHECKBOX_WIDTH);
00270 layout->setColumnStretch(2, 0);
00271 layout->setColumnStretch(3, 0);
00272 layout->setColumnStretch(4, 1);
00273
00274 int row = 0;
00275 createRemoveGridLines (layout, row);
00276 createPreview (layout, row);
00277
00278 return subPanel;
00279 }
00280
00281 void DlgSettingsGridRemoval::handleOk ()
00282 {
00283 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::handleOk";
00284
00285
00286 m_modelGridRemovalAfter->setStable ();
00287
00288 CmdSettingsGridRemoval *cmd = new CmdSettingsGridRemoval (mainWindow (),
00289 cmdMediator ().document(),
00290 *m_modelGridRemovalBefore,
00291 *m_modelGridRemovalAfter);
00292 cmdMediator ().push (cmd);
00293
00294 hide ();
00295 }
00296
00297 void DlgSettingsGridRemoval::load (CmdMediator &cmdMediator)
00298 {
00299 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::load";
00300
00301 setCmdMediator (cmdMediator);
00302
00303
00304 if (m_modelGridRemovalBefore != 0) {
00305 delete m_modelGridRemovalBefore;
00306 }
00307 if (m_modelGridRemovalAfter != 0) {
00308 delete m_modelGridRemovalAfter;
00309 }
00310
00311
00312 m_modelGridRemovalBefore = new DocumentModelGridRemoval (cmdMediator.document());
00313 m_modelGridRemovalAfter = new DocumentModelGridRemoval (cmdMediator.document());
00314
00315
00316 ENGAUGE_ASSERT (CLOSE_DISTANCE_MIN <= m_modelGridRemovalAfter->closeDistance());
00317 ENGAUGE_ASSERT (CLOSE_DISTANCE_MAX >= m_modelGridRemovalAfter->closeDistance());
00318
00319
00320 m_chkRemoveGridLines->setChecked (m_modelGridRemovalAfter->removeDefinedGridLines());
00321
00322 m_editCloseDistance->setText (QString::number (m_modelGridRemovalAfter->closeDistance()));
00323
00324 int indexDisableX = m_cmbDisableX->findData (QVariant (m_modelGridRemovalAfter->gridCoordDisableX()));
00325 m_cmbDisableX->setCurrentIndex (indexDisableX);
00326
00327 m_editCountX->setText(QString::number(m_modelGridRemovalAfter->countX()));
00328 m_editStartX->setText(QString::number(m_modelGridRemovalAfter->startX()));
00329 m_editStepX->setText(QString::number(m_modelGridRemovalAfter->stepX()));
00330 m_editStopX->setText(QString::number(m_modelGridRemovalAfter->stopX()));
00331
00332 int indexDisableY = m_cmbDisableY->findData (QVariant (m_modelGridRemovalAfter->gridCoordDisableY()));
00333 m_cmbDisableY->setCurrentIndex (indexDisableY);
00334
00335 m_editCountY->setText(QString::number(m_modelGridRemovalAfter->countY()));
00336 m_editStartY->setText(QString::number(m_modelGridRemovalAfter->startY()));
00337 m_editStepY->setText(QString::number(m_modelGridRemovalAfter->stepY()));
00338 m_editStopY->setText(QString::number(m_modelGridRemovalAfter->stopY()));
00339
00340 m_scenePreview->clear();
00341 m_scenePreview->addPixmap (cmdMediator.document().pixmap());
00342
00343 updateControls ();
00344 enableOk (false);
00345 updatePreview();
00346 }
00347
00348 void DlgSettingsGridRemoval::setSmallDialogs(bool smallDialogs)
00349 {
00350 if (!smallDialogs) {
00351 setMinimumHeight (MINIMUM_HEIGHT);
00352 }
00353 }
00354
00355 void DlgSettingsGridRemoval::slotCloseDistance(const QString &)
00356 {
00357 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotCloseDistance";
00358
00359 m_modelGridRemovalAfter->setCloseDistance(m_editCloseDistance->text().toDouble());
00360 updateControls ();
00361 updatePreview();
00362 }
00363
00364 void DlgSettingsGridRemoval::slotCountX(const QString &count)
00365 {
00366 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotCountX";
00367
00368 m_modelGridRemovalAfter->setCountX(count.toInt());
00369 updateControls ();
00370 updatePreview();
00371 }
00372
00373 void DlgSettingsGridRemoval::slotCountY(const QString &count)
00374 {
00375 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotCountY";
00376
00377 m_modelGridRemovalAfter->setCountY(count.toInt());
00378 updateControls ();
00379 updatePreview();
00380 }
00381
00382 void DlgSettingsGridRemoval::slotDisableX(const QString &)
00383 {
00384 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotDisableX";
00385
00386 GridCoordDisable gridCoordDisable = (GridCoordDisable) m_cmbDisableX->currentData().toInt();
00387 m_modelGridRemovalAfter->setGridCoordDisableX(gridCoordDisable);
00388 updateControls();
00389 updatePreview();
00390 }
00391
00392 void DlgSettingsGridRemoval::slotDisableY(const QString &)
00393 {
00394 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotDisableY";
00395
00396 GridCoordDisable gridCoordDisable = (GridCoordDisable) m_cmbDisableY->currentData().toInt();
00397 m_modelGridRemovalAfter->setGridCoordDisableY(gridCoordDisable);
00398 updateControls();
00399 updatePreview();
00400 }
00401
00402 void DlgSettingsGridRemoval::slotRemoveGridLines (int state)
00403 {
00404 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotRemoveGridLines";
00405
00406 m_modelGridRemovalAfter->setRemoveDefinedGridLines(state == Qt::Checked);
00407 updateControls();
00408 updatePreview();
00409 }
00410
00411 void DlgSettingsGridRemoval::slotStartX(const QString &startX)
00412 {
00413 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStartX";
00414
00415 m_modelGridRemovalAfter->setStartX(startX.toDouble());
00416 updateControls();
00417 updatePreview();
00418 }
00419
00420 void DlgSettingsGridRemoval::slotStartY(const QString &startY)
00421 {
00422 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStartY";
00423
00424 m_modelGridRemovalAfter->setStartY(startY.toDouble());
00425 updateControls();
00426 updatePreview();
00427 }
00428
00429 void DlgSettingsGridRemoval::slotStepX(const QString &stepX)
00430 {
00431 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStepX";
00432
00433 m_modelGridRemovalAfter->setStepX(stepX.toDouble());
00434 updateControls();
00435 updatePreview();
00436 }
00437
00438 void DlgSettingsGridRemoval::slotStepY(const QString &stepY)
00439 {
00440 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStepY";
00441
00442 m_modelGridRemovalAfter->setStepY(stepY.toDouble());
00443 updateControls();
00444 updatePreview();
00445 }
00446
00447 void DlgSettingsGridRemoval::slotStopX(const QString &stopX)
00448 {
00449 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStopX";
00450
00451 m_modelGridRemovalAfter->setStopX(stopX.toDouble());
00452 updateControls();
00453 updatePreview();
00454 }
00455
00456 void DlgSettingsGridRemoval::slotStopY(const QString &stopY)
00457 {
00458 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStopY";
00459
00460 m_modelGridRemovalAfter->setStopY(stopY.toDouble());
00461 updateControls();
00462 updatePreview();
00463 }
00464
00465 void DlgSettingsGridRemoval::updateControls ()
00466 {
00467 m_editCloseDistance->setEnabled (m_chkRemoveGridLines->isChecked ());
00468
00469 m_cmbDisableX->setEnabled (m_chkRemoveGridLines->isChecked ());
00470
00471 GridCoordDisable disableX = (GridCoordDisable) m_cmbDisableX->currentData().toInt();
00472 m_editCountX->setEnabled (m_chkRemoveGridLines->isChecked () && (disableX != GRID_COORD_DISABLE_COUNT));
00473 m_editStartX->setEnabled (m_chkRemoveGridLines->isChecked () && (disableX != GRID_COORD_DISABLE_START));
00474 m_editStepX->setEnabled (m_chkRemoveGridLines->isChecked () && (disableX != GRID_COORD_DISABLE_STEP));
00475 m_editStopX->setEnabled (m_chkRemoveGridLines->isChecked () && (disableX != GRID_COORD_DISABLE_STOP));
00476
00477 m_cmbDisableY->setEnabled (m_chkRemoveGridLines->isChecked ());
00478
00479 GridCoordDisable disableY = (GridCoordDisable) m_cmbDisableY->currentData().toInt();
00480 m_editCountY->setEnabled (m_chkRemoveGridLines->isChecked () && (disableY != GRID_COORD_DISABLE_COUNT));
00481 m_editStartY->setEnabled (m_chkRemoveGridLines->isChecked () && (disableY != GRID_COORD_DISABLE_START));
00482 m_editStepY->setEnabled (m_chkRemoveGridLines->isChecked () && (disableY != GRID_COORD_DISABLE_STEP));
00483 m_editStopY->setEnabled (m_chkRemoveGridLines->isChecked () && (disableY != GRID_COORD_DISABLE_STOP));
00484
00485 QString textCloseDistance = m_editCloseDistance->text();
00486 QString textCountX = m_editCountX->text();
00487 QString textStartX = m_editStartX->text();
00488 QString textStepX = m_editStepX->text();
00489 QString textStopX = m_editStopX->text();
00490 QString textCountY = m_editCountY->text();
00491 QString textStartY = m_editStartY->text();
00492 QString textStepY = m_editStepY->text();
00493 QString textStopY = m_editStopY->text();
00494
00495 int pos;
00496 bool isOk = (m_validatorCloseDistance->validate (textCloseDistance, pos) == QValidator::Acceptable) &&
00497 (m_validatorCountX->validate (textCountX, pos) == QValidator::Acceptable) &&
00498 (m_validatorStartX->validate (textStartX, pos) == QValidator::Acceptable) &&
00499 (m_validatorStepX->validate (textStepX, pos) == QValidator::Acceptable) &&
00500 (m_validatorStopX->validate (textStopX, pos) == QValidator::Acceptable) &&
00501 (m_validatorCountY->validate (textCountY, pos) == QValidator::Acceptable) &&
00502 (m_validatorStartY->validate (textStartY, pos) == QValidator::Acceptable) &&
00503 (m_validatorStepY->validate (textStepY, pos) == QValidator::Acceptable) &&
00504 (m_validatorStopY->validate (textStopY, pos) == QValidator::Acceptable);
00505 enableOk (isOk);
00506 }
00507
00508 void DlgSettingsGridRemoval::updatePreview ()
00509 {
00510
00511 }