26 #include <QPushButton>
28 #include <ArmarXGui/applications/ArmarXGui/ui_GuiUseCaseSelector.h>
38 ui->buttonBox->button(QDialogButtonBox::Ok)->setText(
"Open selected use case");
39 ui->buttonBox->button(QDialogButtonBox::Ok)->setToolTip(
"Opens the selected use case and loads the associated preconfigured widgets.");
40 ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(
"Open empty GUI");
41 ui->buttonBox->button(QDialogButtonBox::Cancel)->setToolTip(
"Opens an empty gui.");
51 path /=
"GuiDefaultConfigs";
52 if (!std::filesystem::exists(path))
57 for (std::filesystem::recursive_directory_iterator end, dir(path);
58 dir != end ; ++dir, i++)
60 if (dir->path().extension() ==
".armarxgui")
67 ARMARX_INFO_S <<
"Scanning file " << i <<
": " << dir->path().c_str();
71 ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(
false);
72 ui->checkBoxDoNotShowAgain->setChecked(doNotShowAgain);
82 for (
int i = 0; i < ui->verticalLayout_3->count(); ++i)
84 UseCaseSelectorItem* item = qobject_cast<UseCaseSelectorItem*>(ui->verticalLayout_3->itemAt(i)->widget());
95 return ui->checkBoxDoNotShowAgain->isChecked();
100 ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(text);
106 QSettings
s(configPath, QSettings::IniFormat);
108 s.value(
"ConfigDescription").toString(),
111 s.value(
"IconPath").toString(),
113 ui->verticalLayout_3->addWidget(item);
114 connect(item, SIGNAL(selected(QString)),
this, SLOT(
setSelection(QString)));
115 connect(item, SIGNAL(doubleClicked()),
this, SLOT(accept()));
120 for (
int i = 0; i < ui->verticalLayout_3->count(); ++i)
122 UseCaseSelectorItem* item = qobject_cast<UseCaseSelectorItem*>(ui->verticalLayout_3->itemAt(i)->widget());
135 ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(
true);