summaryrefslogtreecommitdiff
path: root/MySpace/options.cpp
diff options
context:
space:
mode:
authorsje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-07-11 07:54:06 +0000
committersje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-07-11 07:54:06 +0000
commit801768c22a7643afad2f334b5fecead14645ab78 (patch)
treee8728a438a9ed4d8ff8d027a7c0e2492cf35329f /MySpace/options.cpp
parent01a664406e36abb810364237fda24e204265d7b4 (diff)
added myim: link support
added main menu item to add myspace friends to contact list git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@277 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'MySpace/options.cpp')
-rw-r--r--MySpace/options.cpp16
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;
}