Skip to content

Commit

Permalink
pncconf -fix loading of 'discovered' firmware
Browse files Browse the repository at this point in the history
If one used 'discovery' to build a config, then reloade the config,
It would fail. I think code not converted fro gtk2 to gtk3.

Access to combo box's model is slightly different
  • Loading branch information
c-morley committed May 23, 2023
1 parent 8c9f5da commit 4db32a4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/emc/usr_intf/pncconf/pncconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2140,10 +2140,10 @@ def init_mesa_options(self,boardnum):
dbg('Looking for firmware data %s'%self.d["mesa%d_firmware"% boardnum])
found = False
search = 0
model = self.widgets["mesa%d_firmware"% boardnum].get_model()
for search,item in enumerate(model):
dbg('%d,%s'%(search,model[search][0]))
if model[search][0] == self.d["mesa%d_firmware"% boardnum]:
combo_model = self.widgets["mesa%d_firmware"% boardnum].get_model()
for search,item in enumerate(combo_model):
dbg('%d,%s'%(search,combo_model[search][0]))
if combo_model[search][0] == self.d["mesa%d_firmware"% boardnum]:
self.widgets["mesa%d_firmware"% boardnum].set_active(search)
found = True
dbg('found firmware # %d'% search)
Expand All @@ -2152,9 +2152,10 @@ def init_mesa_options(self,boardnum):
dbg('firmware not found')
cur_firm = self.d['mesa%d_currentfirmwaredata'% boardnum][_PD._FIRMWARE]
dbg('looking for: %s'% cur_firm )
combo = self.widgets["mesa%d_firmware"% boardnum]
#self.widgets["mesa%d_firmware"% boardnum].set_active(0)
self._p.MESA_FIRMWAREDATA.append(self.d['mesa%d_currentfirmwaredata'% boardnum])
model.append((cur_firm,))
combo.append_text(cur_firm)
self.init_mesa_options(boardnum)
return
else:
Expand Down

0 comments on commit 4db32a4

Please sign in to comment.