diff options
author | Eugeni Dodonov <eugeni@mandriva.com> | 2010-06-05 18:29:35 -0300 |
---|---|---|
committer | Eugeni Dodonov <eugeni@mandriva.com> | 2010-06-05 18:29:35 -0300 |
commit | 73e53f9e5f2256a010dc979eae68ce4aea08587e (patch) | |
tree | 69db3cbeecb529f8ac9450e14bec3676bdbce7f8 | |
parent | 5494b15d444bf7c43f01a96ca5fa80c0c8aa4c0e (diff) | |
download | net_monitor-73e53f9e5f2256a010dc979eae68ce4aea08587e.tar net_monitor-73e53f9e5f2256a010dc979eae68ce4aea08587e.tar.gz net_monitor-73e53f9e5f2256a010dc979eae68ce4aea08587e.tar.bz2 net_monitor-73e53f9e5f2256a010dc979eae68ce4aea08587e.tar.xz net_monitor-73e53f9e5f2256a010dc979eae68ce4aea08587e.zip |
add support for refreshing connections
-rwxr-xr-x | src/net_monitor | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/net_monitor b/src/net_monitor index 4e42ebe..5385fd3 100755 --- a/src/net_monitor +++ b/src/net_monitor @@ -330,6 +330,9 @@ class MonitorGui: # finally, we have tabs for network connections network_stat_label, network_stat, self.connections = self.build_network_stat() + # refresh current connections + self.refresh_connections(None) + cur_page = self.notebook.append_page(network_stat, network_stat_label) # global statusbar @@ -544,8 +547,9 @@ class MonitorGui: ret = dialog.run() dialog.destroy() - def refresh_connections(self, lstore): + def refresh_connections(self, widget): """Updates connections""" + lstore = self.connections lstore.clear() for proto in ["tcp", "udp"]: connections = self.monitor.get_connections(proto=proto) @@ -598,9 +602,6 @@ class MonitorGui: sw.add(treeview) - # refresh connections - self.refresh_connections(lstore) - # build tab label widget = gtk.HBox() try: @@ -613,7 +614,13 @@ class MonitorGui: widget.pack_start(gtk.Label(_("connections"))) widget.show_all() - return widget, sw, lstore + vbox.pack_start(sw) + + button = gtk.Button(_("Refresh")) + button.connect('clicked', self.refresh_connections) + vbox.pack_start(button, False, False) + + return widget, vbox, lstore def build_iface_stat(self, iface): """Builds graphical view for interface""" |