Skip to content

Commit

Permalink
refine goagent gtk
Browse files Browse the repository at this point in the history
  • Loading branch information
phuslu committed Jun 1, 2013
1 parent ab309eb commit d015a90
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions local/goagent-gtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,17 @@ def should_visible():

class GoAgentGTK:

command = ['/usr/bin/env', 'python3', 'proxy.py']
command = ['/usr/bin/env', 'python', 'proxy.py']
message = u'GoAgent已经启动,单击托盘图标可以最小化'
fail_message = u'GoAgent启动失败,请查看控制台窗口的错误信息。'

def __init__(self, window, terminal):
self.window = window
self.terminal = terminal

if os.system('which python3') == 0:
self.command[1] = 'python3'

self.window.add(terminal)
self.childpid = self.terminal.fork_command(self.command[0], self.command, os.getcwd())
if self.childpid > 0:
Expand Down Expand Up @@ -247,13 +250,13 @@ def on_reload(self, widget, data=None):
self.on_show(widget, data)
self.childpid = self.terminal.fork_command(self.command[0], self.command, os.getcwd())
self.childexited = self.terminal.connect('child-exited', lambda term: gtk.main_quit())

def show_hide_toggle(self, widget, data= None):
if self.window.get_property('visible'):
self.on_hide(widget, data)
else:
self.on_show(widget, data)

def on_quit(self, widget, data=None):
gtk.main_quit()

Expand Down

0 comments on commit d015a90

Please sign in to comment.