void SettingsDialog::DeleteApplication() { QList<QListWidgetItem *> selected = mUI.mListWidget->selectedItems(); QListWidgetItem *item = 0; foreach(item, selected) { mTempApplications->RemoveApplication(mUI.mListWidget->row(item)); mUI.mListWidget->clear(); PopulateListWidget(); }
SettingsDialog::SettingsDialog(QSettings *programSettings, ApplicationList *list, QWidget *parent) : QDialog(parent), mSettings(programSettings), mApplications(list), mTempApplications(new ApplicationList(this)) { mUI.setupUi(this); mTempApplications->Copy(list); mUI.mEditIncludePaths->setText(programSettings->value(SETTINGS_GLOBAL_INCLUDE_PATHS).toString()); mUI.mJobs->setText(programSettings->value(SETTINGS_CHECK_THREADS, 1).toString()); mUI.mForce->setCheckState(BoolToCheckState(programSettings->value(SETTINGS_CHECK_FORCE, false).toBool())); mUI.mShowFullPath->setCheckState(BoolToCheckState(programSettings->value(SETTINGS_SHOW_FULL_PATH, false).toBool())); mUI.mShowNoErrorsMessage->setCheckState(BoolToCheckState(programSettings->value(SETTINGS_SHOW_NO_ERRORS, false).toBool())); mUI.mShowDebugWarnings->setCheckState(BoolToCheckState(programSettings->value(SETTINGS_SHOW_DEBUG_WARNINGS, false).toBool())); mUI.mSaveAllErrors->setCheckState(BoolToCheckState(programSettings->value(SETTINGS_SAVE_ALL_ERRORS, false).toBool())); mUI.mSaveFullPath->setCheckState(BoolToCheckState(programSettings->value(SETTINGS_SAVE_FULL_PATH, false).toBool())); mUI.mInlineSuppressions->setCheckState(BoolToCheckState(programSettings->value(SETTINGS_INLINE_SUPPRESSIONS, false).toBool())); connect(mUI.mButtons, SIGNAL(accepted()), this, SLOT(Ok())); connect(mUI.mButtons, SIGNAL(rejected()), this, SLOT(reject())); connect(mUI.mButtonAdd, SIGNAL(clicked()), this, SLOT(AddApplication())); connect(mUI.mButtonDelete, SIGNAL(clicked()), this, SLOT(DeleteApplication())); connect(mUI.mButtonModify, SIGNAL(clicked()), this, SLOT(ModifyApplication())); connect(mUI.mButtonDefault, SIGNAL(clicked()), this, SLOT(DefaultApplication())); connect(mUI.mListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(ModifyApplication())); connect(mUI.mBtnAddIncludePath, SIGNAL(clicked()), this, SLOT(AddIncludePath())); mUI.mListWidget->setSortingEnabled(false); PopulateListWidget(); const int count = QThread::idealThreadCount(); if (count != -1) mUI.mLblIdealThreads->setText(QString::number(count)); else mUI.mLblIdealThreads->setText(tr("N/A")); LoadSettings(); }
void IsosurfaceDockWidget::HandleIsovaluesChanged() { PopulateListWidget(); }