#include <menugenerator.h>
Public Member Functions | |
| MenuGenerator () | |
| ~MenuGenerator () | |
| void | check () |
| void | translate () |
Static Public Member Functions | |
| static bool | special (const QString &itemName) |
Private Member Functions | |
| void | addLocString (const QString &id, const QString &name) |
| void | setAvail (const QString &name) |
Private Attributes | |
| gui::StaticSettings * | set |
| QStringList | tbs |
| QStringList | trans |
| QMap< QString, int > | avail |
Generator, checker and translation generator of menu configuration
This is helper utility used to:
| MenuGenerator::MenuGenerator | ( | ) |
Constructor
| MenuGenerator::~MenuGenerator | ( | ) |
Destructor
| void MenuGenerator::addLocString | ( | const QString & | id, | |
| const QString & | name | |||
| ) | [private] |
Add menu to localization list
| id | Id of menu item | |
| name | Caption of menu item |
References util::CON, util::convertFromUnicode(), and trans.
Referenced by setAvail().
| void MenuGenerator::check | ( | ) |
Check menu structure, print items and their reference counts Warn about unreferenced items
References avail, util::CON, util::convertFromUnicode(), and setAvail().
Referenced by main(), and translate().
| void MenuGenerator::setAvail | ( | const QString & | name | ) | [private] |
Set menu item as "reachable" (increases its reference count) and add translation on it. Recursively run on subitems if item is list
| name | Id of menu item |
References addLocString(), avail, util::explode(), util::fatalError(), gui::MENUDEF_SEPARATOR, gui::MENULIST_SEPARATOR, and special().
Referenced by check().
| bool MenuGenerator::special | ( | const QString & | itemName | ) | [static] |
Check if given name is a "special item" (or separator)
| itemName | Name of the item |
Referenced by setAvail().
| void MenuGenerator::translate | ( | ) |
Produce dummy header used for menu items localization
References check(), util::fatalError(), and trans.
Referenced by main().
QMap<QString,int> MenuGenerator::avail [private] |
Reachable menu items
Referenced by check(), and setAvail().
gui::StaticSettings* MenuGenerator::set [private] |
Settings object used to load configuration
QStringList MenuGenerator::tbs [private] |
Installed toolbars
QStringList MenuGenerator::trans [private] |
Translation data
Referenced by addLocString(), and translate().