summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-12-27 17:19:20 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-12-27 17:19:20 +0300
commite1a3a426a742028570baaee7430b2b5750734e4c (patch)
treeed801bc7954fcd7c860c506d4f451a8bcb82e39b /plugins
parent3ae8bfcab00ae1b497b8c1c61d6dcf4bf7322e06 (diff)
obsolete structure ADDCONTACTSTRUCT, service MS_ADDCONTACT_SHOW and whole m_addcontact.h removed and replaced with Contact_Add* functions
Diffstat (limited to 'plugins')
-rw-r--r--plugins/AddContactPlus/src/addcontact.cpp2
-rw-r--r--plugins/AddContactPlus/src/stdafx.h2
-rw-r--r--plugins/Clist_nicer/src/clistmenus.cpp9
-rw-r--r--plugins/Clist_nicer/src/stdafx.h2
-rw-r--r--plugins/ContactsPlus/src/receive.cpp4
-rw-r--r--plugins/ContactsPlus/src/send.cpp2
-rw-r--r--plugins/ContactsPlus/src/stdafx.h2
-rw-r--r--plugins/ContactsPlus/src/utils.cpp9
-rw-r--r--plugins/ContactsPlus/src/utils.h2
-rw-r--r--plugins/HistoryStats/src/stdafx.h1
-rw-r--r--plugins/Popup/src/popup_wnd2.cpp28
-rw-r--r--plugins/Popup/src/skin.cpp10
-rw-r--r--plugins/Popup/src/stdafx.h2
-rw-r--r--plugins/Scriver/src/msgdialog.cpp5
-rw-r--r--plugins/Scriver/src/stdafx.h1
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp7
-rw-r--r--plugins/TabSRMM/src/stdafx.h1
-rw-r--r--plugins/helpers/commonheaders.h1
18 files changed, 28 insertions, 62 deletions
diff --git a/plugins/AddContactPlus/src/addcontact.cpp b/plugins/AddContactPlus/src/addcontact.cpp
index 85bab9265a..44ce81bad8 100644
--- a/plugins/AddContactPlus/src/addcontact.cpp
+++ b/plugins/AddContactPlus/src/addcontact.cpp
@@ -25,7 +25,6 @@ struct AddDialogParam : public MZeroedObject
{
AddDialogParam() {}
- int handleType;
HANDLE handle;
CMStringA proto;
PROTOSEARCHRESULT *psr;
@@ -155,7 +154,6 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM)
switch (msg) {
case WM_INITDIALOG:
acs = new AddDialogParam();
- acs->handleType = HANDLE_SEARCHRESULT;
SetWindowLongPtr(hdlg, GWLP_USERDATA, (LONG_PTR)acs);
Utils_RestoreWindowPositionNoSize(hdlg, NULL, "AddContact", "");
diff --git a/plugins/AddContactPlus/src/stdafx.h b/plugins/AddContactPlus/src/stdafx.h
index db8647b8b6..bd1c6996d8 100644
--- a/plugins/AddContactPlus/src/stdafx.h
+++ b/plugins/AddContactPlus/src/stdafx.h
@@ -32,7 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <m_langpack.h>
#include <m_message.h>
#include <m_protosvc.h>
-#include <m_addcontact.h>
+#include <m_contacts.h>
#include <m_string.h>
#include "m_toptoolbar.h"
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp
index 5076f93f09..f1a57c2dac 100644
--- a/plugins/Clist_nicer/src/clistmenus.cpp
+++ b/plugins/Clist_nicer/src/clistmenus.cpp
@@ -173,13 +173,8 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
break;
case IDC_IGN_ADDPERMANENTLY:
- {
- ADDCONTACTSTRUCT acs = { 0 };
- acs.hContact = hContact;
- acs.handleType = HANDLE_CONTACT;
- CallService(MS_ADDCONTACT_SHOW, (WPARAM)hWnd, (LPARAM)&acs);
- Utils::enableDlgControl(hWnd, IDC_IGN_ADDPERMANENTLY, db_get_b(hContact, "CList", "NotOnList", 0));
- }
+ Contact_Add(hContact, hWnd);
+ Utils::enableDlgControl(hWnd, IDC_IGN_ADDPERMANENTLY, db_get_b(hContact, "CList", "NotOnList", 0));
break;
case IDC_DSP_LOADDEFAULT:
diff --git a/plugins/Clist_nicer/src/stdafx.h b/plugins/Clist_nicer/src/stdafx.h
index 9754475682..71ccf05041 100644
--- a/plugins/Clist_nicer/src/stdafx.h
+++ b/plugins/Clist_nicer/src/stdafx.h
@@ -48,7 +48,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_options.h>
#include <m_protosvc.h>
#include <m_skin.h>
-#include <m_addcontact.h>
+#include <m_contacts.h>
#include <m_timezones.h>
#include <m_cluiframes.h>
#include <m_icolib.h>
diff --git a/plugins/ContactsPlus/src/receive.cpp b/plugins/ContactsPlus/src/receive.cpp
index 67b2290358..5b919d71fe 100644
--- a/plugins/ContactsPlus/src/receive.cpp
+++ b/plugins/ContactsPlus/src/receive.cpp
@@ -355,7 +355,7 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
case ID_POPUP_ADDUSER:
hContact = CreateTemporaryContactForItem(hwndDlg, wndData, wndData->iPopupItem);
if (hContact)
- DialogAddContactExecute(hwndDlg, hContact);
+ Contact_Add(hContact, hwndDlg);
break;
case ID_POPUP_USERDETAILS:
@@ -389,7 +389,7 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
break;
case IDC_ADD:
- DialogAddContactExecute(hwndDlg, wndData->mhContact);
+ Contact_Add(wndData->mhContact, hwndDlg);
break;
}
}
diff --git a/plugins/ContactsPlus/src/send.cpp b/plugins/ContactsPlus/src/send.cpp
index 9887b10071..6176597a39 100644
--- a/plugins/ContactsPlus/src/send.cpp
+++ b/plugins/ContactsPlus/src/send.cpp
@@ -372,7 +372,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
break;
case IDC_ADD:
- DialogAddContactExecute(hwndDlg, wndData->hContact);
+ Contact_Add(wndData->hContact, hwndDlg);
break;
}
break;
diff --git a/plugins/ContactsPlus/src/stdafx.h b/plugins/ContactsPlus/src/stdafx.h
index 14b3a280b9..6ae4c02e89 100644
--- a/plugins/ContactsPlus/src/stdafx.h
+++ b/plugins/ContactsPlus/src/stdafx.h
@@ -35,7 +35,7 @@
#include "m_clist.h"
#include "m_clistint.h"
#include "m_clc.h"
-#include "m_addcontact.h"
+#include "m_contacts.h"
#include "m_history.h"
#include "m_userinfo.h"
#include "m_button.h"
diff --git a/plugins/ContactsPlus/src/utils.cpp b/plugins/ContactsPlus/src/utils.cpp
index c6c079cf3a..acc2c47a16 100644
--- a/plugins/ContactsPlus/src/utils.cpp
+++ b/plugins/ContactsPlus/src/utils.cpp
@@ -87,15 +87,6 @@ wchar_t* GetContactUID(MCONTACT hContact)
return nullptr;
}
-void DialogAddContactExecute(HWND hwndDlg, MCONTACT hNewContact)
-{
- ADDCONTACTSTRUCT acs = { 0 };
- acs.hContact = hNewContact;
- acs.handleType = HANDLE_CONTACT;
- CallService(MS_ADDCONTACT_SHOW, (WPARAM)hwndDlg, (LPARAM)&acs);
-}
-
-
void DrawProtocolIcon(HWND hwndDlg, LPARAM lParam, MCONTACT hContact)
{
LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
diff --git a/plugins/ContactsPlus/src/utils.h b/plugins/ContactsPlus/src/utils.h
index 01eee73411..6a15ed06c9 100644
--- a/plugins/ContactsPlus/src/utils.h
+++ b/plugins/ContactsPlus/src/utils.h
@@ -40,8 +40,6 @@ void UpdateDialogAddButton(HWND hwndDlg, MCONTACT hContact);
HICON InitMButton(HWND hDlg, int idButton, int idIcon, wchar_t *szTip);
-void DialogAddContactExecute(HWND hwndDlg, MCONTACT hNewContact);
-
HICON LoadContactProtoIcon(MCONTACT hContact);
void EnableDlgItem(HWND hwndDlg, UINT control, int state);
diff --git a/plugins/HistoryStats/src/stdafx.h b/plugins/HistoryStats/src/stdafx.h
index d0b4aee7ce..06800ecb98 100644
--- a/plugins/HistoryStats/src/stdafx.h
+++ b/plugins/HistoryStats/src/stdafx.h
@@ -64,7 +64,6 @@
#include <m_imgsrvc.h>
#include <m_timezones.h>
-#include <m_addcontact.h> // not used, depends on m_protosvc.h
#include <m_icq.h> // depends on m_protosvc.h
#include <m_metacontacts.h>
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp
index a3d5c3c425..fada19920f 100644
--- a/plugins/Popup/src/popup_wnd2.cpp
+++ b/plugins/Popup/src/popup_wnd2.cpp
@@ -545,9 +545,9 @@ int PopupWnd2::fixActions(POPUPACTION *theActions, int count)
{
bool isIm = (m_hContact && (CallProtoService(GetContactProto(m_hContact), PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM)) ? true : false;
- bool enableDefaultGen = (m_hContact || !(PopupOptions.actions&ACT_DEF_NOGLOBAL)) ? true : false;
- bool enableDefaultUsr = (isIm || m_hContact && !(PopupOptions.actions&ACT_DEF_IMONLY)) ? true : false;
- bool iconSize = PopupOptions.actions&ACT_LARGE ? TRUE : FALSE;
+ bool enableDefaultGen = (m_hContact || !(PopupOptions.actions & ACT_DEF_NOGLOBAL)) ? true : false;
+ bool enableDefaultUsr = (isIm || m_hContact && !(PopupOptions.actions & ACT_DEF_IMONLY)) ? true : false;
+ bool iconSize = PopupOptions.actions & ACT_LARGE ? TRUE : FALSE;
if (PopupOptions.actions & ACT_ENABLE) {
if (enableDefaultUsr && isIm && IsActionEnabled("General/Quick reply")) ++m_actionCount;
@@ -857,7 +857,7 @@ LRESULT CALLBACK ReplyEditWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
case WM_DESTROY:
PopupThreadUnlock();
- if (!(PopupOptions.actions&ACT_DEF_KEEPWND))
+ if (!(PopupOptions.actions & ACT_DEF_KEEPWND))
PUDeletePopup(dat->hwndPopup);
SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)dat->oldWndProc);
SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
@@ -908,7 +908,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
switch (lParam) {
case ACT_DEF_MESSAGE:
CallServiceSync(MS_MSG_SENDMESSAGE, (WPARAM)m_hContact, 0);
- if (!(PopupOptions.actions&ACT_DEF_KEEPWND))
+ if (!(PopupOptions.actions & ACT_DEF_KEEPWND))
PUDeletePopup(m_hwnd);
break;
@@ -936,7 +936,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
case ACT_DEF_DETAILS:
CallServiceSync(MS_USERINFO_SHOWDIALOG, (WPARAM)m_hContact, 0);
- if (!(PopupOptions.actions&ACT_DEF_KEEPWND))
+ if (!(PopupOptions.actions & ACT_DEF_KEEPWND))
PUDeletePopup(m_hwnd);
break;
@@ -946,15 +946,9 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
break;
case ACT_DEF_ADD:
- {
- ADDCONTACTSTRUCT acs = { 0 };
- acs.hContact = m_hContact;
- acs.handleType = HANDLE_CONTACT;
- acs.szProto = nullptr;
- CallServiceSync(MS_ADDCONTACT_SHOW, NULL, (LPARAM)&acs);
- if (!(PopupOptions.actions&ACT_DEF_KEEPWND))
- PUDeletePopup(m_hwnd);
- }
+ Contact_Add(m_hContact);
+ if (!(PopupOptions.actions & ACT_DEF_KEEPWND))
+ PUDeletePopup(m_hwnd);
break;
case ACT_DEF_PIN:
@@ -965,7 +959,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
m_bIsPinned = !m_bIsPinned;
{
- bool iconSize = PopupOptions.actions&ACT_LARGE ? TRUE : FALSE;
+ bool iconSize = PopupOptions.actions & ACT_LARGE ? TRUE : FALSE;
PUModifyActionIcon(m_hwnd, wParam, lParam, m_bIsPinned ? LoadIconEx(IDI_ACT_PINNED, iconSize) : LoadIconEx(IDI_ACT_PIN, iconSize));
}
break;
@@ -1011,7 +1005,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
case UM_MENUDONE:
{
unlock();
- if (!(PopupOptions.actions&ACT_DEF_KEEPWND))
+ if (!(PopupOptions.actions & ACT_DEF_KEEPWND))
PUDeletePopup(m_hwnd);
break;
}
diff --git a/plugins/Popup/src/skin.cpp b/plugins/Popup/src/skin.cpp
index 157c9aa981..bd912cf115 100644
--- a/plugins/Popup/src/skin.cpp
+++ b/plugins/Popup/src/skin.cpp
@@ -128,8 +128,8 @@ void PopupSkin::drawAction(MyBitmap *bmp, POPUPACTION *act, int x, int y, bool h
wchar_t *str = TranslateW(wname);
GetTextExtentPoint32(bmp->getDC(), str, (int)mir_wstrlen(str), &szText);
bmp->Draw_Text(str,
- (PopupOptions.actions&ACT_LARGE) ? (x + szSpace.cx + 32) : (x + szSpace.cx + 16),
- max(y + 2, y + 2 + (((PopupOptions.actions&ACT_LARGE) ? 32 : 16) - szText.cy) / 2));
+ (PopupOptions.actions & ACT_LARGE) ? (x + szSpace.cx + 32) : (x + szSpace.cx + 16),
+ max(y + 2, y + 2 + (((PopupOptions.actions & ACT_LARGE) ? 32 : 16) - szText.cy) / 2));
mir_free(wname);
SelectObject(bmp->getDC(), hFntSave);
@@ -139,8 +139,8 @@ void PopupSkin::drawAction(MyBitmap *bmp, POPUPACTION *act, int x, int y, bool h
RECT rc;
rc.left = x;
rc.top = y;
- rc.right = x + ((PopupOptions.actions&ACT_LARGE) ? 32 : 16) + 4;
- rc.bottom = y + ((PopupOptions.actions&ACT_LARGE) ? 32 : 16) + 4;
+ rc.right = x + ((PopupOptions.actions & ACT_LARGE) ? 32 : 16) + 4;
+ rc.bottom = y + ((PopupOptions.actions & ACT_LARGE) ? 32 : 16) + 4;
bmp->saveAlpha(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top);
HBRUSH hbr = CreateSolidBrush(fonts.clActionHover);
FrameRect(bmp->getDC(), &rc, hbr);
@@ -520,7 +520,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW
drawActionBar(bmp, wnd,
db_get_b(NULL, MODULNAME, "CenterActions", 0) ?
(pt.x + (textAreaWidth - wnd->getRenderInfo()->actw) / 2) :
- (PopupOptions.actions&ACT_RIGHTICONS) ?
+ (PopupOptions.actions & ACT_RIGHTICONS) ?
(pt.x + textAreaWidth - wnd->getRenderInfo()->actw) :
// else
pt.x,
diff --git a/plugins/Popup/src/stdafx.h b/plugins/Popup/src/stdafx.h
index e892d518f6..75e7733f12 100644
--- a/plugins/Popup/src/stdafx.h
+++ b/plugins/Popup/src/stdafx.h
@@ -72,7 +72,7 @@ https://miranda-ng.org/distr/
#include <m_button.h>
#include <m_message.h>
#include <m_userinfo.h>
-#include <m_addcontact.h>
+#include <m_contacts.h>
#include <m_clc.h>
#include <m_icolib.h>
#include <m_genmenu.h>
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp
index 162b22b7de..b85b0f413e 100644
--- a/plugins/Scriver/src/msgdialog.cpp
+++ b/plugins/Scriver/src/msgdialog.cpp
@@ -540,10 +540,7 @@ void CSrmmWindow::onClick_Quote(CCtrlButton*)
void CSrmmWindow::onClick_Add(CCtrlButton*)
{
- ADDCONTACTSTRUCT acs = {};
- acs.hContact = m_hContact;
- acs.handleType = HANDLE_CONTACT;
- CallService(MS_ADDCONTACT_SHOW, (WPARAM)m_hwnd, (LPARAM)&acs);
+ Contact_Add(m_hContact, m_hwnd);
if (!db_get_b(m_hContact, "CList", "NotOnList", 0))
ShowWindow(GetDlgItem(m_hwnd, IDC_ADD), SW_HIDE);
diff --git a/plugins/Scriver/src/stdafx.h b/plugins/Scriver/src/stdafx.h
index 422d4fb8ae..2076df25a0 100644
--- a/plugins/Scriver/src/stdafx.h
+++ b/plugins/Scriver/src/stdafx.h
@@ -50,7 +50,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_contacts.h>
#include <m_userinfo.h>
#include <m_history.h>
-#include <m_addcontact.h>
#include <m_message.h>
#include <m_file.h>
#include <m_fontservice.h>
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index f340f0d8a2..e8a653bbbe 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -1168,11 +1168,8 @@ void CSrmmWindow::onClick_Ok(CCtrlButton*)
void CSrmmWindow::onClick_Add(CCtrlButton*)
{
- ADDCONTACTSTRUCT acs = {};
- acs.hContact = m_hContact;
- acs.handleType = HANDLE_CONTACT;
- acs.szProto = nullptr;
- CallService(MS_ADDCONTACT_SHOW, (WPARAM)m_hwnd, (LPARAM)&acs);
+ Contact_Add(m_hContact, m_hwnd);
+
if (!db_get_b(m_hContact, "CList", "NotOnList", 0)) {
m_bNotOnList = FALSE;
ShowMultipleControls(m_hwnd, addControls, _countof(addControls), SW_HIDE);
diff --git a/plugins/TabSRMM/src/stdafx.h b/plugins/TabSRMM/src/stdafx.h
index 452fb3151a..0f20db7320 100644
--- a/plugins/TabSRMM/src/stdafx.h
+++ b/plugins/TabSRMM/src/stdafx.h
@@ -65,7 +65,6 @@
#include <m_clist.h>
#include <m_userinfo.h>
#include <m_history.h>
-#include <m_addcontact.h>
#include <m_file.h>
#include <m_fontservice.h>
#include <m_acc.h>
diff --git a/plugins/helpers/commonheaders.h b/plugins/helpers/commonheaders.h
index f85a681b1e..77ff813360 100644
--- a/plugins/helpers/commonheaders.h
+++ b/plugins/helpers/commonheaders.h
@@ -52,7 +52,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_message.h>
#include <m_userinfo.h>
#include <m_history.h>
-#include <m_addcontact.h>
#include <m_findadd.h>
#include <m_file.h>
#include <m_email.h>