Finish migrate from #868. Lots of tox/formatting/inspection fixes to the files touched.
This commit is contained in:
118
gui/builtinPreferenceViews/pyfaContextMenuPreferences.py
Normal file
118
gui/builtinPreferenceViews/pyfaContextMenuPreferences.py
Normal file
@@ -0,0 +1,118 @@
|
||||
import wx
|
||||
|
||||
from gui.preferenceView import PreferenceView
|
||||
from gui.bitmapLoader import BitmapLoader
|
||||
|
||||
import gui.mainFrame
|
||||
from service.settings import ContextMenuSettings
|
||||
|
||||
|
||||
class PFContextMenuPref(PreferenceView):
|
||||
title = "Context Menu Panel"
|
||||
|
||||
def populatePanel(self, panel):
|
||||
self.settings = ContextMenuSettings.getInstance()
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
|
||||
self.dirtySettings = False
|
||||
dlgWidth = panel.GetParent().GetParent().ClientSize.width
|
||||
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
self.stTitle = wx.StaticText(panel, wx.ID_ANY, self.title, wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stTitle.Wrap(-1)
|
||||
self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
|
||||
|
||||
mainSizer.Add(self.stTitle, 0, wx.ALL, 5)
|
||||
|
||||
self.stInfo = wx.StaticText(panel, wx.ID_ANY, u"Disabling context menus can improve responsiveness.", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stInfo.Wrap(dlgWidth - 50)
|
||||
mainSizer.Add(self.stInfo, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
|
||||
|
||||
# Row 1
|
||||
self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
|
||||
mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
|
||||
|
||||
rbSizerRow1 = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.rbBox1 = wx.RadioBox(panel, -1, "Set as Damage Pattern", wx.DefaultPosition, wx.DefaultSize, ['Disabled', 'Enabled'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbBox1.SetSelection(self.settings.get('ammoPattern'))
|
||||
rbSizerRow1.Add(self.rbBox1, 1, wx.TOP | wx.RIGHT, 5)
|
||||
self.rbBox1.Bind(wx.EVT_RADIOBOX, self.OnSetting1Change)
|
||||
|
||||
self.rbBox2 = wx.RadioBox(panel, -1, "Change Skills", wx.DefaultPosition, wx.DefaultSize, ['Disabled', 'Enabled'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbBox2.SetSelection(self.settings.get('changeAffectingSkills'))
|
||||
rbSizerRow1.Add(self.rbBox2, 1, wx.ALL, 5)
|
||||
self.rbBox2.Bind(wx.EVT_RADIOBOX, self.OnSetting2Change)
|
||||
|
||||
self.rbBox3 = wx.RadioBox(panel, -1, "Factor in Reload Time", wx.DefaultPosition, wx.DefaultSize, ['Disabled', 'Enabled'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbBox3.SetSelection(self.settings.get('factorReload'))
|
||||
rbSizerRow1.Add(self.rbBox3, 1, wx.ALL, 5)
|
||||
self.rbBox3.Bind(wx.EVT_RADIOBOX, self.OnSetting3Change)
|
||||
|
||||
mainSizer.Add(rbSizerRow1, 1, wx.ALL | wx.EXPAND, 0)
|
||||
|
||||
# Row 2
|
||||
self.m_staticline2 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
|
||||
mainSizer.Add(self.m_staticline2, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
|
||||
|
||||
rbSizerRow2 = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.rbBox4 = wx.RadioBox(panel, -1, "Variations", wx.DefaultPosition, wx.DefaultSize, ['Disabled', 'Enabled'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbBox4.SetSelection(self.settings.get('metaSwap'))
|
||||
rbSizerRow2.Add(self.rbBox4, 1, wx.TOP | wx.RIGHT, 5)
|
||||
self.rbBox4.Bind(wx.EVT_RADIOBOX, self.OnSetting4Change)
|
||||
|
||||
self.rbBox5 = wx.RadioBox(panel, -1, "Charge", wx.DefaultPosition, wx.DefaultSize, ['Disabled', 'Enabled'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbBox5.SetSelection(self.settings.get('moduleAmmoPicker'))
|
||||
rbSizerRow2.Add(self.rbBox5, 1, wx.ALL, 5)
|
||||
self.rbBox5.Bind(wx.EVT_RADIOBOX, self.OnSetting5Change)
|
||||
|
||||
self.rbBox6 = wx.RadioBox(panel, -1, "Charge (All)", wx.DefaultPosition, wx.DefaultSize, ['Disabled', 'Enabled'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbBox6.SetSelection(self.settings.get('moduleGlobalAmmoPicker'))
|
||||
rbSizerRow2.Add(self.rbBox6, 1, wx.ALL, 5)
|
||||
self.rbBox6.Bind(wx.EVT_RADIOBOX, self.OnSetting6Change)
|
||||
|
||||
mainSizer.Add(rbSizerRow2, 1, wx.ALL | wx.EXPAND, 0)
|
||||
|
||||
# Row 3
|
||||
self.m_staticline3 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
|
||||
mainSizer.Add(self.m_staticline3, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
|
||||
|
||||
rbSizerRow3 = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.rbBox7 = wx.RadioBox(panel, -1, "Project onto Fit", wx.DefaultPosition, wx.DefaultSize, ['Disabled', 'Enabled'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbBox7.SetSelection(self.settings.get('project'))
|
||||
rbSizerRow3.Add(self.rbBox7, 1, wx.TOP | wx.RIGHT, 5)
|
||||
self.rbBox7.Bind(wx.EVT_RADIOBOX, self.OnSetting7Change)
|
||||
|
||||
mainSizer.Add(rbSizerRow3, 1, wx.ALL | wx.EXPAND, 0)
|
||||
|
||||
panel.SetSizer(mainSizer)
|
||||
panel.Layout()
|
||||
|
||||
def OnSetting1Change(self, event):
|
||||
self.settings.set('ammoPattern', event.GetInt())
|
||||
|
||||
def OnSetting2Change(self, event):
|
||||
self.settings.set('changeAffectingSkills', event.GetInt())
|
||||
|
||||
def OnSetting3Change(self, event):
|
||||
self.settings.set('factorReload', event.GetInt())
|
||||
|
||||
def OnSetting4Change(self, event):
|
||||
self.settings.set('metaSwap', event.GetInt())
|
||||
|
||||
def OnSetting5Change(self, event):
|
||||
self.settings.set('moduleAmmoPicker', event.GetInt())
|
||||
|
||||
def OnSetting6Change(self, event):
|
||||
self.settings.set('moduleGlobalAmmoPicker', event.GetInt())
|
||||
|
||||
def OnSetting7Change(self, event):
|
||||
self.settings.set('project', event.GetInt())
|
||||
|
||||
def getImage(self):
|
||||
return BitmapLoader.getBitmap("pref-gauges_big", "gui")
|
||||
|
||||
|
||||
PFContextMenuPref.register()
|
||||
@@ -3,76 +3,70 @@ import wx
|
||||
from gui.preferenceView import PreferenceView
|
||||
from gui.bitmapLoader import BitmapLoader
|
||||
|
||||
import gui.mainFrame
|
||||
import service
|
||||
from gui.mainFrame import MainFrame
|
||||
import config
|
||||
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
from eos.db.saveddata.loadDefaultDatabaseValues import DefaultDatabaseValues
|
||||
|
||||
|
||||
class PFGeneralPref ( PreferenceView):
|
||||
class PFGeneralPref(PreferenceView):
|
||||
title = "Database"
|
||||
|
||||
def populatePanel( self, panel ):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
def populatePanel(self, panel):
|
||||
self.mainFrame = MainFrame.getInstance()
|
||||
self.dirtySettings = False
|
||||
#self.openFitsSettings = service.SettingsProvider.getInstance().getSettings("pyfaPrevOpenFits", {"enabled": False, "pyfaOpenFits": []})
|
||||
# self.openFitsSettings = service.SettingsProvider.getInstance().getSettings("pyfaPrevOpenFits", {"enabled": False, "pyfaOpenFits": []})
|
||||
|
||||
mainSizer = wx.BoxSizer( wx.VERTICAL )
|
||||
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
self.stTitle = wx.StaticText( panel, wx.ID_ANY, self.title, wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.stTitle.Wrap( -1 )
|
||||
self.stTitle.SetFont( wx.Font( 12, 70, 90, 90, False, wx.EmptyString ) )
|
||||
mainSizer.Add( self.stTitle, 0, wx.ALL, 5 )
|
||||
self.stTitle = wx.StaticText(panel, wx.ID_ANY, self.title, wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stTitle.Wrap(-1)
|
||||
self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
|
||||
mainSizer.Add(self.stTitle, 0, wx.ALL, 5)
|
||||
|
||||
self.stSubTitle = wx.StaticText( panel, wx.ID_ANY, u"(Cannot be changed while Pyfa is running.)", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.stSubTitle.Wrap( -1 )
|
||||
self.stSubTitle.SetFont( wx.Font( 10, 70, 90, 90, False, wx.EmptyString ) )
|
||||
mainSizer.Add( self.stSubTitle, 0, wx.ALL, 5 )
|
||||
self.stSubTitle = wx.StaticText(panel, wx.ID_ANY, u"(Cannot be changed while Pyfa is running.)", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stSubTitle.Wrap(-1)
|
||||
self.stSubTitle.SetFont(wx.Font(10, 70, 90, 90, False, wx.EmptyString))
|
||||
mainSizer.Add(self.stSubTitle, 0, wx.ALL, 5)
|
||||
|
||||
self.m_staticline1 = wx.StaticLine( panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
|
||||
mainSizer.Add( self.m_staticline1, 0, wx.EXPAND|wx.TOP|wx.BOTTOM, 5 )
|
||||
self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
|
||||
mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
|
||||
|
||||
#Save in Root
|
||||
self.cbsaveInRoot = wx.CheckBox( panel, wx.ID_ANY, u"Using Executable Path for Saved Fit Database and Settings", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
mainSizer.Add( self.cbsaveInRoot, 0, wx.ALL|wx.EXPAND, 5 )
|
||||
# Save in Root
|
||||
self.cbsaveInRoot = wx.CheckBox(panel, wx.ID_ANY, u"Using Executable Path for Saved Fit Database and Settings", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbsaveInRoot, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
#Database path
|
||||
self.stSetUserPath = wx.StaticText( panel, wx.ID_ANY, u"Pyfa User Path:", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.stSetUserPath.Wrap( -1 )
|
||||
mainSizer.Add( self.stSetUserPath, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
# Database path
|
||||
self.stSetUserPath = wx.StaticText(panel, wx.ID_ANY, u"Pyfa User Path:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stSetUserPath.Wrap(-1)
|
||||
mainSizer.Add(self.stSetUserPath, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
self.inputUserPath = wx.TextCtrl(panel, wx.ID_ANY, config.savePath, wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.inputUserPath.SetEditable(False)
|
||||
self.inputUserPath.SetBackgroundColour((200, 200, 200))
|
||||
mainSizer.Add(self.inputUserPath, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
|
||||
|
||||
#Save DB
|
||||
self.stFitDB = wx.StaticText( panel, wx.ID_ANY, u"Fitting Database:", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.stFitDB.Wrap( -1 )
|
||||
mainSizer.Add( self.stFitDB, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
# Save DB
|
||||
self.stFitDB = wx.StaticText(panel, wx.ID_ANY, u"Fitting Database:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stFitDB.Wrap(-1)
|
||||
mainSizer.Add(self.stFitDB, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
self.inputFitDB = wx.TextCtrl(panel, wx.ID_ANY, config.saveDB, wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.inputFitDB.SetEditable(False)
|
||||
self.inputFitDB.SetBackgroundColour((200, 200, 200))
|
||||
mainSizer.Add(self.inputFitDB, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
|
||||
|
||||
#Game Data DB
|
||||
self.stGameDB = wx.StaticText( panel, wx.ID_ANY, u"Game Database:", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.stGameDB.Wrap( -1 )
|
||||
mainSizer.Add( self.stGameDB, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
|
||||
# Game Data DB
|
||||
self.stGameDB = wx.StaticText(panel, wx.ID_ANY, u"Game Database:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stGameDB.Wrap(-1)
|
||||
mainSizer.Add(self.stGameDB, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
self.inputGameDB = wx.TextCtrl(panel, wx.ID_ANY, config.gameDB, wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.inputGameDB.SetEditable(False)
|
||||
self.inputGameDB.SetBackgroundColour((200, 200, 200))
|
||||
mainSizer.Add(self.inputGameDB, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
|
||||
|
||||
|
||||
defCharSizer = wx.BoxSizer( wx.HORIZONTAL )
|
||||
|
||||
self.cbsaveInRoot.SetValue(config.saveInRoot)
|
||||
self.cbsaveInRoot.Bind(wx.EVT_CHECKBOX, self.onCBsaveInRoot)
|
||||
|
||||
@@ -80,10 +74,9 @@ class PFGeneralPref ( PreferenceView):
|
||||
self.inputFitDB.Bind(wx.EVT_LEAVE_WINDOW, self.OnWindowLeave)
|
||||
self.inputGameDB.Bind(wx.EVT_LEAVE_WINDOW, self.OnWindowLeave)
|
||||
|
||||
panel.SetSizer( mainSizer )
|
||||
panel.SetSizer(mainSizer)
|
||||
panel.Layout()
|
||||
|
||||
|
||||
def onCBsaveInRoot(self, event):
|
||||
# We don't want users to be able to actually change this,
|
||||
# so if they try and change it, set it back to the current setting
|
||||
@@ -118,4 +111,5 @@ class PFGeneralPref ( PreferenceView):
|
||||
DefaultDatabaseValues.importResistProfileDefaults()
|
||||
'''
|
||||
|
||||
|
||||
PFGeneralPref.register()
|
||||
|
||||
@@ -2,80 +2,80 @@ import logging
|
||||
|
||||
import wx
|
||||
|
||||
import gui.globalEvents as GE
|
||||
import gui.mainFrame
|
||||
import service
|
||||
from service.fit import Fit
|
||||
from gui.bitmapLoader import BitmapLoader
|
||||
from gui.preferenceView import PreferenceView
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class PFFittingEnginePref ( PreferenceView):
|
||||
class PFFittingEnginePref(PreferenceView):
|
||||
title = "Fitting Engine"
|
||||
|
||||
def populatePanel( self, panel ):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
def __init__(self):
|
||||
self.dirtySettings = False
|
||||
#self.openFitsSettings = service.SettingsProvider.getInstance().getSettings("pyfaPrevOpenFits", {"enabled": False, "pyfaOpenFits": []})
|
||||
|
||||
mainSizer = wx.BoxSizer( wx.VERTICAL )
|
||||
def refreshPanel(self, fit):
|
||||
pass
|
||||
|
||||
self.stTitle = wx.StaticText( panel, wx.ID_ANY, self.title, wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.stTitle.Wrap( -1 )
|
||||
self.stTitle.SetFont( wx.Font( 12, 70, 90, 90, False, wx.EmptyString ) )
|
||||
mainSizer.Add( self.stTitle, 0, wx.ALL, 5 )
|
||||
# noinspection PyAttributeOutsideInit
|
||||
def populatePanel(self, panel):
|
||||
# self.openFitsSettings = service.SettingsProvider.getInstance().getSettings("pyfaPrevOpenFits", {"enabled": False, "pyfaOpenFits": []})
|
||||
|
||||
self.m_staticline1 = wx.StaticLine( panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
|
||||
mainSizer.Add( self.m_staticline1, 0, wx.EXPAND|wx.TOP|wx.BOTTOM, 5 )
|
||||
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
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.stTitle = wx.StaticText(panel, wx.ID_ANY, self.title, wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stTitle.Wrap(-1)
|
||||
self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
|
||||
mainSizer.Add(self.stTitle, 0, wx.ALL, 5)
|
||||
|
||||
self.cbGlobalForceReloadText = wx.StaticText( panel, wx.ID_ANY, u" Ignores reload when calculating capacitor usage,\n damage, and tank.", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.cbGlobalForceReloadText.Wrap( -1 )
|
||||
self.cbGlobalForceReloadText.SetFont( wx.Font( 10, 70, 90, 90, False, wx.EmptyString ) )
|
||||
mainSizer.Add( self.cbGlobalForceReloadText, 0, wx.ALL, 5 )
|
||||
self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
|
||||
mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 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.cbGlobalForceReloadText = wx.StaticText(panel, wx.ID_ANY, u" Ignores reload when calculating capacitor usage,\n damage, and tank.",
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbGlobalForceReloadText.Wrap(-1)
|
||||
self.cbGlobalForceReloadText.SetFont(wx.Font(10, 70, 90, 90, False, wx.EmptyString))
|
||||
mainSizer.Add(self.cbGlobalForceReloadText, 0, wx.ALL, 5)
|
||||
|
||||
# Future code once new cap sim is implemented
|
||||
'''
|
||||
self.cbGlobalForceReactivationTimer = wx.CheckBox( panel, wx.ID_ANY, u"Factor in reactivation timer", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
mainSizer.Add( self.cbGlobalForceReactivationTimer, 0, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
self.cbGlobalForceReactivationTimerText = wx.StaticText( panel, wx.ID_ANY, u" Ignores reactivation timer when calculating capacitor usage,\n damage, and tank.", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
text = u" Ignores reactivation timer when calculating capacitor usage,\n damage, and tank."
|
||||
self.cbGlobalForceReactivationTimerText = wx.StaticText( panel, wx.ID_ANY, text, wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.cbGlobalForceReactivationTimerText.Wrap( -1 )
|
||||
self.cbGlobalForceReactivationTimerText.SetFont( wx.Font( 10, 70, 90, 90, False, wx.EmptyString ) )
|
||||
mainSizer.Add( self.cbGlobalForceReactivationTimerText, 0, wx.ALL, 5 )
|
||||
'''
|
||||
|
||||
# Future code once for mining laser crystal
|
||||
# Future code for mining laser crystal
|
||||
'''
|
||||
self.cbGlobalMiningSpecialtyCrystal = wx.CheckBox( panel, wx.ID_ANY, u"Factor in reactivation timer", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
mainSizer.Add( self.cbGlobalMiningSpecialtyCrystal, 0, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
self.cbGlobalMiningSpecialtyCrystalText = wx.StaticText( panel, wx.ID_ANY, u" If enabled, displays the Specialty Crystal mining amount.\n This is the amount mined when using crystals and mining the matching asteroid.", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
text = u" If enabled, displays the Specialty Crystal mining amount.\n This is the amount mined when using crystals and mining the matching asteroid."
|
||||
self.cbGlobalMiningSpecialtyCrystalText = wx.StaticText( panel, wx.ID_ANY, text, wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.cbGlobalMiningSpecialtyCrystalText.Wrap( -1 )
|
||||
self.cbGlobalMiningSpecialtyCrystalText.SetFont( wx.Font( 10, 70, 90, 90, False, wx.EmptyString ) )
|
||||
mainSizer.Add( self.cbGlobalMiningSpecialtyCrystalText, 0, wx.ALL, 5 )
|
||||
'''
|
||||
|
||||
|
||||
self.sFit = service.Fit.getInstance()
|
||||
self.sFit = Fit.getInstance()
|
||||
|
||||
self.cbGlobalForceReload.SetValue(self.sFit.serviceFittingOptions["useGlobalForceReload"])
|
||||
|
||||
self.cbGlobalForceReload.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalForceReloadStateChange)
|
||||
|
||||
panel.SetSizer( mainSizer )
|
||||
panel.SetSizer(mainSizer)
|
||||
panel.Layout()
|
||||
|
||||
|
||||
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 getImage(self):
|
||||
return BitmapLoader.getBitmap("prefs_settings", "gui")
|
||||
|
||||
@@ -3,48 +3,43 @@ import wx
|
||||
from gui.preferenceView import PreferenceView
|
||||
from gui.bitmapLoader import BitmapLoader
|
||||
|
||||
import gui.mainFrame
|
||||
import service
|
||||
from gui.mainFrame import MainFrame
|
||||
import config
|
||||
|
||||
|
||||
class PFGeneralPref ( PreferenceView):
|
||||
class PFGeneralPref(PreferenceView):
|
||||
title = "Logging"
|
||||
|
||||
def populatePanel( self, panel ):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
def populatePanel(self, panel):
|
||||
self.mainFrame = MainFrame.getInstance()
|
||||
self.dirtySettings = False
|
||||
#self.openFitsSettings = service.SettingsProvider.getInstance().getSettings("pyfaPrevOpenFits", {"enabled": False, "pyfaOpenFits": []})
|
||||
# self.openFitsSettings = service.SettingsProvider.getInstance().getSettings("pyfaPrevOpenFits", {"enabled": False, "pyfaOpenFits": []})
|
||||
|
||||
mainSizer = wx.BoxSizer( wx.VERTICAL )
|
||||
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
self.stTitle = wx.StaticText( panel, wx.ID_ANY, self.title, wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.stTitle.Wrap( -1 )
|
||||
self.stTitle.SetFont( wx.Font( 12, 70, 90, 90, False, wx.EmptyString ) )
|
||||
mainSizer.Add( self.stTitle, 0, wx.ALL, 5 )
|
||||
self.stTitle = wx.StaticText(panel, wx.ID_ANY, self.title, wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stTitle.Wrap(-1)
|
||||
self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
|
||||
mainSizer.Add(self.stTitle, 0, wx.ALL, 5)
|
||||
|
||||
self.stSubTitle = wx.StaticText( panel, wx.ID_ANY, u"(Cannot be changed while Pyfa is running.)", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
self.stSubTitle.Wrap( -1 )
|
||||
self.stSubTitle.SetFont( wx.Font( 10, 70, 90, 90, False, wx.EmptyString ) )
|
||||
mainSizer.Add( self.stSubTitle, 0, wx.ALL, 5 )
|
||||
self.stSubTitle = wx.StaticText(panel, wx.ID_ANY, u"(Cannot be changed while Pyfa is running.)", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stSubTitle.Wrap(-1)
|
||||
self.stSubTitle.SetFont(wx.Font(10, 70, 90, 90, False, wx.EmptyString))
|
||||
mainSizer.Add(self.stSubTitle, 0, wx.ALL, 5)
|
||||
|
||||
self.m_staticline1 = wx.StaticLine( panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
|
||||
mainSizer.Add( self.m_staticline1, 0, wx.EXPAND|wx.TOP|wx.BOTTOM, 5 )
|
||||
self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
|
||||
mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
|
||||
|
||||
#Debug Logging
|
||||
self.cbdebugLogging = wx.CheckBox( panel, wx.ID_ANY, u"Debug Logging Enabled", wx.DefaultPosition, wx.DefaultSize, 0 )
|
||||
mainSizer.Add( self.cbdebugLogging, 0, wx.ALL|wx.EXPAND, 5 )
|
||||
|
||||
|
||||
defCharSizer = wx.BoxSizer( wx.HORIZONTAL )
|
||||
# Debug Logging
|
||||
self.cbdebugLogging = wx.CheckBox(panel, wx.ID_ANY, u"Debug Logging Enabled", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbdebugLogging, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbdebugLogging.SetValue(config.debug)
|
||||
self.cbdebugLogging.Bind(wx.EVT_CHECKBOX, self.onCBdebugLogging)
|
||||
|
||||
panel.SetSizer( mainSizer )
|
||||
panel.SetSizer(mainSizer)
|
||||
panel.Layout()
|
||||
|
||||
|
||||
def onCBdebugLogging(self, event):
|
||||
# We don't want users to be able to actually change this,
|
||||
# so if they try and change it, set it back to the current setting
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
# noinspection PyPackageRequirements
|
||||
import wx
|
||||
|
||||
from gui.preferenceView import PreferenceView
|
||||
from gui.bitmapLoader import BitmapLoader
|
||||
|
||||
import gui.mainFrame
|
||||
import service
|
||||
from service.crest import CrestModes
|
||||
|
||||
from wx.lib.intctrl import IntCtrl
|
||||
from service.settings import StatViewSettings
|
||||
|
||||
|
||||
class PFStatViewPref(PreferenceView):
|
||||
title = "Statistics Panel"
|
||||
|
||||
def populatePanel(self, panel):
|
||||
self.settings = service.settings.statViewSettings.getInstance()
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
|
||||
def __init__(self):
|
||||
self.dirtySettings = False
|
||||
self.settings = StatViewSettings.getInstance()
|
||||
|
||||
def refreshPanel(self, fit):
|
||||
pass
|
||||
|
||||
# noinspection PyAttributeOutsideInit
|
||||
def populatePanel(self, panel):
|
||||
dlgWidth = panel.GetParent().GetParent().ClientSize.width
|
||||
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
@@ -27,8 +27,7 @@ class PFStatViewPref(PreferenceView):
|
||||
|
||||
mainSizer.Add(self.stTitle, 0, wx.ALL, 5)
|
||||
|
||||
self.stInfo = wx.StaticText(panel, wx.ID_ANY, u"Changes require restart of Pyfa to take effect.",
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stInfo = wx.StaticText(panel, wx.ID_ANY, u"Changes require restart of Pyfa to take effect.", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stInfo.Wrap(dlgWidth - 50)
|
||||
mainSizer.Add(self.stInfo, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
|
||||
|
||||
@@ -38,24 +37,21 @@ class PFStatViewPref(PreferenceView):
|
||||
|
||||
rbSizerRow1 = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.rbResources = wx.RadioBox(panel, -1, "Resources", wx.DefaultPosition, wx.DefaultSize,
|
||||
['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbResources = wx.RadioBox(panel, -1, "Resources", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
|
||||
# Disable minimal as we don't have a view for this yet
|
||||
self.rbResources.EnableItem(1, False)
|
||||
self.rbResources.SetSelection(self.settings.get('resources'))
|
||||
rbSizerRow1.Add(self.rbResources, 1, wx.TOP | wx.RIGHT, 5)
|
||||
self.rbResources.Bind(wx.EVT_RADIOBOX, self.OnResourcesChange)
|
||||
|
||||
self.rbResistances = wx.RadioBox(panel, -1, "Resistances", wx.DefaultPosition, wx.DefaultSize,
|
||||
['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbResistances = wx.RadioBox(panel, -1, "Resistances", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
|
||||
# Disable minimal as we don't have a view for this yet
|
||||
self.rbResistances.EnableItem(1, False)
|
||||
self.rbResistances.SetSelection(self.settings.get('resistances'))
|
||||
rbSizerRow1.Add(self.rbResistances, 1, wx.ALL, 5)
|
||||
self.rbResistances.Bind(wx.EVT_RADIOBOX, self.OnResistancesChange)
|
||||
|
||||
self.rbRecharge = wx.RadioBox(panel, -1, "Shield/Armor Tank", wx.DefaultPosition, wx.DefaultSize,
|
||||
['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbRecharge = wx.RadioBox(panel, -1, "Shield/Armor Tank", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
|
||||
# Disable minimal as we don't have a view for this yet
|
||||
self.rbRecharge.EnableItem(1, False)
|
||||
self.rbRecharge.SetSelection(self.settings.get('recharge'))
|
||||
@@ -70,24 +66,21 @@ class PFStatViewPref(PreferenceView):
|
||||
|
||||
rbSizerRow2 = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.rbFirepower = wx.RadioBox(panel, -1, "Firepower", wx.DefaultPosition, wx.DefaultSize,
|
||||
['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbFirepower = wx.RadioBox(panel, -1, "Firepower", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
|
||||
# Disable minimal as we don't have a view for this yet
|
||||
self.rbFirepower.EnableItem(1, False)
|
||||
self.rbFirepower.SetSelection(self.settings.get('firepower'))
|
||||
rbSizerRow2.Add(self.rbFirepower, 1, wx.TOP | wx.RIGHT, 5)
|
||||
self.rbFirepower.Bind(wx.EVT_RADIOBOX, self.OnFirepowerChange)
|
||||
|
||||
self.rbCapacitor = wx.RadioBox(panel, -1, "Capacitor", wx.DefaultPosition, wx.DefaultSize,
|
||||
['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbCapacitor = wx.RadioBox(panel, -1, "Capacitor", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
|
||||
# Disable minimal as we don't have a view for this yet
|
||||
self.rbCapacitor.EnableItem(1, False)
|
||||
self.rbCapacitor.SetSelection(self.settings.get('capacitor'))
|
||||
rbSizerRow2.Add(self.rbCapacitor, 1, wx.ALL, 5)
|
||||
self.rbCapacitor.Bind(wx.EVT_RADIOBOX, self.OnCapacitorChange)
|
||||
|
||||
self.rbMisc = wx.RadioBox(panel, -1, "Misc", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1,
|
||||
wx.RA_SPECIFY_COLS)
|
||||
self.rbMisc = wx.RadioBox(panel, -1, "Misc", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
|
||||
# Disable full as we don't have a view for this yet
|
||||
self.rbMisc.EnableItem(2, False)
|
||||
self.rbMisc.SetSelection(self.settings.get('targetingmisc'))
|
||||
@@ -102,8 +95,7 @@ class PFStatViewPref(PreferenceView):
|
||||
|
||||
rbSizerRow3 = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.rbPrice = wx.RadioBox(panel, -1, "Price", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'],
|
||||
1, wx.RA_SPECIFY_COLS)
|
||||
self.rbPrice = wx.RadioBox(panel, -1, "Price", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
|
||||
# Disable minimal as we don't have a view for this yet
|
||||
self.rbPrice.EnableItem(1, False)
|
||||
self.rbPrice.SetSelection(self.settings.get('price'))
|
||||
@@ -130,9 +122,6 @@ class PFStatViewPref(PreferenceView):
|
||||
panel.SetSizer(mainSizer)
|
||||
panel.Layout()
|
||||
|
||||
# serviceStatViewDefaultSettings = {"resources": 2, "resistances": 2, "recharge": 2, "firepower": 2, "capacitor": 1,
|
||||
# "targetingmisc": 2, "price": 2, "miningyield": 0}
|
||||
|
||||
def OnResourcesChange(self, event):
|
||||
self.settings.set('resources', event.GetInt())
|
||||
|
||||
@@ -164,4 +153,4 @@ class PFStatViewPref(PreferenceView):
|
||||
return BitmapLoader.getBitmap("pref-gauges_big", "gui")
|
||||
|
||||
|
||||
PFStatViewPref.register()
|
||||
PFStatViewPref.register()
|
||||
|
||||
@@ -44,7 +44,7 @@ class PFUpdatePref(PreferenceView):
|
||||
self.versionSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
self.versionTitle = wx.StaticText(panel, wx.ID_ANY, "Suppressing {0} Notifications".format(
|
||||
self.UpdateSettings.get('version')), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.UpdateSettings.get('version')), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.versionTitle.Wrap(-1)
|
||||
self.versionTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user