From 7e7e40905b0a894f88d165781f631459886fd488 Mon Sep 17 00:00:00 2001 From: Eugeni Dodonov Date: Sat, 5 Jun 2010 18:13:40 -0300 Subject: add tab title --- src/net_monitor | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/net_monitor b/src/net_monitor index 7f4d009..4e42ebe 100755 --- a/src/net_monitor +++ b/src/net_monitor @@ -276,6 +276,7 @@ class LoadGraph: class MonitorGui: # icon pattern - icons are pulled from drakx-net ICON_PATTERN="/usr/share/libDrakX/pixmaps/%s-16.png" + ICON_CONNECTED="/usr/share/libDrakX/pixmaps/connected.png" (COLUMN_PROTO, COLUMN_LOC_ADDR, COLUMN_LOC_PORT, COLUMN_REM_ADDR, COLUMN_REM_PORT, COLUMN_STATUS) = range(6) def __init__(self, default_iface=None): self.window = gtk.Window() @@ -328,8 +329,8 @@ class MonitorGui: self.enabled_ifaces.append(iface) # finally, we have tabs for network connections - network_stat, self.connections = self.build_network_stat() - cur_page = self.notebook.append_page(network_stat, gtk.Label(_("Connections"))) + network_stat_label, network_stat, self.connections = self.build_network_stat() + cur_page = self.notebook.append_page(network_stat, network_stat_label) # global statusbar self.statusbar = gtk.Statusbar() @@ -600,7 +601,19 @@ class MonitorGui: # refresh connections self.refresh_connections(lstore) - return sw, lstore + # build tab label + widget = gtk.HBox() + try: + icon = gtk.Image() + pixbuf = gtk.gdk.pixbuf_new_from_file(self.ICON_CONNECTED) + icon.set_from_pixbuf(pixbuf) + widget.pack_start(icon) + except: + traceback.print_exc() + widget.pack_start(gtk.Label(_("connections"))) + widget.show_all() + + return widget, sw, lstore def build_iface_stat(self, iface): """Builds graphical view for interface""" -- cgit v1.2.1