summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-03-24 13:20:27 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-03-24 13:20:27 +0300
commit53041a97c6039572a384d2843293ddc830586cb7 (patch)
tree8e54a98bca5eb97a03787e3f9256feb6c8059bb2 /src
parenta9ef9d6a8d62984b7e39cb8be0af3a5f6403ab82 (diff)
fixes #4291 (in the menu editor Apply button doesn't save the custom name)
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/menu_options.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/mir_app/src/menu_options.cpp b/src/mir_app/src/menu_options.cpp
index 8e2d1e3409..947c86b4ea 100644
--- a/src/mir_app/src/menu_options.cpp
+++ b/src/mir_app/src/menu_options.cpp
@@ -76,7 +76,7 @@ static int SortMenuItems(const MenuItemOptData *p1, const MenuItemOptData *p2)
class CGenMenuOptionsPage : public CDlgBase
{
- int iInitMenuValue;
+ bool m_bInitMenuValue;
LIST<TMO_IntMenuItem> m_arDeleted;
wchar_t idstr[100];
@@ -326,9 +326,8 @@ public:
//---- init dialog -------------------------------------------
bool OnInitDialog() override
{
- iInitMenuValue = db_get_b(0, "CList", "MoveProtoMenus", TRUE);
-
- if (iInitMenuValue)
+ m_bInitMenuValue = db_get_b(0, "CList", "MoveProtoMenus", true) != 0;
+ if (m_bInitMenuValue)
m_radio2.SetState(true);
else
m_radio1.SetState(true);
@@ -347,19 +346,23 @@ public:
bool OnApply() override
{
- bIconsDisabled = m_enableIcons.GetState() == 0;
+ bIconsDisabled = !m_enableIcons.IsChecked();
db_set_b(0, "CList", "DisableMenuIcons", bIconsDisabled);
+
+ if (m_customName.IsChanged())
+ btnSet_Clicked(0);
+
SaveTree();
for (auto &pimi : m_arDeleted)
Menu_RemoveItem(pimi);
- int iNewMenuValue = !m_radio1.GetState();
- if (iNewMenuValue != iInitMenuValue) {
+ bool iNewMenuValue = !m_radio1.IsChecked();
+ if (iNewMenuValue != m_bInitMenuValue) {
db_set_b(0, "CList", "MoveProtoMenus", iNewMenuValue);
RebuildProtoMenus();
- iInitMenuValue = iNewMenuValue;
+ m_bInitMenuValue = iNewMenuValue;
}
RebuildCurrent();
return true;