Work on plugin mechanism
Context actions have become normal actions in the pluginwidget so the widget knows abot them and can easily do things like enable/disable.
This commit is contained in:
parent
eca8841427
commit
a704332342
24 changed files with 239 additions and 267 deletions
56
pglab/plugin_support/LMainMenu.h
Normal file
56
pglab/plugin_support/LMainMenu.h
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
#ifndef LMAINMENU_H
|
||||
#define LMAINMENU_H
|
||||
|
||||
#include <QString>
|
||||
#include <vector>
|
||||
|
||||
class QAction;
|
||||
|
||||
class LMenuGroupItem {
|
||||
public:
|
||||
LMenuGroupItem(QAction *action, int position)
|
||||
: m_menuAction(action)
|
||||
, m_position(position)
|
||||
{}
|
||||
|
||||
int position() const { return m_position; }
|
||||
|
||||
private:
|
||||
QAction *m_menuAction;
|
||||
int m_position;
|
||||
};
|
||||
|
||||
// Menu's are divided into logical groups,
|
||||
// these groups form only a single level they are NOT submenu's
|
||||
class LMenuGroup {
|
||||
public:
|
||||
|
||||
explicit LMenuGroup(QString group_id);
|
||||
QString groupId() const;
|
||||
|
||||
private:
|
||||
QString m_groupId;
|
||||
};
|
||||
|
||||
class LMenu {
|
||||
public:
|
||||
QString menuId() const;
|
||||
|
||||
void addGroup(const LMenuGroup &group)
|
||||
{
|
||||
m_groups.push_back(group);
|
||||
}
|
||||
private:
|
||||
using Groups = std::vector<LMenuGroup>;
|
||||
|
||||
QString m_caption;
|
||||
Groups m_groups;
|
||||
};
|
||||
|
||||
|
||||
class LMainMenu: public LMenu {
|
||||
public:
|
||||
LMainMenu();
|
||||
};
|
||||
|
||||
#endif // LMAINMENU_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue