VectorSelector::VectorSelector(QWidget *parent, ObjectStore *store) : QWidget(parent), _allowEmptySelection(false), _isX(false), _store(store) { setupUi(this); int size = style()->pixelMetric(QStyle::PM_SmallIconSize); _newVector->setIcon(KstGetIcon("kst_vectornew")); _editVector->setIcon(KstGetIcon("kst_vectoredit")); _newVector->setFixedSize(iconWidth(), iconWidth()); _editVector->setFixedSize(iconWidth(), iconWidth()); fillVectors(); connect(_newVector, SIGNAL(pressed()), this, SLOT(newVector())); connect(_editVector, SIGNAL(pressed()), this, SLOT(editVector())); connect(_vector, SIGNAL(activated(int)), this, SLOT(emitSelectionChanged())); connect(_vector, SIGNAL(currentIndexChanged(int)), this, SLOT(updateDescriptionTip())); connect(UpdateServer::self(), SIGNAL(objectListsChanged()), this, SLOT(fillVectors())); }
ChangeFileDialog::ChangeFileDialog(QWidget *parent) : QDialog(parent), _dataSource(0), _requestID(0) { setupUi(this); MainWindow::setWidgetFlags(this); if (MainWindow *mw = qobject_cast<MainWindow*>(parent)) { _store = mw->document()->objectStore(); } else { // FIXME: we need the object store qFatal("ERROR: can't construct a ChangeFileDialog without the object store"); } connect(_add, SIGNAL(clicked()), this, SLOT(addButtonClicked())); connect(_remove, SIGNAL(clicked()), this, SLOT(removeButtonClicked())); connect(_removeAll, SIGNAL(clicked()), this, SLOT(removeAll())); connect(_addAll, SIGNAL(clicked()), this, SLOT(addAll())); connect(_changeFilePrimitiveList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(availableDoubleClicked(QListWidgetItem*))); connect(_selectedFilePrimitiveList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(selectedDoubleClicked(QListWidgetItem*))); connect(_allFromFile, SIGNAL(clicked()), this, SLOT(selectAllFromFile())); connect(_changeFilePrimitiveList, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons())); connect(_selectedFilePrimitiveList, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons())); connect(_duplicateSelected, SIGNAL(toggled(bool)), _duplicateDependents, SLOT(setEnabled(bool))); connect(_dataFile, SIGNAL(changed(QString)), this, SLOT(fileNameChanged(QString))); connect(_dataFile, SIGNAL(destroyed()), kstApp->mainWindow(), SLOT(cleanUpDataSourceList())); connect(_buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(reject())); connect(_buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(OKClicked())); connect(_buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(apply())); connect(_configure, SIGNAL(clicked()), this, SLOT(showConfigWidget())); connect(UpdateServer::self(), SIGNAL(objectListsChanged()), this, SLOT(updatePrimitiveList())); _dataFile->setFile(dialogDefaults().value("changedatafile/newFileName",QDir::currentPath()).toString()); updateButtons(); }