diff options
author | George Hazan <ghazan@miranda.im> | 2023-03-16 15:25:56 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-03-16 15:25:56 +0300 |
commit | 12559ebb28d49c90b4b603dd78a4f1599b50a6fb (patch) | |
tree | be3a32635ce149dad45b3e43e3510d45a7a3ee68 /plugins/Sessions | |
parent | 3355cfd8d583d286053fe8874453e64f8dff1811 (diff) |
fixes #3430 (Sessions: чекбоксы в выборе контактов)
Diffstat (limited to 'plugins/Sessions')
-rw-r--r-- | plugins/Sessions/Src/Options.cpp | 9 | ||||
-rw-r--r-- | plugins/Sessions/Src/SaveSessions.cpp | 14 | ||||
-rw-r--r-- | plugins/Sessions/Src/stdafx.h | 1 | ||||
-rw-r--r-- | 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 <http://www.gnu.org/licenses/>. #include <m_message.h>
#include <m_metacontacts.h>
#include <m_options.h>
+#include <m_skin.h>
#include <m_srmm_int.h>
#include <m_utils.h>
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
|