soc.2009.vulture: e14f1380: Beginnings of 'Join a Chat' dialogue.

gdick at soc.pidgin.im gdick at soc.pidgin.im
Fri Jul 3 16:05:27 EDT 2009


-----------------------------------------------------------------
Revision: e14f13801e6b8fe54885c2b86063a475dd0e53e1
Ancestor: 5188c50ed3bf88c1d2d51e872f86f4a6ced7e8f6
Author: gdick at soc.pidgin.im
Date: 2009-07-03T20:00:36
Branch: im.pidgin.soc.2009.vulture
URL: http://d.pidgin.im/viewmtn/revision/info/e14f13801e6b8fe54885c2b86063a475dd0e53e1

Added files:
        vulture/vulturedlg.c vulture/vulturedlg.h
Modified files:
        vulture/Makefile.mingw vulture/resource.h
        vulture/vulture-res.rc vulture/vultureblist.c

ChangeLog: 

Beginnings of 'Join a Chat' dialogue.

-------------- next part --------------
============================================================
--- vulture/vulturedlg.c	f2752c6e89c3bbe831e23d80e344cfc689943657
+++ vulture/vulturedlg.c	f2752c6e89c3bbe831e23d80e344cfc689943657
@@ -0,0 +1,85 @@
+/*
+ * Vulture - Win32 libpurple client
+ *
+ * vulturedlg.c: Sundry dialogues.
+ *
+ * Copyright (C) 2009, Gregor Dick <gdick at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
+
+#include <windows.h>
+#include <glib.h>
+
+#include "vulture.h"
+#include "vulturedlg.h"
+#include "resource.h"
+
+
+static INT_PTR CALLBACK JoinChatDlgProc(HWND hwndDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam);
+
+
+/**
+ * Displays the "Join a Chat" dialogue.
+ *
+ * @param	hwndParent	Parent window handle.
+ *
+ * @return Hash table containing details of chat to join, and which caller is
+ * responsible for freeing; or NULL if cancelled.
+ */
+GHashTable* VultureJoinChatDlg(HWND hwndParent)
+{
+	return (GHashTable*)DialogBox(g_hInstance, MAKEINTRESOURCE(IDD_JOINCHAT), hwndParent, JoinChatDlgProc);
+}
+
+
+/**
+ * Dialogue procedure for "Join a Chat" dialogue.
+ *
+ * @param	hwndDlg		Dialogue window handle.
+ * @param	uiMsg		Message ID.
+ * @param	wParam		Message-specific.
+ * @param	lParam		Message-specific.
+ *
+ * @return Usually TRUE if message processed and FALSE otherwise. There are
+ * some exceptions for particular messages.
+ */
+static INT_PTR CALLBACK JoinChatDlgProc(HWND hwndDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
+{
+	switch(uiMsg)
+	{
+	case WM_INITDIALOG:
+		/* Let the system set the focus. */
+		return TRUE;
+
+	case WM_COMMAND:
+		switch(LOWORD(wParam))
+		{
+		case IDOK:
+			/* TODO: return hash table. */
+			EndDialog(hwndDlg, (INT_PTR)NULL);
+			return TRUE;
+
+		case IDCANCEL:
+			EndDialog(hwndDlg, (INT_PTR)NULL);
+			return TRUE;
+		}
+
+		break;
+	}
+
+	return FALSE;
+}
============================================================
--- vulture/vulturedlg.h	b7a8a4b54369c0475abf8bbaa7f5da0558c3b9bc
+++ vulture/vulturedlg.h	b7a8a4b54369c0475abf8bbaa7f5da0558c3b9bc
@@ -0,0 +1,34 @@
+/*
+ * Vulture - Win32 libpurple client
+ *
+ * vulturedlg.h: Sundry dialogues.
+ *
+ * Copyright (C) 2009, Gregor Dick <gdick at soc.pidgin.im>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
+#ifndef _VULTURE_VULTUREDLG_H_
+#define _VULTURE_VULTUREDLG_H_
+
+
+#include <windows.h>
+#include <glib.h>
+
+
+GHashTable* VultureJoinChatDlg(HWND hwndParent);
+
+
+#endif
============================================================
--- vulture/Makefile.mingw	8720a9da3fa955e817384453773dbf35ff96571f
+++ vulture/Makefile.mingw	f092c2bb84eb2ef5200bb1bdd42d43369e86e8ee
@@ -66,7 +66,8 @@ VULTURE_C_SRC =	\
 			purpleacct.c \
 			purpleblist.c \
 			vultureconv.c \
-			purpleconv.c
+			purpleconv.c \
+			vulturedlg.c
 
 VULTURE_RC_SRC = vulture-res.rc
 VULTURE_OBJECTS = $(VULTURE_C_SRC:%.c=%.o) $(VULTURE_RC_SRC:%.rc=%.o)
============================================================
--- vulture/resource.h	a6055c0465d0535fe29a544087fcc5bd137fbf99
+++ vulture/resource.h	2fddd9a771474dcdc36212d68b1ba76dc1396054
@@ -11,6 +11,8 @@
 #define IDD_CONVCONT                            113
 #define IDD_IM                                  115
 #define IDD_CHAT                                117
+#define IDD_JOINCHAT                            119
+#define IDC_COMBO1                              1000
 #define IDC_LIST_NAMES                          1001
 #define IDC_TAB_CONVERSATIONS                   1001
 #define IDC_BUDDY_ICON                          1002
@@ -21,8 +23,10 @@
 #define IDS_ERROR_BLIST                         40000
 #define IDM_BLIST_ACCOUNTS_MANAGE               40001
 #define IDS_ERROR_PURPLEINIT                    40001
+#define IDM_BLIST_BUDDIES_JOINCHAT              40002
 #define IDS_ACCMGR_ACCOUNT                      40002
 #define IDC_EDIT_STATUSMSG                      40003
+#define IDM__1                                  40003
 #define IDS_ACCMGR_PROTOCOL                     40003
 #define IDC_TREE_BLIST                          40004
 #define IDS_ERROR_CONVCONTCLASS                 40004
============================================================
--- vulture/vulture-res.rc	21a80ef8271d5e11fc42bebb78fa093252a4f5ef
+++ vulture/vulture-res.rc	72957cbc45d13645e2e052b8ed974f4ac596fc21
@@ -16,6 +16,8 @@ IDM_BLIST MENU
 {
     POPUP "&Buddies"
     {
+        MENUITEM "&Join a Chat...\tCtrl+J", IDM_BLIST_BUDDIES_JOINCHAT
+        MENUITEM SEPARATOR
         MENUITEM "&Close", IDM_BLIST_BUDDIES_CLOSE
     }
     POPUP "&Accounts"
@@ -74,8 +76,8 @@ FONT 8, "Ms Shell Dlg"
 STYLE DS_3DLOOK | DS_CENTER | DS_SHELLFONT | WS_CHILDWINDOW | WS_DISABLED
 FONT 8, "Ms Shell Dlg"
 {
-    CONTROL         "", IDC_RICHEDIT_CONV, RICHEDIT_CLASS, WS_TABSTOP | WS_VSCROLL | WS_BORDER | ES_AUTOVSCROLL | ES_MULTILINE | ES_READONLY, 5, 5, 245, 180
-    CONTROL         "", IDC_RICHEDIT_INPUT, RICHEDIT_CLASS, WS_TABSTOP | WS_BORDER | ES_MULTILINE | ES_WANTRETURN, 5, 190, 245, 40
+    CONTROL         "Rich Edit", IDC_RICHEDIT_CONV, RICHEDIT_CLASS, WS_TABSTOP | WS_VSCROLL | WS_BORDER | ES_AUTOVSCROLL | ES_MULTILINE | ES_READONLY, 5, 5, 245, 180
+    CONTROL         "Rich Edit", IDC_RICHEDIT_INPUT, RICHEDIT_CLASS, WS_TABSTOP | WS_BORDER | ES_MULTILINE | ES_WANTRETURN, 5, 190, 245, 40
     CONTROL         "", IDC_LIST_NAMES, WC_LISTVIEW, WS_TABSTOP | WS_BORDER | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS | LVS_REPORT, 255, 5, 65, 225
 }
 
@@ -93,12 +95,28 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_U
 
 
 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
+IDD_JOINCHAT DIALOG 0, 0, 204, 123
+STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_FIXEDSYS | WS_VISIBLE | WS_BORDER | WS_CAPTION | WS_DLGFRAME | WS_POPUP | WS_SYSMENU
+CAPTION "Join a Chat"
+FONT 8, "Ms Shell Dlg 2"
+{
+    DEFPUSHBUTTON   "OK", IDOK, 95, 105, 50, 14, BS_DEFPUSHBUTTON
+    PUSHBUTTON      "Cancel", IDCANCEL, 150, 105, 50, 14, BS_PUSHBUTTON
+    LTEXT           "Please choose an account, and then enter the details of the chat that you wish to join.", IDC_STATIC, 5, 5, 195, 20, SS_LEFT
+    LTEXT           "Account:", IDC_STATIC, 5, 32, 35, 10, SS_LEFT
+    COMBOBOX        IDC_COMBO1, 45, 30, 155, 12, CBS_DROPDOWN | CBS_HASSTRINGS
+    GROUPBOX        "Static", IDC_STATIC, 5, 50, 195, 50
+}
+
+
+
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
 IDD_IM DIALOG 0, 0, 325, 235
 STYLE DS_3DLOOK | DS_CENTER | DS_SHELLFONT | WS_CHILDWINDOW | WS_DISABLED
 FONT 8, "Ms Shell Dlg"
 {
-    CONTROL         "", IDC_RICHEDIT_CONV, RICHEDIT_CLASS, WS_TABSTOP | WS_VSCROLL | WS_BORDER | ES_AUTOVSCROLL | ES_MULTILINE | ES_READONLY, 5, 35, 310, 150
-    CONTROL         "", IDC_RICHEDIT_INPUT, RICHEDIT_CLASS, WS_TABSTOP | WS_BORDER | ES_MULTILINE | ES_WANTRETURN, 5, 190, 310, 40
+    CONTROL         "Rich Edit", IDC_RICHEDIT_CONV, RICHEDIT_CLASS, WS_TABSTOP | WS_VSCROLL | WS_BORDER | ES_AUTOVSCROLL | ES_MULTILINE | ES_READONLY, 5, 35, 310, 150
+    CONTROL         "Rich Edit", IDC_RICHEDIT_INPUT, RICHEDIT_CLASS, WS_TABSTOP | WS_BORDER | ES_MULTILINE | ES_WANTRETURN, 5, 190, 310, 40
     CONTROL         "", IDC_STATIC, WC_STATIC, SS_BITMAP, 5, 5, 20, 17
     LTEXT           "", IDC_STATIC_NAME, 40, 5, 275, 8, SS_LEFT
     LTEXT           "", IDC_STATIC_STATUS, 40, 15, 275, 8, SS_LEFT
@@ -142,6 +160,7 @@ IDR_ACCEL_MAIN ACCELERATORS
 IDR_ACCEL_MAIN ACCELERATORS
 {
     "A",            IDM_BLIST_ACCOUNTS_MANAGE, VIRTKEY, CONTROL
+    "J",            IDM_BLIST_BUDDIES_JOINCHAT, VIRTKEY, CONTROL
 }
 
 
============================================================
--- vulture/vultureblist.c	bc32bb2ebe383cff669d95674a43bf1939fef665
+++ vulture/vultureblist.c	ee41f1b4173a1fb445f8182fc92010342dcd6d85
@@ -38,6 +38,7 @@
 #include "purplemain.h"
 #include "vultureconv.h"
 #include "purpleconv.h"
+#include "vulturedlg.h"
 
 
 typedef struct _STATUSDLGDATA
@@ -164,6 +165,10 @@ static LRESULT CALLBACK MainWndProc(HWND
 	case WM_COMMAND:
 		switch(LOWORD(wParam))
 		{
+		case IDM_BLIST_BUDDIES_JOINCHAT:
+			VultureJoinChatDlg(hwnd);
+			return 0;
+
 		case IDM_BLIST_BUDDIES_CLOSE:
 			SendMessage(hwnd, WM_CLOSE, 0, 0);
 			return 0;


More information about the Commits mailing list