Commit 882e68e4 authored by Nathan Zadoks's avatar Nathan Zadoks

Merged connect and disconnect buttons.

parent 086620c6
...@@ -139,7 +139,9 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -139,7 +139,9 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
def online(self): def online(self):
print _("Printer is now online.") 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: for i in self.printerControls:
wx.CallAfter(i.Enable) wx.CallAfter(i.Enable)
...@@ -442,10 +444,6 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -442,10 +444,6 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
uts.Add(self.connectbtn) uts.Add(self.connectbtn)
self.connectbtn.SetToolTipString(_("Connect to the printer")) self.connectbtn.SetToolTipString(_("Connect to the printer"))
self.connectbtn.Bind(wx.EVT_BUTTON,self.connect) 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=wx.Button(self.panel,-1,_("Reset"))
self.resetbtn.Bind(wx.EVT_BUTTON,self.reset) self.resetbtn.Bind(wx.EVT_BUTTON,self.reset)
uts.Add(self.resetbtn) uts.Add(self.resetbtn)
...@@ -1482,8 +1480,10 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -1482,8 +1480,10 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
print _("Disconnected.") print _("Disconnected.")
self.p.disconnect() self.p.disconnect()
self.statuscheck=False 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.printbtn.Disable);
wx.CallAfter(self.pausebtn.Disable); wx.CallAfter(self.pausebtn.Disable);
for i in self.printerControls: for i in self.printerControls:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment