Proxy class for a Gui.ViewProviderDocumentObject Server.ViewObject.
More...
Public Member Functions | |
| def | __init__ (self, vp) |
| Initialization method for ViewProviderServerProxy. More... | |
| def | onDelete (self, vp, subelements) |
Method called when FeaturePython Server is about to be deleted. More... | |
| def | doubleClicked (self, vp) |
Method called when FeaturePython Server is double-clicked in the Tree View. More... | |
| def | setupContextMenu (self, vp, menu) |
| Method called by the FreeCAD to customize a context menu for a Server. More... | |
| def | getIcon (self) |
| Method used to get a path to an icon which will appear in the tree view. More... | |
| def | setProperties (self, vp) |
| Method to hide properties and select appropriate icon to show it the Tree View. More... | |
Proxy class for a Gui.ViewProviderDocumentObject Server.ViewObject.
A ViewProviderServerProxy instance changes a FeaturePython Server's icon in the Tree view to show if Server is Running or not. It also closes/starts ServerProxy's cmd_server if the FeaturePython is double-clicked, deleted or chosen to be connected/disconnected through its context view. The context view is also provided by this class.
To connect this Proxy object to a Gui.ViewProviderDocumentObject Server.ViewObject do:
| def Server.ViewProviderServerProxy.__init__ | ( | self, | |
| vp | |||
| ) |
Initialization method for ViewProviderServerProxy.
A class instance is created and made a Proxy for a generic Gui.ViewProviderDocumentObject Server.ViewObject. This method selects appropriate icon for FeaturePython Server and hides unnecessary unused View properties.
| vp | A barebone Gui.ViewProviderDocumentObject Server.ViewObject. |
| def Server.ViewProviderServerProxy.doubleClicked | ( | self, | |
| vp | |||
| ) |
Method called when FeaturePython Server is double-clicked in the Tree View.
This methods tries to start ServerProxy's cmd_server if it wasn't running and closes it in the opposite case. It shows warning dialogs if something failed. If action is successful, then the icon in the Tree View is changed (You may need to recompute the document to see the change).
| vp | A double-clicked Gui.ViewProviderDocumentObject Server.ViewObject. |
Definition at line 295 of file Server.py.
| def Server.ViewProviderServerProxy.getIcon | ( | self | ) |
| def Server.ViewProviderServerProxy.onDelete | ( | self, | |
| vp, | |||
| subelements | |||
| ) |
Method called when FeaturePython Server is about to be deleted.
This method is used to close ServerProxy's cmd_server as not to leave a Port occupied.
| vp | A Gui.ViewProviderDocumentObject Server.ViewObject being closed. |
| subelements | An unused argument from C++ binding. |
| def Server.ViewProviderServerProxy.setProperties | ( | self, | |
| vp | |||
| ) |
Method to hide properties and select appropriate icon to show it the Tree View.
This method is called during initialization or document restoration. All unused unnecessary view properties are hidden and icon is chosen in accordance with ServerProxy's Running state.
| vp | A Gui.ViewProviderDocumentObject Server.ViewObject. |
Definition at line 364 of file Server.py.
| def Server.ViewProviderServerProxy.setupContextMenu | ( | self, | |
| vp, | |||
| menu | |||
| ) |
Method called by the FreeCAD to customize a context menu for a Server.
The Transform and Set colors... items are removed from the context menu shown upon right click on FeaturePython Server in the Tree View. The option to Disconnect Server, or Connect Server is added instead.
| vp | A right-clicked Gui.ViewProviderDocumentObject Server.ViewObject. |
| menu | A Qt's QMenu to be edited. |
Definition at line 334 of file Server.py.