Skip to content
Snippets Groups Projects
Commit 26617aa5 authored by Christoph Pohl's avatar Christoph Pohl
Browse files

Merge remote-tracking branch 'origin/master' into feature/end-effector-trajectories

parents b87155a2 29bce717
No related branches found
No related tags found
1 merge request!443Feature/end effector trajectories
Pipeline #18379 failed
......@@ -63,7 +63,7 @@ set(SOURCES
SkillMemoryGui.cpp
gui_utils.cpp
StatusLabel.cpp
)
set(HEADERS
aron_tree_widget/visitors/AronTreeWidgetCreator.h
......@@ -105,7 +105,6 @@ set(HEADERS
SkillMemoryGui.h
gui_utils.h
StatusLabel.h
)
armarx_gui_library("${LIB_NAME}" "${SOURCES}" "${GUI_MOC_HDRS}" "${GUI_UIS}" "" "${LIBRARIES}")
......
......@@ -10,8 +10,7 @@
#include <ArmarXCore/core/logging/Logging.h>
#include <ArmarXGui/libraries/ArmarXGuiBase/widgets/PeriodicUpdateWidget.h>
#include "RobotAPI/libraries/skills_gui/StatusLabel.h"
#include <ArmarXGui/libraries/ArmarXGuiBase/widgets/StatusLabel.h>
#include "./aron_tree_widget/widgets/SkillDescriptionWidget.h"
#include "./executions/SkillExecutionTreeWidget.h"
......
#include "StatusLabel.h"
#include <QHBoxLayout>
namespace armarx::skills::gui
{
StatusLabel::StatusLabel()
{
this->label = new QLabel("");
this->resetButton = new QPushButton("");
this->setupUi();
}
void
StatusLabel::handleMessage(const std::string& message, std::string const& error)
{
this->label->setText(QString::fromStdString(message));
this->resetButton->setHidden(false);
label->setToolTip(QString::fromStdString(error));
}
void
StatusLabel::resetLabel()
{
this->label->setText(QString::fromStdString(""));
this->resetButton->setHidden(true);
}
void
StatusLabel::setupUi()
{
QHBoxLayout* layout = new QHBoxLayout();
layout->addWidget(resetButton);
layout->addWidget(label);
this->setLayout(layout);
layout->setStretch(1, 2);
label->setStyleSheet("QLabel { color : red; }");
this->resetButton->setHidden(true);
label->setMinimumHeight(35);
label->setMaximumHeight(35);
QPixmap pixmap(":/icons/delete.ico");
QIcon ButtonIcon(pixmap);
resetButton->setIcon(ButtonIcon);
resetButton->setIconSize(pixmap.rect().size() / 2);
connect(this->resetButton, &QPushButton::clicked, this, &StatusLabel::resetLabel);
}
} // namespace armarx::skills::gui
#pragma once
#include <QLabel>
#include <QPushButton>
namespace armarx::skills::gui
{
class StatusLabel : public QWidget
{
public:
/**
* @brief Constructor for StatusLabel
*/
StatusLabel();
public slots:
/**
* @brief Display a message to indicate an update.
*/
void handleMessage(std::string const& message, std::string const& error);
private slots:
/**
* @brief Reset the label to default state.
*/
void resetLabel();
private:
void setupUi();
// contents
QLabel* label = nullptr;
QPushButton* resetButton = nullptr;
};
} // namespace armarx::skills::gui
......@@ -7,6 +7,14 @@
namespace armarx::skills::gui
{
QIcon
getIcon(const std::string name)
{
QPixmap pix(QString::fromStdString(":icons/" + name));
QIcon icon(pix);
return icon;
}
void
ProfileMenuWidget::setupUi()
{
......@@ -33,7 +41,9 @@ namespace armarx::skills::gui
// Text
setArgsFromClipboard->setText(QString::fromStdString(SET_ARGS_BUTTON_TEXT));
copyArgsToClipboard->setText(QString::fromStdString(COPY_ARGS_BUTTON_TEXT));
copyArgsToClipboard->setIcon(getIcon("edit-copy-4.svg"));
resetArgsToProfile->setText(QString::fromStdString(RESET_ARGS_BUTTON_TEXT));
resetArgsToProfile->setIcon(getIcon("refresh-black.svg"));
profileSelector->addItem(QString::fromStdString(DEFAULT_PROFILE_TEXT));
profileSelector->setDisabled(true);
profileSelector->setToolTip(QString::fromStdString(PROFILE_NOT_IMPLEMENTED));
......
......@@ -14,8 +14,8 @@ namespace armarx::skills::gui
Q_OBJECT
public:
static const constexpr char* SET_ARGS_BUTTON_TEXT = "Set Args from Clipboard";
static const constexpr char* COPY_ARGS_BUTTON_TEXT = "Copy Args to Clipboard";
static const constexpr char* RESET_ARGS_BUTTON_TEXT = "Reset Args to Profile";
static const constexpr char* COPY_ARGS_BUTTON_TEXT = " Copy Args to Clipboard";
static const constexpr char* RESET_ARGS_BUTTON_TEXT = " Reset Args to Profile";
static const constexpr char* DEFAULT_PROFILE_TEXT = "<No Profile selected. Using root>";
static const constexpr char* PROFILE_NOT_IMPLEMENTED =
"Profiles other than the root profile are currently not supported.";
......
......@@ -113,6 +113,12 @@ namespace armarx::skills::gui
// Text
this->executeSkillButton->setText(
QString::fromStdString(SkillDetailGroupBox::EXECUTE_SKILL_BUTTON_TEXT));
{
QPixmap pix(QString::fromStdString(":icons/run.svg"));
QIcon icon(pix);
this->executeSkillButton->setIcon(icon);
}
connectSignals();
}
......
......@@ -19,7 +19,7 @@ namespace armarx::skills::gui
{
Q_OBJECT
public:
static const constexpr char* EXECUTE_SKILL_BUTTON_TEXT = "Request Execution";
static const constexpr char* EXECUTE_SKILL_BUTTON_TEXT = " Request Execution";
static const constexpr char* GROUP_BOX_TITLE = "Skill Description";
SkillDetailGroupBox(std::shared_ptr<SkillManagerWrapper> _memory,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment