changeset 9976:f4ff7d2b9b2c

[gaim-migrate @ 10887] Dave West fixed a few things from his patch to remove the default action for certain dialogs that pop-up committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 08 Sep 2004 03:59:17 +0000
parents c66345b33b88
children 0ac9b01c6837
files src/away.c src/ft.c src/gtkdialogs.c src/gtkrequest.c src/protocols/msn/userlist.c src/protocols/oscar/oscar.c src/server.c
diffstat 7 files changed, 59 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/src/away.c	Wed Sep 08 03:33:37 2004 +0000
+++ b/src/away.c	Wed Sep 08 03:59:17 2004 +0000
@@ -362,8 +362,8 @@
 
 	text = g_strdup_printf(_("Are you sure you want to remove the away message \"%s\"?"), a->name);
 
-	gaim_request_action(NULL, NULL, _("Remove Away Message"), text, 
-						GAIM_DEFAULT_ACTION_NONE, g_strdup(a->name), 2,
+	gaim_request_action(NULL, NULL, _("Remove Away Message"), text,
+						0, g_strdup(a->name), 2,
 						_("Remove"), G_CALLBACK(do_rem_away_mess),
 						_("Cancel"), G_CALLBACK(g_free));
 
--- a/src/ft.c	Wed Sep 08 03:33:37 2004 +0000
+++ b/src/ft.c	Wed Sep 08 03:59:17 2004 +0000
@@ -264,9 +264,10 @@
 			serv_got_im(gaim_account_get_connection(xfer->account),
 								 xfer->who, xfer->message, 0, time(NULL));
 
-		gaim_request_accept_cancel(xfer, NULL, buf, NULL, 0, xfer,
-					   G_CALLBACK(gaim_xfer_choose_file),
-					   G_CALLBACK(cancel_recv_cb));
+		gaim_request_accept_cancel(xfer, NULL, buf, NULL,
+								  GAIM_DEFAULT_ACTION_NONE, xfer,
+								  G_CALLBACK(gaim_xfer_choose_file),
+								  G_CALLBACK(cancel_recv_cb));
 
 		g_free(buf);
 	} else
@@ -303,9 +304,10 @@
 					 "Remote host: %s\nRemote port: %d"),
 				       gaim_xfer_get_remote_ip(xfer),
 				       gaim_xfer_get_remote_port(xfer));
-	gaim_request_accept_cancel(xfer, NULL, buf, buf2, 0, xfer,
-				   G_CALLBACK(ask_accept_ok),
-				   G_CALLBACK(ask_accept_cancel));
+	gaim_request_accept_cancel(xfer, NULL, buf, buf2,
+							   GAIM_DEFAULT_ACTION_NONE, xfer,
+							   G_CALLBACK(ask_accept_ok),
+							   G_CALLBACK(ask_accept_cancel));
 	g_free(buf);
 	g_free(buf2);
 }
--- a/src/gtkdialogs.c	Wed Sep 08 03:33:37 2004 +0000
+++ b/src/gtkdialogs.c	Wed Sep 08 03:59:17 2004 +0000
@@ -753,8 +753,7 @@
 		gchar *text = g_strdup_printf(_("You are about to remove the contact containing %s and %d other buddies from your buddy list.  Do you want to continue?"),
 			       buddy->name, contact->totalsize - 1);
 
-		gaim_request_action(NULL, NULL, _("Remove Contact"), text, 
-				GAIM_DEFAULT_ACTION_NONE, contact, 2,
+		gaim_request_action(NULL, NULL, _("Remove Contact"), text, 0, contact, 2,
 				_("Remove Contact"), G_CALLBACK(gaim_gtkdialogs_remove_contact_cb),
 				_("Cancel"), NULL);
 
@@ -814,7 +813,7 @@
 	text = g_strdup_printf(_("You are about to remove the group %s and all its members from your buddy list.  Do you want to continue?"),
 						   group->name);
 
-	gaim_request_action(NULL, NULL, _("Remove Group"), text, -1, group, 2,
+	gaim_request_action(NULL, NULL, _("Remove Group"), text, 0, group, 2,
 						_("Remove Group"), G_CALLBACK(gaim_gtkdialogs_remove_group_cb),
 						_("Cancel"), NULL);
 
@@ -856,8 +855,7 @@
 	text = g_strdup_printf(_("You are about to remove %s from your buddy list.  Do you want to continue?"),
 						   buddy->name);
 
-	gaim_request_action(NULL, NULL, _("Remove Buddy"), text, 
-						GAIM_DEFAULT_ACTION_NONE, buddy, 2,
+	gaim_request_action(NULL, NULL, _("Remove Buddy"), text, 0, buddy, 2,
 						_("Remove Buddy"), G_CALLBACK(gaim_gtkdialogs_remove_buddy_cb),
 						_("Cancel"), NULL);
 
@@ -892,7 +890,7 @@
 
 	g_return_if_fail(chat != NULL);
 
-	gaim_request_action(NULL, NULL, _("Remove Chat"), text, -1, chat, 2,
+	gaim_request_action(NULL, NULL, _("Remove Chat"), text, 0, chat, 2,
 						_("Remove Chat"), G_CALLBACK(gaim_gtkdialogs_remove_chat_cb),
 						_("Cancel"), NULL);
 
--- a/src/gtkrequest.c	Wed Sep 08 03:33:37 2004 +0000
+++ b/src/gtkrequest.c	Wed Sep 08 03:59:17 2004 +0000
@@ -522,7 +522,7 @@
 	g_free(label_text);
 
 
-    if (default_action == GAIM_DEFAULT_ACTION_NONE && img != NULL) {
+    if (default_action == GAIM_DEFAULT_ACTION_NONE) {
 		GTK_WIDGET_SET_FLAGS(img, GTK_CAN_DEFAULT);		
 		GTK_WIDGET_SET_FLAGS(img, GTK_CAN_FOCUS);		
 		gtk_widget_grab_focus(img);
--- a/src/protocols/msn/userlist.c	Wed Sep 08 03:33:37 2004 +0000
+++ b/src/protocols/msn/userlist.c	Wed Sep 08 03:59:17 2004 +0000
@@ -70,8 +70,7 @@
 }
 
 static void
-got_new_entry(GaimConnection *gc, const char *passport,
-			  const char *friendly)
+got_new_entry(GaimConnection *gc, const char *passport, const char *friendly)
 {
 	MsnPermitAdd *pa;
 	char *msg;
@@ -96,7 +95,7 @@
 				   passport, gaim_account_get_username(gc->account));
 	}
 
-	gaim_request_action(gc, NULL, msg, NULL, 
+	gaim_request_action(gc, NULL, msg, NULL,
 						GAIM_DEFAULT_ACTION_NONE, pa, 2,
 						_("Authorize"), G_CALLBACK(msn_accept_add_cb),
 						_("Deny"), G_CALLBACK(msn_cancel_add_cb));
--- a/src/protocols/oscar/oscar.c	Wed Sep 08 03:33:37 2004 +0000
+++ b/src/protocols/oscar/oscar.c	Wed Sep 08 03:59:17 2004 +0000
@@ -46,14 +46,15 @@
 #include "aim.h"
 #include "md5.h"
 
-#define AIM_ICQ_STATUS_ID_ONLINE	"online"
-#define AIM_ICQ_STATUS_ID_AWAY		"away"
-#define AIM_ICQ_STATUS_ID_DND		"dnd"
-#define AIM_ICQ_STATUS_ID_NA		"na"
-#define AIM_ICQ_STATUS_ID_OCCUPIED	"occupied"
-#define AIM_ICQ_STATUS_ID_FREE4CHAT	"free4chat"
-#define AIM_ICQ_STATUS_ID_INVISIBLE	"invisible"
-#define AIM_ICQ_STATUS_ID_CUSTOM	"custom"
+#define OSCAR_STATUS_ID_INVISIBLE	"invisible"
+#define OSCAR_STATUS_ID_OFFLINE		"offline"
+#define OSCAR_STATUS_ID_ONLINE		"online"
+#define OSCAR_STATUS_ID_AWAY		"away"
+#define OSCAR_STATUS_ID_DND			"dnd"
+#define OSCAR_STATUS_ID_NA			"na"
+#define OSCAR_STATUS_ID_OCCUPIED	"occupied"
+#define OSCAR_STATUS_ID_FREE4CHAT	"free4chat"
+#define OSCAR_STATUS_ID_CUSTOM		"custom"
 
 #define UC_UNAVAILABLE	0x01
 #define UC_AOL			0x02
@@ -2980,7 +2981,8 @@
 		gc->login_time_official = signon;
 	}
 
-	serv_got_update(gc, info->sn, TRUE, (info->warnlevel/10.0) + 0.5, signon, time_idle, type);
+	/* STATUS - time_idle is idle time, type is type, info->warnlevel/10.0 is warning level */
+	serv_got_update(gc, info->sn, TRUE, signon);
 
 	return 1;
 }
@@ -3002,7 +3004,7 @@
 	info = va_arg(ap, aim_userinfo_t *);
 	va_end(ap);
 
-	serv_got_update(gc, info->sn, FALSE, 0, 0, 0, 0);
+	serv_got_update(gc, info->sn, FALSE, 0);
 
 	g_hash_table_remove(od->buddyinfo, gaim_normalize(gc->account, info->sn));
 
@@ -6818,10 +6820,37 @@
 
 	is_icq = aim_sn_is_icq(gaim_account_get_username(account));
 
-
+	type = gaim_status_type_new_full(GAIM_STATUS_HIDDEN, OSCAR_STATUS_ID_INVISIBLE, _("Invisible"), FALSE, TRUE, FALSE);
+	status_types = g_list_append(status_types, type);
+
+	type = gaim_status_type_new_full(GAIM_STATUS_OFFLINE, OSCAR_STATUS_ID_OFFLINE, _("Offline"), FALSE, FALSE, FALSE);
+	status_types = g_list_append(status_types, type);
+
+	type = gaim_status_type_new_full(GAIM_STATUS_ONLINE, OSCAR_STATUS_ID_ONLINE, _("Online"), FALSE, FALSE, FALSE);
+	status_types = g_list_append(status_types, type);
+
+	type = gaim_status_type_new_full(GAIM_STATUS_AWAY, OSCAR_STATUS_ID_AWAY, _("Away"), FALSE, TRUE, FALSE);
+	status_types = g_list_append(status_types, type);
+
+	type = gaim_status_type_new_full(GAIM_STATUS_AWAY, OSCAR_STATUS_ID_DND, _("Do Not Disturb"), FALSE, TRUE, FALSE);
+	status_types = g_list_append(status_types, type);
+
+	type = gaim_status_type_new_full(GAIM_STATUS_AWAY, OSCAR_STATUS_ID_NA, _("Not Available"), FALSE, TRUE, FALSE);
+	status_types = g_list_append(status_types, type);
+
+	type = gaim_status_type_new_full(GAIM_STATUS_AWAY, OSCAR_STATUS_ID_OCCUPIED, _("Occupied"), FALSE, TRUE, FALSE);
+	status_types = g_list_append(status_types, type);
+
+	type = gaim_status_type_new_full(GAIM_STATUS_AWAY, OSCAR_STATUS_ID_FREE4CHAT, _("Free For Chat"), FALSE, TRUE, FALSE);
+	status_types = g_list_append(status_types, type);
 
 	return status_types;
 
+	/*
+	 * Do something with:
+	 * #define OSCAR_STATUS_ID_CUSTOM		"custom"
+	 */
+
 #if 0 /* STATUS - old stuff that should be removed */
 	if (od->icq) {
 		m = g_list_append(m, _("Online"));
--- a/src/server.c	Wed Sep 08 03:33:37 2004 +0000
+++ b/src/server.c	Wed Sep 08 03:59:17 2004 +0000
@@ -1369,8 +1369,8 @@
 	cid->gc = gc;
 	cid->components = data;
 
-	gaim_request_accept_cancel(gc, NULL, _("Accept chat invitation?"),
-							   buf2, 0, cid,
+	gaim_request_accept_cancel(gc, NULL, _("Accept chat invitation?"), buf2,
+							   GAIM_DEFAULT_ACTION_NONE, cid,
 							   G_CALLBACK(chat_invite_accept),
 							   G_CALLBACK(chat_invite_reject));
 }