diff --git a/gui/mainFrame.py b/gui/mainFrame.py index 244ac215b..e33c8bac9 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -146,6 +146,8 @@ class MainFrame(wx.Frame): # Load stored settings (width/height/maximized..) self.LoadMainFrameAttribs() + self.disableOverrideEditor = disableOverrideEditor + # Fix for msw (have the frame background color match panel color if 'wxMSW' in wx.PlatformInfo: self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE)) @@ -205,7 +207,7 @@ class MainFrame(wx.Frame): self.closePageId = wx.NewId() self.widgetInspectMenuID = wx.NewId() - self.SetMenuBar(MainMenuBar()) + self.SetMenuBar(MainMenuBar(self)) self.registerMenu() # Internal vars to keep track of other windows (graphing/stats) diff --git a/gui/mainMenuBar.py b/gui/mainMenuBar.py index 7473c45cb..5e28da949 100644 --- a/gui/mainMenuBar.py +++ b/gui/mainMenuBar.py @@ -21,7 +21,6 @@ import wx import config from service.character import Character -import gui.mainFrame #import gui.graphFrame import gui.globalEvents as GE from gui.bitmapLoader import BitmapLoader @@ -32,7 +31,7 @@ if 'wxMac' not in wx.PlatformInfo or ('wxMac' in wx.PlatformInfo and wx.VERSION class MainMenuBar(wx.MenuBar): - def __init__(self): + def __init__(self, mainFrame): self.characterEditorId = wx.NewId() self.damagePatternEditorId = wx.NewId() self.targetResistsEditorId = wx.NewId() @@ -58,7 +57,7 @@ class MainMenuBar(wx.MenuBar): wx.ID_COPY = wx.NewId() wx.ID_PASTE = wx.NewId() - self.mainFrame = gui.mainFrame.MainFrame.getInstance() + self.mainFrame = mainFrame wx.MenuBar.__init__(self) # File menu @@ -139,7 +138,7 @@ class MainMenuBar(wx.MenuBar): self.Enable(self.eveFittingsId, False) self.Enable(self.exportToEveId, False) - if not gui.mainFrame.disableOverrideEditor: + if not self.mainFrame.disableOverrideEditor: windowMenu.AppendSeparator() attrItem = wx.MenuItem(windowMenu, self.attrEditorId, "Attribute Overrides\tCTRL+B") attrItem.SetBitmap(BitmapLoader.getBitmap("fit_rename_small", "gui"))