void MatrixTab::updateEnables() {
  _dataSourceGroup->setEnabled(_readFromSource->isChecked());
  _dataRangeGroup->setEnabled(_readFromSource->isChecked());
  _gradientGroup->setEnabled(_generateGradient->isChecked());

  if (_dataRangeGroup->isEnabled()) {
    _skip->setEnabled(_doSkip->isChecked());
    _doAverage->setEnabled(_doSkip->isChecked());
    xStartCountFromEndClicked();
    xNumStepsReadToEndClicked();
    yStartCountFromEndClicked();
    yNumStepsReadToEndClicked();
  }
}
Example #2
0
void KstMatrixDialogI::updateEnables() {
  _w->_dataSourceGroup->setEnabled(_w->_readFromSource->isChecked());
  _w->_dataRangeGroup->setEnabled(_w->_readFromSource->isChecked());
  _w->_gradientGroup->setEnabled(_w->_generateGradient->isChecked());
  _w->_scalingGroup->setEnabled(_w->_generateGradient->isChecked());
  _ok->setEnabled(_ok->isEnabled() || !_w->_readFromSource->isChecked());

  // also some enables for the checkboxes and spinboxes
  if (_w->_dataRangeGroup->isEnabled()) {
    _w->_skip->setEnabled(_w->_doSkip->isChecked());
    _w->_doAve->setEnabled(_w->_doSkip->isChecked());
    xStartCountFromEndClicked();
    xNumStepsReadToEndClicked();
    yStartCountFromEndClicked();
    yNumStepsReadToEndClicked();
  }
}
MatrixTab::MatrixTab(ObjectStore *store, QWidget *parent)
  : DataTab(parent), _mode(DataMatrix), _store(store), _requestID(0) {

  setupUi(this);
  setTabTitle(tr("Matrix"));

  connect(_readFromSource, SIGNAL(toggled(bool)), this, SLOT(readFromSourceChanged()));
  connect(_fileName, SIGNAL(changed(const QString &)), this, SLOT(fileNameChanged(const QString &)));
  connect(_configure, SIGNAL(clicked()), this, SLOT(showConfigWidget()));

  connect(_xStartCountFromEnd, SIGNAL(clicked()), this, SLOT(xStartCountFromEndClicked()));
  connect(_yStartCountFromEnd, SIGNAL(clicked()), this, SLOT(yStartCountFromEndClicked()));
  connect(_xNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(xNumStepsReadToEndClicked()));
  connect(_yNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(yNumStepsReadToEndClicked()));

  connect(_readFromSource, SIGNAL(clicked()), this, SLOT(updateEnables()));
  connect(_generateGradient, SIGNAL(clicked()), this, SLOT(updateEnables()));
  connect(_doSkip, SIGNAL(clicked()), this, SLOT(updateEnables()));

  connect(_xStart, SIGNAL(valueChanged(int)), this, SIGNAL(modified()));
  connect(_yStart, SIGNAL(valueChanged(int)), this, SIGNAL(modified()));
  connect(_xNumSteps, SIGNAL(valueChanged(int)), this, SIGNAL(modified()));
  connect(_yNumSteps, SIGNAL(valueChanged(int)), this, SIGNAL(modified()));
  connect(_skip, SIGNAL(valueChanged(int)), this, SIGNAL(modified()));
  connect(_nX, SIGNAL(valueChanged(int)), this, SIGNAL(modified()));
  connect(_nY, SIGNAL(valueChanged(int)), this, SIGNAL(modified()));
  connect(_gradientZAtMin, SIGNAL(textChanged(const QString&)), this, SIGNAL(modified()));
  connect(_gradientZAtMax, SIGNAL(textChanged(const QString&)), this, SIGNAL(modified()));
  connect(_minX, SIGNAL(textChanged(const QString&)), this, SIGNAL(modified()));
  connect(_minX, SIGNAL(textChanged(const QString&)), this, SIGNAL(modified()));
  connect(_xStep, SIGNAL(textChanged(const QString&)), this, SIGNAL(modified()));
  connect(_yStep, SIGNAL(textChanged(const QString&)), this, SIGNAL(modified()));
  connect(_xStartCountFromEnd, SIGNAL(clicked()), this, SIGNAL(modified()));
  connect(_yStartCountFromEnd, SIGNAL(clicked()), this, SIGNAL(modified()));
  connect(_xNumStepsReadToEnd, SIGNAL(clicked()), this, SIGNAL(modified()));
  connect(_yNumStepsReadToEnd, SIGNAL(clicked()), this, SIGNAL(modified()));
  connect(_doSkip, SIGNAL(clicked()), this, SIGNAL(modified()));
  connect(_doAverage, SIGNAL(clicked()), this, SIGNAL(modified()));
  connect(_gradientX, SIGNAL(clicked()), this, SIGNAL(modified()));
  connect(_gradientY, SIGNAL(clicked()), this, SIGNAL(modified()));

  _connect->setVisible(false);
}
Example #4
0
KstMatrixDialogI::KstMatrixDialogI(QWidget* parent, const char* name, bool modal, WFlags fl)
: KstDataDialog(parent, name, modal, fl) {
  _w = new MatrixDialogWidget(_contents);
  setMultiple(true);
  _inTest = false;
  _w->_fileName->completionObject()->setDir(QDir::currentDirPath());

  connect(_w->_readFromSource, SIGNAL(clicked()), this, SLOT(updateEnables()));
  connect(_w->_generateGradient, SIGNAL(clicked()), this, SLOT(updateEnables()));
  connect(_w->_xStartCountFromEnd, SIGNAL(clicked()), this, SLOT(xStartCountFromEndClicked()));
  connect(_w->_yStartCountFromEnd, SIGNAL(clicked()), this, SLOT(yStartCountFromEndClicked()));
  connect(_w->_xNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(xNumStepsReadToEndClicked()));
  connect(_w->_yNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(yNumStepsReadToEndClicked()));
  connect(_w->_doSkip, SIGNAL(clicked()), this, SLOT(updateEnables()));

  _w->_fileName->setMode(KFile::File | KFile::Directory | KFile::ExistingOnly);
  connect(_w->_fileName, SIGNAL(textChanged(const QString&)), this, SLOT(updateCompletion()));
  connect(_w->_configure, SIGNAL(clicked()), this, SLOT(configureSource()));
  connect(_w->_readFromSource, SIGNAL(clicked()), this, SLOT(enableSource()));
  connect(_w->_generateGradient, SIGNAL(clicked()), this, SLOT(updateEnables()));
  connect(_w->_connect, SIGNAL(clicked()), this, SLOT(testURL()));

  _w->_configure->setEnabled(false);
  _fieldCompletion = _w->_field->completionObject();
  _w->_field->setAutoDeleteCompletionObject(true);
  setFixedHeight(height());
  _configWidget = 0L;
  _w->_field->setEnabled(false);
  _ok->setEnabled(_w->_field->isEnabled());

  // connections for multiple edit mode
  connect(_w->_xStartCountFromEnd, SIGNAL(clicked()), this, SLOT(setXStartCountFromEndDirty()));
  connect(_w->_yStartCountFromEnd, SIGNAL(clicked()), this, SLOT(setYStartCountFromEndDirty()));
  connect(_w->_xNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(setXNumStepsReadToEndDirty()));
  connect(_w->_yNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(setYNumStepsReadToEndDirty()));
  connect(_w->_doSkip, SIGNAL(clicked()), this, SLOT(setDoSkipDirty()));
  connect(_w->_doAve, SIGNAL(clicked()), this, SLOT(setDoAveDirty()));

  adjustSize();
  resize(minimumSizeHint());
  setFixedHeight(height());
}
Example #5
0
KstMatrixDialog::KstMatrixDialog(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : KstDataDialog(parent) {
  _w = new Ui::MatrixDialogWidget();
  _w->setupUi(_contents);

  setMultiple(true);
  _inTest = false;
// xxx  _w->_fileName->completionObject()->setDir(QDir::currentPath());

  connect(_w->_readFromSource, SIGNAL(clicked()), this, SLOT(updateEnables()));
  connect(_w->_generateGradient, SIGNAL(clicked()), this, SLOT(updateEnables()));
  connect(_w->_xStartCountFromEnd, SIGNAL(clicked()), this, SLOT(xStartCountFromEndClicked()));
  connect(_w->_yStartCountFromEnd, SIGNAL(clicked()), this, SLOT(yStartCountFromEndClicked()));
  connect(_w->_xNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(xNumStepsReadToEndClicked()));
  connect(_w->_yNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(yNumStepsReadToEndClicked()));
  connect(_w->_doSkip, SIGNAL(clicked()), this, SLOT(updateEnables()));

// xxx  _w->_fileName->setMode(KFile::File | KFile::Directory | KFile::ExistingOnly);
// xxx  connect(_w->_fileName, SIGNAL(openFileDialog(KURLRequester *)), this, SLOT(selectFolder()));
// xxx  connect(_w->_fileName, SIGNAL(textChanged(const QString&)), this, SLOT(updateCompletion()));
  connect(_w->_configure, SIGNAL(clicked()), this, SLOT(configureSource()));
  connect(_w->_readFromSource, SIGNAL(clicked()), this, SLOT(enableSource()));
  connect(_w->_generateGradient, SIGNAL(clicked()), this, SLOT(updateEnables()));
  connect(_w->_connect, SIGNAL(clicked()), this, SLOT(testURL()));

  _w->_configure->setEnabled(false);
// xxx  _fieldCompletion = _w->_field->completionObject();
// xxx  _w->_field->setAutoDeleteCompletionObject(true);
  setFixedHeight(height());
  _configWidget = 0L;
  _w->_field->setEnabled(false);
  _ok->setEnabled(_w->_field->isEnabled());

  //
  // connections for multiple edit mode...
  //

  connect(_w->_xStartCountFromEnd, SIGNAL(clicked()), this, SLOT(setXStartCountFromEndDirty()));
  connect(_w->_yStartCountFromEnd, SIGNAL(clicked()), this, SLOT(setYStartCountFromEndDirty()));
  connect(_w->_xNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(setXNumStepsReadToEndDirty()));
  connect(_w->_yNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(setYNumStepsReadToEndDirty()));
  connect(_w->_doSkip, SIGNAL(clicked()), this, SLOT(setDoSkipDirty()));
  connect(_w->_doAve, SIGNAL(clicked()), this, SLOT(setDoAveDirty()));

  //
  // connections for apply button...
  //

// xxx  connect(_w->_fileName, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_field, SIGNAL(highlighted(int)), this, SLOT(wasModifiedApply()));
  connect(_w->_configure, SIGNAL(clicked()), this, SLOT(wasModifiedApply()));
  connect(_w->_xStart, SIGNAL(valueChanged(int)), this, SLOT(wasModifiedApply()));
  connect(_w->_yStart, SIGNAL(valueChanged(int)), this, SLOT(wasModifiedApply()));
  connect(_w->_xNumSteps, SIGNAL(valueChanged(int)), this, SLOT(wasModifiedApply()));
  connect(_w->_yNumSteps, SIGNAL(valueChanged(int)), this, SLOT(wasModifiedApply()));
// xxx  connect(_w->_xStart->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
// xxx  connect(_w->_yStart->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
// xxx  connect(_w->_xNumSteps->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
// xxx  connect(_w->_yNumSteps->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_xStartCountFromEnd, SIGNAL(clicked()), this, SLOT(wasModifiedApply()));
  connect(_w->_yStartCountFromEnd, SIGNAL(clicked()), this, SLOT(wasModifiedApply()));
  connect(_w->_xNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(wasModifiedApply()));
  connect(_w->_yNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(wasModifiedApply()));
  connect(_w->_doSkip, SIGNAL(clicked()), this, SLOT(wasModifiedApply()));
  connect(_w->_skip, SIGNAL(valueChanged(int)), this, SLOT(wasModifiedApply()));
// xxx  connect(_w->_skip->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_doAve, SIGNAL(clicked()), this, SLOT(wasModifiedApply()));
  connect(_w->_gradientX, SIGNAL(clicked()), this, SLOT(wasModifiedApply()));
  connect(_w->_gradientY, SIGNAL(clicked()), this, SLOT(wasModifiedApply()));
  connect(_w->_gradientZAtMin, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_gradientZAtMax, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_nX, SIGNAL(valueChanged(int)), this, SLOT(wasModifiedApply()));
  connect(_w->_nY, SIGNAL(valueChanged(int)), this, SLOT(wasModifiedApply()));
  connect(_w->_minX, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_minY, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_xStep, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_yStep, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));

  adjustSize();
  resize(minimumSizeHint());
  setFixedHeight(height());
}