コード例 #1
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());
}
コード例 #2
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());
}