Commit d1f2ebd7 authored by Keegi's avatar Keegi

last used serial port pre-selection logic change, based on if it is...

last used serial port pre-selection logic change, based on if it is autodetected to be present or not
parent d59fc731
...@@ -381,13 +381,17 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -381,13 +381,17 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
uts=self.uppertopsizer=wx.BoxSizer(wx.HORIZONTAL) uts=self.uppertopsizer=wx.BoxSizer(wx.HORIZONTAL)
uts.Add(wx.StaticText(self.panel,-1,_("Port:"),pos=(0,5)),wx.TOP|wx.LEFT,5) uts.Add(wx.StaticText(self.panel,-1,_("Port:"),pos=(0,5)),wx.TOP|wx.LEFT,5)
scan=self.scanserial() scan=self.scanserial()
portslist=list(scan)
if self.settings.port != "" and self.settings.port not in portslist:
portslist += [self.settings.port]
self.serialport = wx.ComboBox(self.panel, -1, self.serialport = wx.ComboBox(self.panel, -1,
choices=scan, choices=portslist,
style=wx.CB_DROPDOWN|wx.CB_SORT, pos=(50,0)) style=wx.CB_DROPDOWN|wx.CB_SORT, pos=(50,0))
try: try:
self.serialport.SetValue(scan[0]) if self.settings.port in scan:
if self.settings.port:
self.serialport.SetValue(self.settings.port) self.serialport.SetValue(self.settings.port)
elif len(portslist)>0:
self.serialport.SetValue(portslist[0])
except: except:
pass pass
uts.Add(self.serialport) uts.Add(self.serialport)
......
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