Show preference pages in the order they appear in builtinPreferenceViews

This commit is contained in:
blitzmann
2014-03-02 20:02:36 -05:00
parent cd5d047891
commit ea3969e1e3
4 changed files with 6 additions and 10 deletions

View File

@@ -1 +1 @@
__all__ = ["pyfaGlobalPreferences","pyfaProxyPreferences","pyfaHTMLExportPreferences"]
__all__ = ["pyfaGlobalPreferences","pyfaHTMLExportPreferences","pyfaProxyPreferences"]

View File

@@ -11,7 +11,7 @@ import gui.globalEvents as GE
class PFGlobalPref ( PreferenceView):
title = "General Options"
title = "General"
def populatePanel( self, panel ):
charHelpText = '''Each fit has a character assigned to it, with different fits having different

View File

@@ -53,7 +53,7 @@ class PreferenceDialog(wx.Dialog):
self.Centre(wx.BOTH)
for title, prefView in PreferenceView.views.iteritems():
for prefView in PreferenceView.views:
page = wx.Panel(self.listbook)
bmp = prefView.getImage()
if bmp:
@@ -61,7 +61,7 @@ class PreferenceDialog(wx.Dialog):
else:
imgID = -1
prefView.populatePanel(page)
self.listbook.AddPage(page, title, imageId = imgID)
self.listbook.AddPage(page, prefView.title, imageId = imgID)
self.Fit()
self.Layout()

View File

@@ -20,17 +20,13 @@
import wx
class PreferenceView(object):
views = {}
views = []
def __init__(self):
pass
@classmethod
def register(cls):
PreferenceView.views[cls.title] = cls()
@classmethod
def getView(cls, name):
return cls.views[name]
PreferenceView.views.append(cls())
def populatePanel(self, panel):
raise NotImplementedError()