From 408a0da710805ea5e762fe27a7e799fdf33b89b3 Mon Sep 17 00:00:00 2001 From: sje Date: Tue, 12 Jun 2007 02:18:11 +0000 Subject: added 'end session on window close' option git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@202 4f64403b-2f21-0410-a795-97e2b3489a10 --- otr/options.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'otr/options.cpp') diff --git a/otr/options.cpp b/otr/options.cpp index cee195e..4334362 100644 --- a/otr/options.cpp +++ b/otr/options.cpp @@ -112,6 +112,9 @@ void LoadOptions() { options.delete_history = (DBGetContactSettingByte(0, MODULE, "DeleteHistory", 1) == 1); options.timeout_finished = (DBGetContactSettingByte(0, MODULE, "TimeoutFinished", 0) == 1); + options.end_offline = (DBGetContactSettingByte(0, MODULE, "EndOffline", 1) == 1); + options.end_window_close = (DBGetContactSettingByte(0, MODULE, "EndWindowClose", 0) == 1); + LoadFilenames(); } @@ -129,6 +132,9 @@ void SaveOptions(ContactPolicyMap *contact_policies) { DBWriteContactSettingByte(0, MODULE, "DeleteHistory", options.delete_history ? 1 : 0); DBWriteContactSettingByte(0, MODULE, "TimeoutFinished", options.timeout_finished ? 1 : 0); + + DBWriteContactSettingByte(0, MODULE, "EndOffline", options.end_offline ? 1 : 0); + DBWriteContactSettingByte(0, MODULE, "EndWindowClose", options.end_window_close ? 1 : 0); } ContactFingerprintMap strlist; // temp storage for fingerprint string pointers @@ -234,7 +240,10 @@ INT_PTR CALLBACK DlgProcOpts1(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar CheckDlgButton(hwndDlg, IDC_CHK_PREFIX, options.prefix_messages ? TRUE : FALSE); CheckDlgButton(hwndDlg, IDC_CHK_MSGINLINE, options.msg_inline ? TRUE : FALSE); CheckDlgButton(hwndDlg, IDC_CHK_TIMEFINISH, options.timeout_finished ? TRUE : FALSE); - + + CheckDlgButton(hwndDlg, IDC_CHK_ENDOFFLINE, options.end_offline ? TRUE : FALSE); + CheckDlgButton(hwndDlg, IDC_CHK_ENDCLOSE, options.end_window_close ? TRUE : FALSE); + SetDlgItemText(hwndDlg, IDC_ED_PREFIX, options.prefix); return TRUE; @@ -355,6 +364,8 @@ INT_PTR CALLBACK DlgProcOpts1(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar case IDC_CHK_PREFIX: case IDC_CHK_TIMEFINISH: case IDC_CHK_MSGINLINE: + case IDC_CHK_ENDOFFLINE: + case IDC_CHK_ENDCLOSE: SendMessage( GetParent( hwndDlg ), PSM_CHANGED, 0, 0 ); return TRUE; } @@ -482,6 +493,10 @@ INT_PTR CALLBACK DlgProcOpts1(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar options.prefix_messages = IsDlgButtonChecked(hwndDlg, IDC_CHK_PREFIX) ? true : false; options.msg_inline = IsDlgButtonChecked(hwndDlg, IDC_CHK_MSGINLINE) ? true : false; options.timeout_finished = IsDlgButtonChecked(hwndDlg, IDC_CHK_TIMEFINISH) ? true : false; + + options.end_offline = IsDlgButtonChecked(hwndDlg, IDC_CHK_ENDOFFLINE) ? true : false; + options.end_window_close = IsDlgButtonChecked(hwndDlg, IDC_CHK_ENDCLOSE) ? true : false; + GetDlgItemText(hwndDlg, IDC_ED_PREFIX, options.prefix, 64); ContactPolicyMap *contact_policies = (ContactPolicyMap *)GetWindowLong(hwndDlg, GWL_USERDATA); -- cgit v1.2.3