pqProxyGroupMenuManager is a menu-populator that fills up a menu with proxies defined in an XML configuration file. More...
#include <pqProxyGroupMenuManager.h>
Inherits QObject.
Public Slots | |
void | setEnabled (bool) |
void | loadConfiguration (vtkPVXMLElement *) |
Update from servermanager. More... | |
void | lookForNewDefinitions () |
Look for new proxy definition to add inside the menu Iter over known proxy definitions to parse Hints tag. More... | |
void | removeProxyDefinitionUpdateObservers () |
Remove all ProxyDefinitionUpdate observers to active server. More... | |
void | addProxyDefinitionUpdateObservers () |
Update the list of ProxyDefinitionUpdate observers to server. More... | |
Signals | |
void | triggered (const QString &group, const QString &name) |
void | menuPopulated () |
fired when the menu gets repopulated,typically means that the actions have been updated. More... | |
void | categoriesUpdated () |
Fired when categories were updated. More... | |
Public Member Functions | |
pqProxyGroupMenuManager (QMenu *menu, const QString &resourceTagName, bool supportsQuickLaunch=true, bool enableFavorites=false) | |
Constructor. More... | |
~pqProxyGroupMenuManager () override | |
QMenu * | menu () const |
Access the menu. More... | |
QWidget * | widgetActionsHolder () const |
returns the widget that hold actions created by this menu manager. More... | |
QMenu * | getFavoritesMenu () |
void | setRecentlyUsedMenuSize (unsigned int val) |
When size>0 a recently used category will be added to the menu. More... | |
unsigned int | recentlyUsedMenuSize () const |
bool | supportsQuickLaunch () const |
Returns true if the pqProxyGroupMenuManager has been registered with quick-launch mechanism maintained by pqApplicationCore. More... | |
void | setEnableFavorites (bool enable) |
vtkSMProxy * | getPrototype (QAction *action) const |
Returns the prototype proxy for the action. More... | |
void | addProxy (const QString &xmlgroup, const QString &xmlname) |
Provides mechanism to explicitly add a proxy to the menu. More... | |
void | removeProxy (const QString &xmlgroup, const QString &xmlname) |
Provides mechanism to explicitly remove a proxy to the menu. More... | |
void | addProxyDefinitionUpdateListener (const QString &proxyGroupName) |
Attach an observer to proxy manager to monitor any proxy definition update The detected proxy have to own a hint: More... | |
void | removeProxyDefinitionUpdateListener (const QString &proxyGroupName) |
virtual void | populateMenu () |
Forces a re-population of the menu. More... | |
void | writeCategoryToSettings () |
Write categories to settings. More... | |
QStringList | getToolbarCategories () const |
Categories information. More... | |
QString | getToolbarName (pqProxyCategory *category) |
Return a name for the toolbar. More... | |
QString | categoryLabel (const QString &category) |
Given a category name, return the category label. More... | |
bool | hideForTests (const QString &) const |
Returns whether or not the category's toolbar should be hidden initially. More... | |
QList< QAction * > | actions () const |
List actions. More... | |
QList< QAction * > | categoryActions (const QString &category) |
Returns actions from given category. More... | |
QList< QAction * > | categoryActions (pqProxyCategory *category) |
Returns actions from given category. More... | |
QList< QAction * > | actionsInToolbars () |
Returns this list of actions that appear in toolbars. More... | |
QAction * | getAction (pqProxyInfo *proxy) |
Return the action for a given proxy. More... | |
void | updateActionIcon (pqProxyInfo *proxy) |
Update action icon from proxy info. More... | |
pqProxyCategory * | getApplicationCategory () |
Specific-meaning categories. More... | |
pqProxyCategory * | getMenuCategory () |
Returns the invisible root category containing all categories to display. More... | |
pqProxyCategory * | getFavoritesCategory () |
Returns the Favorites category. More... | |
bool | isFavorites (pqProxyCategory *category) |
Returns true if the given category is a favorites. More... | |
Protected Slots | |
void | triggered () |
void | quickLaunch () |
void | switchActiveServer () |
void | updateMenuStyle () |
void | updateActionsStyle () |
void | populateRecentlyUsedMenu () |
Fill recently used submenu. More... | |
void | populateFavoritesMenu () |
called when "favorites" menu is being shown. More... | |
Protected Member Functions | |
void | loadRecentlyUsedItems () |
void | saveRecentlyUsedItems () |
void | loadFavoritesItems () |
Load the favorites from settings. More... | |
QAction * | getAddToFavoritesAction (const QString &path) |
QAction * | getAction (const QString &pgroup, const QString &proxyname) |
Return the action for a given proxy. More... | |
Protected Attributes | |
QString | ResourceTagName |
vtkPVXMLElement * | MenuRoot = nullptr |
int | RecentlyUsedMenuSize = 0 |
bool | Enabled |
bool | EnableFavorites = false |
pqProxyGroupMenuManager is a menu-populator that fills up a menu with proxies defined in an XML configuration file.
This is use to automatically build the sources and filters menu in ParaView.
Definition at line 25 of file pqProxyGroupMenuManager.h.
pqProxyGroupMenuManager::pqProxyGroupMenuManager | ( | QMenu * | menu, |
const QString & | resourceTagName, | ||
bool | supportsQuickLaunch = true , |
||
bool | enableFavorites = false |
||
) |
Constructor.
menu
is the Menu to be populated. resourceTagName
is the tag name eg. "ParaViewSources" in the client configuration files which contains lists the items shown by this menu. supportsQuickLaunch
, set to false if quick-launch is not to be supported for this menu.
|
override |
|
inline |
Access the menu.
Definition at line 46 of file pqProxyGroupMenuManager.h.
QWidget* pqProxyGroupMenuManager::widgetActionsHolder | ( | ) | const |
returns the widget that hold actions created by this menu manager.
QMenu* pqProxyGroupMenuManager::getFavoritesMenu | ( | ) |
|
inline |
When size>0 a recently used category will be added to the menu.
One must call update() or initialize() after changing this value.
Definition at line 58 of file pqProxyGroupMenuManager.h.
|
inline |
Definition at line 59 of file pqProxyGroupMenuManager.h.
|
inline |
Returns true if the pqProxyGroupMenuManager has been registered with quick-launch mechanism maintained by pqApplicationCore.
Definition at line 64 of file pqProxyGroupMenuManager.h.
|
inline |
Definition at line 65 of file pqProxyGroupMenuManager.h.
vtkSMProxy* pqProxyGroupMenuManager::getPrototype | ( | QAction * | action | ) | const |
Returns the prototype proxy for the action.
Provides mechanism to explicitly add a proxy to the menu.
Provides mechanism to explicitly remove a proxy to the menu.
QStringList pqProxyGroupMenuManager::getToolbarCategories | ( | ) | const |
Categories information.
Returns a list of categories that have the "show_in_toolbar" attribute set to 1.
QString pqProxyGroupMenuManager::getToolbarName | ( | pqProxyCategory * | category | ) |
Return a name for the toolbar.
This is based on category name and proxy group.
QString pqProxyGroupMenuManager::categoryLabel | ( | const QString & | category | ) |
Given a category name, return the category label.
|
inline |
Returns whether or not the category's toolbar should be hidden initially.
Definition at line 105 of file pqProxyGroupMenuManager.h.
QList<QAction*> pqProxyGroupMenuManager::actions | ( | ) | const |
List actions.
returns the actions holds by the widgetActionsHolder
QList<QAction*> pqProxyGroupMenuManager::categoryActions | ( | const QString & | category | ) |
Returns actions from given category.
Create actions as needed. Looks for category in the default categories list.
QList<QAction*> pqProxyGroupMenuManager::categoryActions | ( | pqProxyCategory * | category | ) |
Returns actions from given category.
Create actions as needed.
QList<QAction*> pqProxyGroupMenuManager::actionsInToolbars | ( | ) |
Returns this list of actions that appear in toolbars.
QAction* pqProxyGroupMenuManager::getAction | ( | pqProxyInfo * | proxy | ) |
Return the action for a given proxy.
void pqProxyGroupMenuManager::updateActionIcon | ( | pqProxyInfo * | proxy | ) |
Update action icon from proxy info.
void pqProxyGroupMenuManager::addProxyDefinitionUpdateListener | ( | const QString & | proxyGroupName | ) |
Attach an observer to proxy manager to monitor any proxy definition update The detected proxy have to own a hint:
where all the attribute are fully optional.
void pqProxyGroupMenuManager::removeProxyDefinitionUpdateListener | ( | const QString & | proxyGroupName | ) |
pqProxyCategory* pqProxyGroupMenuManager::getApplicationCategory | ( | ) |
Specific-meaning categories.
Returns the invisible root category containing all categories to display, as defined by the application.
pqProxyCategory* pqProxyGroupMenuManager::getMenuCategory | ( | ) |
Returns the invisible root category containing all categories to display.
Use settings if existing.
pqProxyCategory* pqProxyGroupMenuManager::getFavoritesCategory | ( | ) |
Returns the Favorites category.
bool pqProxyGroupMenuManager::isFavorites | ( | pqProxyCategory * | category | ) |
Returns true if the given category is a favorites.
Based on name.
|
slot |
Update from servermanager.
Load a configuration XML. It will find the elements with resourceTagName in the XML and populate the menu accordingly. Applications do not need to call this method directly, it's by default connected to pqApplicationCore::loadXML()
|
slot |
Look for new proxy definition to add inside the menu Iter over known proxy definitions to parse Hints tag.
|
slot |
Remove all ProxyDefinitionUpdate observers to active server.
|
slot |
Update the list of ProxyDefinitionUpdate observers to server.
|
inlineslot |
Definition at line 203 of file pqProxyGroupMenuManager.h.
|
virtual |
Forces a re-population of the menu.
Create the main submenu entries. Actions are mostly created on "aboutToShow" signal, as menu should present the currently available proxies. See also populateRecentlyUsedMenu, populateAlphabeticalMenu, populateMiscMenu, populateCategoriesMenus, clearMenu
void pqProxyGroupMenuManager::writeCategoryToSettings | ( | ) |
Write categories to settings.
|
signal |
fired when the menu gets repopulated,typically means that the actions have been updated.
|
signal |
Fired when categories were updated.
|
protectedslot |
|
protectedslot |
|
protectedslot |
|
protectedslot |
|
protectedslot |
|
protectedslot |
Fill recently used submenu.
|
protectedslot |
called when "favorites" menu is being shown.
create the menu (and submenu) with actions for the filters in the favorites list.
|
protected |
|
protected |
|
protected |
Load the favorites from settings.
|
protected |
|
protected |
Return the action for a given proxy.
|
protected |
Definition at line 252 of file pqProxyGroupMenuManager.h.
|
protected |
Definition at line 253 of file pqProxyGroupMenuManager.h.
|
protected |
Definition at line 254 of file pqProxyGroupMenuManager.h.
|
protected |
Definition at line 256 of file pqProxyGroupMenuManager.h.
|
protected |
Definition at line 257 of file pqProxyGroupMenuManager.h.