Newer
Older
#include <QHBoxLayout>
#include <QLabel>
#include <QVBoxLayout>
QIcon
getIcon(const std::string name)
{
QPixmap pix(QString::fromStdString(":icons/" + name));
QIcon icon(pix);
return icon;
}
void
ProfileMenuWidget::setupUi()
{
setArgsFromClipboard = new QPushButton();
copyArgsToClipboard = new QPushButton();
//profileSelector = new QComboBox();
historySelector = new QPushButton();
changesSelector = new QPushButton();
// layouting
QVBoxLayout* mainLayout = new QVBoxLayout();
QHBoxLayout* topLayout = new QHBoxLayout();
QHBoxLayout* bottomLayout = new QHBoxLayout();
mainLayout->addLayout(topLayout);
//mainLayout->addWidget(profileSelector);
mainLayout->addLayout(bottomLayout);
bottomLayout->addWidget(historySelector);
bottomLayout->addWidget(changesSelector);
topLayout->addWidget(setArgsFromClipboard);
topLayout->addWidget(copyArgsToClipboard);
topLayout->addWidget(resetArgsToProfile);
this->setLayout(mainLayout);
setArgsFromClipboard->setText(QString::fromStdString(SET_ARGS_BUTTON_TEXT));
copyArgsToClipboard->setText(QString::fromStdString(COPY_ARGS_BUTTON_TEXT));
copySkillIdToClipboard->setText(QString::fromStdString(COPY_SKILL_BUTTON_TEXT));
copySkillIdToClipboard->setIcon(getIcon("edit-copy-4.svg"));
resetArgsToProfile->setText(QString::fromStdString(RESET_ARGS_BUTTON_TEXT));
//profileSelector->addItem(QString::fromStdString(DEFAULT_PROFILE_TEXT));
//profileSelector->setDisabled(true);
//profileSelector->setToolTip(QString::fromStdString(PROFILE_NOT_IMPLEMENTED));
historySelector->setText(QString::fromStdString(HIST_BUTTON_TEXT));
changesSelector->setText(QString::fromStdString(CNGS_BUTTON_TEXT));
void ProfileMenuWidget::updateChangesSelector(skills::SkillID shownSkill)
{
auto params = memory->getLatestParametersForSkill(shownSkill);
changesSelector->setDisabled(not params.has_value());
}
} // namespace armarx::skills::gui