diff options
author | George Hazan <ghazan@miranda.im> | 2019-06-10 13:49:12 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-06-10 13:49:12 +0300 |
commit | a4cc4fb8da7396eaae8252cd42564b34fae2c774 (patch) | |
tree | 0f8c2ff4eb859ff209bd0b2faa9066738a719411 | |
parent | fceec22e76927745f74b9853db9c4975d2680bf7 (diff) |
fixes #1981 ([MsgExport] - it is no longer possible to change contact settings for export)
-rw-r--r-- | src/mir_core/src/CCtrlBase.cpp | 7 | ||||
-rw-r--r-- | src/mir_core/src/CCtrlListView.cpp | 14 |
2 files changed, 17 insertions, 4 deletions
diff --git a/src/mir_core/src/CCtrlBase.cpp b/src/mir_core/src/CCtrlBase.cpp index 84b4998416..ca32fd82cf 100644 --- a/src/mir_core/src/CCtrlBase.cpp +++ b/src/mir_core/src/CCtrlBase.cpp @@ -89,10 +89,11 @@ bool CCtrlBase::Enabled() const void CCtrlBase::NotifyChange() { - if (!m_parentWnd || m_parentWnd->IsInitialized()) - m_bChanged = true; + if (!m_parentWnd || !m_parentWnd->IsInitialized()) + return; - if (m_parentWnd && !m_bSilent) + m_bChanged = true; + if (!m_bSilent) m_parentWnd->NotifyChange(); OnChange(this); diff --git a/src/mir_core/src/CCtrlListView.cpp b/src/mir_core/src/CCtrlListView.cpp index e3c3e1548a..2150dd2f09 100644 --- a/src/mir_core/src/CCtrlListView.cpp +++ b/src/mir_core/src/CCtrlListView.cpp @@ -50,11 +50,23 @@ BOOL CCtrlListView::OnNotify(int, NMHDR *pnmh) case LVN_HOTTRACK: OnHotTrack(&evt); return TRUE; case LVN_INSERTITEM: OnInsertItem(&evt); return TRUE; case LVN_ITEMACTIVATE: OnItemActivate(&evt); return TRUE; - case LVN_ITEMCHANGED: OnItemChanged(&evt); return TRUE; case LVN_ITEMCHANGING: OnItemChanging(&evt); return TRUE; case LVN_KEYDOWN: OnKeyDown(&evt); return TRUE; case LVN_MARQUEEBEGIN: OnMarqueeBegin(&evt); return TRUE; case LVN_SETDISPINFO: OnSetDispInfo(&evt); return TRUE; + + case LVN_ITEMCHANGED: + OnItemChanged(&evt); + + // item's state is calculated as 1/2 << 12, so we check it to filter out all non-state changes + if (evt.nmlv->uChanged & LVIF_STATE) + if ((evt.nmlv->uOldState >> 12) != 0 && (evt.nmlv->uNewState >> 12) != 0) + NotifyChange(); + return TRUE; + + case LVN_ODSTATECHANGED: + NotifyChange(); + return TRUE; } return FALSE; |