Needs work for correctly placing the items in menu and on toolbar. Old system still needs to be removed left in place to keep app useable.
75 lines
1.2 KiB
C++
75 lines
1.2 KiB
C++
#include "StaticAction.h"
|
|
|
|
BaseAction::BaseAction(const QString &text)
|
|
: m_text(text)
|
|
{}
|
|
|
|
const QIcon& BaseAction::icon() const
|
|
{
|
|
return m_icon;
|
|
}
|
|
|
|
const MenuLocation& BaseAction::menuLocation() const
|
|
{
|
|
return m_menuLocation;
|
|
}
|
|
|
|
void BaseAction::setIcon(QIcon icon)
|
|
{
|
|
m_icon = std::move(icon);
|
|
}
|
|
|
|
void BaseAction::setMenuLocation(MenuLocation menu_location)
|
|
{
|
|
m_menuLocation = std::move(menu_location);
|
|
}
|
|
|
|
void BaseAction::setToolbarLocation(ToolbarLocation toolbar_location)
|
|
{
|
|
m_toolbarLocation = toolbar_location;
|
|
}
|
|
|
|
void BaseAction::setShortcut(QKeySequence shortcut)
|
|
{
|
|
m_shortcut = std::move(shortcut);
|
|
}
|
|
|
|
void BaseAction::setText(QString text)
|
|
{
|
|
m_text = std::move(text);
|
|
}
|
|
|
|
void BaseAction::setToolTip(QString tooltip)
|
|
{
|
|
m_toolTip = std::move(tooltip);
|
|
}
|
|
|
|
const QKeySequence& BaseAction::shortcut() const
|
|
{
|
|
return m_shortcut;
|
|
}
|
|
|
|
const QString& BaseAction::text() const
|
|
{
|
|
return m_text;
|
|
}
|
|
|
|
const QString& BaseAction::toolTip() const
|
|
{
|
|
return m_toolTip;
|
|
}
|
|
|
|
StaticAction::StaticAction(QString text, Func func)
|
|
: BaseAction(std::move(text))
|
|
, m_func(std::move(func))
|
|
{}
|
|
|
|
void StaticAction::perform(IPluginContentWidgetContext *context) const
|
|
{
|
|
if (m_func)
|
|
m_func(context);
|
|
}
|
|
|
|
|
|
ContextBaseAction::~ContextBaseAction()
|
|
{}
|