From 4b94525fe5eeac649bbe9cc4dcc3cbf7c84d226c Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Fri, 11 Mar 2016 19:16:04 +0000 Subject: stduserinfo: add display for MaritalStatus (BYTE) git-svn-id: http://svn.miranda-ng.org/main/trunk@16465 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/stduserinfo/src/stdinfo.cpp | 42 +++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/src/core/stduserinfo/src/stdinfo.cpp b/src/core/stduserinfo/src/stdinfo.cpp index 699c6a1b06..049d1eb49f 100644 --- a/src/core/stduserinfo/src/stdinfo.cpp +++ b/src/core/stduserinfo/src/stdinfo.cpp @@ -34,6 +34,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP #define SVS_MONTH 5 #define SVS_SIGNED 6 #define SVS_TIMEZONE 7 +#define SVS_MARTITAL 8 static int Proto_GetContactInfoSetting(MCONTACT hContact, const char *szProto, const char *szModule, const char *szSetting, DBVARIANT *dbv, const int nType) { @@ -96,6 +97,45 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule mir_snprintf(str, dbv.cVal ? "UTC%+d:%02d" : "UTC", -dbv.cVal / 2, (dbv.cVal & 1) * 30); } } + else if (special == SVS_MARTITAL) { + switch (dbv.cVal) { + case 0: + ptstr = TranslateT(""); + break; + case 10: + ptstr = TranslateT("single"); + break; + case 11: + ptstr = TranslateT("close relationships"); + break; + case 12: + ptstr = TranslateT("engaged"); + break; + case 20: + ptstr = TranslateT("married"); + break; + case 30: + ptstr = TranslateT("divorced"); + break; + case 31: + ptstr = TranslateT("separated"); + break; + case 40: + ptstr = TranslateT("Widowed"); + break; + case 50: + ptstr = TranslateT("actively searching"); + break; + case 60: + ptstr = TranslateT("in love"); + break; + case 70: + ptstr = TranslateT("it\'s complicated"); + break; + default: + unspecified = 1; + } + } else { unspecified = (special == SVS_ZEROISUNSPEC && dbv.bVal == 0); pstr = _itoa(special == SVS_SIGNED ? dbv.cVal : dbv.bVal, str, 10); @@ -199,7 +239,7 @@ static INT_PTR CALLBACK SummaryDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP SetValue(hwndDlg, IDC_DOBDAY, hContact, szProto, "BirthDay", 0); SetValue(hwndDlg, IDC_DOBMONTH, hContact, szProto, "BirthMonth", SVS_MONTH); SetValue(hwndDlg, IDC_DOBYEAR, hContact, szProto, "BirthYear", 0); - SetValue(hwndDlg, IDC_MARITAL, hContact, szProto, "MaritalStatus", 0); + SetValue(hwndDlg, IDC_MARITAL, hContact, szProto, "MaritalStatus", SVS_MARTITAL); } } break; -- cgit v1.2.3