comparison gtk/gtkdialogs.c @ 14464:a9f8d3964d62

[gaim-migrate @ 17178] This commit adds a confirmation dialog to GTKgaim when merging two groups. committer: Tailor Script <tailor@pidgin.im>
author Aaron Sheldon <aaronsheldon>
date Wed, 06 Sep 2006 05:24:13 +0000
parents 289490ee84d1
children 8395297271c6
comparison
equal deleted inserted replaced
14463:7df4ab213577 14464:a9f8d3964d62
40 #include "gaimstock.h" 40 #include "gaimstock.h"
41 41
42 static GList *dialogwindows = NULL; 42 static GList *dialogwindows = NULL;
43 43
44 static GtkWidget *about = NULL; 44 static GtkWidget *about = NULL;
45
46 struct _GaimGroupMergeObject {
47 GaimGroup* parent;
48 char *new_name;
49 };
45 50
46 struct developer { 51 struct developer {
47 char *name; 52 char *name;
48 char *role; 53 char *role;
49 char *email; 54 char *email;
994 999
995 g_free(text); 1000 g_free(text);
996 } 1001 }
997 } 1002 }
998 1003
1004 void
1005 gaim_gtkdialogs_merge_groups_cb(struct _GaimGroupMergeObject *GGP)
1006 {
1007 gaim_blist_rename_group(GGP->parent, GGP->new_name);
1008 }
1009
1010 void
1011 gaim_gtkdialogs_merge_groups(GaimGroup *source, const char *new_name)
1012 {
1013 gchar *text;
1014 struct _GaimGroupMergeObject *ggp;
1015
1016 g_return_if_fail(source != NULL);
1017 g_return_if_fail(new_name != NULL);
1018
1019 text = g_strdup_printf(
1020 "You are about to merge the group called %s into the group "
1021 "called %s. Do you want to continue?", source->name, new_name);
1022
1023 ggp = g_new(struct _GaimGroupMergeObject, 1);
1024 ggp->parent = source;
1025 ggp->new_name = g_strdup(new_name);
1026
1027 gaim_request_action(source, NULL, _("Merge Groups"), text, 0, ggp, 2,
1028 _("_Merge Groups"), G_CALLBACK(gaim_gtkdialogs_merge_groups_cb),
1029 _("Cancel"), NULL);
1030
1031 g_free(text);
1032 }
1033
999 static void 1034 static void
1000 gaim_gtkdialogs_remove_group_cb(GaimGroup *group) 1035 gaim_gtkdialogs_remove_group_cb(GaimGroup *group)
1001 { 1036 {
1002 GaimBlistNode *cnode, *bnode; 1037 GaimBlistNode *cnode, *bnode;
1003 1038