diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-18 12:59:15 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-18 12:59:15 +0300 |
commit | 8f6650583ad1d12a081a1676275d8f527af33351 (patch) | |
tree | 707942e2f159e71f58d788087bd11f4855b523b9 /src | |
parent | 131d86ed82bde79889ef8d0de3b37707ba5e2a00 (diff) |
this feature was never used and only causes problems
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_app/src/mir_app.def | 3 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 3 | ||||
-rw-r--r-- | src/mir_app/src/proto_ui.cpp | 66 |
3 files changed, 15 insertions, 57 deletions
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index e85f2d2561..6b296a7b83 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -24,7 +24,7 @@ IcoLib_Release @22 IcoLib_AddRef @23
Skin_GetIconName @24
??0CProtoIntDlgBase@@QAE@ABV0@@Z @25 NONAME
-??0CProtoIntDlgBase@@QAE@PAUPROTO_INTERFACE@@H_N@Z @26 NONAME
+??0CProtoIntDlgBase@@QAE@PAUPROTO_INTERFACE@@H@Z @26 NONAME
??0PROTO_INTERFACE@@QAE@ABU0@@Z @27 NONAME
??1CProtoIntDlgBase@@UAE@XZ @29 NONAME
??4CProtoIntDlgBase@@QAEAAV0@ABV0@@Z @30 NONAME
@@ -71,7 +71,6 @@ Skin_GetIconName @24 ?SetAwayMsg@PROTO_INTERFACE@@UAAHHPB_W@Z @71 NONAME
?SetStatus@PROTO_INTERFACE@@UAAHH@Z @72 NONAME
?SetStatusText@CProtoIntDlgBase@@QAEXPB_W@Z @73 NONAME
-?UpdateProtoTitle@CProtoIntDlgBase@@AAEXPB_W@Z @74 NONAME
?UpdateStatusBar@CProtoIntDlgBase@@AAEXXZ @75 NONAME
?UserIsTyping@PROTO_INTERFACE@@UAAHIH@Z @76 NONAME
?WindowSubscribe@PROTO_INTERFACE@@QAEXPAUHWND__@@@Z @77 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 62f9fe8672..6e3946adff 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -24,7 +24,7 @@ IcoLib_Release @22 IcoLib_AddRef @23
Skin_GetIconName @24
??0CProtoIntDlgBase@@QEAA@AEBV0@@Z @25 NONAME
-??0CProtoIntDlgBase@@QEAA@PEAUPROTO_INTERFACE@@H_N@Z @26 NONAME
+??0CProtoIntDlgBase@@QEAA@PEAUPROTO_INTERFACE@@H@Z @26 NONAME
??0PROTO_INTERFACE@@QEAA@AEBU0@@Z @27 NONAME
??1CProtoIntDlgBase@@UEAA@XZ @29 NONAME
??4CProtoIntDlgBase@@QEAAAEAV0@AEBV0@@Z @30 NONAME
@@ -71,7 +71,6 @@ Skin_GetIconName @24 ?SetAwayMsg@PROTO_INTERFACE@@UEAAHHPEB_W@Z @71 NONAME
?SetStatus@PROTO_INTERFACE@@UEAAHH@Z @72 NONAME
?SetStatusText@CProtoIntDlgBase@@QEAAXPEB_W@Z @73 NONAME
-?UpdateProtoTitle@CProtoIntDlgBase@@AEAAXPEB_W@Z @74 NONAME
?UpdateStatusBar@CProtoIntDlgBase@@AEAAXXZ @75 NONAME
?UserIsTyping@PROTO_INTERFACE@@UEAAHIH@Z @76 NONAME
?WindowSubscribe@PROTO_INTERFACE@@QEAAXPEAUHWND__@@@Z @77 NONAME
diff --git a/src/mir_app/src/proto_ui.cpp b/src/mir_app/src/proto_ui.cpp index 401c5530ee..ba10aeb279 100644 --- a/src/mir_app/src/proto_ui.cpp +++ b/src/mir_app/src/proto_ui.cpp @@ -36,12 +36,11 @@ HINSTANCE ProtoGetInstance(const char *szModuleName) /////////////////////////////////////////////////////////////////////////////////////////
// Base protocol dialog
-CProtoIntDlgBase::CProtoIntDlgBase(PROTO_INTERFACE *proto, int idDialog, bool show_label)
- : CDlgBase(::ProtoGetInstance(proto->m_szModuleName), idDialog),
- m_proto_interface(proto),
- m_show_label(show_label),
- m_hwndStatus(nullptr)
-{}
+CProtoIntDlgBase::CProtoIntDlgBase(PROTO_INTERFACE *proto, int idDialog) :
+ CDlgBase(::ProtoGetInstance(proto->m_szModuleName), idDialog),
+ m_proto_interface(proto)
+{
+}
void CProtoIntDlgBase::CreateLink(CCtrlData& ctrl, char *szSetting, BYTE type, DWORD iValue)
{
@@ -59,8 +58,13 @@ void CProtoIntDlgBase::OnProtoCheckOnline(WPARAM, LPARAM) {} void CProtoIntDlgBase::SetStatusText(const wchar_t *statusText)
{
- if (m_hwndStatus)
- SendMessage(m_hwndStatus, SB_SETTEXT, 0, (LPARAM)statusText);
+ if (m_hwndStatus == nullptr) {
+ m_hwndStatus = CreateStatusWindow(WS_CHILD | WS_VISIBLE, nullptr, m_hwnd, 999);
+ SetWindowPos(m_hwndStatus, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
+ UpdateStatusBar();
+ }
+
+ SendMessage(m_hwndStatus, SB_SETTEXT, 0, (LPARAM)statusText);
}
INT_PTR CProtoIntDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
@@ -71,12 +75,6 @@ INT_PTR CProtoIntDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) case WM_INITDIALOG: // call inherited init code first
result = CSuper::DlgProc(msg, wParam, lParam);
m_proto_interface->WindowSubscribe(m_hwnd);
- if (m_show_label) {
- m_hwndStatus = CreateStatusWindow(WS_CHILD | WS_VISIBLE, nullptr, m_hwnd, 999);
- SetWindowPos(m_hwndStatus, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
- UpdateStatusBar();
- UpdateProtoTitle();
- }
return result;
case WM_DESTROY:
@@ -84,16 +82,6 @@ INT_PTR CProtoIntDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) m_proto_interface->WindowUnsubscribe(m_hwnd);
break;
- case WM_SETTEXT:
- if (m_show_label && IsWindowUnicode(m_hwnd)) {
- wchar_t *szTitle = (wchar_t *)lParam;
- if (!wcsstr(szTitle, m_proto_interface->m_tszUserName)) {
- UpdateProtoTitle(szTitle);
- return TRUE;
- }
- }
- break;
-
case WM_SIZE:
if (m_hwndStatus) {
RECT rcStatus; GetWindowRect(m_hwndStatus, &rcStatus);
@@ -103,7 +91,7 @@ INT_PTR CProtoIntDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) }
break;
- // Protocol events
+ // Protocol events
case WM_PROTO_ACTIVATE:
OnProtoActivate(wParam, lParam);
return m_lresult;
@@ -121,34 +109,6 @@ INT_PTR CProtoIntDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) return CSuper::DlgProc(msg, wParam, lParam);
}
-
-void CProtoIntDlgBase::UpdateProtoTitle(const wchar_t *szText)
-{
- if (!m_show_label)
- return;
-
- int curLength;
- const wchar_t *curText;
-
- if (szText) {
- curText = szText;
- curLength = (int)mir_wstrlen(curText);
- }
- else {
- curLength = GetWindowTextLength(m_hwnd) + 1;
- wchar_t *tmp = (wchar_t *)_alloca(curLength * sizeof(wchar_t));
- GetWindowText(m_hwnd, tmp, curLength);
- curText = tmp;
- }
-
- if (!wcsstr(curText, m_proto_interface->m_tszUserName)) {
- size_t length = curLength + mir_wstrlen(m_proto_interface->m_tszUserName) + 256;
- wchar_t *text = (wchar_t *)_alloca(length * sizeof(wchar_t));
- mir_snwprintf(text, length, L"%s [%s: %s]", curText, TranslateT("Account"), m_proto_interface->m_tszUserName);
- SetWindowText(m_hwnd, text);
- }
-}
-
void CProtoIntDlgBase::UpdateStatusBar()
{
SIZE sz;
|