soc.2009.vulture: 7c3d75d9: Simple status-changing using combo-box.

gdick at soc.pidgin.im gdick at soc.pidgin.im
Mon Jun 8 17:25:31 EDT 2009


-----------------------------------------------------------------
Revision: 7c3d75d94d9caa58805685c6b4d330a1a490c918
Ancestor: 1408616f14b57b6d06a93883c9e373852aa82949
Author: gdick at soc.pidgin.im
Date: 2009-06-08T10:33:55
Branch: im.pidgin.soc.2009.vulture
URL: http://d.pidgin.im/viewmtn/revision/info/7c3d75d94d9caa58805685c6b4d330a1a490c918

Modified files:
        vulture/blist.c vulture/purplequeue.c vulture/purplequeue.h

ChangeLog: 

Simple status-changing using combo-box.

-------------- next part --------------
============================================================
--- vulture/blist.c	bc8666bf7d1a94221dc617e40aea18b09f35bf53
+++ vulture/blist.c	d27ac2b10ff5537468bcb9bb8c53f9852b534213
@@ -261,6 +261,37 @@ static INT_PTR CALLBACK StatusDlgProc(HW
 
 		return TRUE;
 
+
+	case WM_COMMAND:
+
+		switch(LOWORD(wParam))
+		{
+		case IDC_CBEX_STATUS:
+			if(HIWORD(wParam) == CBN_SELCHANGE)
+			{
+				/* Inform libpurple of the change in status,
+				 * and update message edit box.
+				 */
+
+				int iSel = SendDlgItemMessage(hwndDlg, IDC_CBEX_STATUS, CB_GETCURSEL, 0, 0);
+
+				if(iSel >= 0)
+				{
+					VULTURE_SAVED_STATUS *lpvss = (VULTURE_SAVED_STATUS*)SendDlgItemMessage(hwndDlg, IDC_CBEX_STATUS, CB_GETITEMDATA, iSel, 0);
+					VultureSingleSyncPurpleCall(PC_SETSAVEDSTATUS, lpvss);
+
+					SetDlgItemText(hwndDlg, IDC_EDIT_STATUSMSG, lpvss->szMessage);
+				}
+
+				return TRUE;
+			}
+
+			break;
+		}
+
+		break;
+
+
 	case WM_DESTROY:
 		if(s_lpglistStatuses)
 				VulturePurpleFreeStatusList(s_lpglistStatuses);
============================================================
--- vulture/purplequeue.c	e0e2ce7e2f0d0a3ea64061238de56981b98ec323
+++ vulture/purplequeue.c	da54d82063dd5ae8994f9140e9785a7fca4e20d4
@@ -182,6 +182,10 @@ static void DispatchPurpleCall(PURPLE_CA
 		PurpleApplyVultureAccount((VULTURE_ACCOUNT*)lppurplecall->lpvParam);
 		break;
 
+	case PC_SETSAVEDSTATUS:
+		purple_savedstatus_activate(((VULTURE_SAVED_STATUS*)lppurplecall->lpvParam)->lppss);
+		break;
+
 	case PC_QUIT:
 		g_main_loop_quit(g_lpgmainloop);
 		break;
============================================================
--- vulture/purplequeue.h	ab4d3e302bb7422d5a5941d38b1b89dd92551776
+++ vulture/purplequeue.h	2daf6b9a32a6b0d004f7c75b523508cb10f14b52
@@ -47,6 +47,9 @@ enum PURPLE_CALL_ID
 
 	/* (VULTURE_ACCOUNT*) Account to update. */
 	PC_UPDATEPURPLEACCOUNT,
+
+	/* (VULTURE_SAVED_STATUS*) Status to set. */
+	PC_SETSAVEDSTATUS,
 };
 
 


More information about the Commits mailing list