##// END OF EJS Templates
Some refactoring on PB11 wrappers...
Some refactoring on PB11 wrappers Most sciqlop core wrappers are moved into a dedicated python module. We needs to get rid off sqpapp! All current sciqlop modules should either be stateless or act as real singletons they must not need any app to be used. This will ease testing, wrapping and usage. Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r1328:eb278710ae3b
r1341:f18e017310bc
Show More
ActionsGuiController.cpp
52 lines | 1.6 KiB | text/x-c | CppLexer
/ gui / src / Actions / ActionsGuiController.cpp
Adds a a gui controller class to manage global actions across the application.
r1076 #include "Actions/ActionsGuiController.h"
struct ActionsGuiController::ActionsGuiControllerPrivate {
QVector<std::shared_ptr<SelectionZoneAction> > m_SelectionZoneActions;
LineEdit to filter the create catalogue menu
r1328 QSet<QStringList> m_FilteredMenu;
Adds a a gui controller class to manage global actions across the application.
r1076 };
ActionsGuiController::ActionsGuiController()
: impl{spimpl::make_unique_impl<ActionsGuiControllerPrivate>()}
{
}
std::shared_ptr<SelectionZoneAction>
ActionsGuiController::addSectionZoneAction(const QString &name,
SelectionZoneAction::ExecuteFunction function)
{
auto action = std::make_shared<SelectionZoneAction>(name, function);
impl->m_SelectionZoneActions.push_back(action);
return action;
}
Put the align actions in sub menus
r1083 std::shared_ptr<SelectionZoneAction>
ActionsGuiController::addSectionZoneAction(const QStringList &subMenuList, const QString &name,
SelectionZoneAction::ExecuteFunction function)
{
auto action = std::make_shared<SelectionZoneAction>(subMenuList, name, function);
impl->m_SelectionZoneActions.push_back(action);
return action;
}
Adds a a gui controller class to manage global actions across the application.
r1076 QVector<std::shared_ptr<SelectionZoneAction> > ActionsGuiController::selectionZoneActions() const
{
return impl->m_SelectionZoneActions;
}
Refresh catalogue menu when the catalogue list changed
r1327
void ActionsGuiController::removeAction(const std::shared_ptr<SelectionZoneAction> &action)
{
impl->m_SelectionZoneActions.removeAll(action);
}
LineEdit to filter the create catalogue menu
r1328
void ActionsGuiController::addFilterForMenu(const QStringList &menuPath)
{
impl->m_FilteredMenu.insert(menuPath);
}
bool ActionsGuiController::isMenuFiltered(const QStringList &menuPath) const
{
return impl->m_FilteredMenu.contains(menuPath);
}