commotion_client.GUI.extension_toolbar.ExtensionToolBar Class Reference
Inheritance diagram for commotion_client.GUI.extension_toolbar.ExtensionToolBar:

Public Member Functions

def __init__
 
def add_item
 

Public Attributes

 log
 
 translate
 
 viewport
 
 menu_items
 
 icon
 

Detailed Description

The central widget for the commotion client. This widget initalizes all other sub-widgets and extensions as well as defines the paramiters of the main GUI container.


An example of adding a single button to the menu that calls a function "save_form()"

new_button = MenuItem
my_button.setIcon(icon.save)
my_button.setText(self.translate("menu", "Save"))
new_button.action = self.save_form
self.add_item(new_button)

Constructor & Destructor Documentation

def commotion_client.GUI.extension_toolbar.ExtensionToolBar.__init__ (   self,
  viewport 
)
Sets up all the translation, logging, and core items needed for an extension toolbar.

Args:
  extension_menu_items (object): The extension specific menu-item to be used by an extension. This class is derived from the  
  viewport (object): The extensions viewport. This allows menu_items to have its actions interact with the current viewport.        

References commotion_client.GUI.extension_toolbar.ExtensionToolBar._dirty, commotion_client.extensions.config_editor.main.ViewPort._dirty, commotion_client.GUI.extension_toolbar.ExtensionToolBar.icon, commotion_client.GUI.crash_report.CrashReport.log, commotion_client.extensions.config_editor.main.ViewPort.log, commotion_client.GUI.extension_toolbar.ExtensionToolBar.log, commotion_client.commotion_client.HoldStateDuringRestart.log, commotion_client.GUI.crash_report.ReportGatherer.log, commotion_client.commotion_client.CommotionClientApplication.log, commotion_client.GUI.extension_toolbar.ExtensionToolBar.menu_items, commotion_client.extensions.config_editor.main.ViewPort.translate, commotion_client.GUI.extension_toolbar.ExtensionToolBar.translate, commotion_client.commotion_client.CommotionClientApplication.translate, and commotion_client.GUI.extension_toolbar.ExtensionToolBar.viewport.

36 
37  def __init__(self, viewport):
38  """Sets up all the translation, logging, and core items needed for an extension toolbar.
39 
40  Args:
41  extension_menu_items (object): The extension specific menu-item to be used by an extension. This class is derived from the
42  viewport (object): The extensions viewport. This allows menu_items to have its actions interact with the current viewport.
43  """
44  super().__init__()
45  self._dirty = False
46  self.log = logging.getLogger("commotion_client."+__name__)
47  self.translate = QtCore.QCoreApplication.translate
48  self.viewport = viewport
49  self.menu_items = {}
50  #The basic set of icons for extensions
51  self.icon = {
52  "save":QtGui.QIcon(":save32.png"),
53  "load":QtGui.QIcon(":load32.png"),
54  "user":QtGui.QIcon(":user32.png"),
55  "settings":QtGui.QIcon(":settings32.png"),
56  "full_screen_start":QtGui.QIcon(":full_screen_start32.png"),
57  "full_screen_end":QtGui.QIcon(":full_screen_end32.png"),
58  }
menu_items
Definition: extension_toolbar.py:48
viewport
Definition: extension_toolbar.py:47
translate
Definition: extension_toolbar.py:46
def __init__
Definition: extension_toolbar.py:36

The documentation for this class was generated from the following file:
  • commotion_client/GUI/extension_toolbar.py