diff options
author | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-07-02 07:35:38 +0000 |
---|---|---|
committer | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-07-02 07:35:38 +0000 |
commit | 5b3e765af9b3f8c52cd84f60f6778bfd7fe8d5f9 (patch) | |
tree | a2e94c8eb384d88da6a870ed6b87ce5a0d83bdff | |
parent | 597c790ab3955f04c039aca5a634428fe5ab01b4 (diff) |
added 'create new account' link to options
added 'show profile' contact menu item
main menu item goes to your myspace page
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@243 4f64403b-2f21-0410-a795-97e2b3489a10
-rw-r--r-- | MySpace/MySpace.rc | 3 | ||||
-rw-r--r-- | MySpace/menu.cpp | 26 | ||||
-rw-r--r-- | MySpace/options.cpp | 15 | ||||
-rw-r--r-- | MySpace/resource.h | 4 | ||||
-rw-r--r-- | MySpace/version.h | 2 |
5 files changed, 35 insertions, 15 deletions
diff --git a/MySpace/MySpace.rc b/MySpace/MySpace.rc index 311a321..de4d472 100644 --- a/MySpace/MySpace.rc +++ b/MySpace/MySpace.rc @@ -31,11 +31,12 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 400, 0, 0x0
BEGIN
- GROUPBOX "MySpace",IDC_STATIC,26,17,201,89
+ GROUPBOX "MySpace",IDC_STATIC,26,17,201,119
RTEXT "E-mail:",IDC_STATIC,40,39,54,8
EDITTEXT IDC_ED_EMAIL,113,36,89,14,ES_AUTOHSCROLL
RTEXT "Password:",IDC_STATIC,35,72,59,8
EDITTEXT IDC_ED_PW,113,68,89,14,ES_PASSWORD | ES_AUTOHSCROLL
+ CONTROL "Sign up for a new account",IDC_LNK_NEWACCOUNT,"Hyperlink",WS_TABSTOP | 0x1,36,102,174,15
END
diff --git a/MySpace/menu.cpp b/MySpace/menu.cpp index d3db193..196c3e5 100644 --- a/MySpace/menu.cpp +++ b/MySpace/menu.cpp @@ -1,6 +1,7 @@ #include "common.h"
#include "menu.h"
#include "resource.h"
+#include "server_con.h"
HANDLE hMenuMain = 0, hServiceMenuMain = 0;
@@ -13,6 +14,8 @@ int MainMenuService(WPARAM wParam, LPARAM lParam) { //menu.flags = CMIM_NAME | CMIF_TCHAR;
//menu.ptszName = (char *)TranslateT("Changed menu text");
//CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuMain, (LPARAM)&menu);
+
+ CallService(MS_UTILS_OPENURL, (WPARAM)TRUE, (LPARAM)"http://home.myspace.com/index.cfm?fuseaction=user");
return 0;
}
@@ -21,9 +24,12 @@ HANDLE hMenuContact = 0, hServiceMenuContact = 0, hEventMenuBuild = 0; int ContactMenuService(WPARAM wParam, LPARAM lParam) {
HANDLE hContact = (HANDLE)wParam;
- // TODO: add code here that executes when the menu item is chosen
-
- // e.g. you could modify the menu item here - see below
+ int uid;
+ if((uid = DBGetContactSettingDword(hContact, MODULE, "UID", 0)) != 0) {
+ char buff[512];
+ mir_snprintf(buff, 512, "http://www.myspace.com/%d", uid);
+ CallService(MS_UTILS_OPENURL, (WPARAM)TRUE, (LPARAM)buff);
+ }
return 0;
}
@@ -52,19 +58,25 @@ void InitMenu() { menu.hIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MYSPACE), IMAGE_ICON, 0, 0, 0);
hServiceMenuMain = CreateProtoServiceFunction(MODULE, "/MainMenu", MainMenuService);
- menu.ptszName = TranslateTS(MODULE);
+ TCHAR tbuff[512];
+#ifdef _UNICODE
+ MultiByteToWideChar(code_page, 0, MODULE, -1, tbuff, 512);
+#else
+ strncpy(tbuff, MODULE, 512);
+#endif
+ menu.ptszName = TranslateTS(tbuff);
mir_snprintf(buff, 512, "%s%s", MODULE, "/MainMenu");
menu.pszService = buff;
- menu.position = 0;
+ menu.position = 2000060000;
hMenuMain = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&menu);
// contact menu item
hServiceMenuContact = CreateProtoServiceFunction(MODULE, "/ContactMenu", ContactMenuService);
- menu.ptszName = TranslateTS(MODULE);
+ menu.ptszName = TranslateT("Show profile");
mir_snprintf(buff, 512, "%s%s", MODULE, "/ContactMenu");
menu.pszService = buff;
menu.position = 0;
- menu.flags = CMIF_NOTOFFLINE; // only show for not-offline contacts
+ //menu.flags |= CMIF_NOTOFFLINE; // only show for not-offline contacts
hMenuContact = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&menu);
hEventMenuBuild = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PrebuildContactMenu);
diff --git a/MySpace/options.cpp b/MySpace/options.cpp index 5d3077c..88c49a3 100644 --- a/MySpace/options.cpp +++ b/MySpace/options.cpp @@ -4,6 +4,8 @@ Options options = {0};
+#define URL_NEW_ACCOUNT "http://signup.myspace.com/index.cfm?fuseaction=join"
+
void LoadOptions() {
DBVARIANT dbv;
if(!DBGetContactSettingTString(0, MODULE, "email", &dbv)) {
@@ -77,13 +79,16 @@ BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) SetDlgItemText(hwndDlg, IDC_ED_PW, options.pw);
return FALSE;
case WM_COMMAND:
- if ( HIWORD( wParam ) == EN_CHANGE && ( HWND )lParam == GetFocus()) {
- switch( LOWORD( wParam )) {
+ switch( LOWORD( wParam )) {
case IDC_ED_EMAIL:
case IDC_ED_PW:
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- break;
+ if ( HIWORD( wParam ) == EN_CHANGE && ( HWND )lParam == GetFocus()) {
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+ break;
+ case IDC_LNK_NEWACCOUNT:
+ CallService(MS_UTILS_OPENURL, (WPARAM)TRUE, (LPARAM)URL_NEW_ACCOUNT);
+ break;
}
break;
case WM_NOTIFY:
diff --git a/MySpace/resource.h b/MySpace/resource.h index 3b8097c..46972ab 100644 --- a/MySpace/resource.h +++ b/MySpace/resource.h @@ -10,6 +10,8 @@ #define IDC_ED_NICK 1002
#define IDC_BTN_CHECK 1003
#define IDC_ST_MSG 1004
+#define IDC_CUSTOM1 1005
+#define IDC_LNK_NEWACCOUNT 1005
// Next default values for new objects
//
@@ -17,7 +19,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 123
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1005
+#define _APS_NEXT_CONTROL_VALUE 1006
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
diff --git a/MySpace/version.h b/MySpace/version.h index 5b79c86..161a352 100644 --- a/MySpace/version.h +++ b/MySpace/version.h @@ -5,7 +5,7 @@ #define __MAJOR_VERSION 0
#define __MINOR_VERSION 0
#define __RELEASE_NUM 1
-#define __BUILD_NUM 12
+#define __BUILD_NUM 13
#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
#define __FILEVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM
|