From 23f1148da6fd87d759b69d6f3865384672f78974 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 12 Aug 2019 19:42:08 +0300 Subject: tabSRMM: old perversion for chat options removed --- plugins/TabSRMM/src/chat_options.cpp | 152 +++++++++------------------ plugins/TabSRMM/src/eventpopups.cpp | 51 ++++++++- plugins/TabSRMM/src/msgoptions.cpp | 195 +++++++++++++++++++++++++--------- plugins/TabSRMM/src/stdafx.h | 7 +- plugins/TabSRMM/src/translator.cpp | 197 ----------------------------------- plugins/TabSRMM/src/translator.h | 55 ---------- 6 files changed, 241 insertions(+), 416 deletions(-) delete mode 100644 plugins/TabSRMM/src/translator.cpp delete mode 100644 plugins/TabSRMM/src/translator.h diff --git a/plugins/TabSRMM/src/chat_options.cpp b/plugins/TabSRMM/src/chat_options.cpp index 18d64e8661..078c178a53 100644 --- a/plugins/TabSRMM/src/chat_options.cpp +++ b/plugins/TabSRMM/src/chat_options.cpp @@ -126,50 +126,6 @@ static FontOptionsList IP_fontOptionsList[] = { LPGENW("Window caption (skinned mode)"), RGB(255, 255, 255), lfDefault.lfFaceName, DEFAULT_CHARSET, 0, -12 }, }; -struct branch_t -{ - wchar_t* szDescr; - char* szDBName; - int iMode; - BYTE bDefault; - HTREEITEM hItem; -}; -static branch_t branch1[] = { - { LPGENW("Open new chat rooms in the default container"), "DefaultContainer", 0, 1, nullptr }, - { LPGENW("Flash window when someone speaks"), "FlashWindow", 0, 0, nullptr }, - { LPGENW("Flash window when a word is highlighted"), "FlashWindowHighlight", 0, 1, nullptr }, - { LPGENW("Create tabs or windows for highlight events"), "CreateWindowOnHighlight", 0, 0, nullptr }, - { LPGENW("Activate chat window on highlight"), "AnnoyingHighlight", 0, 0, nullptr }, - { LPGENW("Show list of users in the chat room"), "ShowNicklist", 0, 1, nullptr }, - { LPGENW("Colorize nicknames in member list"), "ColorizeNicks", 0, 1, nullptr }, - { LPGENW("Show button menus when right clicking the buttons"), "RightClickFilter", 0, 1, nullptr }, - { LPGENW("Show topic as status message on the contact list"), "TopicOnClist", 0, 1, nullptr }, - { LPGENW("Do not pop up the window when joining a chat room"), "PopupOnJoin", 0, 0, nullptr }, - { LPGENW("Sync splitter position with standard IM sessions"), "SyncSplitter", 0, 0, nullptr }, - { LPGENW("Show contact's status modes if supported by the protocol"), "ShowContactStatus", 0, 1, nullptr }, - { LPGENW("Display contact's status icon before user role icon"), "ContactStatusFirst", 0, 0, nullptr }, - { LPGENW("Use IRC style status indicators in the nick list"), "ClassicIndicators", 0, 0, nullptr }, - { LPGENW("Use alternative sorting method in member list"), "AlternativeSorting", 0, 1, nullptr } -}; - -static branch_t branch2[] = { - { LPGENW("Prefix all events with a timestamp"), "ShowTimeStamp", 0, 1, nullptr }, - { LPGENW("Timestamp only when event time differs"), "ShowTimeStampIfChanged", 0, 0, nullptr }, - { LPGENW("Timestamp has same color as the event"), "TimeStampEventColour", 0, 0, nullptr }, - { LPGENW("Indent the second line of a message"), "LogIndentEnabled", 0, 1, nullptr }, - { LPGENW("Limit user names in the message log to 20 characters"), "LogLimitNames", 0, 1, nullptr }, - { LPGENW("Add a colon (:) to auto-completed user names"), "AddColonToAutoComplete", 0, 1, nullptr }, - { LPGENW("Add a comma instead of a colon to auto-completed user names"), "UseCommaAsColon", 0, 0, nullptr }, - { LPGENW("Start private conversation on double click in nick list (insert nick if unchecked)"), "DoubleClick4Privat", 0, 0, nullptr }, - { LPGENW("Strip colors from messages in the log"), "StripFormatting", 0, 0, nullptr }, - { LPGENW("Enable the 'event filter' for new rooms"), "FilterEnabled", 0, 0, nullptr }, - { LPGENW("Use IRC style status indicators in the log"), "LogClassicIndicators", 0, 0, nullptr }, - { LPGENW("Allow clickable user names in the message log"), "ClickableNicks", 0, 1, nullptr }, - { LPGENW("Add new line after names"), "NewlineAfterNames", 0, 0, nullptr }, - { LPGENW("Colorize user names in message log"), "ColorizeNicksInLog", 0, 1, nullptr }, - { LPGENW("Scale down icons to 10x10 pixels in the chat log"), "ScaleIcons", 0, 1, nullptr } -}; - void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour, char *szMod) { char str[32]; @@ -526,6 +482,50 @@ protected: ///////////////////////////////////////////////////////////////////////////////////////// // Group chat - Settings +TOptionListGroup lvGroupsChat[] = +{ + { 0, LPGENW("Appearance and functionality of chat room windows") }, + { 0, LPGENW("Appearance of the message log") }, + { 0 } +}; + +static TOptionListItem lvItemsChat[] = +{ + { 0, LPGENW("Open new chat rooms in the default container"), 1, LOI_TYPE_SETTING, (UINT_PTR)"DefaultContainer", 0 }, + { 0, LPGENW("Flash window when someone speaks"), 0, LOI_TYPE_SETTING, (UINT_PTR)"FlashWindow", 0 }, + { 0, LPGENW("Flash window when a word is highlighted"), 1, LOI_TYPE_SETTING, (UINT_PTR)"FlashWindowHighlight", 0 }, + { 0, LPGENW("Create tabs or windows for highlight events"), 0, LOI_TYPE_SETTING, (UINT_PTR)"CreateWindowOnHighlight", 0 }, + { 0, LPGENW("Activate chat window on highlight"), 0, LOI_TYPE_SETTING, (UINT_PTR)"AnnoyingHighlight", 0 }, + { 0, LPGENW("Show list of users in the chat room"), 1, LOI_TYPE_SETTING, (UINT_PTR)"ShowNicklist", 0 }, + { 0, LPGENW("Colorize nicknames in member list"), 1, LOI_TYPE_SETTING, (UINT_PTR)"ColorizeNicks", 0 }, + { 0, LPGENW("Show button menus when right clicking the buttons"), 1, LOI_TYPE_SETTING, (UINT_PTR)"RightClickFilter", 0 }, + { 0, LPGENW("Show topic as status message on the contact list"), 1, LOI_TYPE_SETTING, (UINT_PTR)"TopicOnClist", 0 }, + { 0, LPGENW("Do not pop up the window when joining a chat room"), 0, LOI_TYPE_SETTING, (UINT_PTR)"PopupOnJoin", 0 }, + { 0, LPGENW("Sync splitter position with standard IM sessions"), 0, LOI_TYPE_SETTING, (UINT_PTR)"SyncSplitter", 0 }, + { 0, LPGENW("Show contact's status modes if supported by the protocol"), 1, LOI_TYPE_SETTING, (UINT_PTR)"ShowContactStatus", 0 }, + { 0, LPGENW("Display contact's status icon before user role icon"), 0, LOI_TYPE_SETTING, (UINT_PTR)"ContactStatusFirst", 0 }, + { 0, LPGENW("Use IRC style status indicators in the nick list"), 0, LOI_TYPE_SETTING, (UINT_PTR)"ClassicIndicators", 0 }, + { 0, LPGENW("Use alternative sorting method in member list"), 1, LOI_TYPE_SETTING, (UINT_PTR)"AlternativeSorting", 0 }, + + { 0, LPGENW("Prefix all events with a timestamp"), 1, LOI_TYPE_SETTING, (UINT_PTR)"ShowTimeStamp", 1 }, + { 0, LPGENW("Timestamp only when event time differs"), 0, LOI_TYPE_SETTING, (UINT_PTR)"ShowTimeStampIfChanged", 1 }, + { 0, LPGENW("Timestamp has same color as the event"), 0, LOI_TYPE_SETTING, (UINT_PTR)"TimeStampEventColour", 1 }, + { 0, LPGENW("Indent the second line of a message"), 1, LOI_TYPE_SETTING, (UINT_PTR)"LogIndentEnabled", 1 }, + { 0, LPGENW("Limit user names in the message log to 20 characters"), 1, LOI_TYPE_SETTING, (UINT_PTR)"LogLimitNames", 1 }, + { 0, LPGENW("Add a colon (:) to auto-completed user names"), 1, LOI_TYPE_SETTING, (UINT_PTR)"AddColonToAutoComplete", 1 }, + { 0, LPGENW("Add a comma instead of a colon to auto-completed user names"), 0, LOI_TYPE_SETTING, (UINT_PTR)"UseCommaAsColon", 1 }, + { 0, LPGENW("Start private conversation on double click in nick list (insert nick if unchecked)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"DoubleClick4Privat", 1 }, + { 0, LPGENW("Strip colors from messages in the log"), 0, LOI_TYPE_SETTING, (UINT_PTR)"StripFormatting", 1 }, + { 0, LPGENW("Enable the 'event filter' for new rooms"), 0, LOI_TYPE_SETTING, (UINT_PTR)"FilterEnabled", 1 }, + { 0, LPGENW("Use IRC style status indicators in the log"), 0, LOI_TYPE_SETTING, (UINT_PTR)"LogClassicIndicators", 1 }, + { 0, LPGENW("Allow clickable user names in the message log"), 1, LOI_TYPE_SETTING, (UINT_PTR)"ClickableNicks", 1 }, + { 0, LPGENW("Add new line after names"), 0, LOI_TYPE_SETTING, (UINT_PTR)"NewlineAfterNames", 1 }, + { 0, LPGENW("Colorize user names in message log"), 1, LOI_TYPE_SETTING, (UINT_PTR)"ColorizeNicksInLog", 1 }, + { 0, LPGENW("Scale down icons to 10x10 pixels in the chat log"), 1, LOI_TYPE_SETTING, (UINT_PTR)"ScaleIcons", 1 }, + + { 0, 0, 0, 0, 0, 0 } +}; + class CChatSettingsDlg : public CChatBaseOptionDlg { HTREEITEM hListHeading1 = nullptr; @@ -534,59 +534,6 @@ class CChatSettingsDlg : public CChatBaseOptionDlg CCtrlTreeView treeCheck; CCtrlEdit edtGroup; - HTREEITEM InsertBranch(wchar_t* pszDescr, BOOL bExpanded) - { - TVINSERTSTRUCT tvis; - tvis.hParent = nullptr; - tvis.hInsertAfter = TVI_LAST; - tvis.item.mask = TVIF_TEXT | TVIF_STATE; - tvis.item.pszText = TranslateW(pszDescr); - tvis.item.stateMask = TVIS_EXPANDED | TVIS_BOLD; - tvis.item.state = (bExpanded ? TVIS_EXPANDED : 0) | TVIS_BOLD; - return treeCheck.InsertItem(&tvis); - } - - void FillBranch(HTREEITEM hParent, branch_t *branch, size_t nValues, DWORD defaultval) - { - if (hParent == nullptr) - return; - - TVINSERTSTRUCT tvis = {}; - - for (size_t i = 0; i < nValues; i++) { - tvis.hParent = hParent; - tvis.hInsertAfter = TVI_LAST; - tvis.item.mask = TVIF_TEXT; - tvis.item.pszText = TranslateW(branch[i].szDescr); - branch[i].hItem = treeCheck.InsertItem(&tvis); - - BOOL bCheck; - if (branch[i].iMode) - bCheck = (db_get_dw(0, CHAT_MODULE, branch[i].szDBName, defaultval) & branch[i].iMode) != 0; - else - bCheck = db_get_dw(0, CHAT_MODULE, branch[i].szDBName, branch[i].bDefault) != 0; - treeCheck.SetCheckState(branch[i].hItem, bCheck); - } - } - - void SaveBranch(branch_t *branch, int nValues) - { - TVITEMEX tvi = { 0 }; - DWORD iState = 0; - - for (int i = 0; i < nValues; i++) { - BOOL bChecked = treeCheck.GetCheckState(branch[i].hItem); - if (branch[i].iMode) { - if (bChecked) - iState |= branch[i].iMode; - if (iState & GC_EVENT_ADDSTATUS) - iState |= GC_EVENT_REMOVESTATUS; - db_set_dw(0, CHAT_MODULE, branch[i].szDBName, iState); - } - else db_set_b(0, CHAT_MODULE, branch[i].szDBName, bChecked); - } - } - public: CChatSettingsDlg() : CChatBaseOptionDlg(IDD_OPTIONS1), @@ -596,13 +543,9 @@ public: bool OnInitDialog() override { - SetWindowLongPtr(treeCheck.GetHwnd(), GWL_STYLE, GetWindowLongPtr(treeCheck.GetHwnd(), GWL_STYLE) | (TVS_NOHSCROLL)); - - hListHeading1 = InsertBranch(TranslateT("Appearance and functionality of chat room windows"), TRUE); - hListHeading2 = InsertBranch(TranslateT("Appearance of the message log"), TRUE); + SetWindowLongPtr(treeCheck.GetHwnd(), GWL_STYLE, GetWindowLongPtr(treeCheck.GetHwnd(), GWL_STYLE) | (TVS_HASBUTTONS | TVS_CHECKBOXES | TVS_NOHSCROLL)); - FillBranch(hListHeading1, branch1, _countof(branch1), 0x0000); - FillBranch(hListHeading2, branch2, _countof(branch2), 0x0000); + TreeViewInit(treeCheck.GetHwnd(), lvGroupsChat, lvItemsChat, CHAT_MODULE); edtGroup.SetText(ptrW(Chat_GetGroup())); return true; @@ -612,8 +555,7 @@ public: { Chat_SetGroup(ptrW(edtGroup.GetText())); - SaveBranch(branch1, _countof(branch1)); - SaveBranch(branch2, _countof(branch2)); + TreeViewToDB(treeCheck.GetHwnd(), lvItemsChat, CHAT_MODULE, nullptr); return true; } diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index 21556817ce..d273f1994b 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -456,13 +456,56 @@ static int TSAPI PopupPreview() return 0; } +static TOptionListItem lvItemsNEN[] = +{ + { 0, LPGENW("Show a preview of the event"), IDC_CHKPREVIEW, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bPreview, 1 }, + { 0, LPGENW("Don't announce event when message dialog is open"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bWindowCheck, 1 }, + { 0, LPGENW("Don't announce events from RSS protocols"), IDC_NORSS, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bNoRSS, 1 }, + { 0, LPGENW("Enable the system tray icon"), IDC_ENABLETRAYSUPPORT, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bTraySupport, 2 }, + { 0, LPGENW("Merge new events for the same contact into existing popup"), 1, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bMergePopup, 6 }, + { 0, LPGENW("Show headers"), IDC_CHKSHOWHEADERS, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bShowHeaders, 6 }, + { 0, LPGENW("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 }, + { 0, LPGENW("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 }, + { 0, LPGENW("Dismiss event"), MASK_REMOVE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 }, + + { 0, LPGENW("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 }, + { 0, LPGENW("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 }, + { 0, LPGENW("Dismiss event"), MASK_REMOVE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 }, + + { 0, LPGENW("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActTE, 5 }, + { 0, LPGENW("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActTE, 5 }, + + { 0, LPGENW("Disable event notifications for instant messages"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.iDisable, 0 }, + { 0, LPGENW("Disable event notifications for group chats"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.iMUCDisable, 0 }, + { 0, LPGENW("Disable notifications for non-message events"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bDisableNonMessage, 0 }, + + { 0, LPGENW("Remove popups for a contact when the message window is focused"), PU_REMOVE_ON_FOCUS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 }, + { 0, LPGENW("Remove popups for a contact when I start typing a reply"), PU_REMOVE_ON_TYPE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 }, + { 0, LPGENW("Remove popups for a contact when I send a reply"), PU_REMOVE_ON_SEND, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 }, + + { 0, nullptr, 0, 0, 0, 0 } +}; + +static TOptionListGroup lvGroupsNEN[] = +{ + { 0, LPGENW("Disable notifications") }, + { 0, LPGENW("General options") }, + { 0, LPGENW("System tray icon") }, + { 0, LPGENW("Left click actions (popups only)") }, + { 0, LPGENW("Right click actions (popups only)") }, + { 0, LPGENW("Timeout actions (popups only)") }, + { 0, LPGENW("Combine notifications for the same contact") }, + { 0, LPGENW("Remove popups under following conditions") }, + { 0, nullptr } +}; + static INT_PTR CALLBACK DlgProcPopupOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { case WM_INITDIALOG: TranslateDialogDefault(hWnd); { - TreeViewInit(GetDlgItem(hWnd, IDC_EVENTOPTIONS), CTranslator::TREE_NEN, 0, TRUE); + TreeViewInit(GetDlgItem(hWnd, IDC_EVENTOPTIONS), lvGroupsNEN, lvItemsNEN, 0, 0, TRUE); SendDlgItemMessage(hWnd, IDC_COLBACK_MESSAGE, CPM_SETCOLOUR, 0, nen_options.colBackMsg); SendDlgItemMessage(hWnd, IDC_COLTEXT_MESSAGE, CPM_SETCOLOUR, 0, nen_options.colTextMsg); @@ -598,7 +641,7 @@ static INT_PTR CALLBACK DlgProcPopupOpts(HWND hWnd, UINT msg, WPARAM wParam, LPA case PSN_APPLY: // scan the tree view and obtain the options... - TreeViewToDB(GetDlgItem(hWnd, IDC_EVENTOPTIONS), CTranslator::TREE_NEN, nullptr, nullptr); + TreeViewToDB(GetDlgItem(hWnd, IDC_EVENTOPTIONS), lvItemsNEN, nullptr, nullptr); db_set_b(0, CHAT_MODULE, "PopupStyle", (BYTE)g_Settings.iPopupStyle); db_set_w(0, CHAT_MODULE, "PopupTimeout", g_Settings.iPopupTimeout); @@ -650,7 +693,7 @@ void TSAPI UpdateTrayMenuState(CTabBaseDlg *dat, BOOL bForced) PluginConfig.m_UnreadInTray -= mii.dwItemData; if (mii.dwItemData > 0 || bForced) { wchar_t szMenuEntry[80]; - mir_snwprintf(szMenuEntry, L"%s: %s (%s) [%d]", tszProto, dat->m_cache->getNick(), dat->m_wszStatus[0] ? dat->m_wszStatus : L"(undef)", mii.dwItemData); + mir_snwprintf(szMenuEntry, L"%s: %s (%s) [%d]", tszProto, dat->m_cache->getNick(), dat->m_wszStatus[0] ? dat->m_wszStatus : L"(undef)", (int)mii.dwItemData); if (!bForced) mii.dwItemData = 0; @@ -690,7 +733,7 @@ int TSAPI UpdateTrayMenu(const CTabBaseDlg *dat, WORD wStatus, const char *szPro wchar_t szMenuEntry[80]; const wchar_t *szNick = (dat != nullptr) ? dat->m_cache->getNick() : Clist_GetContactDisplayName(hContact); - mir_snwprintf(szMenuEntry, L"%s: %s (%s) [%d]", tszFinalProto, szNick, szMyStatus, mii.dwItemData); + mir_snwprintf(szMenuEntry, L"%s: %s (%s) [%d]", tszFinalProto, szNick, szMyStatus, (int)mii.dwItemData); mii.hbmpItem = HBMMENU_CALLBACK; mii.fMask |= MIIM_STRING | MIIM_BITMAP; diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index c02c4dd279..ab20605b56 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -55,15 +55,12 @@ void LoadLogfont(int section, int i, LOGFONTA * lf, COLORREF * colour, char *szM ///////////////////////////////////////////////////////////////////////////////////////// -void TreeViewInit(HWND hwndTree, UINT id, DWORD dwFlags, BOOL bFromMem) +void TreeViewInit(HWND hwndTree, TOptionListGroup *lvGroups, TOptionListItem *lvItems, const char *DBPath, DWORD dwFlags, bool bFromMem) { - TVINSERTSTRUCT tvi = {}; - TOptionListGroup *lvGroups = CTranslator::getGroupTree(id); - TOptionListItem *lvItems = CTranslator::getTree(id); - SetWindowLongPtr(hwndTree, GWL_STYLE, GetWindowLongPtr(hwndTree, GWL_STYLE) | (TVS_HASBUTTONS | TVS_CHECKBOXES | TVS_NOHSCROLL)); // fill the list box, create groups first, then add items + TVINSERTSTRUCT tvi = {}; for (int i = 0; lvGroups[i].szName != nullptr; i++) { tvi.hParent = nullptr; tvi.hInsertAfter = TVI_LAST; @@ -76,75 +73,71 @@ void TreeViewInit(HWND hwndTree, UINT id, DWORD dwFlags, BOOL bFromMem) TreeView_SetItemState(hwndTree, lvGroups[i].handle, 0, TVIS_STATEIMAGEMASK); } - for (int i = 0; lvItems[i].szName != nullptr; i++) { - tvi.hParent = (HTREEITEM)lvGroups[lvItems[i].uGroup].handle; + for (auto *p = lvItems; p->szName != nullptr; p++) { + tvi.hParent = (HTREEITEM)lvGroups[p->uGroup].handle; tvi.hInsertAfter = TVI_LAST; - tvi.item.pszText = TranslateW(lvItems[i].szName); + tvi.item.pszText = TranslateW(p->szName); tvi.item.mask = TVIF_TEXT | TVIF_PARAM; - tvi.item.lParam = i; - lvItems[i].handle = TreeView_InsertItem(hwndTree, &tvi); + tvi.item.lParam = p - lvItems; + p->handle = TreeView_InsertItem(hwndTree, &tvi); BOOL bCheck = FALSE; if (bFromMem == FALSE) { - switch (lvItems[i].uType) { + switch (p->uType) { case LOI_TYPE_FLAG: - bCheck = (dwFlags & (UINT)lvItems[i].lParam) != 0; + bCheck = (dwFlags & (UINT)p->lParam) != 0; break; case LOI_TYPE_SETTING: - bCheck = M.GetByte((char *)lvItems[i].lParam, lvItems[i].id); + bCheck = db_get_b(0, DBPath, (char *)p->lParam, p->id); break; } } else { - switch (lvItems[i].uType) { + switch (p->uType) { case LOI_TYPE_FLAG: - bCheck = ((*((UINT *)lvItems[i].lParam)) & lvItems[i].id) != 0; + bCheck = ((*((UINT *)p->lParam)) & p->id) != 0; break; case LOI_TYPE_SETTING: - bCheck = *((BOOL *)lvItems[i].lParam); + bCheck = *((BOOL *)p->lParam); break; } } - TreeView_SetCheckState(hwndTree, lvItems[i].handle, bCheck); + TreeView_SetCheckState(hwndTree, p->handle, bCheck); } } -void TreeViewSetFromDB(HWND hwndTree, UINT id, DWORD dwFlags) +void TreeViewSetFromDB(HWND hwndTree, TOptionListItem *lvItems, DWORD dwFlags) { - TOptionListItem *lvItems = CTranslator::getTree(id); - - for (int i = 0; lvItems[i].szName != nullptr; i++) { + for (auto *p = lvItems; p->szName != nullptr; p++) { BOOL bCheck = FALSE; - if (lvItems[i].uType == LOI_TYPE_FLAG) - bCheck = (dwFlags & (UINT)lvItems[i].lParam) != 0; - else if (lvItems[i].uType == LOI_TYPE_SETTING) - bCheck = M.GetByte((char *)lvItems[i].lParam, lvItems[i].id); - TreeView_SetCheckState(hwndTree, lvItems[i].handle, bCheck); + if (p->uType == LOI_TYPE_FLAG) + bCheck = (dwFlags & (UINT)p->lParam) != 0; + else if (p->uType == LOI_TYPE_SETTING) + bCheck = M.GetByte((char *)p->lParam, p->id); + TreeView_SetCheckState(hwndTree, p->handle, bCheck); } } -void TreeViewToDB(HWND hwndTree, UINT id, char *DBPath, DWORD *dwFlags) +void TreeViewToDB(HWND hwndTree, TOptionListItem *lvItems, const char *DBPath, DWORD *dwFlags) { - TOptionListItem *lvItems = CTranslator::getTree(id); + for (auto *p = lvItems; p->szName != nullptr; p++) { + UINT iState = TreeView_GetCheckState(hwndTree, p->handle); - for (int i = 0; lvItems[i].szName != nullptr; i++) { - UINT iState = TreeView_GetCheckState(hwndTree, lvItems[i].handle); - - switch (lvItems[i].uType) { + switch (p->uType) { case LOI_TYPE_FLAG: if (dwFlags != nullptr) - (*dwFlags) |= (iState == 1) ? lvItems[i].lParam : 0; + (*dwFlags) |= (iState == 1) ? p->lParam : 0; if (DBPath == nullptr) { - UINT *tm = (UINT*)lvItems[i].lParam; - (*tm) = (iState == 1) ? ((*tm) | lvItems[i].id) : ((*tm) & ~lvItems[i].id); + UINT *tm = (UINT*)p->lParam; + (*tm) = (iState == 1) ? ((*tm) | p->id) : ((*tm) & ~p->id); } break; case LOI_TYPE_SETTING: if (DBPath != nullptr) { - db_set_b(0, DBPath, (char *)lvItems[i].lParam, iState == 1); + db_set_b(0, DBPath, (char *)p->lParam, iState == 1); } else { - (*((BOOL*)lvItems[i].lParam)) = iState == 1; + (*((BOOL*)p->lParam)) = iState == 1; } break; } @@ -497,6 +490,31 @@ public: ///////////////////////////////////////////////////////////////////////////////////////// // Main options dialog +static TOptionListGroup lvGroupsMsg[] = +{ + { 0, LPGENW("Message window behavior") }, + { 0, LPGENW("Sending messages") }, + { 0, LPGENW("Other options") }, + { 0, nullptr } +}; + +static TOptionListItem lvItemsMsg[] = +{ + { 0, LPGENW("Send on Shift+Enter"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendonshiftenter", 1 }, + { 0, LPGENW("Send message on 'Enter'"), SRMSGDEFSET_SENDONENTER, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_SENDONENTER, 1 }, + { 0, LPGENW("Send message on double 'Enter'"), 0, LOI_TYPE_SETTING, (UINT_PTR)"SendOnDblEnter", 1 }, + { 0, LPGENW("Minimize the message window on send"), SRMSGDEFSET_AUTOMIN, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_AUTOMIN, 1 }, + { 0, LPGENW("Close the message window on send"), 0, LOI_TYPE_SETTING, (UINT_PTR)"AutoClose", 1 }, + { 0, LPGENW("Always flash contact list and tray icon for new messages"), 0, LOI_TYPE_SETTING, (UINT_PTR)"flashcl", 0 }, + { 0, LPGENW("Delete temporary contacts on close"), 0, LOI_TYPE_SETTING, (UINT_PTR)"deletetemp", 0 }, + { 0, LPGENW("Enable \"Paste and send\" feature"), 0, LOI_TYPE_SETTING, (UINT_PTR)"pasteandsend", 1 }, + { 0, LPGENW("Allow BBCode formatting in outgoing messages"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendformat", 1 }, + { 0, LPGENW("Automatically split long messages (experimental, use with care)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"autosplit", 2 }, + { 0, LPGENW("Log status changes"), 0, LOI_TYPE_SETTING, (UINT_PTR)"logstatuschanges", 2 }, + { 0, LPGENW("Automatically copy selected text"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autocopy", 2 }, + { 0, nullptr, 0, 0, 0, 0 } +}; + class COptMainDlg : public CDlgBase { CCtrlSpin spnAvaSize; @@ -519,7 +537,7 @@ public: bool OnInitDialog() override { - TreeViewInit(treeOpts.GetHwnd(), CTranslator::TREE_MSG, 0, FALSE); + TreeViewInit(treeOpts.GetHwnd(), lvGroupsMsg, lvItemsMsg, SRMSGMOD_T); chkAvaPreserve.SetState(M.GetByte("dontscaleavatars", 0)); @@ -533,7 +551,7 @@ public: db_set_b(0, SRMSGMOD_T, "dontscaleavatars", chkAvaPreserve.GetState()); // scan the tree view and obtain the options... - TreeViewToDB(treeOpts.GetHwnd(), CTranslator::TREE_MSG, SRMSGMOD_T, nullptr); + TreeViewToDB(treeOpts.GetHwnd(), lvItemsMsg, SRMSGMOD_T, nullptr); PluginConfig.reloadSettings(); Srmm_Broadcast(DM_OPTIONSAPPLIED, 1, 0); return true; @@ -550,6 +568,39 @@ public: static UINT __ctrls[] = { IDC_INDENTSPIN, IDC_RINDENTSPIN, IDC_INDENTAMOUNT, IDC_RIGHTINDENT, IDC_MODIFY, IDC_RTLMODIFY }; +static TOptionListGroup lvGroupsLog[] = +{ + { 0, LPGENW("Message log appearance") }, + { 0, LPGENW("Support for external plugins") }, + { 0, LPGENW("Timestamp settings (note: timestamps also depend on your templates)") }, + { 0, LPGENW("Message log icons") }, + { 0, nullptr } +}; + +static TOptionListItem lvItemsLog[] = +{ + { 0, LPGENW("Show timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWTIME, 2 }, + { 0, LPGENW("Show dates in timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWDATES, 2 }, + { 0, LPGENW("Show seconds in timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWSECONDS, 2 }, + { 0, LPGENW("Use contacts local time (if timezone info available)"), 0, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_LOCALTIME, 2 }, + { 0, LPGENW("Draw grid lines"), 1, LOI_TYPE_FLAG, MWF_LOG_GRID, 0 }, + { 0, LPGENW("Event type icons in the message log"), 1, LOI_TYPE_FLAG, MWF_LOG_SHOWICONS, 3 }, + { 0, LPGENW("Text symbols as event markers"), 0, LOI_TYPE_FLAG, MWF_LOG_SYMBOLS, 3 }, + { 0, LPGENW("Use incoming/outgoing icons"), 1, LOI_TYPE_FLAG, MWF_LOG_INOUTICONS, 3 }, + { 0, LPGENW("Use message grouping"), 1, LOI_TYPE_FLAG, MWF_LOG_GROUPMODE, 0 }, + { 0, LPGENW("Indent message body"), 1, LOI_TYPE_FLAG, MWF_LOG_INDENT, 0 }, + { 0, LPGENW("Simple text formatting (*bold*, etc.)"), 0, LOI_TYPE_FLAG, MWF_LOG_TEXTFORMAT, 0 }, + { 0, LPGENW("Support BBCode formatting"), 1, LOI_TYPE_FLAG, MWF_LOG_BBCODE, 0 }, + { 0, LPGENW("Place a separator in the log after a window lost its foreground status"), 0, LOI_TYPE_SETTING, (UINT_PTR)"usedividers", 0 }, + { 0, LPGENW("Only place a separator when an incoming event is announced with a popup"), 0, LOI_TYPE_SETTING, (UINT_PTR)"div_popupconfig", 0 }, + { 0, LPGENW("RTL is default text direction"), 0, LOI_TYPE_FLAG, MWF_LOG_RTL, 0 }, + { 0, LPGENW("Show events at the new line (IEView Compatibility Mode)"), 1, LOI_TYPE_FLAG, MWF_LOG_NEWLINE, 1 }, + { 0, LPGENW("Underline timestamp/nickname (IEView Compatibility Mode)"), 0, LOI_TYPE_FLAG, MWF_LOG_UNDERLINE, 1 }, + { 0, LPGENW("Show timestamp after nickname (IEView Compatibility Mode)"), 0, LOI_TYPE_FLAG, MWF_LOG_SWAPNICK, 1 }, + { 0, LPGENW("Use normal templates (uncheck to use simple templates if your template set supports them)"), 1, LOI_TYPE_FLAG, MWF_LOG_NORMALTEMPLATES, 0 }, + { 0, nullptr, 0, 0, 0, 0 } +}; + class COptLogDlg : public CDlgBase { CCtrlSpin spnLeft, spnRight, spnLoadCount, spnLoadTime, spnTrim; @@ -625,7 +676,7 @@ public: break; } - TreeViewInit(logOpts.GetHwnd(), CTranslator::TREE_LOG, dwFlags, FALSE); + TreeViewInit(logOpts.GetHwnd(), lvGroupsLog, lvItemsLog, SRMSGMOD_T, dwFlags); spnLeft.SetPosition(M.GetDword("IndentAmount", 20)); spnRight.SetPosition(M.GetDword("RightIndent", 20)); @@ -697,7 +748,7 @@ public: } // scan the tree view and obtain the options... - TreeViewToDB(logOpts.GetHwnd(), CTranslator::TREE_LOG, SRMSGMOD_T, &dwFlags); + TreeViewToDB(logOpts.GetHwnd(), lvItemsLog, SRMSGMOD_T, &dwFlags); db_set_dw(0, SRMSGMOD_T, "mwflags", dwFlags); if (chkAlwaysTrim.GetState()) db_set_dw(0, SRMSGMOD_T, "maxhist", spnTrim.GetPosition()); @@ -912,6 +963,30 @@ public: ///////////////////////////////////////////////////////////////////////////////////////// // options for tabbed messaging got their own page.. finally :) +static TOptionListGroup lvGroupsTab[] = +{ + { 0, LPGENW("Tab options") }, + { 0, LPGENW("How to create tabs and windows for incoming messages") }, + { 0, LPGENW("Miscellaneous options") }, + { 0, nullptr } +}; + +static TOptionListItem lvItemsTab[] = +{ + { 0, LPGENW("Show status text on tabs"), 1, LOI_TYPE_SETTING, (UINT_PTR)"tabstatus", 0 }, + { 0, LPGENW("Prefer xStatus icons when available"), 1, LOI_TYPE_SETTING, (UINT_PTR)"use_xicons", 0 }, + { 0, LPGENW("Detailed tooltip on tabs (requires Tipper plugin)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"d_tooltips", 0 }, + { 0, LPGENW("ALWAYS activate new message sessions (has PRIORITY over the options below)"), SRMSGDEFSET_AUTOPOPUP, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_AUTOPOPUP, 1 }, + { 0, LPGENW("Automatically create new message sessions without activating them"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autotabs", 1 }, + { 0, LPGENW("New windows are minimized (the option above MUST be active)"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autocontainer", 1 }, + { 0, LPGENW("Activate a minimized window when a new tab is created inside it"), 0, LOI_TYPE_SETTING, (UINT_PTR)"cpopup", 1 }, + { 0, LPGENW("Automatically switch existing tabs in minimized windows on incoming messages (ignored when using Aero Peek task bar features)"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autoswitchtabs", 1 }, + { 0, LPGENW("Close button only hides message windows"), 0, LOI_TYPE_SETTING, (UINT_PTR)"hideonclose", 2 }, + { 0, LPGENW("Allow Tab key in typing area (this will disable focus selection by Tab key)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"tabmode", 2 }, + { 0, LPGENW("Add offline contacts to multisend list"), 0, LOI_TYPE_SETTING, (UINT_PTR) "AllowOfflineMultisend", 2 }, + { 0, nullptr, 0, 0, 0, 0 } +}; + class COptTabbedDlg : public CDlgBase { CCtrlEdit edtLimit; @@ -938,7 +1013,7 @@ public: bool OnInitDialog() override { - TreeViewInit(tabOptions.GetHwnd(), CTranslator::TREE_TAB, 0, FALSE); + TreeViewInit(tabOptions.GetHwnd(), lvGroupsTab, lvItemsTab, SRMSGMOD_T); chkLimit.SetState(M.GetByte("cuttitle", 0)); spnLimit.SetPosition(db_get_w(0, SRMSGMOD_T, "cut_at", 15)); @@ -958,7 +1033,7 @@ public: db_set_b(0, SRMSGMOD_T, "cuttitle", chkLimit.GetState()); db_set_b(0, SRMSGMOD_T, "escmode", cmbEscMode.GetCurSel()); - TreeViewToDB(tabOptions.GetHwnd(), CTranslator::TREE_TAB, SRMSGMOD_T, nullptr); + TreeViewToDB(tabOptions.GetHwnd(), lvItemsTab, SRMSGMOD_T, nullptr); PluginConfig.reloadSettings(); Srmm_Broadcast(DM_OPTIONSAPPLIED, 0, 0); @@ -1080,6 +1155,25 @@ public: ///////////////////////////////////////////////////////////////////////////////////////// // TabModPlus options +TOptionListGroup lvGroupsModPlus[] = +{ + { 0, LPGENW("Message window tweaks") }, + { 0, LPGENW("Display metacontact icons") }, + { 0, LPGENW("Error feedback") }, + { 0, nullptr } +}; + +TOptionListItem lvItemsModPlus[] = +{ + { 0, LPGENW("Close current tab on send"), 0, LOI_TYPE_SETTING, (UINT_PTR)"adv_AutoClose_2", 0 }, + { 0, LPGENW("Enable unattended send (experimental feature, required for multisend and send later) (*)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendLaterAvail", 0 }, + { 0, LPGENW("Show client description in info panel"), 1, LOI_TYPE_SETTING, (UINT_PTR)"ShowClientDescription", 0 }, + { 0, LPGENW("On tab control"), 1, LOI_TYPE_SETTING, (UINT_PTR)"MetaiconTab", 1 }, + { 0, LPGENW("On the button bar"), 0, LOI_TYPE_SETTING, (UINT_PTR)"MetaiconBar", 1 }, + { 0, LPGENW("Disable error popups on sending failures"), 0, LOI_TYPE_SETTING, (UINT_PTR)"adv_noErrorPopups", 2 }, + { 0, nullptr, 0, 0, 0, 0 } +}; + class COptAdvancedDlg : public CDlgBase { CCtrlSpin spnTimeout, spnHistSize; @@ -1101,7 +1195,7 @@ public: bool OnInitDialog() override { - TreeViewInit(plusOptions.GetHwnd(), CTranslator::TREE_MODPLUS, 0, FALSE); + TreeViewInit(plusOptions.GetHwnd(), lvGroupsModPlus, lvItemsModPlus, SRMSGMOD_T); spnTimeout.SetPosition(PluginConfig.m_MsgTimeout / 1000); spnHistSize.SetPosition(M.GetByte("historysize", 0)); @@ -1110,7 +1204,7 @@ public: bool OnApply() override { - TreeViewToDB(plusOptions.GetHwnd(), CTranslator::TREE_MODPLUS, SRMSGMOD_T, nullptr); + TreeViewToDB(plusOptions.GetHwnd(), lvItemsModPlus, SRMSGMOD_T, nullptr); int msgTimeout = 1000 * spnTimeout.GetPosition(); PluginConfig.m_MsgTimeout = msgTimeout >= SRMSGSET_MSGTIMEOUT_MIN ? msgTimeout : SRMSGSET_MSGTIMEOUT_MIN; @@ -1123,12 +1217,11 @@ public: void onClick_Revert(CCtrlButton*) { - TOptionListItem *lvItems = CTranslator::getTree(CTranslator::TREE_MODPLUS); - - for (int i = 0; lvItems[i].szName != nullptr; i++) - if (lvItems[i].uType == LOI_TYPE_SETTING) - db_set_b(0, SRMSGMOD_T, (char *)lvItems[i].lParam, (BYTE)lvItems[i].id); - TreeViewSetFromDB(GetDlgItem(m_hwnd, IDC_PLUS_CHECKTREE), CTranslator::TREE_MODPLUS, 0); + for (auto &it : lvItemsModPlus) + if (it.uType == LOI_TYPE_SETTING) + db_set_b(0, SRMSGMOD_T, (char *)it.lParam, it.id); + + TreeViewSetFromDB(GetDlgItem(m_hwnd, IDC_PLUS_CHECKTREE), lvItemsModPlus, 0); } }; diff --git a/plugins/TabSRMM/src/stdafx.h b/plugins/TabSRMM/src/stdafx.h index ed7d1590fd..24125e6f09 100644 --- a/plugins/TabSRMM/src/stdafx.h +++ b/plugins/TabSRMM/src/stdafx.h @@ -119,7 +119,6 @@ typedef struct _DWM_THUMBNAIL_PROPERTIES #include "functions.h" #include "chat.h" #include "contactcache.h" -#include "translator.h" #include "themes.h" #include "globals.h" #include "mim.h" @@ -241,9 +240,9 @@ INT_PTR SendMessageCommand(WPARAM, LPARAM); INT_PTR SendMessageCommand_W(WPARAM, LPARAM); INT_PTR SetUserPrefs(WPARAM, LPARAM); -void TreeViewInit(HWND hwndTree, UINT id, DWORD dwFlags, BOOL bFromMem); -void TreeViewSetFromDB(HWND hwndTree, UINT id, DWORD dwFlags); -void TreeViewToDB(HWND hwndTree, UINT id, char *DBPath, DWORD *dwFlags); +void TreeViewInit(HWND hwndTree, TOptionListGroup *lvGroups, TOptionListItem *lvItems, const char *DBPath, DWORD dwFlags = 0, bool bFromMem = false); +void TreeViewSetFromDB(HWND hwndTree, TOptionListItem *lvItems, DWORD dwFlags); +void TreeViewToDB(HWND hwndTree, TOptionListItem *lvItems, const char *DBPath, DWORD *dwFlags); INT_PTR CALLBACK DlgProcSetupStatusModes(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); diff --git a/plugins/TabSRMM/src/translator.cpp b/plugins/TabSRMM/src/translator.cpp deleted file mode 100644 index de744ee082..0000000000 --- a/plugins/TabSRMM/src/translator.cpp +++ /dev/null @@ -1,197 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////// -// Miranda NG: the free IM client for Microsoft* Windows* -// -// Copyright (C) 2012-19 Miranda NG team, -// Copyright (c) 2000-09 Miranda ICQ/IM project, -// all portions of this codebase are copyrighted to the people -// listed in contributors.txt. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// you should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// part of tabSRMM messaging plugin for Miranda. -// -// (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors -// -// handles pretranslated strings - -#include "stdafx.h" - -TOptionListGroup m_lvGroupsModPlus[] = -{ - { 0, LPGENW("Message window tweaks") }, - { 0, LPGENW("Display metacontact icons") }, - { 0, LPGENW("Error feedback") }, - { 0, nullptr } -}; - -TOptionListItem m_lvItemsModPlus[] = -{ - { 0, LPGENW("Close current tab on send"), 0, LOI_TYPE_SETTING, (UINT_PTR)"adv_AutoClose_2", 0 }, - { 0, LPGENW("Enable unattended send (experimental feature, required for multisend and send later) (*)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendLaterAvail", 0 }, - { 0, LPGENW("Show client description in info panel"), 1, LOI_TYPE_SETTING, (UINT_PTR)"ShowClientDescription", 0 }, - { 0, LPGENW("On tab control"), 1, LOI_TYPE_SETTING, (UINT_PTR)"MetaiconTab", 1 }, - { 0, LPGENW("On the button bar"), 0, LOI_TYPE_SETTING, (UINT_PTR)"MetaiconBar", 1 }, - { 0, LPGENW("Disable error popups on sending failures"), 0, LOI_TYPE_SETTING, (UINT_PTR)"adv_noErrorPopups", 2 }, - { 0, nullptr, 0, 0, 0, 0 } -}; - -TOptionListItem m_lvItemsNEN[] = -{ - { 0, LPGENW("Show a preview of the event"), IDC_CHKPREVIEW, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bPreview, 1 }, - { 0, LPGENW("Don't announce event when message dialog is open"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bWindowCheck, 1 }, - { 0, LPGENW("Don't announce events from RSS protocols"), IDC_NORSS, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bNoRSS, 1 }, - { 0, LPGENW("Enable the system tray icon"), IDC_ENABLETRAYSUPPORT, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bTraySupport, 2 }, - { 0, LPGENW("Merge new events for the same contact into existing popup"), 1, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bMergePopup, 6 }, - { 0, LPGENW("Show headers"), IDC_CHKSHOWHEADERS, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bShowHeaders, 6 }, - { 0, LPGENW("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 }, - { 0, LPGENW("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 }, - { 0, LPGENW("Dismiss event"), MASK_REMOVE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActL, 3 }, - - { 0, LPGENW("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 }, - { 0, LPGENW("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 }, - { 0, LPGENW("Dismiss event"), MASK_REMOVE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActR, 4 }, - - { 0, LPGENW("Dismiss popup"), MASK_DISMISS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActTE, 5 }, - { 0, LPGENW("Open event"), MASK_OPEN, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.maskActTE, 5 }, - - { 0, LPGENW("Disable event notifications for instant messages"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.iDisable, 0 }, - { 0, LPGENW("Disable event notifications for group chats"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.iMUCDisable, 0 }, - { 0, LPGENW("Disable notifications for non-message events"), IDC_CHKWINDOWCHECK, LOI_TYPE_SETTING, (UINT_PTR)&nen_options.bDisableNonMessage, 0 }, - - { 0, LPGENW("Remove popups for a contact when the message window is focused"), PU_REMOVE_ON_FOCUS, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 }, - { 0, LPGENW("Remove popups for a contact when I start typing a reply"), PU_REMOVE_ON_TYPE, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 }, - { 0, LPGENW("Remove popups for a contact when I send a reply"), PU_REMOVE_ON_SEND, LOI_TYPE_FLAG, (UINT_PTR)&nen_options.dwRemoveMask, 7 }, - - { 0, nullptr, 0, 0, 0, 0 } -}; - -TOptionListGroup m_lvGroupsNEN[] = -{ - { 0, LPGENW("Disable notifications") }, - { 0, LPGENW("General options") }, - { 0, LPGENW("System tray icon") }, - { 0, LPGENW("Left click actions (popups only)") }, - { 0, LPGENW("Right click actions (popups only)") }, - { 0, LPGENW("Timeout actions (popups only)") }, - { 0, LPGENW("Combine notifications for the same contact") }, - { 0, LPGENW("Remove popups under following conditions") }, - { 0, nullptr } -}; - -TOptionListGroup m_lvGroupsMsg[] = -{ - { 0, LPGENW("Message window behavior") }, - { 0, LPGENW("Sending messages") }, - { 0, LPGENW("Other options") }, - { 0, nullptr } -}; - -TOptionListItem m_lvItemsMsg[] = -{ - { 0, LPGENW("Send on Shift+Enter"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendonshiftenter", 1 }, - { 0, LPGENW("Send message on 'Enter'"), SRMSGDEFSET_SENDONENTER, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_SENDONENTER, 1 }, - { 0, LPGENW("Send message on double 'Enter'"), 0, LOI_TYPE_SETTING, (UINT_PTR)"SendOnDblEnter", 1 }, - { 0, LPGENW("Minimize the message window on send"), SRMSGDEFSET_AUTOMIN, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_AUTOMIN, 1 }, - { 0, LPGENW("Close the message window on send"), 0, LOI_TYPE_SETTING, (UINT_PTR)"AutoClose", 1 }, - { 0, LPGENW("Always flash contact list and tray icon for new messages"), 0, LOI_TYPE_SETTING, (UINT_PTR)"flashcl", 0 }, - { 0, LPGENW("Delete temporary contacts on close"), 0, LOI_TYPE_SETTING, (UINT_PTR)"deletetemp", 0 }, - { 0, LPGENW("Enable \"Paste and send\" feature"), 0, LOI_TYPE_SETTING, (UINT_PTR)"pasteandsend", 1 }, - { 0, LPGENW("Allow BBCode formatting in outgoing messages"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendformat", 1 }, - { 0, LPGENW("Automatically split long messages (experimental, use with care)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"autosplit", 2 }, - { 0, LPGENW("Log status changes"), 0, LOI_TYPE_SETTING, (UINT_PTR)"logstatuschanges", 2 }, - { 0, LPGENW("Automatically copy selected text"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autocopy", 2 }, - { 0, nullptr, 0, 0, 0, 0 } -}; - -TOptionListGroup m_lvGroupsLog[] = -{ - { 0, LPGENW("Message log appearance") }, - { 0, LPGENW("Support for external plugins") }, - { 0, LPGENW("Timestamp settings (note: timestamps also depend on your templates)") }, - { 0, LPGENW("Message log icons") }, - { 0, nullptr } -}; - -TOptionListItem m_lvItemsLog[] = -{ - { 0, LPGENW("Show timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWTIME, 2 }, - { 0, LPGENW("Show dates in timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWDATES, 2 }, - { 0, LPGENW("Show seconds in timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWSECONDS, 2 }, - { 0, LPGENW("Use contacts local time (if timezone info available)"), 0, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_LOCALTIME, 2 }, - { 0, LPGENW("Draw grid lines"), 1, LOI_TYPE_FLAG, MWF_LOG_GRID, 0 }, - { 0, LPGENW("Event type icons in the message log"), 1, LOI_TYPE_FLAG, MWF_LOG_SHOWICONS, 3 }, - { 0, LPGENW("Text symbols as event markers"), 0, LOI_TYPE_FLAG, MWF_LOG_SYMBOLS, 3 }, - { 0, LPGENW("Use incoming/outgoing icons"), 1, LOI_TYPE_FLAG, MWF_LOG_INOUTICONS, 3 }, - { 0, LPGENW("Use message grouping"), 1, LOI_TYPE_FLAG, MWF_LOG_GROUPMODE, 0 }, - { 0, LPGENW("Indent message body"), 1, LOI_TYPE_FLAG, MWF_LOG_INDENT, 0 }, - { 0, LPGENW("Simple text formatting (*bold*, etc.)"), 0, LOI_TYPE_FLAG, MWF_LOG_TEXTFORMAT, 0 }, - { 0, LPGENW("Support BBCode formatting"), 1, LOI_TYPE_FLAG, MWF_LOG_BBCODE, 0 }, - { 0, LPGENW("Place a separator in the log after a window lost its foreground status"), 0, LOI_TYPE_SETTING, (UINT_PTR)"usedividers", 0 }, - { 0, LPGENW("Only place a separator when an incoming event is announced with a popup"), 0, LOI_TYPE_SETTING, (UINT_PTR)"div_popupconfig", 0 }, - { 0, LPGENW("RTL is default text direction"), 0, LOI_TYPE_FLAG, MWF_LOG_RTL, 0 }, - { 0, LPGENW("Show events at the new line (IEView Compatibility Mode)"), 1, LOI_TYPE_FLAG, MWF_LOG_NEWLINE, 1 }, - { 0, LPGENW("Underline timestamp/nickname (IEView Compatibility Mode)"), 0, LOI_TYPE_FLAG, MWF_LOG_UNDERLINE, 1 }, - { 0, LPGENW("Show timestamp after nickname (IEView Compatibility Mode)"), 0, LOI_TYPE_FLAG, MWF_LOG_SWAPNICK, 1 }, - { 0, LPGENW("Use normal templates (uncheck to use simple templates if your template set supports them)"), 1, LOI_TYPE_FLAG, MWF_LOG_NORMALTEMPLATES, 0 }, - { 0, nullptr, 0, 0, 0, 0 } -}; - -TOptionListGroup m_lvGroupsTab[] = -{ - { 0, LPGENW("Tab options") }, - { 0, LPGENW("How to create tabs and windows for incoming messages") }, - { 0, LPGENW("Miscellaneous options") }, - { 0, nullptr } -}; - -TOptionListItem m_lvItemsTab[] = -{ - { 0, LPGENW("Show status text on tabs"), 1, LOI_TYPE_SETTING, (UINT_PTR)"tabstatus", 0 }, - { 0, LPGENW("Prefer xStatus icons when available"), 1, LOI_TYPE_SETTING, (UINT_PTR)"use_xicons", 0 }, - { 0, LPGENW("Detailed tooltip on tabs (requires Tipper plugin)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"d_tooltips", 0 }, - { 0, LPGENW("ALWAYS activate new message sessions (has PRIORITY over the options below)"), SRMSGDEFSET_AUTOPOPUP, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_AUTOPOPUP, 1 }, - { 0, LPGENW("Automatically create new message sessions without activating them"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autotabs", 1 }, - { 0, LPGENW("New windows are minimized (the option above MUST be active)"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autocontainer", 1 }, - { 0, LPGENW("Activate a minimized window when a new tab is created inside it"), 0, LOI_TYPE_SETTING, (UINT_PTR)"cpopup", 1 }, - { 0, LPGENW("Automatically switch existing tabs in minimized windows on incoming messages (ignored when using Aero Peek task bar features)"), 1, LOI_TYPE_SETTING, (UINT_PTR)"autoswitchtabs", 1 }, - { 0, LPGENW("Close button only hides message windows"), 0, LOI_TYPE_SETTING, (UINT_PTR)"hideonclose", 2 }, - { 0, LPGENW("Allow Tab key in typing area (this will disable focus selection by Tab key)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"tabmode", 2 }, - { 0, LPGENW("Add offline contacts to multisend list"), 0, LOI_TYPE_SETTING, (UINT_PTR) "AllowOfflineMultisend", 2 }, - { 0, nullptr, 0, 0, 0, 0 } -}; - -TOptionListItem* CTranslator::getTree(UINT id) -{ - switch (id) { - case TREE_MODPLUS: return m_lvItemsModPlus; - case TREE_NEN: return m_lvItemsNEN; - case TREE_MSG: return m_lvItemsMsg; - case TREE_LOG: return m_lvItemsLog; - case TREE_TAB: return m_lvItemsTab; - } - return nullptr; -} - -TOptionListGroup* CTranslator::getGroupTree(UINT id) -{ - switch (id) { - case TREE_MODPLUS: return m_lvGroupsModPlus; - case TREE_NEN: return m_lvGroupsNEN; - case TREE_MSG: return m_lvGroupsMsg; - case TREE_LOG: return m_lvGroupsLog; - case TREE_TAB: return m_lvGroupsTab; - } - return nullptr; -} diff --git a/plugins/TabSRMM/src/translator.h b/plugins/TabSRMM/src/translator.h deleted file mode 100644 index d82f55ecf7..0000000000 --- a/plugins/TabSRMM/src/translator.h +++ /dev/null @@ -1,55 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////// -// Miranda NG: the free IM client for Microsoft* Windows* -// -// Copyright (C) 2012-19 Miranda NG team, -// Copyright (c) 2000-09 Miranda ICQ/IM project, -// all portions of this codebase are copyrighted to the people -// listed in contributors.txt. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// you should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// part of tabSRMM messaging plugin for Miranda. -// -// (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors -// -// string handling - -#ifndef __STRINGS_H -#define __STRINGS_H - -class CTranslator { - -public: - - /* - * identities for the option trees - */ - - enum { - TREE_MODPLUS = 0, - TREE_NEN = 1, - TREE_MSG = 2, - TREE_LOG = 3, - TREE_TAB = 4, - }; - - CTranslator(); - ~CTranslator(); - - static TOptionListItem* getTree(UINT id); - static TOptionListGroup* getGroupTree(UINT id); -}; - -#endif -- cgit v1.2.3