From f8e1220c22695d224c3ff8a600de99da342d4f1b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 23 Dec 2012 21:26:45 +0000 Subject: fix for the password saving in jabber.rc fixes: #71 git-svn-id: http://svn.miranda-ng.org/main/trunk@2822 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/res/jabber.rc | 18 +++++++++++------- protocols/JabberG/src/jabber_thread.cpp | 11 +++++++++++ protocols/JabberG/src/resource.h | 5 +++-- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/protocols/JabberG/res/jabber.rc b/protocols/JabberG/res/jabber.rc index 70b2846518..7808407ab0 100644 --- a/protocols/JabberG/res/jabber.rc +++ b/protocols/JabberG/res/jabber.rc @@ -226,16 +226,17 @@ BEGIN DEFPUSHBUTTON "Complete",IDC_COMPLETE,150,203,46,14,NOT WS_VISIBLE | WS_DISABLED END -IDD_PASSWORD DIALOGEX 0, 0, 286, 63 +IDD_PASSWORD DIALOGEX 0, 0, 288, 86 STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION CAPTION "Jabber Password" FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN EDITTEXT IDC_JID,7,7,272,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP EDITTEXT IDC_PASSWORD,7,22,272,12,ES_PASSWORD | ES_AUTOHSCROLL - CONTROL "Save password for this session",IDC_SAVEPASSWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,42,157,14 - DEFPUSHBUTTON "OK",IDOK,175,42,50,14 - PUSHBUTTON "Cancel",IDCANCEL,229,42,50,14 + CONTROL "Remember password for this session",IDC_SAVEPASSWORD, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,42,272,14 + CONTROL "Save password permanently",IDC_SAVE_PERM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,56,272,12 + DEFPUSHBUTTON "OK",IDOK,175,70,50,14 + PUSHBUTTON "Cancel",IDCANCEL,229,70,50,14 END IDD_DATAFORM_TEST DIALOGEX 0, 0, 153, 148 @@ -848,8 +849,10 @@ BEGIN IDD_PASSWORD, DIALOG BEGIN + RIGHTMARGIN, 286 VERTGUIDE, 7 VERTGUIDE, 279 + BOTTOMMARGIN, 63 HORZGUIDE, 42 HORZGUIDE, 56 END @@ -937,19 +940,19 @@ IDI_SEND_NOTE ICON "send_note.ico" // TEXTINCLUDE // -1 TEXTINCLUDE +1 TEXTINCLUDE BEGIN "..\\src\\resource.h\0" END -2 TEXTINCLUDE +2 TEXTINCLUDE BEGIN "#include ""winres.h""\r\n" "#include ""richedit.h""\r\n" "\0" END -3 TEXTINCLUDE +3 TEXTINCLUDE BEGIN "\r\n" "\0" @@ -971,3 +974,4 @@ END ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED + diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 213de6f0a6..e948ba1572 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -86,11 +86,22 @@ static INT_PTR CALLBACK JabberPasswordDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa case WM_COMMAND: switch (LOWORD(wParam)) { + case IDC_SAVE_PERM: + EnableWindow(GetDlgItem(hwndDlg,IDC_SAVEPASSWORD),!IsDlgButtonChecked(hwndDlg, IDC_SAVE_PERM)); + break; case IDOK: param->saveOnlinePassword = IsDlgButtonChecked(hwndDlg, IDC_SAVEPASSWORD); param->pro->JSetByte(NULL, "SaveSessionPassword", param->saveOnlinePassword); GetDlgItemText(hwndDlg, IDC_PASSWORD, param->onlinePassword, SIZEOF(param->onlinePassword)); + { + BOOL savePassword = IsDlgButtonChecked(hwndDlg, IDC_SAVE_PERM); + param->pro->JSetByte(NULL, "SavePassword", savePassword); + if (savePassword) { + param->pro->JSetStringCrypt(NULL,"LoginPassword",param->onlinePassword); + param->saveOnlinePassword = TRUE; + } + } // Fall through case IDCANCEL: param->dlgResult = LOWORD(wParam); diff --git a/protocols/JabberG/src/resource.h b/protocols/JabberG/src/resource.h index 5cbc583aa5..fa3b6a0408 100644 --- a/protocols/JabberG/src/resource.h +++ b/protocols/JabberG/src/resource.h @@ -1,6 +1,6 @@ //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. -// Used by jabber.rc +// Used by C:\Users\xx\Documents\Visual Studio 2010\Projects\miranda-ng\protocols\JabberG\res\jabber.rc // #define IDD_OPT_JABBER 101 #define IDI_JABBER 102 @@ -319,6 +319,7 @@ #define IDC_HEADERBAR 1320 #define IDC_USEDOMAINLOGIN 1323 #define IDC_TXT_ALTNICK 1323 +#define IDC_SAVE_PERM 1324 #define IDI_BOOKMARKS 3000 #define IDD_BOOKMARKS 3001 #define IDC_BM_LIST 3002 @@ -352,7 +353,7 @@ #define _APS_NO_MFC 1 #define _APS_NEXT_RESOURCE_VALUE 235 #define _APS_NEXT_COMMAND_VALUE 40017 -#define _APS_NEXT_CONTROL_VALUE 1324 +#define _APS_NEXT_CONTROL_VALUE 1325 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif -- cgit v1.2.3