diff options
author | Eugeni Dodonov <eugeni@mandriva.com> | 2010-06-05 18:13:40 -0300 |
---|---|---|
committer | Eugeni Dodonov <eugeni@mandriva.com> | 2010-06-05 18:13:40 -0300 |
commit | 7e7e40905b0a894f88d165781f631459886fd488 (patch) | |
tree | c3692181ee1c0925916a4d0f6d376f17fc155519 | |
parent | 838cf5f7cded559b6f254f38f40a30a128c6b6f3 (diff) | |
download | net_monitor-7e7e40905b0a894f88d165781f631459886fd488.tar net_monitor-7e7e40905b0a894f88d165781f631459886fd488.tar.gz net_monitor-7e7e40905b0a894f88d165781f631459886fd488.tar.bz2 net_monitor-7e7e40905b0a894f88d165781f631459886fd488.tar.xz net_monitor-7e7e40905b0a894f88d165781f631459886fd488.zip |
add tab title
-rwxr-xr-x | src/net_monitor | 19 |
1 files changed, 16 insertions, 3 deletions
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""" |