diff options
author | kingzero <devnull@localhost> | 2009-06-17 22:49:02 +0200 |
---|---|---|
committer | kingzero <devnull@localhost> | 2009-06-17 22:49:02 +0200 |
commit | a6f731fae892af77ccfe3e217368079cb76fad12 (patch) | |
tree | 2ef74c39ad1577de361ca242023bd2e092b45fbc /pyLoadGui.py | |
parent | some modifications on the gui. you can now connect to pyload and disconnect. (diff) | |
download | pyload-a6f731fae892af77ccfe3e217368079cb76fad12.tar.xz |
added a error message if gui cant connect to server
Diffstat (limited to 'pyLoadGui.py')
-rwxr-xr-x | pyLoadGui.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/pyLoadGui.py b/pyLoadGui.py index e8f68eff9..422d5bd19 100755 --- a/pyLoadGui.py +++ b/pyLoadGui.py @@ -181,16 +181,20 @@ class Pyload_Main_Gui(wx.Frame): self.SetStatusText('Connected to: %s:%s' % (socket_host.host.GetValue(), socket_host.port.GetValue())) except socket.error: if (socket_host.host.GetValue() in ['localhost', '127.0.0.1']): - cmd = ['python', 'pyLoadCore.py'] - subprocess.Popen(cmd) - sleep(1) - self.thread = SocketThread(socket_host.host.GetValue(), int(socket_host.port.GetValue()), socket_host.password.GetValue(), self) - self.SetStatusText('Connected to: %s:%s' % (socket_host.host.GetValue(), socket_host.port.GetValue())) + if (wx.MessageDialog(None, 'Do you want to start pyLoadCore locally?', 'Start pyLoad', wx.OK | wx.CANCEL).ShowModal() == wx.ID_OK): + cmd = ['python', 'pyLoadCore.py'] + subprocess.Popen(cmd) + sleep(1) + self.thread = SocketThread(socket_host.host.GetValue(), int(socket_host.port.GetValue()), socket_host.password.GetValue(), self) + self.SetStatusText('Connected to: %s:%s' % (socket_host.host.GetValue(), socket_host.port.GetValue())) + else: + wx.MessageDialog(None, 'Cant connect to: %s:%s' % (socket_host.host.GetValue(), socket_host.port.GetValue()), 'Error', wx.OK | wx.ICON_ERROR).ShowModal() else: wx.MessageDialog(None, 'Cant connect to: %s:%s' % (socket_host.host.GetValue(), socket_host.port.GetValue()), 'Error', wx.OK | wx.ICON_ERROR).ShowModal() def disconnect(self, event): self.thread.socket.shutdown(socket.SHUT_RDWR) + self.SetStatusText('') |