Show preference pages in the order they appear in builtinPreferenceViews
This commit is contained in:
@@ -1 +1 @@
|
||||
__all__ = ["pyfaGlobalPreferences","pyfaProxyPreferences","pyfaHTMLExportPreferences"]
|
||||
__all__ = ["pyfaGlobalPreferences","pyfaHTMLExportPreferences","pyfaProxyPreferences"]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user