From b248a1db494d2b386db1c642e2a4033f7a02cb7b Mon Sep 17 00:00:00 2001 From: Graeme Humphries Date: Fri, 15 Mar 2013 11:50:10 -0700 Subject: [PATCH] Fixed bug where terminal being removed didn't remove it from edit menu list of terminals. --- crussh.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crussh.py b/crussh.py index 7bdd3fe..c4f5de9 100755 --- a/crussh.py +++ b/crussh.py @@ -175,11 +175,15 @@ class CruSSH: def removeTerminal(self, terminal): # brute force search since we don't actually know the hostname from the # terminal object. this is an infrequent operation, so it should be fine. + for menuitem in self.ActiveHostsMenu.get_children(): + if terminal.get_tooltip_text() == menuitem.get_label(): + self.ActiveHostsMenu.remove(menuitem) for host in self.Terminals.keys(): if terminal == self.Terminals[host]: self.LayoutTable.remove(self.Terminals[host]) print("Disconnected from " + host) del self.Terminals[host] + self.reflow(force=True) def initGUI(self): @@ -213,7 +217,7 @@ class CruSSH: self.Terminals[host].copy_input = checkitem.get_active() ActiveHostsItem = gtk.MenuItem(label="Active Hosts") ActiveHostsItem.set_submenu(self.ActiveHostsMenu) - hosts = sorted(self.Terminals.keys(), reverse=True) + hosts = sorted(self.Terminals.keys(), reverse=False) for host in hosts: hostitem = gtk.CheckMenuItem(label=host) hostitem.set_active(True)