27 #include <ArmarXGui/gui-plugins/ScenarioManager/gui/ui_settingsview.h>
32 #include <QIntValidator>
34 #include <QFileDialog>
43 ui->treeView->setModel(model.get());
44 ui->treeView->setSortingEnabled(
true);
46 ui->treeView->setItemDelegateForColumn(2, &deleteButtonDelegate);
49 ui->delayChooser->setValidator(
new QIntValidator());
52 QObject::connect(&deleteButtonDelegate, SIGNAL(
buttonClicked(
int,
int, QModelIndex)),
53 this, SLOT(removeButtonClicked(
int,
int, QModelIndex)));
55 QObject::connect(ui->closeUnavailablePackagesButton, &QPushButton::pressed,
56 this, &This::closeUnavailablePackages);
67 ui->treeView->setModel(model.get());
68 ui->treeView->setColumnWidth(0, 220);
69 ui->treeView->setColumnWidth(1, 220);
72 void SettingsView::on_lineEdit_textEdited(
const QString& text)
74 model->setFilterRegExp(QRegExp(text, Qt::CaseInsensitive, QRegExp::FixedString));
75 ui->treeView->expandAll();
78 void SettingsView::removeButtonClicked(
int row,
int column, QModelIndex parent)
83 void SettingsView::on_openButton_clicked()
88 void SettingsView::on_applicationStopperChooser_currentIndexChanged(
const QString& text)
90 if (!text.compare(
"Stop only"))
92 ui->delayChooser->setEnabled(
false);
93 ui->delayChooser->setText(
"1000");
97 ui->delayChooser->setEnabled(
true);
100 emit
changeExecutorSettings(ui->applicationStopperChooser->itemText(ui->applicationStopperChooser->currentIndex()).toStdString(),
101 ui->delayChooser->text().toInt(),
102 ui->stopMethodChooser->itemText(ui->stopMethodChooser->currentIndex()).toStdString());
107 void SettingsView::on_delayChooser_returnPressed()
109 emit
changeExecutorSettings(ui->applicationStopperChooser->itemText(ui->applicationStopperChooser->currentIndex()).toStdString(),
110 ui->delayChooser->text().toInt(),
111 ui->stopMethodChooser->itemText(ui->stopMethodChooser->currentIndex()).toStdString());
114 void SettingsView::on_delayChooser_editingFinished()
116 emit
changeExecutorSettings(ui->applicationStopperChooser->itemText(ui->applicationStopperChooser->currentIndex()).toStdString(),
117 ui->delayChooser->text().toInt(),
118 ui->stopMethodChooser->itemText(ui->stopMethodChooser->currentIndex()).toStdString());
121 void SettingsView::on_stopMethodChooser_currentIndexChanged(
const QString& text)
123 emit
changeExecutorSettings(ui->applicationStopperChooser->itemText(ui->applicationStopperChooser->currentIndex()).toStdString(),
124 ui->delayChooser->text().toInt(),
125 ui->stopMethodChooser->itemText(ui->stopMethodChooser->currentIndex()).toStdString());
128 void SettingsView::setExecutorState(
int killIndex,
int delay,
int stopStrategyIndex)
130 ui->applicationStopperChooser->blockSignals(
true);
131 ui->stopMethodChooser->blockSignals(
true);
132 ui->applicationStopperChooser->setCurrentIndex(stopStrategyIndex);
133 if (stopStrategyIndex == 1)
135 ui->delayChooser->setEnabled(
false);
139 ui->delayChooser->setEnabled(
true);
141 ui->delayChooser->setText(QString::number(delay));
142 ui->stopMethodChooser->setCurrentIndex(killIndex);
143 ui->applicationStopperChooser->blockSignals(
false);
144 ui->stopMethodChooser->blockSignals(
false);
147 void SettingsView::on_clearPidCache_clicked()
152 void SettingsView::on_clearXmlCache_clicked()
157 void SettingsView::on_toolButton_clicked()
161 QString dir = QFileDialog::getExistingDirectory(
this, tr(
"Open Directory"),
163 QFileDialog::ShowDirsOnly
164 | QFileDialog::DontResolveSymlinks);