diff options
Diffstat (limited to 'MySpace/options.cpp')
-rw-r--r-- | MySpace/options.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/MySpace/options.cpp b/MySpace/options.cpp index 4192039..a12e38e 100644 --- a/MySpace/options.cpp +++ b/MySpace/options.cpp @@ -1,6 +1,8 @@ #include "common.h"
#include "options.h"
#include "resource.h"
+#include "links.h"
+#include "menu.h"
Options options = {0};
@@ -46,6 +48,7 @@ void LoadOptions() { strncpy(options.im_name, dbv.pszVal, 256);
DBFreeVariant(&dbv);
}
+ options.handle_links = (DBGetContactSettingByte(0, MODULE, "EnableLinkHandling", 0) != 0);
}
void SaveOptions() {
@@ -67,6 +70,7 @@ void SaveOptions() { DBWriteContactSettingByte(0, MODULE, "offline_message_mode", (BYTE)options.offline_message_mode);
DBWriteContactSettingByte(0, MODULE, "show_avatar", options.show_avatar ? 1 : 0);
DBWriteContactSettingStringUtf(0, MODULE, "Nick", options.im_name);
+ DBWriteContactSettingByte(0, MODULE, "EnableLinkHandling", options.handle_links ? 1 : 0);
}
BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
@@ -77,6 +81,7 @@ BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) TranslateDialogDefault( hwndDlg );
SetDlgItemText(hwndDlg, IDC_ED_EMAIL, options.email);
SetDlgItemText(hwndDlg, IDC_ED_PW, options.pw);
+ CheckDlgButton(hwndDlg, IDC_CHK_LINKS, options.handle_links ? TRUE : FALSE);
return FALSE;
case WM_COMMAND:
switch( LOWORD( wParam )) {
@@ -88,6 +93,8 @@ BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) break;
case IDC_LNK_NEWACCOUNT:
CallService(MS_UTILS_OPENURL, (WPARAM)TRUE, (LPARAM)URL_NEW_ACCOUNT);
+ case IDC_CHK_LINKS:
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
}
break;
@@ -99,8 +106,17 @@ BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) case PSN_APPLY:
GetDlgItemText(hwndDlg, IDC_ED_EMAIL, options.email, 256);
GetDlgItemText(hwndDlg, IDC_ED_PW, options.pw, 256);
+ options.handle_links = IsDlgButtonChecked(hwndDlg, IDC_CHK_LINKS) ? true : false;
SaveOptions();
+
+ if(options.handle_links) {
+ myspace_links_init();
+ } else {
+ myspace_links_destroy();
+ myspace_links_unregister();
+ }
+ EnableMainAdd(options.handle_links);
}
break;
}
|