SkillDashboardConfigWindow.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * \package ArmarXGui::gui-plugins::OperatorViewWidgetController
19  * \author Leonie Leven
20  * \date 2024
21  * \copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 
26 
27 namespace armarx
28 {
29 
30 
32  QDialog(parent), ui(new Ui::SkillDashboardConfig)
33  {
34  ui->setupUi(this);
35  this->setWindowTitle("Configure Skill");
36  connect(ui->dialogButtons, &QDialogButtonBox::accepted, this, &QDialog::accept);
37  connect(ui->dialogButtons, &QDialogButtonBox::rejected, this, &QDialog::reject);
38  connect(ui->buttonName,
39  &QLineEdit::textChanged,
40  this,
41  &SkillDashboardConfigWindow::onShortcutNameChanged);
42  }
43 
44  void
45  SkillDashboardConfigWindow::onShortcutNameChanged()
46  {
48  }
49 
50  QString
52  {
53  return ui->buttonName->text();
54  }
55 
56  QString
58  {
59  return ui->skillName->text();
60  }
61 
62  QString
64  {
65  return ui->skillArgs->toPlainText();
66  }
67 
68  void
70  {
71  ui->buttonName->setText(QString::fromStdString(name));
72  }
73 
74  void
76  {
77  ui->skillName->setText(QString::fromStdString(id));
78  }
79 
80  void
81  SkillDashboardConfigWindow::setSkillConfig(const std::string& config)
82  {
83  ui->skillArgs->setPlainText(QString::fromStdString(config));
84  }
85 
86  void
87  SkillDashboardConfigWindow::setInfoText(const std::string& info)
88  {
89  ui->infoText->setText(QString::fromStdString(info));
90  ui->infoText->setStyleSheet("color: red;");
91  }
92 
94  {
95  delete ui;
96  }
97 } // namespace armarx
armarx::SkillDashboardConfigWindow::getSkillConfig
QString getSkillConfig()
Definition: SkillDashboardConfigWindow.cpp:63
Ui
ArmarX Headers.
Definition: ArmarXMainWindow.h:54
armarx::SkillDashboardConfigWindow::setSkillId
void setSkillId(const std::string &id)
Definition: SkillDashboardConfigWindow.cpp:75
armarx::SkillDashboardConfigWindow::~SkillDashboardConfigWindow
~SkillDashboardConfigWindow()
Definition: SkillDashboardConfigWindow.cpp:93
armarx::SkillDashboardConfigWindow::setSkillConfig
void setSkillConfig(const std::string &config)
Definition: SkillDashboardConfigWindow.cpp:81
SkillDashboardConfigWindow.h
armarx::SkillDashboardConfigWindow::setShortcutName
void setShortcutName(const std::string &name)
Definition: SkillDashboardConfigWindow.cpp:69
armarx::SkillDashboardConfigWindow::setInfoText
void setInfoText(const std::string &info)
Definition: SkillDashboardConfigWindow.cpp:87
armarx::SkillDashboardConfigWindow::getSkillId
QString getSkillId()
Definition: SkillDashboardConfigWindow.cpp:57
armarx::SkillDashboardConfigWindow::shortcutNameHasChanged
void shortcutNameHasChanged()
armarx::SkillDashboardConfigWindow::SkillDashboardConfigWindow
SkillDashboardConfigWindow(QWidget *parent=nullptr)
Definition: SkillDashboardConfigWindow.cpp:31
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::SkillDashboardConfigWindow::getShortcutName
QString getShortcutName()
Definition: SkillDashboardConfigWindow.cpp:51