From 4a86731399f158e08ec272fe9a5fc0f0fa0dbad6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 24 Oct 2024 20:31:35 +0300 Subject: =?UTF-8?q?fixes=20#4756=20(=D0=9F=D0=BB=D0=B0=D0=B3=D0=B8=D0=BD?= =?UTF-8?q?=D1=8B=20=D1=81=D0=BE=D0=BE=D0=B1=D1=88=D0=B5=D0=BD=D0=B8=D0=B9?= =?UTF-8?q?:=20=D0=BE=D1=82=D0=B4=D0=B0=D1=82=D1=8C=20=D0=B4=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D1=83=D0=BF=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D0=BA=D0=BD?= =?UTF-8?q?=D0=BE=D0=BF=D0=BE=D0=BA=20=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=82?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D0=BD=D0=BE=D1=81=D1=82=D1=8C=D1=8E=20=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=BE=D1=82=D0=BA=D1=83=D0=BF=20=D0=BF=D1=80=D0=BE=D1=82=D0=BE?= =?UTF-8?q?=D0=BA=D0=BE=D0=BB=D1=83)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/TabSRMM/res/resource.rc | 15 ----- plugins/TabSRMM/src/generic_msghandlers.cpp | 86 +++++++---------------------- plugins/TabSRMM/src/msgdialog.cpp | 3 - plugins/TabSRMM/src/msgdlgother.cpp | 9 --- plugins/TabSRMM/src/msgoptions.cpp | 1 - plugins/TabSRMM/src/msgs.h | 3 +- plugins/TabSRMM/src/resource.h | 5 -- plugins/TabSRMM/src/srmm.cpp | 1 - 8 files changed, 22 insertions(+), 101 deletions(-) (limited to 'plugins/TabSRMM') diff --git a/plugins/TabSRMM/res/resource.rc b/plugins/TabSRMM/res/resource.rc index f873a65e0b..9b962ec7e4 100644 --- a/plugins/TabSRMM/res/resource.rc +++ b/plugins/TabSRMM/res/resource.rc @@ -663,21 +663,6 @@ BEGIN MENUITEM "Global", ID_MODE_GLOBAL MENUITEM "Private", ID_MODE_PRIVATE END - MENUITEM SEPARATOR - POPUP "Send text formatting" - BEGIN - POPUP "Global" - BEGIN - MENUITEM "BBCode", ID_GLOBAL_BBCODE - MENUITEM "Off", ID_GLOBAL_OFF - END - POPUP "This contact" - BEGIN - MENUITEM "Global setting", ID_THISCONTACT_GLOBALSETTING - MENUITEM "BBCode", ID_THISCONTACT_BBCODE - MENUITEM "Force off", ID_THISCONTACT_OFF - END - END END POPUP "Unread menu" BEGIN diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 562349588c..e17fe07358 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -227,74 +227,31 @@ LRESULT CMsgDialog::DM_MsgWindowCmdHandler(UINT cmd, WPARAM wParam, LPARAM lPara case IDC_PROTOMENU: submenu = GetSubMenu(PluginConfig.g_hMenuContext, 4); - { - bool iOldGlobalSendFormat = g_plugin.bSendFormat; - int iLocalFormat = M.GetDword(m_hContact, "sendformat", -1); - int iNewLocalFormat = iLocalFormat; - GetWindowRect(GetDlgItem(m_hwnd, IDC_PROTOCOL), &rc); - - CheckMenuItem(submenu, ID_MODE_GLOBAL, !m_bSplitterOverride ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(submenu, ID_MODE_PRIVATE, m_bSplitterOverride ? MF_CHECKED : MF_UNCHECKED); - - // formatting menu.. - CheckMenuItem(submenu, ID_GLOBAL_BBCODE, (g_plugin.bSendFormat) ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(submenu, ID_GLOBAL_OFF, (g_plugin.bSendFormat == SENDFORMAT_NONE) ? MF_CHECKED : MF_UNCHECKED); - - CheckMenuItem(submenu, ID_THISCONTACT_GLOBALSETTING, (iLocalFormat == SENDFORMAT_NONE) ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(submenu, ID_THISCONTACT_BBCODE, (iLocalFormat > 0) ? MF_CHECKED : MF_UNCHECKED); - CheckMenuItem(submenu, ID_THISCONTACT_OFF, (iLocalFormat == -1) ? MF_CHECKED : MF_UNCHECKED); - - iSelection = TrackPopupMenu(submenu, TPM_RETURNCMD, rc.left, rc.bottom, 0, m_hwnd, nullptr); - switch (iSelection) { - case ID_MODE_GLOBAL: - m_bSplitterOverride = false; - db_set_b(m_hContact, SRMSGMOD_T, "splitoverride", 0); - LoadSplitter(); - AdjustBottomAvatarDisplay(); - DM_RecalcPictureSize(); - Resize(); - break; - - case ID_MODE_PRIVATE: - m_bSplitterOverride = true; - db_set_b(m_hContact, SRMSGMOD_T, "splitoverride", 1); - LoadSplitter(); - AdjustBottomAvatarDisplay(); - DM_RecalcPictureSize(); - Resize(); - break; - - case ID_GLOBAL_BBCODE: - g_plugin.bSendFormat = SENDFORMAT_BBCODE; - break; - - case ID_GLOBAL_OFF: - g_plugin.bSendFormat = SENDFORMAT_NONE; - break; + GetWindowRect(GetDlgItem(m_hwnd, IDC_PROTOCOL), &rc); - case ID_THISCONTACT_GLOBALSETTING: - iNewLocalFormat = -1; - break; - - case ID_THISCONTACT_BBCODE: - iNewLocalFormat = SENDFORMAT_BBCODE; - break; + CheckMenuItem(submenu, ID_MODE_GLOBAL, !m_bSplitterOverride ? MF_CHECKED : MF_UNCHECKED); + CheckMenuItem(submenu, ID_MODE_PRIVATE, m_bSplitterOverride ? MF_CHECKED : MF_UNCHECKED); - case ID_THISCONTACT_OFF: - iNewLocalFormat = SENDFORMAT_NONE; - break; - } - - if (iNewLocalFormat == -1) - db_unset(m_hContact, SRMSGMOD_T, "sendformat"); - else if (iNewLocalFormat != iLocalFormat) - db_set_dw(m_hContact, SRMSGMOD_T, "sendformat", iNewLocalFormat); + iSelection = TrackPopupMenu(submenu, TPM_RETURNCMD, rc.left, rc.bottom, 0, m_hwnd, nullptr); + switch (iSelection) { + case ID_MODE_GLOBAL: + m_bSplitterOverride = false; + db_set_b(m_hContact, SRMSGMOD_T, "splitoverride", 0); + LoadSplitter(); + AdjustBottomAvatarDisplay(); + DM_RecalcPictureSize(); + Resize(); + break; - if (iNewLocalFormat != iLocalFormat || g_plugin.bSendFormat != iOldGlobalSendFormat) { - GetSendFormat(); - Srmm_Broadcast(DM_CONFIGURETOOLBAR, 0, 1); - } + case ID_MODE_PRIVATE: + m_bSplitterOverride = true; + db_set_b(m_hContact, SRMSGMOD_T, "splitoverride", 1); + LoadSplitter(); + AdjustBottomAvatarDisplay(); + DM_RecalcPictureSize(); + Resize(); + break; } break; @@ -758,7 +715,6 @@ void CMsgDialog::OnOptionsApplied() } DM_InitRichEdit(); - GetSendFormat(); if (isChat()) { m_btnOk.SendMsg(BUTTONSETASNORMAL, TRUE, 0); diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 794c4078a3..b213fa3964 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -342,8 +342,6 @@ CMsgDialog::CMsgDialog(int iDlgId, MCONTACT hContact) : m_btnCancelAdd.OnClick = Callback(this, &CMsgDialog::onClick_CancelAdd); } - GetSendFormat(); - m_szProto = Proto_GetBaseAccountName(m_hContact); m_autoClose = CLOSE_ON_CANCEL; m_forceResizable = true; @@ -2226,7 +2224,6 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) SetWindowLongPtr(GetDlgItem(m_hwnd, IDC_SPLITTERY), GWL_EXSTYLE, GetWindowLongPtr(GetDlgItem(m_hwnd, IDC_SPLITTERY), GWL_EXSTYLE) & ~WS_EX_STATICEDGE); if (lParam == 1) { - GetSendFormat(); SetDialogToType(); DM_RecalcPictureSize(); Resize(); diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp index 10fcd4b601..01eb7c7239 100644 --- a/plugins/TabSRMM/src/msgdlgother.cpp +++ b/plugins/TabSRMM/src/msgdlgother.cpp @@ -970,15 +970,6 @@ LRESULT CMsgDialog::GetSendButtonState() return m_btnOk.SendMsg(BUTTONGETSTATEID, TRUE, 0); } -///////////////////////////////////////////////////////////////////////////////////////// -// reads send format and configures the toolbar buttons -// if mode == 0, int only configures the buttons and does not change send format - -void CMsgDialog::GetSendFormat() -{ - m_bSendFormat = M.GetDword(m_hContact, "sendformat", g_plugin.bSendFormat) != 0; -} - ///////////////////////////////////////////////////////////////////////////////////////// HICON CMsgDialog::GetXStatusIcon() const diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index e1e8f5bec1..f0ba38a0ad 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -402,7 +402,6 @@ public: treeOpts.AddOption(pwszSection, LPGENW("Minimize the message window on send"), g_plugin.bAutoMin); treeOpts.AddOption(pwszSection, LPGENW("Close the message window on send"), g_plugin.bAutoClose); treeOpts.AddOption(pwszSection, LPGENW("Enable \"Paste and send\" feature"), g_plugin.bPasteAndSend); - treeOpts.AddOption(pwszSection, LPGENW("Allow BBCode formatting in outgoing messages"), g_plugin.bSendFormat); pwszSection = LPGENW("Other options"); treeOpts.AddOption(pwszSection, LPGENW("Automatically split long messages (experimental, use with care)"), g_plugin.bAutoSplit); diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index e734f5f30e..d336e290cb 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -417,7 +417,6 @@ class CMsgDialog : public CSrmmBaseDialog void FlashOnClist(MEVENT hEvent, const DB::EventInfo &dbei); void FlashTab(bool bInvertMode); LRESULT GetSendButtonState(); - void GetSendFormat(void); HICON GetXStatusIcon() const; void HandlePasteAndSend(void); void LoadContactAvatar(void); @@ -1030,7 +1029,7 @@ struct CMPlugin : public PLUGIN // window settings CMOption bAutoMin, bAutoClose, bFlashOnClist, bDeleteTemp; - CMOption bPasteAndSend, bSendFormat, bAutoSplit, bUseSameSplitSize, bAutoCopy; + CMOption bPasteAndSend, bAutoSplit, bUseSameSplitSize, bAutoCopy; CMOption bStatusOnTabs, bUseXStatus, bDetailedTooltips, bAllowOfflineMultisend; CMOption bAutoPopup, bAutoTabs, bAutoSwitchTabs, bAutoContainer, bPopupContainer, bHideOnClose, bAllowTab; diff --git a/plugins/TabSRMM/src/resource.h b/plugins/TabSRMM/src/resource.h index 50b07bab75..5f7e8be30f 100644 --- a/plugins/TabSRMM/src/resource.h +++ b/plugins/TabSRMM/src/resource.h @@ -662,11 +662,6 @@ #define ID_MODE_GLOBAL 40148 #define ID_MODE_PRIVATE 40150 #define ID_VIEW_BOTTOMTOOLBAR 40171 -#define ID_GLOBAL_OFF 40172 -#define ID_THISCONTACT_GLOBALSETTING 40174 -#define ID_THISCONTACT_BBCODE 40175 -#define ID_THISCONTACT_OFF 40177 -#define ID_GLOBAL_BBCODE 40178 #define ID_LOG_FREEZELOG 40183 #define ID_SENDMENU_SENDWITHOUTTIMEOUTS 40203 #define ID_VIEW_INFOPANEL 40208 diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp index 228b8e936d..1657af8321 100644 --- a/plugins/TabSRMM/src/srmm.cpp +++ b/plugins/TabSRMM/src/srmm.cpp @@ -64,7 +64,6 @@ CMPlugin::CMPlugin() : bAutoSplit(SRMSGMOD_T, "autosplit", false), bDeleteTemp(SRMSGMOD_T, "deletetemp", false), bUseXStatus(SRMSGMOD_T, "use_xicons", true), - bSendFormat(SRMSGMOD_T, "sendformat", false), bHideOnClose(SRMSGMOD_T, "hideonclose", false), bStatusOnTabs(SRMSGMOD_T, "tabstatus", true), bFlashOnClist(SRMSGMOD_T, "flashcl", false), -- cgit v1.2.3