Skip to content

Commit

Permalink
add single window to settings
Browse files Browse the repository at this point in the history
  • Loading branch information
petrasovaa committed Dec 17, 2021
1 parent 3a65856 commit be1a4bb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions gui/wxpython/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def _defaultSettings(self):
"region": {
"resAlign": {"enabled": False},
},
"singleWindow": {"enabled": False},
},
#
# datacatalog
Expand Down
13 changes: 13 additions & 0 deletions gui/wxpython/gui_core/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,19 @@ def _createGeneralPage(self, notebook):
gridSizer = wx.GridBagSizer(hgap=3, vgap=3)

row = 0
singleWindow = wx.CheckBox(
parent=panel,
id=wx.ID_ANY,
label=_("Use single-window mode (requires GUI restart)"),
name="IsChecked",
)
singleWindow.SetValue(
self.settings.Get(group="general", key="singleWindow", subkey="enabled")
)
self.winId["general:singleWindow:enabled"] = singleWindow.GetId()
gridSizer.Add(singleWindow, pos=(row, 0), span=(1, 2))

row += 1
posDisplay = wx.CheckBox(
parent=panel,
id=wx.ID_ANY,
Expand Down
9 changes: 8 additions & 1 deletion gui/wxpython/wxgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

from core import globalvar
from core.utils import registerPid, unregisterPid
from core.settings import UserSettings

import wx

Expand Down Expand Up @@ -83,7 +84,13 @@ def OnInit(self):

def show_main_gui():
# create and show main frame
from lmgr.frame import GMFrame
single = UserSettings.Get(
group="general", key="singleWindow", subkey="enabled"
)
if single:
from main_window.frame import GMFrame
else:
from lmgr.frame import GMFrame

mainframe = GMFrame(parent=None, id=wx.ID_ANY, workspace=self.workspaceFile)
mainframe.Show()
Expand Down

0 comments on commit be1a4bb

Please sign in to comment.