示例#1
0
KstVectorDialogI::KstVectorDialogI(QWidget* parent, Qt::WindowFlags fl)
: KstDataDialog(parent, fl) {

  _w = new Ui::KstVectorDialog;
  _w->setupUi(_contents);

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

  _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->_generateX, SIGNAL(clicked()), this, SLOT(enableGenerate()));
  connect(_w->_connect, SIGNAL(clicked()), this, SLOT(testUrl()));

  // connections for multiple edit mode
  connect(_w->_kstDataRange->CountFromEnd, SIGNAL(clicked()), this, SLOT(setCountFromEndDirty()));
  connect(_w->_kstDataRange->ReadToEnd, SIGNAL(clicked()), this, SLOT(setReadToEndDirty()));
  connect(_w->_kstDataRange->DoFilter, SIGNAL(clicked()), this, SLOT(setDoFilterDirty()));
  connect(_w->_kstDataRange->DoSkip, SIGNAL(clicked()), this, SLOT(setDoSkipDirty()));

  _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());
  _legendLabel->hide();
  _legendText->hide();
}
KstVectorDialogI::KstVectorDialogI(QWidget* parent, const char* name,
                                   bool modal, WFlags fl)
: KstDataDialog(parent, name, modal, fl) {
  _w = new VectorDialogWidget(_contents);
  setMultiple(true);
  _inTest = false;
  _w->FileName->completionObject()->setDir(QDir::currentDirPath());

  _w->FileName->setMode(KFile::File | KFile::Directory | KFile::ExistingOnly);
  connect(_w->FileName, SIGNAL(openFileDialog(KURLRequester *)), this, SLOT(selectFolder()));
  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->_generateX, SIGNAL(clicked()), this, SLOT(enableGenerate()));
  connect(_w->_connect, SIGNAL(clicked()), this, SLOT(testURL()));

  // connections for multiple edit mode
  connect(_w->_kstDataRange->CountFromEnd, SIGNAL(clicked()), this, SLOT(setCountFromEndDirty()));
  connect(_w->_kstDataRange->ReadToEnd, SIGNAL(clicked()), this, SLOT(setReadToEndDirty()));
  connect(_w->_kstDataRange->DoFilter, SIGNAL(clicked()), this, SLOT(setDoFilterDirty()));
  connect(_w->_kstDataRange->DoSkip, SIGNAL(clicked()), this, SLOT(setDoSkipDirty()));

  // for apply button
  connect(_w->_readFromSource, SIGNAL(clicked()), this, SLOT(wasModifiedApply()));
  connect(_w->_generateX, SIGNAL(clicked()), this, SLOT(wasModifiedApply()));
  connect(_w->_configure, SIGNAL(clicked()), this, SLOT(wasModifiedApply()));
  connect(_w->FileName, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->Field, SIGNAL(highlighted(int)), this, SLOT(wasModifiedApply()));
  connect(_w->Field, SIGNAL(completion(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_N, SIGNAL(valueChanged(int)), this, SLOT(wasModifiedApply()));
  connect(_w->_N->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_xMin, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_xMax, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_kstDataRange->F0, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_kstDataRange->_startUnits, SIGNAL(highlighted(int)), this, SLOT(wasModifiedApply()));
  connect(_w->_kstDataRange->N, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply()));
  connect(_w->_kstDataRange->_rangeUnits, SIGNAL(highlighted(int)), this, SLOT(wasModifiedApply()));
  connect(_w->_kstDataRange->CountFromEnd, SIGNAL(clicked()), this, SLOT(wasModifiedApply()));
  connect(_w->_kstDataRange->ReadToEnd, SIGNAL(clicked()), this, SLOT(wasModifiedApply()));
  connect(_w->_kstDataRange->DoSkip, SIGNAL(clicked()), this, SLOT(wasModifiedApply()));
  connect(_w->_kstDataRange->Skip, SIGNAL(valueChanged(int)), this, SLOT(wasModifiedApply()));
  connect(_w->_kstDataRange->DoFilter, SIGNAL(clicked()), this, SLOT(wasModifiedApply()));

  _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());
  _legendLabel->hide();
  _legendText->hide();
}