Merged connect and disconnect buttons.

master
Nathan Zadoks 2011-12-04 02:17:19 +01:00
parent 086620c6ce
commit 882e68e4a3
1 changed files with 7 additions and 7 deletions

View File

@ -139,7 +139,9 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
def online(self):
print _("Printer is now online.")
wx.CallAfter(self.connectbtn.Disable)
self.connectbtn.SetLabel("Disconnect")
self.connectbtn.Bind(wx.EVT_BUTTON,self.disconnect)
for i in self.printerControls:
wx.CallAfter(i.Enable)
@ -442,10 +444,6 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
uts.Add(self.connectbtn)
self.connectbtn.SetToolTipString(_("Connect to the printer"))
self.connectbtn.Bind(wx.EVT_BUTTON,self.connect)
self.disconnectbtn=wx.Button(self.panel,-1,_("Disconnect"))
self.disconnectbtn.Bind(wx.EVT_BUTTON,self.disconnect)
self.printerControls.append(self.disconnectbtn)
uts.Add(self.disconnectbtn)
self.resetbtn=wx.Button(self.panel,-1,_("Reset"))
self.resetbtn.Bind(wx.EVT_BUTTON,self.reset)
uts.Add(self.resetbtn)
@ -1482,8 +1480,10 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
print _("Disconnected.")
self.p.disconnect()
self.statuscheck=False
wx.CallAfter(self.connectbtn.Enable);
self.connectbtn.SetLabel("Connect")
self.connectbtn.Bind(wx.EVT_BUTTON,self.connect)
wx.CallAfter(self.printbtn.Disable);
wx.CallAfter(self.pausebtn.Disable);
for i in self.printerControls: