Skip to content

Commit

Permalink
wxGUI: make single-window default, put it under Appearance (OSGeo#2810)
Browse files Browse the repository at this point in the history
  • Loading branch information
petrasovaa authored and neteler committed Nov 7, 2023
1 parent 548247b commit 26aaf10
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion gui/wxpython/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ def _defaultSettings(self):
"region": {
"resAlign": {"enabled": False},
},
"singleWindow": {"enabled": False},
},
#
# datacatalog
Expand Down Expand Up @@ -191,6 +190,7 @@ def _defaultSettings(self):
"gSelectPopupHeight": {"value": 200},
"iconTheme": {"type": "grass"},
"commandNotebook": {"selection": 0},
"singleWindow": {"enabled": True},
},
#
# language
Expand Down
36 changes: 23 additions & 13 deletions gui/wxpython/gui_core/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,19 +405,6 @@ 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 (experimental, 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 Expand Up @@ -516,6 +503,29 @@ def _createAppearancePage(self, notebook):

border = wx.BoxSizer(wx.VERTICAL)

#
# single window settings
#
box = StaticBox(
parent=panel, id=wx.ID_ANY, label=" %s " % _("Window layout settings")
)
sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
singleWindow = wx.CheckBox(
parent=panel,
id=wx.ID_ANY,
label=_("Use single-window mode (requires GUI restart)"),
name="IsChecked",
)
singleWindow.SetToolTip(
_("Use single-window mode instead of multi-window mode")
)
singleWindow.SetValue(
self.settings.Get(group="appearance", key="singleWindow", subkey="enabled")
)
self.winId["appearance:singleWindow:enabled"] = singleWindow.GetId()
sizer.Add(singleWindow, proportion=0, flag=wx.ALL | wx.EXPAND, border=5)
border.Add(sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=3)

box = StaticBox(parent=panel, id=wx.ID_ANY, label=" %s " % _("Font settings"))
sizer = wx.StaticBoxSizer(box, wx.VERTICAL)

Expand Down
2 changes: 1 addition & 1 deletion gui/wxpython/lmgr/layertree.py
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ def OnNvizProperties(self, event):
vector/volume
"""
if not UserSettings.Get(
group="general",
group="appearance",
key="singleWindow",
subkey="enabled",
):
Expand Down
2 changes: 1 addition & 1 deletion gui/wxpython/wxgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def OnInit(self):
def show_main_gui():
# create and show main frame
single = UserSettings.Get(
group="general", key="singleWindow", subkey="enabled"
group="appearance", key="singleWindow", subkey="enabled"
)
if single:
from main_window.frame import GMFrame
Expand Down

0 comments on commit 26aaf10

Please sign in to comment.