diff options
author | Sebastian Koslowski <koslowski@kit.edu> | 2015-09-25 12:15:45 +0200 |
---|---|---|
committer | Sebastian Koslowski <koslowski@kit.edu> | 2015-10-01 21:51:09 +0200 |
commit | 6970a408e3f4a60d503149cabc0197c76cd16985 (patch) | |
tree | 1c9b948da5fb3694f644c57e629528a3e3f1accf /grc/gui/MainWindow.py | |
parent | 40ffa464f7d70839599f59a51aef06873518ac17 (diff) |
grc: add File->New submenu with generate modes preset, Bar.py refactoring
Diffstat (limited to 'grc/gui/MainWindow.py')
-rw-r--r-- | grc/gui/MainWindow.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/grc/gui/MainWindow.py b/grc/gui/MainWindow.py index 03a4b536f2..f658a85062 100644 --- a/grc/gui/MainWindow.py +++ b/grc/gui/MainWindow.py @@ -65,12 +65,17 @@ PAGE_TITLE_MARKUP_TMPL = """\ class MainWindow(gtk.Window): """The topmost window with menus, the tool bar, and other major windows.""" - def __init__(self, platform): + def __init__(self, platform, action_handler_callback): """ MainWindow contructor Setup the menu, toolbar, flowgraph editor notebook, block selection window... """ self._platform = platform + gen_opts = platform.get_block('options').get_param('generate_options') + generate_mode_default = gen_opts.get_value() + generate_modes = [ + (o.get_key(), o.get_name(), o.get_key() == generate_mode_default) + for o in gen_opts.get_options()] #setup window gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL) vbox = gtk.VBox() @@ -78,7 +83,8 @@ class MainWindow(gtk.Window): self.add(vbox) #create the menu bar and toolbar self.add_accel_group(Actions.get_accel_group()) - vbox.pack_start(Bars.MenuBar(), False) + menu_bar = Bars.MenuBar(generate_modes, action_handler_callback) + vbox.pack_start(menu_bar, False) vbox.pack_start(Bars.Toolbar(), False) vbox.pack_start(self.hpaned) #create the notebook |