Do not restore graph type selected last time
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -514,7 +514,6 @@ class GraphSettings:
|
||||
|
||||
def __init__(self):
|
||||
defaults = {
|
||||
'selectedGraph': None,
|
||||
'mobileDroneMode': 0,
|
||||
'ignoreResists': True}
|
||||
self.settings = SettingsProvider.getInstance().getSettings('graphSettings', defaults)
|
||||
|
||||
Reference in New Issue
Block a user