VectorTab::VectorTab(ObjectStore *store, QWidget *parent) : DataTab(parent), validating(false), _mode(DataVector), _store(store), _initField(QString()), _requestID(0), _valid(false) { setupUi(this); setTabTitle(tr("Vector")); connect(_generatedVectorGroup, SIGNAL(clicked(bool)), this, SLOT(generateClicked())); connect(_dataVectorGroup, SIGNAL(clicked(bool)), this, SLOT(readFromSourceClicked())); connect(_fileName, SIGNAL(changed(QString)), this, SLOT(fileNameChanged(QString))); connect(_configure, SIGNAL(clicked()), this, SLOT(showConfigWidget())); connect(_field, SIGNAL(editTextChanged(QString)), this, SIGNAL(fieldChanged())); connect(_dataRange, SIGNAL(modified()), this, SIGNAL(modified())); connect(_numberOfSamples, SIGNAL(valueChanged(int)), this, SIGNAL(modified())); connect(_from, SIGNAL(textChanged(QString)), this, SIGNAL(modified())); connect(_to, SIGNAL(textChanged(QString)), this, SIGNAL(modified())); // embed data range in the data source box _dataRange->groupBox2->setFlat(true); _dataRange->groupBox2->setTitle(""); int top_margin; _dataRange->groupBox2->layout()->getContentsMargins(NULL,&top_margin,NULL,NULL); _dataRange->groupBox2->layout()->setContentsMargins(0,top_margin,0,0); _connect->setVisible(false); _updateBox->addItem(tr("Time Interval", "update periodically")); _updateBox->addItem(tr("Change Detection", "update when a change is detected")); _updateBox->addItem(tr("No Update", "do not update the file")); updateUpdateBox(); connect(_updateBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateTypeActivated(int))); connect(_updateBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(modified())); }
void VectorTab::sourceValid(QString filename, int requestID) { if (_requestID != requestID) { return; } _valid = true; _dataSource = DataSourcePluginManager::findOrLoadSource(_store, filename); _field->setEnabled(true); _dataSource->readLock(); _field->addItems(_dataSource->vector().list()); if (!_initField.isEmpty()) { setField(_initField); } _field->setEditable(!_dataSource->vector().isListComplete()); _configure->setEnabled(_dataSource->hasConfigWidget() && (_mode == DataVector)); updateUpdateBox(); updateIndexList(_dataSource); _dataSource->unlock(); validating = false; _store->cleanUpDataSourceList(); _field->setEnabled(_mode == DataVector); emit sourceChanged(); }
void VectorTab::setVectorMode(VectorMode mode) { _mode = mode; if (mode == DataVector) { _dataVectorGroup->setChecked(true); _dataRange->setEnabled(true); _generatedVectorGroup->setChecked(false); _field->setEnabled(_valid); _configure->setEnabled(_valid); updateUpdateBox(); } else { _generatedVectorGroup->setChecked(true); _dataVectorGroup->setChecked(false); _dataRange->setEnabled(false); } }
DataWizardPageDataSource::DataWizardPageDataSource(ObjectStore *store, QWidget *parent) : QWizardPage(parent), _pageValid(false), _store(store), _requestID(0) { setupUi(this); MainWindow::setWidgetFlags(this); connect(_url, SIGNAL(changed(const QString&)), this, SLOT(sourceChanged(const QString&))); connect(_configureSource, SIGNAL(clicked()), this, SLOT(configureSource())); QString default_source = _dialogDefaults->value("vector/datasource",".").toString(); _url->setFile(default_source); _url->setFocus(); _updateBox->addItem("Time interval"); _updateBox->addItem("Change detection"); _updateBox->addItem("Don't update"); updateUpdateBox(); connect(_updateBox, SIGNAL(activated(int)), this, SLOT(updateTypeActivated(int))); }
void DataWizardPageDataSource::sourceValid(QString filename, int requestID) { if (_requestID != requestID) { return; } _pageValid = true; _dataSource = DataSourcePluginManager::findOrLoadSource(_store, filename, true); connect(_dataSource, SIGNAL(progress(int,QString)), kstApp->mainWindow(), SLOT(updateProgress(int,QString))); _fileType->setText(_dataSource->fileType()); _dataSource->readLock(); _configureSource->setEnabled(_dataSource->hasConfigWidget()); _dataSource->unlock(); { DataSourcePtr tmpds = _dataSource; // increase usage count _store->cleanUpDataSourceList(); } updateUpdateBox(); emit completeChanged(); emit dataSourceChanged(); }