summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-01-13 15:15:16 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-01-13 15:15:16 +0000
commit8608402b9e3d0a57194e98d7a7d5de6bb8c5d43d (patch)
tree2c0e6ad6c7f71fc1e64f6f1033d89d4bff8029f7 /src
parent60b971325a23cf8fd5745e2a759f74867c244766 (diff)
menu editor:
- click on Default button does nothing, but kills focus in menu items tree; - reading of null custom text doesn't affect a menu; git-svn-id: http://svn.miranda-ng.org/main/trunk@16086 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/menu_options.cpp15
-rw-r--r--src/mir_app/src/menu_utils.cpp3
2 files changed, 6 insertions, 12 deletions
diff --git a/src/mir_app/src/menu_options.cpp b/src/mir_app/src/menu_options.cpp
index 115d7fe8a8..ab06252f2b 100644
--- a/src/mir_app/src/menu_options.cpp
+++ b/src/mir_app/src/menu_options.cpp
@@ -61,7 +61,6 @@ static int SortMenuItems(const MenuItemOptData *p1, const MenuItemOptData *p2)
class CGenMenuOptionsPage : public CDlgBase
{
int iInitMenuValue;
- bool bRebuild;
TCHAR idstr[100];
@@ -237,14 +236,12 @@ class CGenMenuOptionsPage : public CDlgBase
if (bReread) // no need to reread database on reset
MO_RecursiveWalkMenu(pmo->m_items.first, Menu_LoadFromDatabase, szModule);
- bRebuild = true;
m_menuItems.SendMsg(WM_SETREDRAW, FALSE, 0);
m_menuItems.DeleteAllItems();
BuildTreeInternal(szModule, bReread, pmo->m_items.first, NULL);
m_menuItems.SendMsg(WM_SETREDRAW, TRUE, 0);
- bRebuild = false;
ShowWindow(m_warning.GetHwnd(), (pmo->m_bUseUserDefinedItems) ? SW_HIDE : SW_SHOW);
m_menuItems.Enable(pmo->m_bUseUserDefinedItems);
@@ -285,8 +282,7 @@ public:
m_btnDefault(this, IDC_GENMENU_DEFAULT),
m_customName(this, IDC_GENMENU_CUSTOMNAME),
m_service(this, IDC_GENMENU_SERVICE),
- m_warning(this, IDC_NOTSUPPORTWARNING),
- bRebuild(false)
+ m_warning(this, IDC_NOTSUPPORTWARNING)
{
m_btnSet.OnClick = Callback(this, &CGenMenuOptionsPage::btnSet_Clicked);
m_btnReset.OnClick = Callback(this, &CGenMenuOptionsPage::btnReset_Clicked);
@@ -445,9 +441,11 @@ public:
return;
iod->name = mir_tstrdup(iod->defname);
+ m_customName.SetText(iod->defname);
- SaveTree();
- RebuildCurrent();
+ tvi.mask = TVIF_TEXT;
+ tvi.pszText = iod->name;
+ m_menuItems.SetItem(&tvi);
NotifyChange();
}
@@ -483,9 +481,6 @@ public:
void onMenuItemChanged(void*)
{
- if (bRebuild)
- return;
-
m_customName.SetTextA("");
m_service.SetTextA("");
diff --git a/src/mir_app/src/menu_utils.cpp b/src/mir_app/src/menu_utils.cpp
index 8885fc5c90..4fd6bc56a9 100644
--- a/src/mir_app/src/menu_utils.cpp
+++ b/src/mir_app/src/menu_utils.cpp
@@ -1026,8 +1026,7 @@ int Menu_LoadFromDatabase(TMO_IntMenuItem *pimi, void *szModule)
else
pimi->mi.flags |= CMIF_HIDDEN;
- if (tszCustomName[0])
- replaceStrT(pimi->ptszCustomName, tszCustomName);
+ replaceStrT(pimi->ptszCustomName, tszCustomName[0] ? tszCustomName : NULL);
MUUID currentUid;
if (pimi->mi.root == NULL)