summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-10-08 18:49:12 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-10-08 18:49:12 +0300
commit386f7d6f8c8cbfa846f552f72a899c4e045a613c (patch)
tree6f4163445923a8e49bae09c3c08128345e8cca39 /protocols
parentff741d4148025ccb9d62a4dba9ebba4c7da34b5a (diff)
fixes #3716 (YAMN: удалить настройку "кнопка в панели кнопок")
Diffstat (limited to 'protocols')
-rw-r--r--protocols/YAMN/res/YAMN.rc16
-rw-r--r--protocols/YAMN/src/main.cpp1
-rw-r--r--protocols/YAMN/src/main.h1
-rw-r--r--protocols/YAMN/src/proto/pop3/pop3opt.cpp4
-rw-r--r--protocols/YAMN/src/resource.h1
-rw-r--r--protocols/YAMN/src/services.cpp27
-rw-r--r--protocols/YAMN/src/stdafx.h2
-rw-r--r--protocols/YAMN/src/yamn.cpp3
8 files changed, 14 insertions, 41 deletions
diff --git a/protocols/YAMN/res/YAMN.rc b/protocols/YAMN/res/YAMN.rc
index 64286fd5e8..4e8460b858 100644
--- a/protocols/YAMN/res/YAMN.rc
+++ b/protocols/YAMN/res/YAMN.rc
@@ -206,19 +206,17 @@ BEGIN
CONTROL "Invisible",IDC_CHECKST7,"Button",BS_AUTOCHECKBOX | BS_NOTIFY | WS_TABSTOP,134,62,70,9
END
-IDD_YAMNOPT DIALOGEX 0, 0, 312, 121
+IDD_YAMNOPT DIALOGEX 0, 0, 312, 73
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "YAMN General Options",IDC_STATIC,3,2,303,45
- CONTROL "TopToolBar button ""Check mail""",IDC_CHECKTTB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,15,294,11
- GROUPBOX "MailBrowser Options",IDC_STATIC,3,48,151,68
- CONTROL "Enable Close on Delete Button",IDC_CLOSEONDELETE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,60,143,11
- CONTROL "Show long localized date",IDC_LONGDATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,65,129,8
- CONTROL "Show current date",IDC_SMARTDATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,80,129,8
- GROUPBOX "Date/Time Representation",IDC_STATIC,159,48,148,68
- CONTROL "Show seconds",IDC_SECONDS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,94,129,8
+ GROUPBOX "MailBrowser Options",IDC_STATIC,3,1,151,68
+ CONTROL "Enable Close on Delete Button",IDC_CLOSEONDELETE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,13,143,11
+ CONTROL "Show long localized date",IDC_LONGDATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,18,129,8
+ CONTROL "Show current date",IDC_SMARTDATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,33,129,8
+ GROUPBOX "Date/Time Representation",IDC_STATIC,159,1,148,68
+ CONTROL "Show seconds",IDC_SECONDS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,47,129,8
END
IDD_POP3ACCOUNTPOPUP DIALOGEX 0, 0, 315, 230
diff --git a/protocols/YAMN/src/main.cpp b/protocols/YAMN/src/main.cpp
index 3d370d9a44..d165acd93e 100644
--- a/protocols/YAMN/src/main.cpp
+++ b/protocols/YAMN/src/main.cpp
@@ -28,7 +28,6 @@ CMPlugin g_plugin;
HANDLE hNewMailHook;
HANDLE NoWriterEV;
-HANDLE hTTButton;
UINT SecTimer;
diff --git a/protocols/YAMN/src/main.h b/protocols/YAMN/src/main.h
index 79c56fefe0..d60f1f7fc7 100644
--- a/protocols/YAMN/src/main.h
+++ b/protocols/YAMN/src/main.h
@@ -16,7 +16,6 @@
#define YAMN_DBMSGSIZEX "MailMessageWinW"
#define YAMN_DBMSGSIZEY "MailMessageWinH"
#define YAMN_DBMSGPOSSPLIT "MailMessageSplitY"
-#define YAMN_TTBFCHECK "ForceCheckTTB"
#define YAMN_CLOSEDELETE "CloseOnDelete"
#define YAMN_DBTIMEOPTIONS "MailBrowserTimeOpts"
diff --git a/protocols/YAMN/src/proto/pop3/pop3opt.cpp b/protocols/YAMN/src/proto/pop3/pop3opt.cpp
index 8f36604033..2828fb232e 100644
--- a/protocols/YAMN/src/proto/pop3/pop3opt.cpp
+++ b/protocols/YAMN/src/proto/pop3/pop3opt.cpp
@@ -143,7 +143,6 @@ struct CGeneralOptDlg : public CBaseOptionsDlg
bool OnInitDialog() override
{
- CheckDlgButton(m_hwnd, IDC_CHECKTTB, g_plugin.getByte(YAMN_TTBFCHECK, 1) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(m_hwnd, IDC_LONGDATE, (optDateTime & SHOWDATELONG) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(m_hwnd, IDC_SMARTDATE, (optDateTime & SHOWDATENOTODAY) ? BST_UNCHECKED : BST_CHECKED);
CheckDlgButton(m_hwnd, IDC_SECONDS, (optDateTime & SHOWDATENOSECONDS) ? BST_UNCHECKED : BST_CHECKED);
@@ -154,9 +153,6 @@ struct CGeneralOptDlg : public CBaseOptionsDlg
bool OnApply() override
{
g_plugin.setByte(YAMN_CLOSEDELETE, IsDlgButtonChecked(m_hwnd, IDC_CLOSEONDELETE));
- g_plugin.setByte(YAMN_TTBFCHECK, IsDlgButtonChecked(m_hwnd, IDC_CHECKTTB));
-
- AddTopToolbarIcon(0, 0);
optDateTime = 0;
if (IsDlgButtonChecked(m_hwnd, IDC_LONGDATE)) optDateTime |= SHOWDATELONG;
diff --git a/protocols/YAMN/src/resource.h b/protocols/YAMN/src/resource.h
index 8351dd2885..81894659cc 100644
--- a/protocols/YAMN/src/resource.h
+++ b/protocols/YAMN/src/resource.h
@@ -78,7 +78,6 @@
#define IDC_GBNONEWMAIL 1095
#define IDC_GBBADCONNECT 1096
#define IDC_STSTATUS 1102
-#define IDC_CHECKTTB 1117
#define IDC_CHECKSSL 1117
#define IDC_CHECKNMSGP 1118
#define IDC_CHECKNOTLS 1120
diff --git a/protocols/YAMN/src/services.cpp b/protocols/YAMN/src/services.cpp
index 3ada411646..7f733cb666 100644
--- a/protocols/YAMN/src/services.cpp
+++ b/protocols/YAMN/src/services.cpp
@@ -215,25 +215,14 @@ HBITMAP LoadBmpFromIcon(HICON hIcon)
return hBmp;
}
-int AddTopToolbarIcon(WPARAM, LPARAM)
+static int AddTopToolbarIcon(WPARAM, LPARAM)
{
- if (g_plugin.getByte(YAMN_TTBFCHECK, 1)) {
- if (ServiceExists(MS_TTB_REMOVEBUTTON) && hTTButton == nullptr) {
- TTBButton btn = {};
- btn.pszService = MS_YAMN_FORCECHECK;
- btn.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
- btn.hIconHandleUp = btn.hIconHandleDn = g_plugin.getIconHandle(IDI_CHECKMAIL);
- btn.name = btn.pszTooltipUp = LPGEN("Check mail");
- hTTButton = g_plugin.addTTB(&btn);
- }
- }
- else {
- if (hTTButton != nullptr) {
- CallService(MS_TTB_REMOVEBUTTON, (WPARAM)hTTButton, 0);
- hTTButton = nullptr;
- }
- }
-
+ TTBButton btn = {};
+ btn.pszService = MS_YAMN_FORCECHECK;
+ btn.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
+ btn.hIconHandleUp = btn.hIconHandleDn = g_plugin.getIconHandle(IDI_CHECKMAIL);
+ btn.name = btn.pszTooltipUp = LPGEN("Check mail");
+ g_plugin.addTTB(&btn);
return 0;
}
@@ -241,8 +230,6 @@ int AddTopToolbarIcon(WPARAM, LPARAM)
int Shutdown(WPARAM, LPARAM)
{
- CallService(MS_TTB_REMOVEBUTTON, (WPARAM)hTTButton, 0);
-
g_plugin.setDword(YAMN_DBMSGPOSX, HeadPosX);
g_plugin.setDword(YAMN_DBMSGPOSY, HeadPosY);
g_plugin.setDword(YAMN_DBMSGSIZEX, HeadSizeX);
diff --git a/protocols/YAMN/src/stdafx.h b/protocols/YAMN/src/stdafx.h
index 9369f2a418..ab27af87ee 100644
--- a/protocols/YAMN/src/stdafx.h
+++ b/protocols/YAMN/src/stdafx.h
@@ -145,14 +145,12 @@ int YAMNOptInitSvc(WPARAM, LPARAM);
//From main.cpp
int PostLoad(WPARAM, LPARAM); //Executed after all plugins loaded YAMN reads mails from file and notify every protocol it should set its functions
int Shutdown(WPARAM, LPARAM); //Executed before Miranda is going to shutdown
-int AddTopToolbarIcon(WPARAM, LPARAM); //Executed when TopToolBar plugin loaded Adds bitmap to toolbar
extern wchar_t UserDirectory[]; //e.g. "F:\WINNT\Profiles\UserXYZ"
extern wchar_t ProfileName[]; //e.g. "majvan"
extern SWMRG *AccountBrowserSO;
extern YAMN_VARIABLES YAMNVar;
extern HANDLE hNewMailHook;
-extern HANDLE hTTButton;
extern HCURSOR hCurSplitNS, hCurSplitWE;
extern UINT SecTimer;
diff --git a/protocols/YAMN/src/yamn.cpp b/protocols/YAMN/src/yamn.cpp
index e4ad646694..b607c7cb80 100644
--- a/protocols/YAMN/src/yamn.cpp
+++ b/protocols/YAMN/src/yamn.cpp
@@ -149,8 +149,5 @@ INT_PTR ForceCheckSvc(WPARAM, LPARAM)
}
CloseHandle(ThreadRunningEV);
-
- if (hTTButton)
- CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTTButton, 0);
return 1;
}