Remove config options menu from PyShell
We should figure out how to get these into the json settings. In the meantime, disable as they are broken on close Fixes https://gitlab.com/kicad/code/kicad/issues/9691
This commit is contained in:
parent
22b9856a6a
commit
182ccb63ae
|
@ -102,10 +102,11 @@ class KiCadPyShell(KiCadEditorNotebookFrame):
|
||||||
self.history_file = os.path.join(self.config_dir,
|
self.history_file = os.path.join(self.config_dir,
|
||||||
"PyShell_pcbnew.history")
|
"PyShell_pcbnew.history")
|
||||||
|
|
||||||
self.config_file = os.path.join(self.config_dir,
|
self.config = None
|
||||||
"PyShell_pcbnew.cfg")
|
# self.config_file = os.path.join(self.config_dir,
|
||||||
self.config = wx.FileConfig(localFilename=self.config_file)
|
# "PyShell_pcbnew.cfg")
|
||||||
self.config.SetRecordDefaults(True)
|
# self.config = wx.FileConfig(localFilename=self.config_file)
|
||||||
|
# self.config.SetRecordDefaults(True)
|
||||||
|
|
||||||
self.autoSaveSettings = False
|
self.autoSaveSettings = False
|
||||||
self.autoSaveHistory = False
|
self.autoSaveHistory = False
|
||||||
|
|
|
@ -187,26 +187,26 @@ class KiCadPyFrame():
|
||||||
m.Append(ID_TOGGLE_MAXIMIZE, '&Toggle Maximize\tF11',
|
m.Append(ID_TOGGLE_MAXIMIZE, '&Toggle Maximize\tF11',
|
||||||
'Maximize/Restore Application')
|
'Maximize/Restore Application')
|
||||||
|
|
||||||
# Options
|
# # Options
|
||||||
m = self.optionsMenu = wx.Menu()
|
# m = self.optionsMenu = wx.Menu()
|
||||||
|
#
|
||||||
self.historyMenu = wx.Menu()
|
# self.historyMenu = wx.Menu()
|
||||||
self.historyMenu.Append(ID_SAVEHISTORY, '&Autosave History',
|
# self.historyMenu.Append(ID_SAVEHISTORY, '&Autosave History',
|
||||||
'Automatically save history on close', wx.ITEM_CHECK)
|
# 'Automatically save history on close', wx.ITEM_CHECK)
|
||||||
self.historyMenu.Append(ID_SAVEHISTORYNOW, '&Save History Now',
|
# self.historyMenu.Append(ID_SAVEHISTORYNOW, '&Save History Now',
|
||||||
'Save history')
|
# 'Save history')
|
||||||
self.historyMenu.Append(ID_CLEARHISTORY, '&Clear History ',
|
# self.historyMenu.Append(ID_CLEARHISTORY, '&Clear History ',
|
||||||
'Clear history')
|
# 'Clear history')
|
||||||
m.AppendSubMenu(self.historyMenu, "&History", "History Options")
|
# m.AppendSubMenu(self.historyMenu, "&History", "History Options")
|
||||||
|
#
|
||||||
self.startupMenu = wx.Menu()
|
# self.startupMenu = wx.Menu()
|
||||||
self.startupMenu.Append(ID_EXECSTARTUPSCRIPT,
|
# self.startupMenu.Append(ID_EXECSTARTUPSCRIPT,
|
||||||
'E&xecute Startup Script',
|
# 'E&xecute Startup Script',
|
||||||
'Execute Startup Script', wx.ITEM_CHECK)
|
# 'Execute Startup Script', wx.ITEM_CHECK)
|
||||||
self.startupMenu.Append(ID_EDITSTARTUPSCRIPT,
|
# self.startupMenu.Append(ID_EDITSTARTUPSCRIPT,
|
||||||
'&Edit Startup Script...',
|
# '&Edit Startup Script...',
|
||||||
'Edit Startup Script')
|
# 'Edit Startup Script')
|
||||||
m.AppendSubMenu(self.startupMenu, '&Startup', 'Startup Options')
|
# m.AppendSubMenu(self.startupMenu, '&Startup', 'Startup Options')
|
||||||
|
|
||||||
self.settingsMenu = wx.Menu()
|
self.settingsMenu = wx.Menu()
|
||||||
self.settingsMenu.Append(ID_AUTO_SAVESETTINGS,
|
self.settingsMenu.Append(ID_AUTO_SAVESETTINGS,
|
||||||
|
@ -229,7 +229,7 @@ class KiCadPyFrame():
|
||||||
b.Append(self.fileMenu, '&File')
|
b.Append(self.fileMenu, '&File')
|
||||||
b.Append(self.editMenu, '&Edit')
|
b.Append(self.editMenu, '&Edit')
|
||||||
b.Append(self.viewMenu, '&View')
|
b.Append(self.viewMenu, '&View')
|
||||||
b.Append(self.optionsMenu, '&Options')
|
# b.Append(self.optionsMenu, '&Options')
|
||||||
b.Append(self.helpMenu, '&Help')
|
b.Append(self.helpMenu, '&Help')
|
||||||
self.parent.SetMenuBar(b)
|
self.parent.SetMenuBar(b)
|
||||||
|
|
||||||
|
@ -627,31 +627,31 @@ class KiCadPyFrame():
|
||||||
elif id == ID_ENABLEAUTOSYMPY:
|
elif id == ID_ENABLEAUTOSYMPY:
|
||||||
event.Check(self.enableAutoSympy)
|
event.Check(self.enableAutoSympy)
|
||||||
event.Enable(self.config is not None)
|
event.Enable(self.config is not None)
|
||||||
elif id == ID_AUTO_SAVESETTINGS:
|
# elif id == ID_AUTO_SAVESETTINGS:
|
||||||
event.Check(self.autoSaveSettings)
|
# event.Check(self.autoSaveSettings)
|
||||||
event.Enable(self.config is not None)
|
# event.Enable(self.config is not None)
|
||||||
elif id == ID_SAVESETTINGS:
|
# elif id == ID_SAVESETTINGS:
|
||||||
event.Enable(self.config is not None and
|
# event.Enable(self.config is not None and
|
||||||
hasattr(self, 'DoSaveSettings'))
|
# hasattr(self, 'DoSaveSettings'))
|
||||||
elif id == ID_DELSETTINGSFILE:
|
# elif id == ID_DELSETTINGSFILE:
|
||||||
event.Enable(self.config is not None)
|
# event.Enable(self.config is not None)
|
||||||
|
#
|
||||||
elif id == ID_EXECSTARTUPSCRIPT:
|
# elif id == ID_EXECSTARTUPSCRIPT:
|
||||||
event.Check(self.execStartupScript)
|
# event.Check(self.execStartupScript)
|
||||||
event.Enable(self.config is not None)
|
# event.Enable(self.config is not None)
|
||||||
|
#
|
||||||
elif id == ID_SAVEHISTORY:
|
# elif id == ID_SAVEHISTORY:
|
||||||
event.Check(self.autoSaveHistory)
|
# event.Check(self.autoSaveHistory)
|
||||||
event.Enable(self.dataDir is not None)
|
# event.Enable(self.dataDir is not None)
|
||||||
elif id == ID_SAVEHISTORYNOW:
|
# elif id == ID_SAVEHISTORYNOW:
|
||||||
event.Enable(self.dataDir is not None and
|
# event.Enable(self.dataDir is not None and
|
||||||
hasattr(self, 'SaveHistory'))
|
# hasattr(self, 'SaveHistory'))
|
||||||
elif id == ID_CLEARHISTORY:
|
# elif id == ID_CLEARHISTORY:
|
||||||
event.Enable(self.dataDir is not None)
|
# event.Enable(self.dataDir is not None)
|
||||||
|
#
|
||||||
elif id == ID_EDITSTARTUPSCRIPT:
|
# elif id == ID_EDITSTARTUPSCRIPT:
|
||||||
event.Enable(hasattr(self, 'EditStartupScript'))
|
# event.Enable(hasattr(self, 'EditStartupScript'))
|
||||||
event.Enable(self.dataDir is not None)
|
# event.Enable(self.dataDir is not None)
|
||||||
|
|
||||||
elif id == ID_FIND:
|
elif id == ID_FIND:
|
||||||
event.Enable(hasattr(win, 'DoFindNext'))
|
event.Enable(hasattr(win, 'DoFindNext'))
|
||||||
|
|
Loading…
Reference in New Issue