From ca5793e951b6676d053ec4d3c215d027b2a4ed88 Mon Sep 17 00:00:00 2001 From: Christoph Pohl <christoph.pohl@kit.edu> Date: Fri, 24 May 2024 10:07:29 +0200 Subject: [PATCH] cleanup --- .../gui/detailedapplicationview.cpp | 65 ------------------- .../ScenarioManager/gui/scenariolistview.cpp | 23 ------- .../ScenarioManager/gui/scenariolistview.h | 2 - 3 files changed, 90 deletions(-) diff --git a/source/ArmarXGui/gui-plugins/ScenarioManager/gui/detailedapplicationview.cpp b/source/ArmarXGui/gui-plugins/ScenarioManager/gui/detailedapplicationview.cpp index 841c5215..e09338d2 100644 --- a/source/ArmarXGui/gui-plugins/ScenarioManager/gui/detailedapplicationview.cpp +++ b/source/ArmarXGui/gui-plugins/ScenarioManager/gui/detailedapplicationview.cpp @@ -571,50 +571,6 @@ void DetailedApplicationView::showScenario(ScenarioPtr scenario) } } - QtProperty* scenarioIcePropertyTopItem = variantManager->addProperty(QtVariantPropertyManager::groupTypeId(), - QLatin1String("Scenario Ice Deployment Properties")); - scenarioTopItem->addSubProperty(scenarioIcePropertyTopItem); - - QtVariantProperty* scenarioDeploymentTypeItem = nullptr; - if (readOnly) - { - scenarioDeploymentTypeItem = variantManager->addProperty( - QVariant::String, - QString::fromStdString("Deployment Type")); -// scenarioDeploymentTypeItem->setValue( -// scenario->getScenarioDeploymentType() == ScenarioDeploymentType::Local ? "Local" : "Remote"); - scenarioDeploymentTypeItem->setAttribute(QLatin1String("readOnly"), QVariant(true)); - } - else - { - scenarioDeploymentTypeItem = variantManager->addProperty( - QtVariantPropertyManager::enumTypeId(), - QString::fromStdString("Deployment Type")); -// scenarioDeploymentTypeItem->setAttribute("enumNames", scenario->getScenarioDeploymentType() == ScenarioDeploymentType::Local ? QStringList({"Local", "Remote"}) : QStringList({"Remote", "Local"})); - } - scenarioDeploymentTypeItem->setToolTip("Describes if the Scenario should either use the Local build for Ice deployment or an Remote sync directory"); - scenarioIcePropertyTopItem->addSubProperty(scenarioDeploymentTypeItem); - - QtVariantProperty* nodePropertyItem = variantManager->addProperty(QVariant::String, "Node Name"); - nodePropertyItem->setValue(QString::fromStdString(scenario->getNodeName())); - nodePropertyItem->setToolTip("Describes on which Node the currently applications of the current scenario should be deployed on. Can be overwritten for each application."); - nodePropertyItem->setAttribute(QLatin1String("readOnly"), QVariant(scenario->isReadOnly())); - scenarioIcePropertyTopItem->addSubProperty(nodePropertyItem); - - - QtProperty* scenarioIceEnvVarsTopItem = variantManager->addProperty(QtVariantPropertyManager::groupTypeId(), - QLatin1String("Ice Enviroment Variables")); - scenarioIcePropertyTopItem->addSubProperty(scenarioIceEnvVarsTopItem); - -// for (const auto& envVar : scenario->getIceEnviromentVariables()) -// { -// QtVariantProperty* iceEnvVarItem = variantManager->addProperty(QVariant::String, QString::fromStdString(envVar.first)); -// iceEnvVarItem->setValue(QString::fromStdString(envVar.second)); -// iceEnvVarItem->setAttribute(QLatin1String("readOnly"), QVariant(scenario->isReadOnly())); -// scenarioIceEnvVarsTopItem->addSubProperty(iceEnvVarItem); -// } - - ui->propertyBrowser->addProperty(scenarioTopItem); ui->propertyBrowser->setRootIsDecorated(false); } @@ -780,12 +736,6 @@ void DetailedApplicationView::on_addParameterButton_clicked() emit addParameterButtonClicked(); } -//void DetailedApplicationView::on_addIceEnvButton_clicked() -//{ -// ARMARX_INFO << "on_addIceEnvButton_clicked"; -// emit addIceEnvButtonClicked(); -//} - void DetailedApplicationView::on_toolButton_clicked() { emit toolButtonClicked(); @@ -898,17 +848,6 @@ void DetailedApplicationView::itemChanged(QtProperty* property, const QVariant& } updateTimer.start(UPDATE_TIMER_INTERVAL); } - else if (property->propertyName() == "Node Name") - { - ARMARX_INFO << "Setting node name to " << property->valueText().toStdString(); - lastAppInstance->setNodeName(property->valueText().toStdString()); - updateTimer.start(UPDATE_TIMER_INTERVAL); - } - else if (property->propertyName() == "Ice Auto Restart") - { -// lastAppInstance->setIceAutoRestart(property->valueText() == "True"); - updateTimer.start(UPDATE_TIMER_INTERVAL); - } else if (property->propertyName().compare("Instance Name") && properties->getProperty(property->propertyName().toStdString()).compare(value.toString().toStdString())) { lastAppInstance->modifyProperty(property->propertyName().toStdString(), property->valueText().toStdString()); @@ -938,10 +877,6 @@ void DetailedApplicationView::itemChanged(QtProperty* property, const QVariant& { return; } - else if (property->propertyName() == "Node Name") - { - lastScenario->setNodeName(property->valueText().toStdString()); - } else if (properties->getProperty(property->propertyName().toStdString()) != "" && properties->getProperty(property->propertyName().toStdString()).compare(value.toString().toStdString())) { diff --git a/source/ArmarXGui/gui-plugins/ScenarioManager/gui/scenariolistview.cpp b/source/ArmarXGui/gui-plugins/ScenarioManager/gui/scenariolistview.cpp index 19184d50..cb4ce428 100644 --- a/source/ArmarXGui/gui-plugins/ScenarioManager/gui/scenariolistview.cpp +++ b/source/ArmarXGui/gui-plugins/ScenarioManager/gui/scenariolistview.cpp @@ -91,7 +91,6 @@ void ScenarioListView::setModel(FilterableTreeModelSortFilterProxyModelPtr treeM { this->model = treeModel; ui->treeView->setModel(model.get()); - QObject::connect(this->model.get(), SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(onModelDataChange(QModelIndex, QModelIndex))); ui->treeView->setColumnWidth(0, 200); ui->treeView->setColumnWidth(1, 90); @@ -136,27 +135,10 @@ void ScenarioListView::on_openButton_clicked() emit showOpenDialog(); } -void ScenarioListView::updateScenarioIndices() -{ - for (int i = 0; i < this->model->rowCount(); ++i) - { -// auto index = this->model->index(i, 1); -// ui->treeView->openPersistentEditor(index); - // auto w = ui->treeView->indexWidget(index); - // ComboBoxButton* cb = qobject_cast<ComboBoxButton*>(w); - // if (cb) - // { - // cb->setScenarioIndex(index); - // } - } -} - void ScenarioListView::removeItemTriggered() { QModelIndex index = ui->treeView->currentIndex(); emit removeItem(index); - updateScenarioIndices(); - } void ScenarioListView::on_treeView_clicked(const QModelIndex& index) @@ -175,8 +157,3 @@ void ScenarioListView::onCustomContextMenu(const QPoint& point) QMenu::exec(actions, ui->treeView->mapToGlobal(point)); } - -void ScenarioListView::onModelDataChange(QModelIndex start, QModelIndex end) -{ - updateScenarioIndices(); -} diff --git a/source/ArmarXGui/gui-plugins/ScenarioManager/gui/scenariolistview.h b/source/ArmarXGui/gui-plugins/ScenarioManager/gui/scenariolistview.h index 515b5385..b3d15c12 100644 --- a/source/ArmarXGui/gui-plugins/ScenarioManager/gui/scenariolistview.h +++ b/source/ArmarXGui/gui-plugins/ScenarioManager/gui/scenariolistview.h @@ -94,7 +94,6 @@ private slots: void onCustomContextMenu(const QPoint& point); void on_treeView_clicked(const QModelIndex& index); - void onModelDataChange(QModelIndex start, QModelIndex end); private: Ui::ScenarioListView* ui; FilterableTreeModelSortFilterProxyModelPtr model; @@ -103,6 +102,5 @@ private: ButtonDelegate restartButtonDelegate; QMenu contextMenu; QAction removeAction; - void updateScenarioIndices(); }; -- GitLab