diff options
Diffstat (limited to 'protocols/ICQ-WIM')
-rw-r--r-- | protocols/ICQ-WIM/res/resources.rc | 14 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/options.cpp | 8 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/proto.cpp | 1 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/proto.h | 1 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/resource.h | 3 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/server.cpp | 38 |
6 files changed, 37 insertions, 28 deletions
diff --git a/protocols/ICQ-WIM/res/resources.rc b/protocols/ICQ-WIM/res/resources.rc index 2d5f212c1c..3e8df0aa70 100644 --- a/protocols/ICQ-WIM/res/resources.rc +++ b/protocols/ICQ-WIM/res/resources.rc @@ -47,7 +47,7 @@ BEGIN PUSHBUTTON "Sign in/sign up using phone",IDC_REGISTER,42,34,142,14 END -IDD_OPTIONS_FULL DIALOGEX 0, 0, 310, 125 +IDD_OPTIONS_FULL DIALOGEX 0, 0, 310, 136 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT FONT 8, "MS Shell Dlg", 0, 0, 0x1 @@ -59,11 +59,12 @@ BEGIN EDITTEXT IDC_PASSWORD,98,29,106,12,ES_PASSWORD | ES_AUTOHSCROLL CONTROL "Do not open chat windows on creation",IDC_HIDECHATS, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,47,285,10 - CONTROL "Use tray icon notifications",IDC_USETRAYICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,73,285,10 - PUSHBUTTON "Sign in/sign up using phone",IDC_REGISTER,165,106,142,14 - GROUPBOX "E-mail",IDC_STATIC,1,62,306,40 + CONTROL "Use tray icon notifications",IDC_USETRAYICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,73,291,10 CONTROL "Launch mailbox in a browser on click",IDC_LAUNCH_MAILBOX, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,21,86,281,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,21,85,281,10 + CONTROL "Show error popups",IDC_SHOWERRORPOPUPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,97,291,10 + PUSHBUTTON "Sign in/sign up using phone",IDC_REGISTER,165,117,142,14 + GROUPBOX "Notifications",IDC_STATIC,1,62,306,51 END IDD_OPTIONS_ADV DIALOGEX 0, 0, 310, 86 @@ -125,6 +126,7 @@ BEGIN EDITTEXT IDC_LASTSEEN,74,32,139,10,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP END + ///////////////////////////////////////////////////////////////////////////// // // DESIGNINFO @@ -140,7 +142,7 @@ BEGIN IDD_OPTIONS_FULL, DIALOG BEGIN - BOTTOMMARGIN, 120 + BOTTOMMARGIN, 131 END IDD_OPTIONS_ADV, DIALOG diff --git a/protocols/ICQ-WIM/src/options.cpp b/protocols/ICQ-WIM/src/options.cpp index 03ecb37ad9..545b5e353b 100644 --- a/protocols/ICQ-WIM/src/options.cpp +++ b/protocols/ICQ-WIM/src/options.cpp @@ -23,7 +23,7 @@ struct CIcqRegistrationDlg : public CProtoDlgBase<CIcqProto> { CMStringA szTrans, szMsisdn; - int iErrorCode; + int iErrorCode = 0; CCtrlEdit edtPhone, edtCode; CCtrlButton btnSendSms; @@ -158,7 +158,7 @@ void CIcqProto::OnLoginViaPhone(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *pRe class CIcqOptionsDlg : public CProtoDlgBase<CIcqProto> { CCtrlEdit edtUin, edtPassword; - CCtrlCheck chkHideChats, chkTrayIcon, chkLaunchMailbox; + CCtrlCheck chkHideChats, chkTrayIcon, chkLaunchMailbox, chkShowErrorPopups; CCtrlButton btnCreate; CMStringW wszOldPass; @@ -170,7 +170,8 @@ public: edtPassword(this, IDC_PASSWORD), chkTrayIcon(this, IDC_USETRAYICON), chkHideChats(this, IDC_HIDECHATS), - chkLaunchMailbox(this, IDC_LAUNCH_MAILBOX) + chkLaunchMailbox(this, IDC_LAUNCH_MAILBOX), + chkShowErrorPopups(this, IDC_SHOWERRORPOPUPS) { btnCreate.OnClick = Callback(this, &CIcqOptionsDlg::onClick_Register); @@ -180,6 +181,7 @@ public: CreateLink(chkHideChats, ppro->m_bHideGroupchats); CreateLink(chkTrayIcon, ppro->m_bUseTrayIcon); CreateLink(chkLaunchMailbox, ppro->m_bLaunchMailbox); + CreateLink(chkShowErrorPopups, ppro->m_bErrorPopups); chkTrayIcon.OnChange = Callback(this, &CIcqOptionsDlg::onChange_Tray); } diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp index ea9e7f21f9..87b5f337f3 100644 --- a/protocols/ICQ-WIM/src/proto.cpp +++ b/protocols/ICQ-WIM/src/proto.cpp @@ -53,6 +53,7 @@ CIcqProto::CIcqProto(const char* aProtoName, const wchar_t* aUserName) : m_szPassword(this, "Password"), m_bHideGroupchats(this, "HideChats", true), m_bUseTrayIcon(this, "UseTrayIcon", false), + m_bErrorPopups(this, "ShowErrorPopups", true), m_bLaunchMailbox(this, "LaunchMailbox", true) { db_set_resident(m_szModuleName, "IdleTS"); diff --git a/protocols/ICQ-WIM/src/proto.h b/protocols/ICQ-WIM/src/proto.h index 7461dcdd6c..fcdded5f6c 100644 --- a/protocols/ICQ-WIM/src/proto.h +++ b/protocols/ICQ-WIM/src/proto.h @@ -352,6 +352,7 @@ public: CMOption<wchar_t*> m_szPassword; // password, if present CMOption<BYTE> m_bHideGroupchats; // don't pop up group chat windows on startup CMOption<BYTE> m_bUseTrayIcon; // use tray icon notifications + CMOption<BYTE> m_bErrorPopups; // display popups with errors CMOption<BYTE> m_bLaunchMailbox; // launch browser to view email CMOption<DWORD> m_iTimeDiff1; // set this status to m_iStatus1 after this interval of secs CMOption<DWORD> m_iStatus1; diff --git a/protocols/ICQ-WIM/src/resource.h b/protocols/ICQ-WIM/src/resource.h index 32ab58a703..72d0870920 100644 --- a/protocols/ICQ-WIM/src/resource.h +++ b/protocols/ICQ-WIM/src/resource.h @@ -31,6 +31,7 @@ #define IDC_STATUS1 1019 #define IDC_USETRAYICON 1020 #define IDC_LAUNCH_MAILBOX 1021 +#define IDC_SHOWERRORPOPUPS 1022 #define IDC_DIFF2 1023 #define IDC_SPIN2 1024 #define IDC_STATUS2 1025 @@ -41,7 +42,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 110 #define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1021 +#define _APS_NEXT_CONTROL_VALUE 1023 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index 8f4e7c621e..47ef4bf077 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -126,25 +126,27 @@ void CIcqProto::ConnectionFailed(int iReason, int iErrorCode) { debugLogA("ConnectionFailed -> reason %d", iReason); - POPUPDATAW Popup = {}; - Popup.lchIcon = IcoLib_GetIconByHandle(Skin_GetIconHandle(SKINICON_ERROR), true); - wcscpy_s(Popup.lpwzContactName, m_tszUserName); - switch (iReason) { - case LOGINERR_BADUSERID: - mir_snwprintf(Popup.lpwzText, LPGENW("You have not entered an ICQ number.\nConfigure this in Options -> Network -> ICQ and try again.")); - break; - case LOGINERR_WRONGPASSWORD: - mir_snwprintf(Popup.lpwzText, LPGENW("Connection failed.\nYour ICQ number or password was rejected (%d)."), iErrorCode); - break; - case LOGINERR_NONETWORK: - case LOGINERR_NOSERVER: - mir_snwprintf(Popup.lpwzText, LPGENW("Connection failed.\nThe server is temporarily unavailable (%d)."), iErrorCode); - break; - default: - mir_snwprintf(Popup.lpwzText, LPGENW("Connection failed.\nUnknown error during sign on: %d"), iErrorCode); - break; + if (m_bErrorPopups) { + POPUPDATAW Popup = {}; + Popup.lchIcon = IcoLib_GetIconByHandle(Skin_GetIconHandle(SKINICON_ERROR), true); + wcscpy_s(Popup.lpwzContactName, m_tszUserName); + switch (iReason) { + case LOGINERR_BADUSERID: + mir_snwprintf(Popup.lpwzText, TranslateT("You have not entered an ICQ number.\nConfigure this in Options -> Network -> ICQ and try again.")); + break; + case LOGINERR_WRONGPASSWORD: + mir_snwprintf(Popup.lpwzText, TranslateT("Connection failed.\nYour ICQ number or password was rejected (%d)."), iErrorCode); + break; + case LOGINERR_NONETWORK: + case LOGINERR_NOSERVER: + mir_snwprintf(Popup.lpwzText, TranslateT("Connection failed.\nThe server is temporarily unavailable (%d)."), iErrorCode); + break; + default: + mir_snwprintf(Popup.lpwzText, TranslateT("Connection failed.\nUnknown error during sign on: %d"), iErrorCode); + break; + } + PUAddPopupW(&Popup); } - PUAddPopupW(&Popup); ProtoBroadcastAck(0, ACKTYPE_LOGIN, ACKRESULT_FAILED, nullptr, iReason); ShutdownSession(); |