Commit 3f21b9d1 authored by kliment's avatar kliment

Merge pull request #117 from FrozenFire/experimental

Made SD Upload call the right function - not the SD Print function
parents 2e416a7c 882e68e4
...@@ -72,6 +72,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -72,6 +72,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.statuscheck=False self.statuscheck=False
self.tempreport="" self.tempreport=""
self.monitor=0 self.monitor=0
self.f=None
self.skeinp=None self.skeinp=None
self.monitor_interval=3 self.monitor_interval=3
self.paused=False self.paused=False
...@@ -138,7 +139,9 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -138,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)
...@@ -441,10 +444,6 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -441,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)
...@@ -678,9 +677,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -678,9 +677,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
obj = e.GetEventObject() obj = e.GetEventObject()
popupmenu=wx.Menu() popupmenu=wx.Menu()
item = popupmenu.Append(-1,_("SD Upload")) item = popupmenu.Append(-1,_("SD Upload"))
self.Bind(wx.EVT_MENU,self.upload) if not self.f or not len(self.f):
item.Enable(False)
self.Bind(wx.EVT_MENU,self.upload,id=item.GetId())
item = popupmenu.Append(-1,_("SD Print")) item = popupmenu.Append(-1,_("SD Print"))
self.Bind(wx.EVT_MENU,self.sdprintfile) self.Bind(wx.EVT_MENU,self.sdprintfile,id=item.GetId())
self.panel.PopupMenu(popupmenu, obj.GetPosition()) self.panel.PopupMenu(popupmenu, obj.GetPosition())
def htemp_change(self,event): def htemp_change(self,event):
...@@ -1407,7 +1408,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -1407,7 +1408,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.recvlisteners.remove(self.uploadtrigger) self.recvlisteners.remove(self.uploadtrigger)
def upload(self,event): def upload(self,event):
if not len(self.f): if not self.f or not len(self.f):
return return
if not self.p.online: if not self.p.online:
return return
...@@ -1480,7 +1481,9 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -1480,7 +1481,9 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
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