void KstMatrixDialog::fillFieldsForEdit() { KstMatrixPtr mp; mp = kst_cast<KstMatrix>(_dp); if (mp) { KstRMatrixPtr rmp; mp->readLock(); _tagName->setText(mp->tagName()); _w->_minX->setText(QString::number(mp->minX())); _w->_minY->setText(QString::number(mp->minY())); _w->_xStep->setText(QString::number(mp->xStepSize())); _w->_yStep->setText(QString::number(mp->yStepSize())); mp->unlock(); _w->_sourceGroup->hide(); rmp = kst_cast<KstRMatrix>(mp); if (rmp) { fillFieldsForRMatrixEdit(); } else { fillFieldsForSMatrixEdit(); } updateEnables(); adjustSize(); resize(minimumSizeHint()); setFixedHeight(height()); } }
void KstImageDialogI::fillFieldsForNew() { KstImageList images = kstObjectSubList<KstDataObject, KstImage>(KST::dataObjectList); // set tag name _tagName->setText("<New_Image>"); _w->_colorPalette->refresh(); // some default values _w->_lowerZ->setText("0"); _w->_upperZ->setText("100"); _w->_realTimeAutoThreshold->setChecked(true); // let the image be placed in plots _w->_curvePlacement->update(); // for some reason the widgets need to be placed from bottom to top _w->_imageTypeGroup->hide(); _w->_contourMapGroup->hide(); _w->_colorMapGroup->hide(); _w->_matrixGroup->hide(); _w->_curvePlacement->show(); _w->_contourMapGroup->show(); _w->_colorMapGroup->show(); _w->_imageTypeGroup->show(); _w->_matrixGroup->show(); // use whatever setting was used last updateGroups(); updateEnables(); _w->_colorPalette->updatePalette(_w->_colorPalette->selectedPalette()); adjustSize(); resize(minimumSizeHint()); setFixedHeight(height()); }
void KstImageDialogI::fillFieldsForEditNoUpdate() { KstImagePtr ip = kst_cast<KstImage>(_dp); if (!ip) { return; // shouldn't be needed } KstImageList images = kstObjectSubList<KstDataObject, KstImage>(KST::dataObjectList); ip->readLock(); // fill in the tag name _tagName->setText(ip->tagName()); // fill in the other parameters _w->_lowerZ->setText(QString::number(ip->lowerThreshold())); _w->_upperZ->setText(QString::number(ip->upperThreshold())); _w->_realTimeAutoThreshold->setChecked(ip->autoThreshold()); _w->_colorPalette->refresh(ip->paletteName()); _w->_numContourLines->setValue(ip->numContourLines()); _w->_contourColor->setColor(ip->contourColor()); int tempWeight = ip->contourWeight(); _w->_useVariableWeight->setChecked(tempWeight == -1); if (tempWeight >= 0) { _w->_contourWeight->setValue(tempWeight); } ip->unlock(); //don't place the image in edits _w->_curvePlacement->hide(); updateEnables(); }
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); }
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()); }
/* * Common function to add ite at given index */ void MovieSequenceForm::addAtIndex(int index) { MovieSegment segment; mvMovieGetSegment(segment); if (index >= mSegments->size()) mSegments->push_back(segment); else mSegments->insert(mSegments->begin() + index, segment); loadTable(); table->selectRow(index); updateEnables(mMovieEnabled, mMakingMovie); mModified = true; }
KstImageDialogI::KstImageDialogI(QWidget* parent, const char* name, bool modal, WFlags fl) : KstDataDialog(parent, name, modal, fl) { _w = new ImageDialogWidget(_contents); setMultiple(true); connect(_w->_matrix, SIGNAL(newMatrixCreated(const QString&)), this, SIGNAL(modified())); connect(_w->_autoThreshold, SIGNAL(clicked()), this, SLOT(calcAutoThreshold())); connect(_w->_smartThreshold, SIGNAL(clicked()), this, SLOT(calcSmartThreshold())); connect(_w->_colorOnly, SIGNAL(clicked()), this, SLOT(updateGroups())); connect(_w->_contourOnly, SIGNAL(clicked()), this, SLOT(updateGroups())); connect(_w->_colorAndContour, SIGNAL(clicked()), this, SLOT(updateGroups())); connect(_w->_useVariableWeight, SIGNAL(clicked()), this, SLOT(updateEnables())); connect(_w->_realTimeAutoThreshold, SIGNAL(clicked()), this, SLOT(updateEnables())); // for multiple edit mode connect(_w->_colorOnly, SIGNAL(clicked()), this, SLOT(setColorOnlyDirty())); connect(_w->_contourOnly, SIGNAL(clicked()), this, SLOT(setContourOnlyDirty())); connect(_w->_colorAndContour, SIGNAL(clicked()), this, SLOT(setColorAndContourDirty())); connect(_w->_realTimeAutoThreshold, SIGNAL(clicked()), this, SLOT(setRealTimeAutoThresholdDirty())); connect(_w->_useVariableWeight, SIGNAL(clicked()), this, SLOT(setUseVariableWeightDirty())); connect(_w->_contourColor, SIGNAL(clicked()), this, SLOT(setContourColorDirty())); }
/* * Delete current item */ void MovieSequenceForm::deleteClicked() { int index = table->currentRow(); if (index < 0 || index >= mSegments->size()) return; mSegments->erase(mSegments->begin() + index); loadTable(); if (index >= mSegments->size()) index = mSegments->size() - 1; if (index >= 0) table->selectRow(index); updateEnables(mMovieEnabled, mMakingMovie); mModified = true; }
void KstMatrixDialog::fillFieldsForNew() { _tagName->setText("<New_Matrix>"); // // set defaults using KstMatrixDefaults... // KST::matrixDefaults.sync(); // xxx _w->_fileName->setURL(KST::matrixDefaults.dataSource()); _w->_minX->setText("0"); _w->_minY->setText("1"); _w->_xStep->setText("1"); _w->_yStep->setText("1"); _w->_nX->setValue(100); _w->_nY->setValue(100); _w->_xStart->setValue(KST::matrixDefaults.xStart()); _w->_yStart->setValue(KST::matrixDefaults.yStart()); _w->_xNumSteps->setValue(KST::matrixDefaults.xNumSteps()); _w->_yNumSteps->setValue(KST::matrixDefaults.yNumSteps()); _w->_gradientZAtMin->setText("0"); _w->_gradientZAtMax->setText("100"); _w->_xStartCountFromEnd->setChecked(KST::matrixDefaults.xCountFromEnd()); _w->_yStartCountFromEnd->setChecked(KST::matrixDefaults.yCountFromEnd()); _w->_xNumStepsReadToEnd->setChecked(KST::matrixDefaults.xReadToEnd()); _w->_yNumStepsReadToEnd->setChecked(KST::matrixDefaults.yReadToEnd()); _w->_doSkip->setChecked(KST::matrixDefaults.doSkip()); _w->_doAve->setChecked(KST::matrixDefaults.doAverage()); _w->_skip->setValue(KST::matrixDefaults.skip()); _w->_gradientX->setChecked(true); _w->_gradientY->setChecked(false); _w->_sourceGroup->show(); _w->_dataSourceGroup->show(); _w->_dataRangeGroup->show(); _w->_gradientGroup->show(); _w->_scalingGroup->show(); _w->_readFromSource->setChecked(true); updateEnables(); adjustSize(); resize(minimumSizeHint()); setFixedHeight(height()); }
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()); }
void KstImageDialogI::setUseVariableWeightDirty() { _w->_useVariableWeight->setTristate(false); _useVariableWeightDirty = true; updateEnables(); }
void KstImageDialogI::setRealTimeAutoThresholdDirty() { _w->_realTimeAutoThreshold->setTristate(false); _realTimeAutoThresholdDirty = true; updateEnables(); }