summaryrefslogtreecommitdiff
path: root/grc/gui/Bars.py
diff options
context:
space:
mode:
Diffstat (limited to 'grc/gui/Bars.py')
-rw-r--r--grc/gui/Bars.py206
1 files changed, 103 insertions, 103 deletions
diff --git a/grc/gui/Bars.py b/grc/gui/Bars.py
index 770e705ffc..e2b7f4f9bc 100644
--- a/grc/gui/Bars.py
+++ b/grc/gui/Bars.py
@@ -24,31 +24,31 @@ import gtk
##The list of actions for the toolbar.
TOOLBAR_LIST = (
- Actions.FLOW_GRAPH_NEW,
- Actions.FLOW_GRAPH_OPEN,
- Actions.FLOW_GRAPH_SAVE,
- Actions.FLOW_GRAPH_CLOSE,
- None,
- Actions.FLOW_GRAPH_SCREEN_CAPTURE,
- None,
- Actions.BLOCK_CUT,
- Actions.BLOCK_COPY,
- Actions.BLOCK_PASTE,
- Actions.ELEMENT_DELETE,
- None,
- Actions.FLOW_GRAPH_UNDO,
- Actions.FLOW_GRAPH_REDO,
- None,
- Actions.ERRORS_WINDOW_DISPLAY,
- Actions.FLOW_GRAPH_GEN,
- Actions.FLOW_GRAPH_EXEC,
- Actions.FLOW_GRAPH_KILL,
- None,
- Actions.BLOCK_ROTATE_CCW,
- Actions.BLOCK_ROTATE_CW,
- None,
- Actions.BLOCK_ENABLE,
- Actions.BLOCK_DISABLE,
+ Actions.FLOW_GRAPH_NEW,
+ Actions.FLOW_GRAPH_OPEN,
+ Actions.FLOW_GRAPH_SAVE,
+ Actions.FLOW_GRAPH_CLOSE,
+ None,
+ Actions.FLOW_GRAPH_SCREEN_CAPTURE,
+ None,
+ Actions.BLOCK_CUT,
+ Actions.BLOCK_COPY,
+ Actions.BLOCK_PASTE,
+ Actions.ELEMENT_DELETE,
+ None,
+ Actions.FLOW_GRAPH_UNDO,
+ Actions.FLOW_GRAPH_REDO,
+ None,
+ Actions.ERRORS_WINDOW_DISPLAY,
+ Actions.FLOW_GRAPH_GEN,
+ Actions.FLOW_GRAPH_EXEC,
+ Actions.FLOW_GRAPH_KILL,
+ None,
+ Actions.BLOCK_ROTATE_CCW,
+ Actions.BLOCK_ROTATE_CW,
+ None,
+ Actions.BLOCK_ENABLE,
+ Actions.BLOCK_DISABLE,
None,
Actions.RELOAD_BLOCKS,
Actions.OPEN_HIER,
@@ -57,88 +57,88 @@ TOOLBAR_LIST = (
##The list of actions and categories for the menu bar.
MENU_BAR_LIST = (
- (gtk.Action('File', '_File', None, None), [
- Actions.FLOW_GRAPH_NEW,
- Actions.FLOW_GRAPH_OPEN,
- None,
- Actions.FLOW_GRAPH_SAVE,
- Actions.FLOW_GRAPH_SAVE_AS,
- None,
- Actions.FLOW_GRAPH_SCREEN_CAPTURE,
- None,
- Actions.FLOW_GRAPH_CLOSE,
- Actions.APPLICATION_QUIT,
- ]),
- (gtk.Action('Edit', '_Edit', None, None), [
- Actions.FLOW_GRAPH_UNDO,
- Actions.FLOW_GRAPH_REDO,
- None,
- Actions.BLOCK_CUT,
- Actions.BLOCK_COPY,
- Actions.BLOCK_PASTE,
- Actions.ELEMENT_DELETE,
- None,
- Actions.BLOCK_ROTATE_CCW,
- Actions.BLOCK_ROTATE_CW,
- None,
- Actions.BLOCK_ENABLE,
- Actions.BLOCK_DISABLE,
- None,
- Actions.BLOCK_PARAM_MODIFY,
- ]),
- (gtk.Action('View', '_View', None, None), [
- Actions.ERRORS_WINDOW_DISPLAY,
- ]),
- (gtk.Action('Build', '_Build', None, None), [
- Actions.FLOW_GRAPH_GEN,
- Actions.FLOW_GRAPH_EXEC,
- Actions.FLOW_GRAPH_KILL,
- ]),
- (gtk.Action('Help', '_Help', None, None), [
- Actions.HELP_WINDOW_DISPLAY,
- Actions.TYPES_WINDOW_DISPLAY,
- None,
- Actions.ABOUT_WINDOW_DISPLAY,
- ]),
+ (gtk.Action('File', '_File', None, None), [
+ Actions.FLOW_GRAPH_NEW,
+ Actions.FLOW_GRAPH_OPEN,
+ None,
+ Actions.FLOW_GRAPH_SAVE,
+ Actions.FLOW_GRAPH_SAVE_AS,
+ None,
+ Actions.FLOW_GRAPH_SCREEN_CAPTURE,
+ None,
+ Actions.FLOW_GRAPH_CLOSE,
+ Actions.APPLICATION_QUIT,
+ ]),
+ (gtk.Action('Edit', '_Edit', None, None), [
+ Actions.FLOW_GRAPH_UNDO,
+ Actions.FLOW_GRAPH_REDO,
+ None,
+ Actions.BLOCK_CUT,
+ Actions.BLOCK_COPY,
+ Actions.BLOCK_PASTE,
+ Actions.ELEMENT_DELETE,
+ None,
+ Actions.BLOCK_ROTATE_CCW,
+ Actions.BLOCK_ROTATE_CW,
+ None,
+ Actions.BLOCK_ENABLE,
+ Actions.BLOCK_DISABLE,
+ None,
+ Actions.BLOCK_PARAM_MODIFY,
+ ]),
+ (gtk.Action('View', '_View', None, None), [
+ Actions.ERRORS_WINDOW_DISPLAY,
+ ]),
+ (gtk.Action('Build', '_Build', None, None), [
+ Actions.FLOW_GRAPH_GEN,
+ Actions.FLOW_GRAPH_EXEC,
+ Actions.FLOW_GRAPH_KILL,
+ ]),
+ (gtk.Action('Help', '_Help', None, None), [
+ Actions.HELP_WINDOW_DISPLAY,
+ Actions.TYPES_WINDOW_DISPLAY,
+ None,
+ Actions.ABOUT_WINDOW_DISPLAY,
+ ]),
)
class Toolbar(gtk.Toolbar):
- """The gtk toolbar with actions added from the toolbar list."""
+ """The gtk toolbar with actions added from the toolbar list."""
- def __init__(self):
- """
- Parse the list of action names in the toolbar list.
- Look up the action for each name in the action list and add it to the toolbar.
- """
- gtk.Toolbar.__init__(self)
- self.set_style(gtk.TOOLBAR_ICONS)
- for action in TOOLBAR_LIST:
- if action: #add a tool item
- self.add(action.create_tool_item())
- #this reset of the tooltip property is required (after creating the tool item) for the tooltip to show
- action.set_property('tooltip', action.get_property('tooltip'))
- else: self.add(gtk.SeparatorToolItem())
+ def __init__(self):
+ """
+ Parse the list of action names in the toolbar list.
+ Look up the action for each name in the action list and add it to the toolbar.
+ """
+ gtk.Toolbar.__init__(self)
+ self.set_style(gtk.TOOLBAR_ICONS)
+ for action in TOOLBAR_LIST:
+ if action: #add a tool item
+ self.add(action.create_tool_item())
+ #this reset of the tooltip property is required (after creating the tool item) for the tooltip to show
+ action.set_property('tooltip', action.get_property('tooltip'))
+ else: self.add(gtk.SeparatorToolItem())
class MenuBar(gtk.MenuBar):
- """The gtk menu bar with actions added from the menu bar list."""
+ """The gtk menu bar with actions added from the menu bar list."""
- def __init__(self):
- """
- Parse the list of submenus from the menubar list.
- For each submenu, get a list of action names.
- Look up the action for each name in the action list and add it to the submenu.
- Add the submenu to the menu bar.
- """
- gtk.MenuBar.__init__(self)
- for main_action, actions in MENU_BAR_LIST:
- #create the main menu item
- main_menu_item = main_action.create_menu_item()
- self.append(main_menu_item)
- #create the menu
- main_menu = gtk.Menu()
- main_menu_item.set_submenu(main_menu)
- for action in actions:
- if action: #append a menu item
- main_menu.append(action.create_menu_item())
- else: main_menu.append(gtk.SeparatorMenuItem())
- main_menu.show_all() #this show all is required for the separators to show
+ def __init__(self):
+ """
+ Parse the list of submenus from the menubar list.
+ For each submenu, get a list of action names.
+ Look up the action for each name in the action list and add it to the submenu.
+ Add the submenu to the menu bar.
+ """
+ gtk.MenuBar.__init__(self)
+ for main_action, actions in MENU_BAR_LIST:
+ #create the main menu item
+ main_menu_item = main_action.create_menu_item()
+ self.append(main_menu_item)
+ #create the menu
+ main_menu = gtk.Menu()
+ main_menu_item.set_submenu(main_menu)
+ for action in actions:
+ if action: #append a menu item
+ main_menu.append(action.create_menu_item())
+ else: main_menu.append(gtk.SeparatorMenuItem())
+ main_menu.show_all() #this show all is required for the separators to show