commit 2b5602ac329c6e0d45ba9d2cdfb5d7b4eb11c061 Author: Damian Johnson atagar@torproject.org Date: Sat Jul 9 16:21:07 2011 -0700
Adding menu option to shut down tor --- src/cli/menu/actions.py | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/src/cli/menu/actions.py b/src/cli/menu/actions.py index 3c90b10..db9d178 100644 --- a/src/cli/menu/actions.py +++ b/src/cli/menu/actions.py @@ -50,17 +50,22 @@ def makeActionsMenu(): """
control = cli.controller.getController() + conn = torTools.getConn() headerPanel = control.getPanel("header") actionsMenu = cli.menu.item.Submenu("Actions") actionsMenu.add(cli.menu.item.MenuItem("Close Menu", None)) actionsMenu.add(cli.menu.item.MenuItem("New Identity", headerPanel.sendNewnym)) + + if conn.isAlive(): + actionsMenu.add(cli.menu.item.MenuItem("Stop Tor", conn.shutdown)) + + actionsMenu.add(cli.menu.item.MenuItem("Reset Tor", conn.reload)) actionsMenu.add(cli.menu.item.MenuItem("Setup Wizard", cli.wizard.showWizard))
if control.isPaused(): label, arg = "Unpause", False else: label, arg = "Pause", True actionsMenu.add(cli.menu.item.MenuItem(label, functools.partial(control.setPaused, arg)))
- actionsMenu.add(cli.menu.item.MenuItem("Reset Tor", torTools.getConn().reload)) actionsMenu.add(cli.menu.item.MenuItem("Exit", control.quit)) return actionsMenu
tor-commits@lists.torproject.org