Add some conditionals to disable Attribute Editor for wxPython 2.8

This commit is contained in:
blitzmann
2015-11-06 20:23:09 -05:00
parent b302a0a6e5
commit febc2eee09
3 changed files with 21 additions and 9 deletions

View File

@@ -64,11 +64,16 @@ from time import gmtime, strftime
if not 'wxMac' in wx.PlatformInfo or ('wxMac' in wx.PlatformInfo and wx.VERSION >= (3,0)):
from service.crest import CrestModes
from gui.crestFittings import CrestFittings, ExportToEve, CrestMgmt
from gui.propertyEditor import AttributeEditor
from wx.lib.pubsub import setupkwargs
from wx.lib.pubsub import pub
try:
from gui.propertyEditor import AttributeEditor
disableOverrideEditor = False
except ImportError, e:
print "Error loading Attribute Editor: %s.\nAccess to Attribute Editor is disabled."%e.message
disableOverrideEditor = True
#dummy panel(no paint no erasebk)
class PFPanel(wx.Panel):
def __init__(self,parent):

View File

@@ -53,7 +53,6 @@ class MainMenuBar(wx.MenuBar):
self.toggleOverridesId = wx.NewId()
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
wx.MenuBar.__init__(self)
# File menu
@@ -131,12 +130,13 @@ class MainMenuBar(wx.MenuBar):
self.Enable(self.eveFittingsId, False)
self.Enable(self.exportToEveId, False)
attrItem = wx.MenuItem(windowMenu, self.attrEditorId, "Attribute Overrides\tCTRL+B")
attrItem.SetBitmap(BitmapLoader.getBitmap("fit_rename_small", "gui"))
windowMenu.AppendItem(attrItem)
if not gui.mainFrame.disableOverrideEditor:
attrItem = wx.MenuItem(windowMenu, self.attrEditorId, "Attribute Overrides\tCTRL+B")
attrItem.SetBitmap(BitmapLoader.getBitmap("fit_rename_small", "gui"))
windowMenu.AppendItem(attrItem)
editMenu.AppendSeparator()
editMenu.Append(self.toggleOverridesId, "Turn Overrides On")
editMenu.AppendSeparator()
editMenu.Append(self.toggleOverridesId, "Turn Overrides On")
pub.subscribe(self.ssoLogin, 'login_success')
pub.subscribe(self.ssoLogout, 'logout_success')

View File

@@ -1,5 +1,12 @@
import wx
import wx.propgrid as wxpg
try:
import wx.propgrid as wxpg
except:
if wx.VERSION < (2, 9):
raise ImportError("wx.propgrid is only available in wxPython >= 2.9")
else:
raise
import gui.PFSearchBox as SBox
from gui.marketBrowser import SearchBox