Skip to content

Commit cfe753b

Browse files
committed
FFF FOMOD fixup: crash when installing wizard
Just showcases how much of a hack the fomod as subpackage solution really is - we should probably do this via a new variable in the BAIN Installers classes instead and add radio buttons into the GUI to select between FOMOD and BAIN subpackages, disabling the other component depending on what's selected.
1 parent c81a9c8 commit cfe753b

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

Mopy/bash/basher/installer_links.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -275,15 +275,12 @@ def _enable(self):
275275
def Execute(self):
276276
with balt.BusyCursor():
277277
installer = self._selected_info
278-
subs = []
279278
idetails = self.iPanel.detailsPanel
280279
idetails.refreshCurrent(installer)
281-
for index in xrange(idetails.gSubList.GetCount()):
282-
subs.append(idetails.gSubList.GetString(index))
283280
default, pageSize, pos = self._get_size_and_pos()
284281
try:
285282
wizard = InstallerWizard(self.window, self._selected_info,
286-
self.bAuto, subs, pageSize, pos)
283+
self.bAuto, pageSize, pos)
287284
except CancelError:
288285
return
289286
balt.ensureDisplayed(wizard)
@@ -294,10 +291,14 @@ def Execute(self):
294291
return
295292
#Check the sub-packages that were selected by the wizard
296293
installer.resetAllEspmNames()
297-
for index in xrange(idetails.gSubList.GetCount()):
298-
select = installer.subNames[index + 1] in ret.select_sub_packages
294+
# TODO(inf) This (the offset by 1 in the xrange) is nothing but a hack.
295+
# We shouldn't even be exposing an FOMOD subpackage. Probably do this
296+
# via a new variable in BAIN installers, and add radio buttons in the
297+
# GUI to select between BAIN subpackages and FOMOD
298+
for index in xrange(1, idetails.gSubList.GetCount()):
299+
select = installer.subNames[index] in ret.select_sub_packages
299300
idetails.gSubList.Check(index, select)
300-
installer.subActives[index + 1] = select
301+
installer.subActives[index] = select
301302
idetails.refreshCurrent(installer)
302303
#Check the espms that were selected by the wizard
303304
espms = idetails.gEspmList.GetStrings()

Mopy/bash/belt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class InstallerWizard(wiz.Wizard):
8585
"""Class used by Wrye Bash, creates a wx Wizard that dynamically creates
8686
pages based on a script."""
8787

88-
def __init__(self, parentWindow, installer, bAuto, subs, pageSize, pos):
88+
def __init__(self, parentWindow, installer, bAuto, pageSize, pos):
8989
wiz.Wizard.__init__(self, parentWindow, title=_(u'Installer Wizard'),
9090
pos=pos, style=wx.DEFAULT_DIALOG_STYLE |
9191
wx.RESIZE_BORDER | wx.MAXIMIZE_BOX)
@@ -101,7 +101,7 @@ def __init__(self, parentWindow, installer, bAuto, subs, pageSize, pos):
101101
self.finishing = False
102102
#parser that will spit out the pages
103103
self.wizard_file = installer.wizard_file()
104-
self.parser = WryeParser(self, installer, subs, bAuto)
104+
self.parser = WryeParser(self, installer, bAuto)
105105
#Intercept the changing event so we can implement 'blockChange'
106106
set_event_hook(self, Events.WIZARD_PAGE_CHANGING, self.OnChange)
107107
self.ret = WizardReturn()
@@ -672,7 +672,7 @@ def colorize(text_, color=u'black', link=True):
672672
outLines = outLines[:lastBlank]
673673
return outLines
674674

675-
def __init__(self, parent, installer, subs, bAuto, codebox=False):
675+
def __init__(self, parent, installer, bAuto, codebox=False):
676676
ScriptParser.Parser.__init__(self)
677677
if not codebox:
678678
self.parent = parent

0 commit comments

Comments
 (0)