31 #include <QInputDialog>
32 #include <QItemSelectionModel>
34 #include <QMessageBox>
35 #include <QPersistentModelIndex>
36 #include <QStandardItem>
38 #include <ArmarXCore/interface/core/ArmarXManagerInterface.h>
40 #include <ArmarXGui/gui-plugins/SystemStateMonitorPlugin/ui_ArmarXManagerRepositoryDialog.h>
50 this->managerRepositoryModel = managerRepositoryModel->
clone();
51 this->monitoredManagerModel = monitoredManagerModel->
clone();
66 ui->managerRepository->setModel(managerRepositoryModel);
67 ui->monitoredManagers->setModel(monitoredManagerModel);
69 connect(ui->addNewManager, SIGNAL(clicked()),
this, SLOT(
addNewManager()));
70 connect(ui->cancelOkBox, SIGNAL(accepted()),
this, SLOT(accept()));
71 connect(ui->cancelOkBox, SIGNAL(rejected()),
this, SLOT(reject()));
73 connect(ui->moveToMonitoredManagersButton,
77 connect(ui->moveToManagerRepositoryButton,
81 connect(ui->removeSelectedManagersButton,
86 connect(ui->scanButton, SIGNAL(clicked()),
this, SLOT(
scanForManagers()));
88 connect(ui->clearButton, SIGNAL(clicked()),
this, SLOT(
clearRepository()));
94 QStringList::ConstIterator it = managers.begin();
97 brush.setColor(QColor(78, 238, 148));
98 brush.setStyle(Qt::SolidPattern);
100 while (it != managers.end())
113 managerRepositoryModel->appendRow(item);
117 item->setBackground(brush);
127 QString managerName = QInputDialog::getText(parent,
128 tr(
"New ArmarXManager"),
131 tr(
"SampleApplicationManager"),
145 QMessageBox::information(parent,
147 managerName +
" manager already in repository",
156 monitoredManagerModel->
takeSelectionFrom(ui->managerRepository->selectionModel(),
157 managerRepositoryModel);
163 monitoredManagerModel->
moveSelectionTo(ui->monitoredManagers->selectionModel(),
164 managerRepositoryModel);
176 managerRepositoryModel->clear();
182 return managerRepositoryModel;
188 return monitoredManagerModel;
194 managerRepositoryModel->
deleteSelection(ui->managerRepository->selectionModel());