Do not restore graph type selected last time

This commit is contained in:
DarkPhoenix
2019-07-06 01:02:18 +03:00
parent 53de46bab7
commit 389b5d57aa
4 changed files with 2 additions and 6 deletions

View File

@@ -33,13 +33,11 @@ class FitGraph(metaclass=ABCMeta):
# UI stuff
views = []
viewMap = {}
viewIndexMap = {}
@classmethod
def register(cls):
FitGraph.views.append(cls)
FitGraph.viewMap[cls.internalName] = cls
FitGraph.viewIndexMap[cls.internalName] = FitGraph.views.index(cls)
def __init__(self):
# Format: {(fit ID, target type, target ID): data}

View File

@@ -114,9 +114,7 @@ class GraphFrame(wx.Frame):
# Setup - graph selector
for view in FitGraph.views:
self.graphSelection.Append(view.name, view())
viewToSelect = GraphSettings.getInstance().get('selectedGraph')
viewToSelect = FitGraph.viewIndexMap.get(viewToSelect, 0)
self.graphSelection.SetSelection(viewToSelect)
self.graphSelection.SetSelection(0)
self.ctrlPanel.updateControls(layout=False)
# Event bindings - local events

View File

@@ -25,6 +25,7 @@ import wx
from gui.bitmap_loader import BitmapLoader
from service.fit import Fit
from service.settings import GraphSettings
from .input import ConstantBox, RangeBox
from .lists import FitList, TargetList
from .vector import VectorPicker

View File

@@ -514,7 +514,6 @@ class GraphSettings:
def __init__(self):
defaults = {
'selectedGraph': None,
'mobileDroneMode': 0,
'ignoreResists': True}
self.settings = SettingsProvider.getInstance().getSettings('graphSettings', defaults)