summaryrefslogtreecommitdiff
path: root/nohtml/options.cpp
diff options
context:
space:
mode:
authorsje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-04-26 04:50:52 +0000
committersje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-04-26 04:50:52 +0000
commited78d0bc52bbef490b66700e9c8563a68338ad36 (patch)
treeeb78d1e93a3619fce810c3e2af7de00fd456a512 /nohtml/options.cpp
parentb668c691db2fb618029ae031a4be72d15155fdb1 (diff)
fixed detection of unicode messages in filter recv
added 'unicode aware' flag added lotsa options git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@153 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'nohtml/options.cpp')
-rw-r--r--nohtml/options.cpp42
1 files changed, 38 insertions, 4 deletions
diff --git a/nohtml/options.cpp b/nohtml/options.cpp
index c27afb3..bda3de4 100644
--- a/nohtml/options.cpp
+++ b/nohtml/options.cpp
@@ -5,13 +5,21 @@
Options options;
void LoadOptions() {
- options.bbcodes = (DBGetContactSettingDword(0, MODULE, "BBCodes", 0) != 0);
- options.html = (DBGetContactSettingDword(0, MODULE, "HTML", 0) != 0);
+ options.filter_in = (DBGetContactSettingByte(0, MODULE, "FilterIn", 1) != 0);
+ options.filter_out = (DBGetContactSettingByte(0, MODULE, "FilterOut", 0) != 0);
+ options.bbcodes = (DBGetContactSettingByte(0, MODULE, "BBCodes", 0) != 0);
+ options.html = (DBGetContactSettingByte(0, MODULE, "HTML", 0) != 0);
+
+ options.apply_to = DBGetContactSettingDword(0, MODULE, "ApplyTo", ATF_ALL);
}
void SaveOptions() {
- DBWriteContactSettingDword(0, MODULE, "BBCodes", options.bbcodes ? 1 : 0);
- DBWriteContactSettingDword(0, MODULE, "HTML", options.html ? 1 : 0);
+ DBWriteContactSettingByte(0, MODULE, "FilterIn", options.filter_in ? 1 : 0);
+ DBWriteContactSettingByte(0, MODULE, "FilterOut", options.filter_out ? 1 : 0);
+ DBWriteContactSettingByte(0, MODULE, "BBCodes", options.bbcodes ? 1 : 0);
+ DBWriteContactSettingByte(0, MODULE, "HTML", options.html ? 1 : 0);
+
+ DBWriteContactSettingDword(0, MODULE, "ApplyTo", options.apply_to);
}
BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
@@ -20,11 +28,31 @@ BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
switch ( msg ) {
case WM_INITDIALOG:
TranslateDialogDefault( hwndDlg );
+ CheckDlgButton(hwndDlg, IDC_CHK_FILTERIN, options.filter_in);
+ CheckDlgButton(hwndDlg, IDC_CHK_FILTEROUT, options.filter_out);
CheckDlgButton(hwndDlg, IDC_CHK_BBCODES, options.bbcodes);
CheckDlgButton(hwndDlg, IDC_CHK_HTML, options.html);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_BBCODES), IsDlgButtonChecked(hwndDlg, IDC_CHK_FILTERIN));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_HTML), IsDlgButtonChecked(hwndDlg, IDC_CHK_FILTEROUT));
+
+ CheckDlgButton(hwndDlg, IDC_CHK_ALL, options.apply_to & ATF_ALL);
+ CheckDlgButton(hwndDlg, IDC_CHK_OTR, options.apply_to & ATF_OTR);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_OTR), !IsDlgButtonChecked(hwndDlg, IDC_CHK_ALL));
+
return FALSE;
case WM_COMMAND:
if(HIWORD(wParam) == BN_CLICKED) {
+ switch(LOWORD(wParam)) {
+ case IDC_CHK_FILTERIN:
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_BBCODES), IsDlgButtonChecked(hwndDlg, IDC_CHK_FILTERIN));
+ break;
+ case IDC_CHK_FILTEROUT:
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_HTML), IsDlgButtonChecked(hwndDlg, IDC_CHK_FILTEROUT));
+ break;
+ case IDC_CHK_ALL:
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_OTR), !IsDlgButtonChecked(hwndDlg, IDC_CHK_ALL));
+ break;
+ }
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
break;
@@ -34,8 +62,14 @@ BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
switch (((LPNMHDR)lParam)->code)
{
case PSN_APPLY:
+ options.filter_in = IsDlgButtonChecked(hwndDlg, IDC_CHK_FILTERIN);
+ options.filter_out = IsDlgButtonChecked(hwndDlg, IDC_CHK_FILTEROUT);
options.bbcodes = IsDlgButtonChecked(hwndDlg, IDC_CHK_BBCODES);
options.html = IsDlgButtonChecked(hwndDlg, IDC_CHK_HTML);
+
+ options.apply_to = (IsDlgButtonChecked(hwndDlg, IDC_CHK_ALL) ? ATF_ALL : 0);
+ options.apply_to |= (IsDlgButtonChecked(hwndDlg, IDC_CHK_OTR) ? ATF_OTR : 0);
+
SaveOptions();
break;
}