From c6519db3afea05236cd41a144110a8a74f3daa96 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 10 Jun 2021 16:29:02 +0300 Subject: fixes #2914 (unified empty history menu items) --- plugins/HistoryPlusPlus/HistoryForm.pas | 2 +- plugins/HistoryPlusPlus/historypp.dpr | 19 +--------- plugins/HistoryPlusPlus/hpp_global.pas | 59 ++++++++++++++++---------------- plugins/HistoryPlusPlus/hpp_options.pas | 3 +- plugins/HistoryPlusPlus/hpp_services.pas | 16 --------- plugins/HistoryPlusPlus/m_historypp.inc | 8 ----- 6 files changed, 32 insertions(+), 75 deletions(-) (limited to 'plugins/HistoryPlusPlus') diff --git a/plugins/HistoryPlusPlus/HistoryForm.pas b/plugins/HistoryPlusPlus/HistoryForm.pas index 7df2cae662..c2c25f171f 100644 --- a/plugins/HistoryPlusPlus/HistoryForm.pas +++ b/plugins/HistoryPlusPlus/HistoryForm.pas @@ -3232,7 +3232,7 @@ end; procedure THistoryFrm.EmptyHistory1Click(Sender: TObject); begin - CallService(MS_HPP_EMPTYHISTORY, hContact, 0); + CallService(MS_HISTORY_EMPTY, hContact, 0); end; procedure THistoryFrm.EndHotFilterTimer(DoClearFilter: Boolean = False); diff --git a/plugins/HistoryPlusPlus/historypp.dpr b/plugins/HistoryPlusPlus/historypp.dpr index 68006d6a92..e0c8c3add6 100644 --- a/plugins/HistoryPlusPlus/historypp.dpr +++ b/plugins/HistoryPlusPlus/historypp.dpr @@ -70,7 +70,7 @@ uses var MenuCount: Integer = -1; PrevShowHistoryCount: Boolean = False; - hmiEmpty, hmiContact: THandle; + hmiContact: THandle; const hLangpack:THANDLE = 0; @@ -222,14 +222,6 @@ begin menuItem.hIcon := hppIcons[HPP_ICON_CONTACTHISTORY].handle; hmiContact := Menu_AddContactMenuItem(@menuItem); - // create empty item in contact menu - SET_UID(@menuItem, 'BA23B260-0AF7-4336-9703-D47C9AD7B1B0'); - menuItem.Position := 1000090001; - menuItem.szName.w := '&Empty History'; - menuItem.pszService := MS_HPP_EMPTYHISTORY; - menuItem.hIcon := hppIcons[HPP_ICON_TOOL_DELETEALL].handle; - hmiEmpty := Menu_AddContactMenuItem(@menuItem); - // create menu item in main menu for history search SET_UID(@menuItem, 'A5FE6AE6-7674-4DC0-9F22-9F56AE71E2D7'); menuItem.Position := 500060001; @@ -238,14 +230,6 @@ begin menuItem.hIcon := hppIcons[HPP_ICON_GLOBALSEARCH].handle; Menu_AddMainMenuItem(@menuItem); - // create menu item in main menu for empty system history - SET_UID(@menuItem, '633AD23C-24B5-4914-B240-AD9FACB564ED'); - menuItem.Position := 500060002; - menuItem.szName.w := '&Empty System History'; - menuItem.pszService := MS_HPP_EMPTYHISTORY; - menuItem.hIcon := hppIcons[HPP_ICON_TOOL_DELETEALL].handle; - Menu_AddMainMenuItem(@menuItem); - LoadGridOptions; HookSettingsChanged := HookEvent(ME_DB_CONTACT_SETTINGCHANGED,OnSettingsChanged); @@ -422,7 +406,6 @@ begin hLast := db_event_last(hContact); if (PrevShowHistoryCount xor ShowHistoryCount) or (count <> MenuCount) then begin - Menu_ShowItem(hmiEmpty, byte(hLast <> 0)); Menu_ShowItem(hmiContact, byte(hLast <> 0)); if ShowHistoryCount then diff --git a/plugins/HistoryPlusPlus/hpp_global.pas b/plugins/HistoryPlusPlus/hpp_global.pas index 9bae1efa3c..46fb13d739 100644 --- a/plugins/HistoryPlusPlus/hpp_global.pas +++ b/plugins/HistoryPlusPlus/hpp_global.pas @@ -214,37 +214,36 @@ const HPP_ICON_HOTSEARCH = 13; HPP_ICON_SEARCHUP = 14; HPP_ICON_SEARCHDOWN = 15; - HPP_ICON_TOOL_DELETEALL = 16; - HPP_ICON_TOOL_DELETE = 17; - HPP_ICON_TOOL_SESSIONS = 18; - HPP_ICON_TOOL_SAVE = 19; - HPP_ICON_TOOL_COPY = 20; - HPP_ICON_SEARCH_ENDOFPAGE = 21; - HPP_ICON_SEARCH_NOTFOUND = 22; - HPP_ICON_HOTFILTERCLEAR = 23; - HPP_ICON_SESS_HIDE = 24; - HPP_ICON_DROPDOWNARROW = 25; - HPP_ICON_CONTACDETAILS = 26; - HPP_ICON_CONTACTMENU = 27; - HPP_ICON_BOOKMARK = 28; - HPP_ICON_BOOKMARK_ON = 29; - HPP_ICON_BOOKMARK_OFF = 30; - HPP_ICON_SEARCHADVANCED = 31; - HPP_ICON_SEARCHRANGE = 32; + HPP_ICON_TOOL_DELETE = 16; + HPP_ICON_TOOL_SESSIONS = 17; + HPP_ICON_TOOL_SAVE = 18; + HPP_ICON_TOOL_COPY = 29; + HPP_ICON_SEARCH_ENDOFPAGE = 20; + HPP_ICON_SEARCH_NOTFOUND = 21; + HPP_ICON_HOTFILTERCLEAR = 22; + HPP_ICON_SESS_HIDE = 23; + HPP_ICON_DROPDOWNARROW = 24; + HPP_ICON_CONTACDETAILS = 25; + HPP_ICON_CONTACTMENU = 26; + HPP_ICON_BOOKMARK = 27; + HPP_ICON_BOOKMARK_ON = 28; + HPP_ICON_BOOKMARK_OFF = 39; + HPP_ICON_SEARCHADVANCED = 30; + HPP_ICON_SEARCHRANGE = 31; - HPP_ICON_EVENT_INCOMING = 33; - HPP_ICON_EVENT_OUTGOING = 34; - HPP_ICON_EVENT_SYSTEM = 35; - HPP_ICON_EVENT_CONTACTS = 36; - HPP_ICON_EVENT_STATUS = 37; - HPP_ICON_EVENT_SMTPSIMPLE = 38; - HPP_ICON_EVENT_NICK = 39; - HPP_ICON_EVENT_AVATAR = 40; - HPP_ICON_EVENT_WATRACK = 41; - HPP_ICON_EVENT_STATUSMES = 42; - HPP_ICON_EVENT_VOICECALL = 43; - - HppIconsCount = 44; + HPP_ICON_EVENT_INCOMING = 32; + HPP_ICON_EVENT_OUTGOING = 33; + HPP_ICON_EVENT_SYSTEM = 34; + HPP_ICON_EVENT_CONTACTS = 35; + HPP_ICON_EVENT_STATUS = 36; + HPP_ICON_EVENT_SMTPSIMPLE = 37; + HPP_ICON_EVENT_NICK = 38; + HPP_ICON_EVENT_AVATAR = 39; + HPP_ICON_EVENT_WATRACK = 40; + HPP_ICON_EVENT_STATUSMES = 41; + HPP_ICON_EVENT_VOICECALL = 42; + + HppIconsCount = 43; HPP_SKIN_EVENT_MESSAGE = 0; HPP_SKIN_EVENT_URL = 1; diff --git a/plugins/HistoryPlusPlus/hpp_options.pas b/plugins/HistoryPlusPlus/hpp_options.pas index 262452821d..103986f9e9 100644 --- a/plugins/HistoryPlusPlus/hpp_options.pas +++ b/plugins/HistoryPlusPlus/hpp_options.pas @@ -98,7 +98,7 @@ const DEFFORMAT_SELECTION = '%selmes%\n'; DEFFORMAT_DATETIME = 'c'; // ShortDateFormat + LongTimeFormat - hppIconsDefs : array[0..32] of ThppIconsRec = ( + hppIconsDefs : array[0..31] of ThppIconsRec = ( (name:'historypp_01'; desc:'Contact history'; group: nil; i:HPP_ICON_CONTACTHISTORY), (name:'historypp_02'; desc:'History search'; group: nil; i:HPP_ICON_GLOBALSEARCH), (name:'historypp_03'; desc:'Conversation divider'; group: 'Conversations'; i:HPP_ICON_SESS_DIVIDER), @@ -115,7 +115,6 @@ const (name:'historypp_14'; desc:'Search'; group: 'Toolbar'; i:HPP_ICON_HOTSEARCH), (name:'historypp_15'; desc:'Search Up'; group: 'Search panel'; i:HPP_ICON_SEARCHUP), (name:'historypp_16'; desc:'Search Down'; group: 'Search panel'; i:HPP_ICON_SEARCHDOWN), - (name:'historypp_17'; desc:'Delete All'; group: 'Toolbar'; i:HPP_ICON_TOOL_DELETEALL), (name:'historypp_18'; desc:'Delete'; group: 'Toolbar'; i:HPP_ICON_TOOL_DELETE), (name:'historypp_19'; desc:'Conversations'; group: 'Toolbar'; i:HPP_ICON_TOOL_SESSIONS), (name:'historypp_20'; desc:'Save'; group: 'Toolbar'; i:HPP_ICON_TOOL_SAVE), diff --git a/plugins/HistoryPlusPlus/hpp_services.pas b/plugins/HistoryPlusPlus/hpp_services.pas index 4ee1d5c161..ba4be43229 100644 --- a/plugins/HistoryPlusPlus/hpp_services.pas +++ b/plugins/HistoryPlusPlus/hpp_services.pas @@ -202,27 +202,11 @@ begin Result := 0; end; -// MS_HPP_EMPTYHISTORY service -// See m_historypp.inc for details -function HppEmptyHistory(wParam { hContact } : WPARAM; lParam { 0 } : LPARAM): uint_ptr; cdecl; -var - wHistory: THistoryFrm; -begin - wHistory := FindContactWindow(wParam); - with TEmptyHistoryFrm.Create(wHistory) do - begin - Contact := wParam; - Result := int_ptr(ShowModal = mrYes); - Free; - end; -end; - procedure hppRegisterServices; begin HstWindowList := TList.Create; CreateServiceFunction(MS_HISTORY_SHOWCONTACTHISTORY,@HppShowHistory); - CreateServiceFunction(MS_HPP_EMPTYHISTORY, @HppEmptyHistory); CreateServiceFunction(MS_HPP_GETVERSION, @HppGetVersion); CreateServiceFunction(MS_HPP_SHOWGLOBALSEARCH,@HppShowGlobalSearch); CreateServiceFunction(MS_HPP_OPENHISTORYEVENT,@HppOpenHistoryEvent); diff --git a/plugins/HistoryPlusPlus/m_historypp.inc b/plugins/HistoryPlusPlus/m_historypp.inc index 3bd0de87c5..1947ad98e6 100644 --- a/plugins/HistoryPlusPlus/m_historypp.inc +++ b/plugins/HistoryPlusPlus/m_historypp.inc @@ -180,12 +180,4 @@ const // Return - current version, via PLUGIN_MAKE_VERSION macro MS_HPP_GETVERSION = 'History++/GetVersion'; - // MS_HPP_EMPTYHISTORY - // (supported from 1.5.0.118) - // Erases contact's history - // wParam - hContact - // lParam - zero - // Notes - hContact can be NULL(0) to empty system history - MS_HPP_EMPTYHISTORY = 'History++/EmptyHistory'; - {$ENDIF} -- cgit v1.2.3