Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
pqProxyGroupMenuManager Class Reference

pqProxyGroupMenuManager is a menu-populator that fills up a menu with proxies defined in an XML configuration file. More...

#include <pqProxyGroupMenuManager.h>

Inherits QObject.

Collaboration diagram for pqProxyGroupMenuManager:
Collaboration graph
[legend]

Public Slots

void loadConfiguration (vtkPVXMLElement *)
 Load a configuration XML. More...
 
void lookForNewDefinitions ()
 Look for new proxy definition to add inside the menu. More...
 
void removeProxyDefinitionUpdateObservers ()
 Remove all ProxyDefinitionUpdate observers to active server. More...
 
void addProxyDefinitionUpdateObservers ()
 Update the list of ProxyDefinitionUpdate observers to server. More...
 
void setEnabled (bool enable)
 Enable/disable the menu and the actions. More...
 
void populateMenu ()
 Forces a re-population of the menu. 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...
 

Public Member Functions

 pqProxyGroupMenuManager (QMenu *menu, const QString &resourceTagName, bool supportsQuickLaunch=true)
 Constructor. More...
 
 ~pqProxyGroupMenuManager () override
 
QMenu * menu () const
 Access the menu. More...
 
void setRecentlyUsedMenuSize (unsigned int val)
 When size>0 a recently used category will be added to the menu. More...
 
unsigned int recentlyUsedMenuSize () const
 
QWidget * widgetActionsHolder () const
 returns the widget that hold actions created by this menu manager. More...
 
QList< QAction * > actions () const
 returns the actions holds by the widgetActionsHolder More...
 
vtkSMProxygetPrototype (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...
 
QStringList getToolbarCategories () const
 Returns a list of categories that have the "show_in_toolbar" attribute set to 1. More...
 
QList< QAction * > actions (const QString &category)
 Returns the list of actions in a category. More...
 
QList< QAction * > actionsInToolbars ()
 Returns this list of actions that appear in toolbars. More...
 
bool hideForTests (const QString &category) const
 Returns whether or not the category's toolbar should be hidden initially. 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)
 
bool supportsQuickLaunch () const
 Returns true if the pqProxyGroupMenuManager has been registered with quick-launch mechanism maintained by pqApplicationCore. More...
 
void setEnableFavorites (bool enable)
 
QMenu * getFavoritesMenu ()
 
QString categoryLabel (const QString &category)
 Given a category name, return the category label. More...
 

Protected Slots

void triggered ()
 
void quickLaunch ()
 
void switchActiveServer ()
 
void updateMenuStyle ()
 
void populateRecentlyUsedMenu ()
 called when "recent" menu is being shown. 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 * getAction (const QString &pgroup, const QString &proxyname)
 Returns the action for a given proxy. More...
 
QAction * getAddToCategoryAction (const QString &path)
 

Protected Attributes

QString ResourceTagName
 
vtkPVXMLElementMenuRoot
 
int RecentlyUsedMenuSize
 
bool Enabled
 
bool EnableFavorites
 

Detailed Description

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 46 of file pqProxyGroupMenuManager.h.

Constructor & Destructor Documentation

◆ pqProxyGroupMenuManager()

pqProxyGroupMenuManager::pqProxyGroupMenuManager ( QMenu *  menu,
const QString &  resourceTagName,
bool  supportsQuickLaunch = true 
)

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.

◆ ~pqProxyGroupMenuManager()

pqProxyGroupMenuManager::~pqProxyGroupMenuManager ( )
override

Member Function Documentation

◆ menu()

QMenu* pqProxyGroupMenuManager::menu ( ) const
inline

Access the menu.

Definition at line 67 of file pqProxyGroupMenuManager.h.

◆ setRecentlyUsedMenuSize()

void pqProxyGroupMenuManager::setRecentlyUsedMenuSize ( unsigned int  val)
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 73 of file pqProxyGroupMenuManager.h.

◆ recentlyUsedMenuSize()

unsigned int pqProxyGroupMenuManager::recentlyUsedMenuSize ( ) const
inline

Definition at line 75 of file pqProxyGroupMenuManager.h.

◆ widgetActionsHolder()

QWidget* pqProxyGroupMenuManager::widgetActionsHolder ( ) const

returns the widget that hold actions created by this menu manager.

◆ actions() [1/2]

QList<QAction*> pqProxyGroupMenuManager::actions ( ) const

returns the actions holds by the widgetActionsHolder

◆ getPrototype()

vtkSMProxy* pqProxyGroupMenuManager::getPrototype ( QAction *  action) const

Returns the prototype proxy for the action.

◆ addProxy()

void pqProxyGroupMenuManager::addProxy ( const QString &  xmlgroup,
const QString &  xmlname 
)

Provides mechanism to explicitly add a proxy to the menu.

◆ removeProxy()

void pqProxyGroupMenuManager::removeProxy ( const QString &  xmlgroup,
const QString &  xmlname 
)

Provides mechanism to explicitly remove a proxy to the menu.

◆ getToolbarCategories()

QStringList pqProxyGroupMenuManager::getToolbarCategories ( ) const

Returns a list of categories that have the "show_in_toolbar" attribute set to 1.

◆ actions() [2/2]

QList<QAction*> pqProxyGroupMenuManager::actions ( const QString &  category)

Returns the list of actions in a category.

◆ actionsInToolbars()

QList<QAction*> pqProxyGroupMenuManager::actionsInToolbars ( )

Returns this list of actions that appear in toolbars.

◆ hideForTests()

bool pqProxyGroupMenuManager::hideForTests ( const QString &  category) const

Returns whether or not the category's toolbar should be hidden initially.

◆ addProxyDefinitionUpdateListener()

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:

<ShowInMenu category="" icon=""/>

where all the attribute are fully optional.

◆ removeProxyDefinitionUpdateListener()

void pqProxyGroupMenuManager::removeProxyDefinitionUpdateListener ( const QString &  proxyGroupName)

◆ supportsQuickLaunch()

bool pqProxyGroupMenuManager::supportsQuickLaunch ( ) const
inline

Returns true if the pqProxyGroupMenuManager has been registered with quick-launch mechanism maintained by pqApplicationCore.

Definition at line 138 of file pqProxyGroupMenuManager.h.

◆ setEnableFavorites()

void pqProxyGroupMenuManager::setEnableFavorites ( bool  enable)
inline

Definition at line 140 of file pqProxyGroupMenuManager.h.

◆ getFavoritesMenu()

QMenu* pqProxyGroupMenuManager::getFavoritesMenu ( )

◆ categoryLabel()

QString pqProxyGroupMenuManager::categoryLabel ( const QString &  category)

Given a category name, return the category label.

◆ loadConfiguration

void pqProxyGroupMenuManager::loadConfiguration ( vtkPVXMLElement )
slot

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()

◆ lookForNewDefinitions

void pqProxyGroupMenuManager::lookForNewDefinitions ( )
slot

Look for new proxy definition to add inside the menu.

◆ removeProxyDefinitionUpdateObservers

void pqProxyGroupMenuManager::removeProxyDefinitionUpdateObservers ( )
slot

Remove all ProxyDefinitionUpdate observers to active server.

◆ addProxyDefinitionUpdateObservers

void pqProxyGroupMenuManager::addProxyDefinitionUpdateObservers ( )
slot

Update the list of ProxyDefinitionUpdate observers to server.

◆ setEnabled

void pqProxyGroupMenuManager::setEnabled ( bool  enable)
slot

Enable/disable the menu and the actions.

◆ populateMenu

void pqProxyGroupMenuManager::populateMenu ( )
slot

Forces a re-population of the menu.

Any need to call this only after addProxy() has been used to explicitly add entries.

◆ triggered [1/2]

void pqProxyGroupMenuManager::triggered ( const QString &  group,
const QString &  name 
)
signal

◆ menuPopulated

void pqProxyGroupMenuManager::menuPopulated ( )
signal

fired when the menu gets repopulated,typically means that the actions have been updated.

◆ triggered [2/2]

void pqProxyGroupMenuManager::triggered ( )
protectedslot

◆ quickLaunch

void pqProxyGroupMenuManager::quickLaunch ( )
protectedslot

◆ switchActiveServer

void pqProxyGroupMenuManager::switchActiveServer ( )
protectedslot

◆ updateMenuStyle

void pqProxyGroupMenuManager::updateMenuStyle ( )
protectedslot

◆ populateRecentlyUsedMenu

void pqProxyGroupMenuManager::populateRecentlyUsedMenu ( )
protectedslot

called when "recent" menu is being shown.

updates the menu with actions for the filters in the recent list.

◆ populateFavoritesMenu

void pqProxyGroupMenuManager::populateFavoritesMenu ( )
protectedslot

called when "favorites" menu is being shown.

create the menu (and submenu) with actions for the filters in the favorites list.

◆ loadRecentlyUsedItems()

void pqProxyGroupMenuManager::loadRecentlyUsedItems ( )
protected

◆ saveRecentlyUsedItems()

void pqProxyGroupMenuManager::saveRecentlyUsedItems ( )
protected

◆ loadFavoritesItems()

void pqProxyGroupMenuManager::loadFavoritesItems ( )
protected

Load the favorites from settings.

◆ getAction()

QAction* pqProxyGroupMenuManager::getAction ( const QString &  pgroup,
const QString &  proxyname 
)
protected

Returns the action for a given proxy.

◆ getAddToCategoryAction()

QAction* pqProxyGroupMenuManager::getAddToCategoryAction ( const QString &  path)
protected

Member Data Documentation

◆ ResourceTagName

QString pqProxyGroupMenuManager::ResourceTagName
protected

Definition at line 212 of file pqProxyGroupMenuManager.h.

◆ MenuRoot

vtkPVXMLElement* pqProxyGroupMenuManager::MenuRoot
protected

Definition at line 213 of file pqProxyGroupMenuManager.h.

◆ RecentlyUsedMenuSize

int pqProxyGroupMenuManager::RecentlyUsedMenuSize
protected

Definition at line 214 of file pqProxyGroupMenuManager.h.

◆ Enabled

bool pqProxyGroupMenuManager::Enabled
protected

Definition at line 215 of file pqProxyGroupMenuManager.h.

◆ EnableFavorites

bool pqProxyGroupMenuManager::EnableFavorites
protected

Definition at line 216 of file pqProxyGroupMenuManager.h.


The documentation for this class was generated from the following file: