From bf0b89f3b5ac61c6f56ee0c4fc82bad3593fc016 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Tue, 3 Nov 2015 21:25:52 -0500 Subject: [PATCH] Old mac client shouldn't even know about CREST / override. Disable all instances of them for this build. --- gui/builtinPreferenceViews/__init__.py | 7 +++- gui/mainFrame.py | 16 ++++---- gui/mainMenuBar.py | 51 ++++++++++++++------------ service/__init__.py | 5 ++- service/crest.py | 1 + 5 files changed, 48 insertions(+), 32 deletions(-) diff --git a/gui/builtinPreferenceViews/__init__.py b/gui/builtinPreferenceViews/__init__.py index 20d2cba38..9d29c75ff 100644 --- a/gui/builtinPreferenceViews/__init__.py +++ b/gui/builtinPreferenceViews/__init__.py @@ -1 +1,6 @@ -__all__ = ["pyfaGeneralPreferences","pyfaHTMLExportPreferences","pyfaUpdatePreferences","pyfaNetworkPreferences","pyfaCrestPreferences"] +__all__ = ["pyfaGeneralPreferences","pyfaHTMLExportPreferences","pyfaUpdatePreferences","pyfaNetworkPreferences"] + +import wx + +if not 'wxMac' in wx.PlatformInfo or ('wxMac' in wx.PlatformInfo and wx.VERSION >= (3,0)): + __all__.append("pyfaCrestPreferences") diff --git a/gui/mainFrame.py b/gui/mainFrame.py index 17e39af71..3f9961273 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -45,7 +45,6 @@ from gui.multiSwitch import MultiSwitch from gui.statsPane import StatsPane from gui.shipBrowser import ShipBrowser, FitSelected, ImportSelected, Stage3Selected from gui.characterEditor import CharacterEditor, SaveCharacterAs -from gui.crestFittings import CrestFittings, ExportToEve, CrestMgmt from gui.characterSelection import CharacterSelection from gui.patternEditor import DmgPatternEditorDlg from gui.resistsEditor import ResistsEditorDlg @@ -55,7 +54,6 @@ from gui.copySelectDialog import CopySelectDialog from gui.utils.clipboard import toClipboard, fromClipboard from gui.fleetBrowser import FleetBrowser from gui.updateDialog import UpdateDialog -from gui.propertyEditor import AttributeEditor from gui.builtinViews import * # import this to access override setting @@ -63,10 +61,13 @@ from eos.modifiedAttributeDict import ModifiedAttributeDict from time import gmtime, strftime -from service.crest import CrestModes +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 + from wx.lib.pubsub import setupkwargs + from wx.lib.pubsub import pub #dummy panel(no paint no erasebk) class PFPanel(wx.Panel): @@ -203,8 +204,9 @@ class MainFrame(wx.Frame): self.sUpdate = service.Update.getInstance() self.sUpdate.CheckUpdate(self.ShowUpdateBox) - pub.subscribe(self.onSSOLogin, 'login_success') - pub.subscribe(self.onSSOLogout, 'logout_success') + if not 'wxMac' in wx.PlatformInfo or ('wxMac' in wx.PlatformInfo and wx.VERSION >= (3,0)): + pub.subscribe(self.onSSOLogin, 'login_success') + pub.subscribe(self.onSSOLogout, 'logout_success') self.titleTimer = wx.Timer(self) self.Bind(wx.EVT_TIMER, self.updateTitle, self.titleTimer) diff --git a/gui/mainMenuBar.py b/gui/mainMenuBar.py index 991810587..9f09d9025 100644 --- a/gui/mainMenuBar.py +++ b/gui/mainMenuBar.py @@ -24,7 +24,9 @@ import gui.mainFrame import gui.graphFrame import gui.globalEvents as GE import service -from service.crest import CrestModes + +if not 'wxMac' in wx.PlatformInfo or ('wxMac' in wx.PlatformInfo and wx.VERSION >= (3,0)): + from service.crest import CrestModes from wx.lib.pubsub import setupkwargs from wx.lib.pubsub import pub @@ -52,8 +54,6 @@ class MainMenuBar(wx.MenuBar): self.mainFrame = gui.mainFrame.MainFrame.getInstance() - self.sCrest = service.Crest.getInstance() - wx.MenuBar.__init__(self) # File menu @@ -89,8 +89,6 @@ class MainMenuBar(wx.MenuBar): editMenu.Append(self.saveCharId, "Save Character") editMenu.Append(self.saveCharAsId, "Save Character As...") editMenu.Append(self.revertCharId, "Revert Character") - editMenu.AppendSeparator() - editMenu.Append(self.toggleOverridesId, "Turn Overrides On") # Character menu windowMenu = wx.Menu() @@ -116,23 +114,33 @@ class MainMenuBar(wx.MenuBar): preferencesItem.SetBitmap(BitmapLoader.getBitmap("preferences_small", "gui")) windowMenu.AppendItem(preferencesItem) - # CREST Menu - crestMenu = wx.Menu() - self.Append(crestMenu, "&CREST") - if self.sCrest.settings.get('mode') != CrestModes.IMPLICIT: - crestMenu.Append(self.ssoLoginId, "Manage Characters") - else: - crestMenu.Append(self.ssoLoginId, "Login to EVE") - crestMenu.Append(self.eveFittingsId, "Browse EVE Fittings") - crestMenu.Append(self.exportToEveId, "Export To EVE") + if not 'wxMac' in wx.PlatformInfo or ('wxMac' in wx.PlatformInfo and wx.VERSION >= (3,0)): + self.sCrest = service.Crest.getInstance() - if self.sCrest.settings.get('mode') == CrestModes.IMPLICIT or len(self.sCrest.getCrestCharacters()) == 0: - self.Enable(self.eveFittingsId, False) - self.Enable(self.exportToEveId, False) + # CREST Menu + crestMenu = wx.Menu() + self.Append(crestMenu, "&CREST") + if self.sCrest.settings.get('mode') != CrestModes.IMPLICIT: + crestMenu.Append(self.ssoLoginId, "Manage Characters") + else: + crestMenu.Append(self.ssoLoginId, "Login to EVE") + crestMenu.Append(self.eveFittingsId, "Browse EVE Fittings") + crestMenu.Append(self.exportToEveId, "Export To EVE") - attrItem = wx.MenuItem(windowMenu, self.attrEditorId, "Attribute Overrides\tCTRL+B") - attrItem.SetBitmap(BitmapLoader.getBitmap("fit_rename_small", "gui")) - windowMenu.AppendItem(attrItem) + if self.sCrest.settings.get('mode') == CrestModes.IMPLICIT or len(self.sCrest.getCrestCharacters()) == 0: + 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) + + editMenu.AppendSeparator() + editMenu.Append(self.toggleOverridesId, "Turn Overrides On") + + pub.subscribe(self.ssoLogin, 'login_success') + pub.subscribe(self.ssoLogout, 'logout_success') + pub.subscribe(self.updateCrest, 'crest_changed') # Help menu helpMenu = wx.Menu() @@ -146,9 +154,6 @@ class MainMenuBar(wx.MenuBar): helpMenu.Append( self.mainFrame.widgetInspectMenuID, "Open Widgets Inspect tool", "Open Widgets Inspect tool") self.mainFrame.Bind(GE.FIT_CHANGED, self.fitChanged) - pub.subscribe(self.ssoLogin, 'login_success') - pub.subscribe(self.ssoLogout, 'logout_success') - pub.subscribe(self.updateCrest, 'crest_changed') def fitChanged(self, event): enable = event.fitID is not None diff --git a/service/__init__.py b/service/__init__.py index 8f5445527..db0ca3478 100644 --- a/service/__init__.py +++ b/service/__init__.py @@ -10,6 +10,9 @@ from service.update import Update from service.price import Price from service.network import Network from service.eveapi import EVEAPIConnection, ParseXML -from service.crest import Crest from service.server import StoppableHTTPServer, AuthHandler from service.pycrest import EVE + +import wx +if not 'wxMac' in wx.PlatformInfo or ('wxMac' in wx.PlatformInfo and wx.VERSION >= (3,0)): + from service.crest import Crest diff --git a/service/crest.py b/service/crest.py index e49704861..011ed8368 100644 --- a/service/crest.py +++ b/service/crest.py @@ -1,3 +1,4 @@ +print "import crest" import thread import config import logging