Initial rollup of #868
This commit is contained in:
@@ -1,8 +1,16 @@
|
|||||||
# noinspection PyPackageRequirements
|
# noinspection PyPackageRequirements
|
||||||
import wx
|
import wx
|
||||||
|
|
||||||
__all__ = ["pyfaGeneralPreferences", "pyfaHTMLExportPreferences", "pyfaUpdatePreferences",
|
__all__ = [
|
||||||
"pyfaNetworkPreferences"] # noqa
|
"pyfaGeneralPreferences",
|
||||||
|
"pyfaHTMLExportPreferences",
|
||||||
|
"pyfaUpdatePreferences",
|
||||||
|
"pyfaNetworkPreferences",
|
||||||
|
"pyfaDatabasePreferences",
|
||||||
|
"pyfaLoggingPreferences",
|
||||||
|
"pyfaEnginePreferences",
|
||||||
|
"pyfaStatViewPreferences",
|
||||||
|
]
|
||||||
|
|
||||||
if 'wxMac' not in wx.PlatformInfo or ('wxMac' in wx.PlatformInfo and wx.VERSION >= (3, 0)):
|
if 'wxMac' not in wx.PlatformInfo or ('wxMac' in wx.PlatformInfo and wx.VERSION >= (3, 0)):
|
||||||
__all__.append("pyfaCrestPreferences")
|
__all__.append("pyfaCrestPreferences")
|
||||||
|
|||||||
0
gui/builtinPreferenceViews/pyfaEnginePreferences.py
Normal file
0
gui/builtinPreferenceViews/pyfaEnginePreferences.py
Normal file
@@ -40,10 +40,6 @@ class PFGeneralPref(PreferenceView):
|
|||||||
wx.DefaultSize, 0)
|
wx.DefaultSize, 0)
|
||||||
mainSizer.Add(self.cbGlobalDmgPattern, 0, wx.ALL | wx.EXPAND, 5)
|
mainSizer.Add(self.cbGlobalDmgPattern, 0, wx.ALL | wx.EXPAND, 5)
|
||||||
|
|
||||||
self.cbGlobalForceReload = wx.CheckBox(panel, wx.ID_ANY, u"Factor in reload time", wx.DefaultPosition,
|
|
||||||
wx.DefaultSize, 0)
|
|
||||||
mainSizer.Add(self.cbGlobalForceReload, 0, wx.ALL | wx.EXPAND, 5)
|
|
||||||
|
|
||||||
self.cbCompactSkills = wx.CheckBox(panel, wx.ID_ANY, u"Compact skills needed tooltip", wx.DefaultPosition,
|
self.cbCompactSkills = wx.CheckBox(panel, wx.ID_ANY, u"Compact skills needed tooltip", wx.DefaultPosition,
|
||||||
wx.DefaultSize, 0)
|
wx.DefaultSize, 0)
|
||||||
mainSizer.Add(self.cbCompactSkills, 0, wx.ALL | wx.EXPAND, 5)
|
mainSizer.Add(self.cbCompactSkills, 0, wx.ALL | wx.EXPAND, 5)
|
||||||
@@ -97,7 +93,6 @@ class PFGeneralPref(PreferenceView):
|
|||||||
|
|
||||||
self.cbGlobalChar.SetValue(self.sFit.serviceFittingOptions["useGlobalCharacter"])
|
self.cbGlobalChar.SetValue(self.sFit.serviceFittingOptions["useGlobalCharacter"])
|
||||||
self.cbGlobalDmgPattern.SetValue(self.sFit.serviceFittingOptions["useGlobalDamagePattern"])
|
self.cbGlobalDmgPattern.SetValue(self.sFit.serviceFittingOptions["useGlobalDamagePattern"])
|
||||||
self.cbGlobalForceReload.SetValue(self.sFit.serviceFittingOptions["useGlobalForceReload"])
|
|
||||||
self.cbFitColorSlots.SetValue(self.sFit.serviceFittingOptions["colorFitBySlot"] or False)
|
self.cbFitColorSlots.SetValue(self.sFit.serviceFittingOptions["colorFitBySlot"] or False)
|
||||||
self.cbRackSlots.SetValue(self.sFit.serviceFittingOptions["rackSlots"] or False)
|
self.cbRackSlots.SetValue(self.sFit.serviceFittingOptions["rackSlots"] or False)
|
||||||
self.cbRackLabels.SetValue(self.sFit.serviceFittingOptions["rackLabels"] or False)
|
self.cbRackLabels.SetValue(self.sFit.serviceFittingOptions["rackLabels"] or False)
|
||||||
@@ -112,7 +107,6 @@ class PFGeneralPref(PreferenceView):
|
|||||||
|
|
||||||
self.cbGlobalChar.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalCharStateChange)
|
self.cbGlobalChar.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalCharStateChange)
|
||||||
self.cbGlobalDmgPattern.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalDmgPatternStateChange)
|
self.cbGlobalDmgPattern.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalDmgPatternStateChange)
|
||||||
self.cbGlobalForceReload.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalForceReloadStateChange)
|
|
||||||
self.cbFitColorSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalColorBySlot)
|
self.cbFitColorSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalColorBySlot)
|
||||||
self.cbRackSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackSlots)
|
self.cbRackSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackSlots)
|
||||||
self.cbRackLabels.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackLabels)
|
self.cbRackLabels.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackLabels)
|
||||||
@@ -152,13 +146,6 @@ class PFGeneralPref(PreferenceView):
|
|||||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
|
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
|
||||||
event.Skip()
|
event.Skip()
|
||||||
|
|
||||||
def OnCBGlobalForceReloadStateChange(self, event):
|
|
||||||
self.sFit.serviceFittingOptions["useGlobalForceReload"] = self.cbGlobalForceReload.GetValue()
|
|
||||||
fitID = self.mainFrame.getActiveFit()
|
|
||||||
self.sFit.refreshFit(fitID)
|
|
||||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
|
|
||||||
event.Skip()
|
|
||||||
|
|
||||||
def OnCBGlobalCharStateChange(self, event):
|
def OnCBGlobalCharStateChange(self, event):
|
||||||
self.sFit.serviceFittingOptions["useGlobalCharacter"] = self.cbGlobalChar.GetValue()
|
self.sFit.serviceFittingOptions["useGlobalCharacter"] = self.cbGlobalChar.GetValue()
|
||||||
event.Skip()
|
event.Skip()
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
__all__ = ["resourcesViewFull", "resistancesViewFull",
|
__all__ = [
|
||||||
"rechargeViewFull", "firepowerViewFull", "capacitorViewFull",
|
"resourcesViewFull",
|
||||||
"targetingMiscViewFull", "priceViewFull", "miningyieldViewFull"]
|
"resistancesViewFull",
|
||||||
|
"rechargeViewFull",
|
||||||
|
"firepowerViewFull",
|
||||||
|
"capacitorViewFull",
|
||||||
|
"targetingMiscViewMinimal",
|
||||||
|
"priceViewFull",
|
||||||
|
]
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
import wx
|
import wx
|
||||||
|
|
||||||
from service.fit import Fit
|
from service.fit import Fit
|
||||||
|
from service.settings import Settings
|
||||||
import gui.mainFrame
|
import gui.mainFrame
|
||||||
import gui.builtinStatsViews
|
import gui.builtinStatsViews
|
||||||
import gui.globalEvents as GE
|
import gui.globalEvents as GE
|
||||||
@@ -31,9 +32,37 @@ from gui.pyfatogglepanel import TogglePanel
|
|||||||
|
|
||||||
|
|
||||||
class StatsPane(wx.Panel):
|
class StatsPane(wx.Panel):
|
||||||
DEFAULT_VIEWS = ["resourcesViewFull", "resistancesViewFull", "rechargeViewFull", "firepowerViewFull",
|
AVAILIBLE_VIEWS = [
|
||||||
"capacitorViewFull", "targetingmiscViewFull",
|
"resources",
|
||||||
"priceViewFull"]
|
"resistances",
|
||||||
|
"recharge",
|
||||||
|
"firepower",
|
||||||
|
"capacitor",
|
||||||
|
"targetingmisc",
|
||||||
|
"price",
|
||||||
|
]
|
||||||
|
|
||||||
|
# Don't have these....yet....
|
||||||
|
'''
|
||||||
|
"miningyield", "drones"
|
||||||
|
]
|
||||||
|
'''
|
||||||
|
|
||||||
|
DEFAULT_VIEWS = []
|
||||||
|
|
||||||
|
settings = Settings.statViewSettings.getInstance()
|
||||||
|
|
||||||
|
for aView in AVAILIBLE_VIEWS:
|
||||||
|
if settings.get(aView) == 2:
|
||||||
|
DEFAULT_VIEWS.extend(["%sViewFull" % aView])
|
||||||
|
|
||||||
|
if settings.get(aView) == 1:
|
||||||
|
DEFAULT_VIEWS.extend(["%sViewMinimal" % aView])
|
||||||
|
|
||||||
|
# If it's 0, it's disabled and we don't do anything.
|
||||||
|
|
||||||
|
# TODO
|
||||||
|
# Add logging
|
||||||
|
|
||||||
def fitChanged(self, event):
|
def fitChanged(self, event):
|
||||||
sFit = Fit.getInstance()
|
sFit = Fit.getInstance()
|
||||||
@@ -66,7 +95,12 @@ class StatsPane(wx.Panel):
|
|||||||
contentPanel = tp.GetContentPane()
|
contentPanel = tp.GetContentPane()
|
||||||
contentPanel.viewName = viewName
|
contentPanel.viewName = viewName
|
||||||
|
|
||||||
view = StatsView.getView(viewName)(self)
|
try:
|
||||||
|
view = StatsView.getView(viewName)(self)
|
||||||
|
except KeyError:
|
||||||
|
# View doesn't exist. Skip to next view
|
||||||
|
continue
|
||||||
|
|
||||||
self.nameViewMap[viewName] = view
|
self.nameViewMap[viewName] = view
|
||||||
self.views.append(view)
|
self.views.append(view)
|
||||||
|
|
||||||
|
|||||||
@@ -341,4 +341,45 @@ class CRESTSettings(object):
|
|||||||
def set(self, type, value):
|
def set(self, type, value):
|
||||||
self.serviceCRESTSettings[type] = value
|
self.serviceCRESTSettings[type] = value
|
||||||
|
|
||||||
|
class statViewSettings(object):
|
||||||
|
_instance = None
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def getInstance(cls):
|
||||||
|
if cls._instance is None:
|
||||||
|
cls._instance = statViewSettings()
|
||||||
|
|
||||||
|
return cls._instance
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
# mode
|
||||||
|
# 0 - Do not show
|
||||||
|
# 1 - Minimal/Text Only View
|
||||||
|
# 2 - Full View
|
||||||
|
serviceStatViewDefaultSettings = {
|
||||||
|
"resources": 2,
|
||||||
|
"resistances": 2,
|
||||||
|
"recharge": 2,
|
||||||
|
"firepower": 2,
|
||||||
|
"capacitor": 2,
|
||||||
|
"targetingmisc": 1,
|
||||||
|
"price": 2,
|
||||||
|
"miningyield": 2,
|
||||||
|
"drones": 2
|
||||||
|
}
|
||||||
|
|
||||||
|
# We don't have these....yet
|
||||||
|
'''
|
||||||
|
"miningyield": 2,
|
||||||
|
"drones": 2
|
||||||
|
'''
|
||||||
|
|
||||||
|
self.serviceStatViewDefaultSettings = SettingsProvider.getInstance().getSettings("pyfaServiceStatViewSettings", serviceStatViewDefaultSettings)
|
||||||
|
|
||||||
|
def get(self, type):
|
||||||
|
return self.serviceStatViewDefaultSettings[type]
|
||||||
|
|
||||||
|
def set(self, type, value):
|
||||||
|
self.serviceStatViewDefaultSettings[type] = value
|
||||||
|
|
||||||
# @todo: migrate fit settings (from fit service) here?
|
# @todo: migrate fit settings (from fit service) here?
|
||||||
|
|||||||
Reference in New Issue
Block a user