From 80221d816eeb98f0df38e0243390033c614952f3 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Tue, 28 Nov 2017 22:12:43 +0300 Subject: Source files converted to utf-8 --- plugins/TrafficCounter/src/options.cpp | 40 +++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'plugins/TrafficCounter/src/options.cpp') diff --git a/plugins/TrafficCounter/src/options.cpp b/plugins/TrafficCounter/src/options.cpp index 605f04767a..16cfb39ab7 100644 --- a/plugins/TrafficCounter/src/options.cpp +++ b/plugins/TrafficCounter/src/options.cpp @@ -17,13 +17,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* ====================================================================================== - -: Mironych +Здесь содержатся переменные и функции для работы со статистикой +Автор: Mironych =======================================================================================*/ #include "stdafx.h" -OPTTREE_OPTION *pOptions; // opttree.c . +OPTTREE_OPTION *pOptions; // Через этот указатель модуль opttree.c может добраться до списка опций. ///////////////////////////////////////////////////////////////////////////////////////// @@ -135,8 +135,8 @@ static OPTTREE_OPTION options[] = {0, LPGENW("General") L"/" LPGENW("Draw frame as skin element"), OPTTREE_CHECK, 1, nullptr, "DrawFrmAsSkin"}, {0, LPGENW("General") L"/" LPGENW("Show tooltip in traffic window"), OPTTREE_CHECK, 1, nullptr, "ShowTooltip"}, {0, LPGENW("General") L"/" LPGENW("\"Toggle traffic counter\" in main menu"), OPTTREE_CHECK, 1, nullptr, "ShowMainMenuItem"}, - // - // 16 16 + // Резервируем место под активные и видимые протоколы + // Максимум 16 позиций видимых и 16 активных {0, nullptr, OPTTREE_CHECK, OPTTREE_INVISIBLE, nullptr, nullptr}, {0, nullptr, OPTTREE_CHECK, OPTTREE_INVISIBLE, nullptr, nullptr}, {0, nullptr, OPTTREE_CHECK, OPTTREE_INVISIBLE, nullptr, nullptr}, @@ -183,12 +183,12 @@ static INT_PTR CALLBACK DlgProcTCOptions(HWND hwndDlg, UINT msg, WPARAM wParam, if (!Initialized) { pOptions = options; optionCount = _countof(options); - // Variables, + // Если нет Variables, активируем галочки для старого метода рисования if (!bVariablesExists) for (i = 0; i < 8; i++) options[i].dwFlag = 1; - // . + // Флажки для видимости аккаунтов создаются в любом случае. for (i = j = 0; (j < NumberOfAccounts) && (i < optionCount) ; i++) if ((options[i].dwFlag & OPTTREE_INVISIBLE) && !options[i].szSettingName) { @@ -215,11 +215,11 @@ static INT_PTR CALLBACK DlgProcTCOptions(HWND hwndDlg, UINT msg, WPARAM wParam, //show/hide button SetDlgItemText(hwndDlg,IDC_BSHOWHIDE,(IsWindowVisible(TrafficHwnd) != 0)? TranslateT("Hide now") : TranslateT("Show now")); - // + // Строки формата для счётчиков EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_COUNTER_FORMAT), bVariablesExists); SetDlgItemText(hwndDlg, IDC_EDIT_COUNTER_FORMAT, Traffic_CounterFormat); - // + // Формат всплывающей подсказки EnableWindow(GetDlgItem(hwndDlg,IDC_EDIT_TOOLTIP_FORMAT), bTooltipExists); SetDlgItemText(hwndDlg, IDC_EDIT_TOOLTIP_FORMAT, Traffic_TooltipFormat); @@ -230,7 +230,7 @@ static INT_PTR CALLBACK DlgProcTCOptions(HWND hwndDlg, UINT msg, WPARAM wParam, SendDlgItemMessage(hwndDlg, IDC_COMBO_AUTO_CLEAR, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Year")); SendDlgItemMessage(hwndDlg, IDC_COMBO_AUTO_CLEAR, CB_SETCURSEL, unOptions.PeriodForShow, 0); - // + // Интервал между строками SetDlgItemInt(hwndDlg, IDC_EDIT_SPACE, Traffic_AdditionSpace, 0); SendDlgItemMessage(hwndDlg, IDC_EDIT_SPACE, EM_LIMITTEXT, 2, 0); @@ -246,7 +246,7 @@ static INT_PTR CALLBACK DlgProcTCOptions(HWND hwndDlg, UINT msg, WPARAM wParam, OptTree_SetOptions(hwndDlg, IDC_APPEARANCEOPTIONS, options, optionCount, unOptions.ShowTooltip, "ShowTooltip"); OptTree_SetOptions(hwndDlg, IDC_APPEARANCEOPTIONS, options, optionCount, unOptions.ShowMainMenuItem, "ShowMainMenuItem"); - // + // Настройки видимости протоколов for (i = 0; i < NumberOfAccounts; i++) { char buffer[32]; mir_strcpy(buffer, ProtoList[i].name); @@ -285,9 +285,9 @@ static INT_PTR CALLBACK DlgProcTCOptions(HWND hwndDlg, UINT msg, WPARAM wParam, case PSN_APPLY: unOptions.PeriodForShow = (char)SendDlgItemMessage(hwndDlg,IDC_COMBO_AUTO_CLEAR,CB_GETCURSEL,0,0); - // + // Интервал между строками Traffic_AdditionSpace = GetDlgItemInt(hwndDlg, IDC_EDIT_SPACE, nullptr, 0); - // Appearance + // Настройки Appearance unOptions.DrawProtoIcon = OptTree_GetOptions(hwndDlg, IDC_APPEARANCEOPTIONS, options, optionCount, "DrawProtoIcon"); unOptions.DrawProtoName = OptTree_GetOptions(hwndDlg, IDC_APPEARANCEOPTIONS, options, optionCount, "DrawProtoName"); unOptions.DrawCurrentTraffic = OptTree_GetOptions(hwndDlg, IDC_APPEARANCEOPTIONS, options, optionCount, "DrawCurrentTraffic"); @@ -300,7 +300,7 @@ static INT_PTR CALLBACK DlgProcTCOptions(HWND hwndDlg, UINT msg, WPARAM wParam, unOptions.ShowTooltip = OptTree_GetOptions(hwndDlg, IDC_APPEARANCEOPTIONS, options, optionCount, "ShowTooltip"); unOptions.ShowMainMenuItem = OptTree_GetOptions(hwndDlg, IDC_APPEARANCEOPTIONS, options, optionCount, "ShowMainMenuItem"); - // + // Настройки видимости протоколов for (i = 0; i < NumberOfAccounts; i++) { char buffer[32]; @@ -309,25 +309,25 @@ static INT_PTR CALLBACK DlgProcTCOptions(HWND hwndDlg, UINT msg, WPARAM wParam, } unOptions.ShowOverall = OptTree_GetOptions(hwndDlg, IDC_APPEARANCEOPTIONS, options, optionCount, "ShowOverall"); - // + // Формат счётчиков GetDlgItemText(hwndDlg, IDC_EDIT_COUNTER_FORMAT, Traffic_CounterFormat, _countof(Traffic_CounterFormat)); - // + // Формат всплывающей подсказки GetDlgItemText(hwndDlg, IDC_EDIT_TOOLTIP_FORMAT, Traffic_TooltipFormat, _countof(Traffic_TooltipFormat)); - // + // Ключевой цвет UseKeyColor = db_get_b(NULL, "ModernSettings", "UseKeyColor", 1); KeyColor = db_get_dw(NULL, "ModernSettings", "KeyColor", 0); - // + // Перерисовываем фрейм UpdateTrafficWindowSize(); - // , . + // Если отключается показ пункта главного меню, то удаляем его. if (!unOptions.ShowMainMenuItem && hTrafficMainMenuItem) { Menu_RemoveItem(hTrafficMainMenuItem); hTrafficMainMenuItem = nullptr; } - // , . + // Если включается, то создаём. if (unOptions.ShowMainMenuItem && !hTrafficMainMenuItem) Traffic_AddMainMenuItem(); -- cgit v1.2.3