From 12559ebb28d49c90b4b603dd78a4f1599b50a6fb Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 16 Mar 2023 15:25:56 +0300 Subject: =?UTF-8?q?fixes=20#3430=20(Sessions:=20=D1=87=D0=B5=D0=BA=D0=B1?= =?UTF-8?q?=D0=BE=D0=BA=D1=81=D1=8B=20=D0=B2=20=D0=B2=D1=8B=D0=B1=D0=BE?= =?UTF-8?q?=D1=80=D0=B5=20=D0=BA=D0=BE=D0=BD=D1=82=D0=B0=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D0=B2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/Sessions/Src/Options.cpp | 9 +++++---- plugins/Sessions/Src/SaveSessions.cpp | 14 +++++++++----- plugins/Sessions/Src/stdafx.h | 1 + plugins/Sessions/res/Sessions.rc | 4 ++-- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/plugins/Sessions/Src/Options.cpp b/plugins/Sessions/Src/Options.cpp index a9ef600ca8..2b0a65b4f0 100644 --- a/plugins/Sessions/Src/Options.cpp +++ b/plugins/Sessions/Src/Options.cpp @@ -372,24 +372,25 @@ public: void onClick_Save(CCtrlButton *) { + pSession->contacts.clear(); + for (auto &hContact : Contacts()) { uint8_t res = m_clist.GetCheck(m_clist.FindContact(hContact)); - if (res) { - // !!!!!!!!!!!!!!!!!!! - } + if (res) + pSession->contacts.push_back(hContact); } if (bSesssionNameChanged) { if (GetWindowTextLength(hComboBoxEdit)) { wchar_t szUserSessionName[MAX_PATH] = { '\0' }; GetWindowText(hComboBoxEdit, szUserSessionName, _countof(szUserSessionName)); pSession->wszName = szUserSessionName; - pSession->save(); m_list.ResetContent(); LoadSessionToCombobox(m_list, true); } bSesssionNameChanged = FALSE; } + pSession->save(); btnSave.Disable(); } diff --git a/plugins/Sessions/Src/SaveSessions.cpp b/plugins/Sessions/Src/SaveSessions.cpp index 3356c44df5..4e5464d13f 100644 --- a/plugins/Sessions/Src/SaveSessions.cpp +++ b/plugins/Sessions/Src/SaveSessions.cpp @@ -64,7 +64,8 @@ class CSessionDlg : public CDlgBase { CCtrlClc m_clist; CCtrlCombo m_sessions; - CCtrlCheck chkSelContacts, chkSaveAndClose; + CCtrlCheck chkSaveAndClose; + CCtrlMButton chkSelContacts; MCONTACT user_session_list[255]; @@ -73,18 +74,21 @@ public: CDlgBase(g_plugin, IDD_SAVEDIALOG), m_clist(this, IDC_CLIST), m_sessions(this, IDC_LIST), - chkSelContacts(this, IDC_SELCONTACTS), + chkSelContacts(this, IDC_SELCONTACTS, SKINICON_AUTH_ADD, LPGEN("More contacts")), chkSaveAndClose(this, IDC_SANDCCHECK) { memset(user_session_list, 0, sizeof(user_session_list)); - chkSelContacts.OnChange = Callback(this, &CSessionDlg::onChange_SelContacts); + chkSelContacts.OnClick = Callback(this, &CSessionDlg::onChange_SelContacts); m_clist.OnCheckChanged = Callback(this, &CSessionDlg::onCheckChanged_Clist); } bool OnInitDialog() override { + chkSelContacts.MakeFlat(); + chkSelContacts.MakePush(); + g_hSDlg = m_hwnd; LoadSessionToCombobox(m_sessions, true); @@ -107,7 +111,7 @@ public: return false; } - if (chkSelContacts.IsChecked() && bSC) { + if (chkSelContacts.IsPushed() && bSC) { int i = 0; for (auto &hContact : Contacts()) { uint8_t res = m_clist.GetCheck(m_clist.FindContact(hContact)); @@ -153,7 +157,7 @@ public: int x = rWnd.right - rWnd.left, y = rWnd.bottom - rWnd.top, dy, dx, dd; - if (chkSelContacts.IsChecked()) { + if (chkSelContacts.IsPushed()) { chkSaveAndClose.Disable(); dy = 20; dx = 150; diff --git a/plugins/Sessions/Src/stdafx.h b/plugins/Sessions/Src/stdafx.h index d229bc3cca..374db4384d 100644 --- a/plugins/Sessions/Src/stdafx.h +++ b/plugins/Sessions/Src/stdafx.h @@ -38,6 +38,7 @@ along with this program. If not, see . #include #include #include +#include #include #include diff --git a/plugins/Sessions/res/Sessions.rc b/plugins/Sessions/res/Sessions.rc index 707e4b7c52..e02f694be7 100644 --- a/plugins/Sessions/res/Sessions.rc +++ b/plugins/Sessions/res/Sessions.rc @@ -17,7 +17,7 @@ #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -#pragma code_page(1251) +#pragma code_page(65001) #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// @@ -111,7 +111,7 @@ BEGIN COMBOBOX IDC_LIST,12,30,148,65,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP CONTROL "",IDC_CLIST,"CListControl",NOT WS_VISIBLE | WS_TABSTOP | WS_CHILD,12,30,148,65 CONTROL "Save and Close",IDC_SANDCCHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,46,137,10 - CONTROL "adv.",IDC_SELCONTACTS,"Button",BS_AUTOCHECKBOX | BS_PUSHLIKE | BS_FLAT | WS_TABSTOP,136,4,24,10 + CONTROL "",IDC_SELCONTACTS,"MButtonClass",WS_TABSTOP,136,4,16,16 END IDD_EXDIALOG DIALOGEX 0, 0, 170, 70 -- cgit v1.2.3