2018-12-30 15:46:15 +01:00
|
|
|
|
#ifndef MENUPATH_H
|
|
|
|
|
|
#define MENUPATH_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <QString>
|
2019-02-08 10:10:11 +01:00
|
|
|
|
#include <QVector>
|
|
|
|
|
|
#include <vector>
|
2018-12-30 15:46:15 +01:00
|
|
|
|
|
|
|
|
|
|
|
2019-02-08 10:10:11 +01:00
|
|
|
|
/// 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
|
|
|
|
|
|
///
|
2018-12-30 15:46:15 +01:00
|
|
|
|
class MenuPath {
|
|
|
|
|
|
public:
|
|
|
|
|
|
MenuPath();
|
|
|
|
|
|
MenuPath(QString menu_path);
|
|
|
|
|
|
|
2019-02-08 10:10:11 +01:00
|
|
|
|
|
2018-12-30 15:46:15 +01:00
|
|
|
|
private:
|
2019-02-08 10:10:11 +01:00
|
|
|
|
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;
|
2018-12-30 15:46:15 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-02-08 10:10:11 +01:00
|
|
|
|
|
2018-12-30 15:46:15 +01:00
|
|
|
|
#endif // MENUPATH_H
|