From 90c87cac6ad51642d1dd9d9a2400450e667e1da7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 26 Mar 2022 15:41:27 +0300 Subject: =?UTF-8?q?fixes=20#3057=20(=D0=A3=D0=BD=D0=B8=D1=84=D0=B8=D1=86?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D1=82=D1=8C=20=D0=BD=D0=B0=D1=81?= =?UTF-8?q?=D1=82=D1=80=D0=BE=D0=B9=D0=BA=D1=83=20=D0=B3=D0=BE=D1=80=D1=8F?= =?UTF-8?q?=D1=87=D0=B8=D1=85=20=D0=BA=D0=BB=D0=B0=D0=B2=D0=B8=D1=88=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D0=BE=D1=82=D0=BF=D1=80=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8=20=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D0=B9?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/Scriver/src/chat_main.cpp | 2 ++ plugins/Scriver/src/globals.cpp | 17 ----------------- plugins/Scriver/src/globals.h | 17 ++++------------- plugins/Scriver/src/input.cpp | 30 ------------------------------ plugins/Scriver/src/msgdialog.cpp | 17 ----------------- plugins/Scriver/src/msgoptions.cpp | 10 ---------- plugins/Scriver/src/msgs.h | 3 +-- plugins/Scriver/src/resource.h | 1 - 8 files changed, 7 insertions(+), 90 deletions(-) (limited to 'plugins/Scriver/src') diff --git a/plugins/Scriver/src/chat_main.cpp b/plugins/Scriver/src/chat_main.cpp index c3f59fb6e1..d06974eb58 100644 --- a/plugins/Scriver/src/chat_main.cpp +++ b/plugins/Scriver/src/chat_main.cpp @@ -159,6 +159,8 @@ int Chat_Load() g_chatApi.OnFlashHighlight = OnFlashHighlight; g_chatApi.ShowRoom = ShowRoom; + Srmm_CreateHotkey(LPGEN("Messaging"), LPGEN("Action: Send message")); + oldDoPopup = g_chatApi.DoPopup; g_chatApi.DoPopup = DoPopup; oldDoTrayIcon = g_chatApi.DoTrayIcon; g_chatApi.DoTrayIcon = DoTrayIcon; g_chatApi.ReloadSettings(); diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp index 03b1fe1cb5..2b735d9d3c 100644 --- a/plugins/Scriver/src/globals.cpp +++ b/plugins/Scriver/src/globals.cpp @@ -269,22 +269,6 @@ void InitGlobals() memset(&g_dat, 0, sizeof(struct GlobalMessageData)); g_dat.hParentWindowList = WindowList_Create(); - if (!db_get_b(0, "Compatibility", "Scriver", 0)) { - if (g_plugin.getByte("SendOnEnter")) - g_dat.sendMode = SEND_ON_ENTER; - else if (g_plugin.getByte("SendOnDblEnter")) - g_dat.sendMode = SEND_ON_DBL_ENTER; - else if (g_plugin.getByte("SendOnCtrlEnter")) - g_dat.sendMode = SEND_ON_CTRL_ENTER; - - g_plugin.setByte(SRMSGSET_SENDMODE, g_dat.sendMode); - - g_plugin.delSetting("SendOnEnter"); - g_plugin.delSetting("SendOnDblEnter"); - g_plugin.delSetting("SendOnCtrlEnter"); - db_set_b(0, "Compatibility", "Scriver", 1); - } - HookEvent(ME_PROTO_ACK, ackevent); ReloadGlobals(); g_dat.lastParent = nullptr; @@ -346,7 +330,6 @@ void ReloadGlobals() g_dat.flags.bSaveDrafts = g_plugin.bSaveDrafts; g_dat.flags.bDelTemp = g_plugin.bDelTemp; - g_dat.sendMode = (SendMode)g_plugin.getByte(SRMSGSET_SENDMODE, SRMSGDEFSET_SENDMODE); g_dat.openFlags = g_plugin.iPopFlags; g_dat.indentSize = g_plugin.iIndentSize; g_dat.logLineColour = g_plugin.getDword(SRMSGSET_LINECOLOUR, SRMSGDEFSET_LINECOLOUR); diff --git a/plugins/Scriver/src/globals.h b/plugins/Scriver/src/globals.h index af10248c72..5a125e5039 100644 --- a/plugins/Scriver/src/globals.h +++ b/plugins/Scriver/src/globals.h @@ -23,18 +23,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef SRMM_GLOBALS_H #define SRMM_GLOBALS_H -typedef struct ImageListUsageEntry_tag +struct ImageListUsageEntry { int index; int used; -} ImageListUsageEntry; - -enum SendMode -{ - SEND_ON_ENTER, - SEND_ON_DBL_ENTER, - SEND_ON_CTRL_ENTER, - SEND_ON_SHIFT_ENTER }; struct WindowFlags @@ -99,11 +91,10 @@ struct GlobalMessageData TabFlags flags2; }; - uint32_t openFlags; - uint32_t limitNamesLength; + uint32_t openFlags; + uint32_t limitNamesLength; int activeAlpha; int inactiveAlpha; - SendMode sendMode; int tabIconListUsageSize; int smileyAddInstalled; int limitTabsNum; @@ -116,7 +107,7 @@ struct GlobalMessageData HBRUSH hInfobarBrush; int toolbarPosition; HWND hFocusWnd; - uint32_t logLineColour; + uint32_t logLineColour; int logPixelSX; int logPixelSY; HICON hMsgIcon; diff --git a/plugins/Scriver/src/input.cpp b/plugins/Scriver/src/input.cpp index 9dbb22f1b3..bc6da8d3d9 100644 --- a/plugins/Scriver/src/input.cpp +++ b/plugins/Scriver/src/input.cpp @@ -112,36 +112,6 @@ void InputAreaContextMenu(HWND hwnd, WPARAM, LPARAM lParam, MCONTACT hContact) DestroyMenu(hMenu); } -bool CMsgDialog::CheckSend() -{ - BOOL isShift = GetKeyState(VK_SHIFT) & 0x8000; - BOOL isCtrl = GetKeyState(VK_CONTROL) & 0x8000; - - if (!isShift && !isCtrl && g_dat.sendMode == SEND_ON_ENTER) { - PostMessage(m_hwnd, WM_COMMAND, IDOK, 0); - return true; - } - if (!isShift && isCtrl && g_dat.sendMode == SEND_ON_CTRL_ENTER) { - PostMessage(m_hwnd, WM_COMMAND, IDOK, 0); - return true; - } - if (isShift && !isCtrl && g_dat.sendMode == SEND_ON_SHIFT_ENTER) { - PostMessage(m_hwnd, WM_COMMAND, IDOK, 0); - return true; - } - - if (g_dat.sendMode == SEND_ON_DBL_ENTER) { - if (m_iLastEnterTime + 1000 < GetTickCount()) - m_iLastEnterTime = GetTickCount(); - else { - PostMessage(m_hwnd, WM_COMMAND, IDOK, 0); - return true; - } - } - - return false; -} - int CMsgDialog::InputAreaShortcuts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { BOOL isShift = GetKeyState(VK_SHIFT) & 0x8000; diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 024c43fe97..6890f3c971 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -105,7 +105,6 @@ CMsgDialog::CMsgDialog(MCONTACT hContact, bool bIncoming) : m_splitterX(this, IDC_SPLITTERX), m_splitterY(this, IDC_SPLITTERY), - m_btnOk(this, IDOK), m_btnAdd(this, IDC_ADD), m_btnQuote(this, IDC_QUOTE), m_btnDetails(this, IDC_DETAILS), @@ -126,7 +125,6 @@ CMsgDialog::CMsgDialog(SESSION_INFO *si) : m_splitterX(this, IDC_SPLITTERX), m_splitterY(this, IDC_SPLITTERY), - m_btnOk(this, IDOK), m_btnAdd(this, IDC_ADD), m_btnQuote(this, IDC_QUOTE), m_btnDetails(this, IDC_DETAILS), @@ -858,12 +856,6 @@ LRESULT CMsgDialog::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam) switch (msg) { case WM_KEYDOWN: - if (wParam == VK_RETURN) { - if (CheckSend()) - return 0; - } - else m_iLastEnterTime = 0; - if (isChat()) { bool isShift = (GetKeyState(VK_SHIFT) & 0x8000) != 0; bool isCtrl = (GetKeyState(VK_CONTROL) & 0x8000) != 0; @@ -918,16 +910,7 @@ LRESULT CMsgDialog::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam) SetActiveWindow(m_hwnd); break; - case WM_MOUSEWHEEL: - case WM_LBUTTONDOWN: - case WM_RBUTTONDOWN: - case WM_MBUTTONDOWN: - case WM_KILLFOCUS: - m_iLastEnterTime = 0; - break; - case WM_SYSCHAR: - m_iLastEnterTime = 0; if ((wParam == 's' || wParam == 'S') && (GetKeyState(VK_MENU) & 0x8000)) { PostMessage(m_hwnd, WM_COMMAND, IDOK, 0); return 0; diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index 9b0f0c8d57..8ddb352a08 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -244,7 +244,6 @@ class CMainOptionsDlg : public CBaseOptionDlg CCtrlSpin spinTimeout; CCtrlCheck chkAutoMin, chkAutoPopup, chkCascade, chkSavePerContact, chkStayMinimized; CCtrlCheck chkSaveDrafts, chkDelTemp, chkHideContainer; - CCtrlCombo cmbSendMode; CCtrlTreeView m_tree; public: @@ -255,7 +254,6 @@ public: chkAutoMin(this, IDC_AUTOMIN), chkCascade(this, IDC_CASCADE), chkDelTemp(this, IDC_DELTEMP), - cmbSendMode(this, IDC_SENDMODE), chkAutoPopup(this, IDC_AUTOPOPUP), chkSaveDrafts(this, IDC_SAVEDRAFTS), chkHideContainer(this, IDC_HIDECONTAINERS), @@ -280,20 +278,12 @@ public: { SetWindowLongPtr(m_tree.GetHwnd(), GWL_STYLE, (GetWindowLongPtr(m_tree.GetHwnd(), GWL_STYLE) & ~WS_BORDER) | TVS_NOHSCROLL | TVS_CHECKBOXES); FillCheckBoxTree(statusValues, _countof(statusValues), g_plugin.iPopFlags); - - cmbSendMode.AddString(TranslateT("Enter")); - cmbSendMode.AddString(TranslateT("Double 'Enter'")); - cmbSendMode.AddString(TranslateT("Ctrl+Enter")); - cmbSendMode.AddString(TranslateT("Shift+Enter")); - cmbSendMode.SetCurSel(g_dat.sendMode); return true; } bool OnApply() override { g_plugin.iPopFlags = MakeCheckBoxTreeFlags(); - - g_plugin.setByte(SRMSGSET_SENDMODE, cmbSendMode.GetCurSel()); return true; } diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h index 7a24047769..98588d167b 100644 --- a/plugins/Scriver/src/msgs.h +++ b/plugins/Scriver/src/msgs.h @@ -87,7 +87,6 @@ class CMsgDialog : public CSrmmBaseDialog friend struct ParentWindowData; friend INT_PTR CALLBACK InfobarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); - bool CheckSend(void); void ClearLog(void); HICON GetTabIcon(void); void GetTitlebarIcon(struct TitleBarData *tbd); @@ -145,7 +144,7 @@ class CMsgDialog : public CSrmmBaseDialog wchar_t *m_wszSearchQuery, *m_wszSearchResult; SESSION_INFO *m_pLastSession; - CCtrlButton m_btnOk, m_btnAdd, m_btnUserMenu, m_btnQuote, m_btnDetails; + CCtrlButton m_btnAdd, m_btnUserMenu, m_btnQuote, m_btnDetails; CSplitter m_splitterX, m_splitterY; public: diff --git a/plugins/Scriver/src/resource.h b/plugins/Scriver/src/resource.h index 4793e60cde..acb675f715 100644 --- a/plugins/Scriver/src/resource.h +++ b/plugins/Scriver/src/resource.h @@ -98,7 +98,6 @@ #define IDC_LOADCOUNTSPIN 1040 #define IDC_SHOWSTATUSBAR 1041 #define IDC_SHOWTOOLBAR 1042 -#define IDC_SENDMODE 1043 #define IDC_LOADTIMEN 1045 #define IDC_LOADTIMESPIN 1046 #define IDC_LOADTIME 1047 -- cgit v1.2.3