ParaView
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)
 Constructor. More...
 
 ~pqProxyGroupMenuManager ()
 
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)
 

Protected Slots

void triggered ()
 
void quickLaunch ()
 
void switchActiveServer ()
 

Protected Member Functions

void loadRecentlyUsedItems ()
 
void saveRecentlyUsedItems ()
 
void populateRecentlyUsedMenu (QMenu *)
 
QAction * getAction (const QString &pgroup, const QString &proxyname)
 Returns the action for a given proxy. More...
 

Protected Attributes

QString ResourceTagName
 
vtkPVXMLElementMenuRoot
 
int RecentlyUsedMenuSize
 
bool Enabled
 

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 
)

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.

◆ ~pqProxyGroupMenuManager()

pqProxyGroupMenuManager::~pqProxyGroupMenuManager ( )

Member Function Documentation

◆ menu()

QMenu* pqProxyGroupMenuManager::menu ( ) const
inline

Access the menu.

Definition at line 64 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 70 of file pqProxyGroupMenuManager.h.

◆ recentlyUsedMenuSize()

unsigned int pqProxyGroupMenuManager::recentlyUsedMenuSize ( ) const
inline

Definition at line 72 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)

◆ 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

◆ loadRecentlyUsedItems()

void pqProxyGroupMenuManager::loadRecentlyUsedItems ( )
protected

◆ saveRecentlyUsedItems()

void pqProxyGroupMenuManager::saveRecentlyUsedItems ( )
protected

◆ populateRecentlyUsedMenu()

void pqProxyGroupMenuManager::populateRecentlyUsedMenu ( QMenu *  )
protected

◆ getAction()

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

Returns the action for a given proxy.

Member Data Documentation

◆ ResourceTagName

QString pqProxyGroupMenuManager::ResourceTagName
protected

Definition at line 181 of file pqProxyGroupMenuManager.h.

◆ MenuRoot

vtkPVXMLElement* pqProxyGroupMenuManager::MenuRoot
protected

Definition at line 182 of file pqProxyGroupMenuManager.h.

◆ RecentlyUsedMenuSize

int pqProxyGroupMenuManager::RecentlyUsedMenuSize
protected

Definition at line 183 of file pqProxyGroupMenuManager.h.

◆ Enabled

bool pqProxyGroupMenuManager::Enabled
protected

Definition at line 184 of file pqProxyGroupMenuManager.h.


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