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
|
|
@ -2,17 +2,46 @@
|
|||
#define MENUPATH_H
|
||||
|
||||
#include <QString>
|
||||
#include <boost/container/small_vector.hpp>
|
||||
#include <QVector>
|
||||
#include <vector>
|
||||
|
||||
|
||||
/// For a menu path we use a string very similar to a file path. Width however the addition of semicolons
|
||||
/// for specifying groups. So the following path
|
||||
///
|
||||
/// /File:Save
|
||||
///
|
||||
/// Specifies the File menu and the group Save within that menu while
|
||||
///
|
||||
/// /File/Export
|
||||
///
|
||||
/// Would specify the export sub menu of the file menu
|
||||
///
|
||||
class MenuPath {
|
||||
public:
|
||||
MenuPath();
|
||||
MenuPath(QString menu_path);
|
||||
|
||||
|
||||
private:
|
||||
QString m_menuPath;
|
||||
class Elem {
|
||||
public:
|
||||
QStringRef menu;
|
||||
QStringRef group;
|
||||
|
||||
explicit Elem(QStringRef s)
|
||||
{
|
||||
auto p = s.split(':');
|
||||
menu = p[0];
|
||||
if (p.size() > 1) {
|
||||
group = p[1];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
std::vector<Elem> m_elems;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // MENUPATH_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue