From 345c34180e2bd2508efad4e34d2274fc2c2eb670 Mon Sep 17 00:00:00 2001 From: Eugeni Dodonov Date: Mon, 20 Jul 2009 15:17:39 +0000 Subject: Showing logo when running inside MCC, and add toolbar. --- src/msec/msecgui.py | 48 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/msec/msecgui.py b/src/msec/msecgui.py index d0c3f3b..ad07922 100755 --- a/src/msec/msecgui.py +++ b/src/msec/msecgui.py @@ -171,20 +171,40 @@ class MsecGui: menuitem.set_sensitive(False) menu.add(menuitem) - # creating logo - banner = gtk.HBox(homogeneous=False, spacing=10) - try: - # logo - image = gtk.Image() - pixbuf = gtk.gdk.pixbuf_new_from_file("%s/%s" % (config.MSEC_DIR, BANNER)) - image.set_from_pixbuf(pixbuf) - banner.pack_start(image, False, False) - label = gtk.Label(_("MSEC: System Security and Audit")) - label.modify_font(pango.FontDescription("13")) - banner.pack_start(label, False, False) - main_vbox.pack_start(banner, False, False) - except: - print "Banner %s Not found" % ("%s/%s" % (config.MSEC_DIR, BANNER)) + # creating logo if running inside mcc + if embed: + banner = gtk.HBox(homogeneous=False, spacing=10) + try: + # logo + image = gtk.Image() + pixbuf = gtk.gdk.pixbuf_new_from_file("%s/%s" % (config.MSEC_DIR, BANNER)) + image.set_from_pixbuf(pixbuf) + banner.pack_start(image, False, False) + label = gtk.Label(_("MSEC: System Security and Audit")) + label.modify_font(pango.FontDescription("13")) + banner.pack_start(label, False, False) + main_vbox.pack_start(banner, False, False) + except: + print "Banner %s Not found" % ("%s/%s" % (config.MSEC_DIR, BANNER)) + + # toolbar + toolbar = gtk.Toolbar() + toolbar.set_style(gtk.TOOLBAR_ICONS) + toolbar.set_tooltips(True) + + toolbar_item = gtk.ToolButton("Save") + toolbar_item.set_stock_id(gtk.STOCK_SAVE) + toolbar_item.connect("clicked", self.ok) + toolbar_item.set_tooltip_text(_("Save and apply current policy")) + toolbar.insert(toolbar_item, -1) + + toolbar_item = gtk.ToolButton("Quit") + toolbar_item.set_stock_id(gtk.STOCK_QUIT) + toolbar_item.connect("clicked", self.quit) + toolbar_item.set_tooltip_text(_("Quit")) + toolbar.insert(toolbar_item, -1) + + main_vbox.pack_start(toolbar, False, False) # creating tabs self.notebook = gtk.Notebook() -- cgit v1.2.1