annotate pidgin/minidialog.c @ 22930:3ed8f8d074e4

Rewrite a ChangeLog entry I just wrote.
author Stu Tomlinson <stu@nosnilmot.com>
date Tue, 13 May 2008 20:45:29 +0000
parents 7e5d7ebcd24e
children aaaff38e144f 1a94a964bddf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
1 /**
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
2 * @file minidialog.c Implementation of the #PidginMiniDialog Gtk widget.
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
3 * @ingroup pidgin
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
4 */
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
5
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
6 /* pidgin
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
7 *
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
8 * Pidgin is the legal property of its developers, whose names are too numerous
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
10 * source distribution.
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
11 *
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
12 * This program is free software; you can redistribute it and/or modify
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
13 * it under the terms of the GNU General Public License as published by
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
15 * (at your option) any later version.
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
16 *
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
17 * This program is distributed in the hope that it will be useful,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
20 * GNU General Public License for more details.
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
21 *
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
23 * along with this program; if not, write to the Free Software
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
25 */
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
26
21432
4acd6a71b0ef Fix build.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 21417
diff changeset
27 #include "internal.h"
4acd6a71b0ef Fix build.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 21417
diff changeset
28
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
29 #include <gtk/gtkhbox.h>
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
30 #include <gtk/gtkbutton.h>
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
31
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
32 #include "libpurple/prefs.h"
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
33
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
34 #include "pidgin/minidialog.h"
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
35 #include "pidgin/pidgin.h"
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
36 #include "pidgin/pidginstock.h"
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
37
21849
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
38 static void pidgin_mini_dialog_init (PidginMiniDialog *self);
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
39 static void pidgin_mini_dialog_class_init (PidginMiniDialogClass *klass);
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
40
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
41 static gpointer pidgin_mini_dialog_parent_class = NULL;
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
42
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
43 static void
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
44 pidgin_mini_dialog_class_intern_init (gpointer klass)
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
45 {
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
46 pidgin_mini_dialog_parent_class = g_type_class_peek_parent (klass);
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
47 pidgin_mini_dialog_class_init ((PidginMiniDialogClass*) klass);
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
48 }
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
49
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
50 GType
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
51 pidgin_mini_dialog_get_type (void)
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
52 {
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
53 static GType g_define_type_id = 0;
22491
566a805a5bd4 G_UNLIKELY is new in Glib 2.2 and resiak said this wasn't important here
Stu Tomlinson <stu@nosnilmot.com>
parents: 22316
diff changeset
54 if (g_define_type_id == 0)
21849
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
55 {
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
56 static const GTypeInfo g_define_type_info = {
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
57 sizeof (PidginMiniDialogClass),
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
58 (GBaseInitFunc) NULL,
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
59 (GBaseFinalizeFunc) NULL,
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
60 (GClassInitFunc) pidgin_mini_dialog_class_intern_init,
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
61 (GClassFinalizeFunc) NULL,
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
62 NULL, /* class_data */
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
63 sizeof (PidginMiniDialog),
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
64 0, /* n_preallocs */
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
65 (GInstanceInitFunc) pidgin_mini_dialog_init,
21926
9d45eb679bdd Compile warning fix
Stu Tomlinson <stu@nosnilmot.com>
parents: 21849
diff changeset
66 NULL,
21849
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
67 };
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
68 g_define_type_id = g_type_register_static (GTK_TYPE_VBOX,
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
69 "PidginMiniDialog", &g_define_type_info, 0);
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
70 }
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
71 return g_define_type_id;
aa4810065b91 Manually expand G_DEFINE_TYPE for PidginMiniDialog, since it was added in glib 2.4.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21519
diff changeset
72 }
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
73
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
74 enum
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
75 {
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
76 PROP_TITLE = 1,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
77 PROP_DESCRIPTION,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
78 PROP_ICON_NAME,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
79
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
80 LAST_PROPERTY
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
81 } HazeConnectionProperties;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
82
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
83 typedef struct _PidginMiniDialogPrivate
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
84 {
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
85 GtkImage *icon;
21403
0f029f9a75e1 Make PidginMiniDialog do more things right when used as a GtkContainer. _add,
Will Thompson <will.thompson@collabora.co.uk>
parents: 21402
diff changeset
86 GtkBox *title_box;
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
87 GtkLabel *title;
21403
0f029f9a75e1 Make PidginMiniDialog do more things right when used as a GtkContainer. _add,
Will Thompson <will.thompson@collabora.co.uk>
parents: 21402
diff changeset
88 GtkLabel *desc;
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
89 GtkBox *buttons;
21519
5123f25788f2 Don't crash when someone ignores an error. The mini-dialog was being
Will Thompson <will.thompson@collabora.co.uk>
parents: 21432
diff changeset
90
5123f25788f2 Don't crash when someone ignores an error. The mini-dialog was being
Will Thompson <will.thompson@collabora.co.uk>
parents: 21432
diff changeset
91 guint idle_destroy_cb_id;
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
92 } PidginMiniDialogPrivate;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
93
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
94 #define PIDGIN_MINI_DIALOG_GET_PRIVATE(dialog) \
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
95 ((PidginMiniDialogPrivate *) ((dialog)->priv))
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
96
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
97 PidginMiniDialog *
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
98 pidgin_mini_dialog_new(const gchar *title,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
99 const gchar *description,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
100 const gchar *icon_name)
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
101 {
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
102 PidginMiniDialog *mini_dialog = g_object_new(PIDGIN_TYPE_MINI_DIALOG,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
103 "title", title,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
104 "description", description,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
105 "icon-name", icon_name,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
106 NULL);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
107
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
108 return mini_dialog;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
109 }
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
110
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
111 void
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
112 pidgin_mini_dialog_set_title(PidginMiniDialog *mini_dialog,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
113 const char *title)
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
114 {
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
115 g_object_set(G_OBJECT(mini_dialog), "title", title, NULL);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
116 }
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
117
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
118 void
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
119 pidgin_mini_dialog_set_description(PidginMiniDialog *mini_dialog,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
120 const char *description)
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
121 {
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
122 g_object_set(G_OBJECT(mini_dialog), "description", description, NULL);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
123 }
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
124
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
125 void
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
126 pidgin_mini_dialog_set_icon_name(PidginMiniDialog *mini_dialog,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
127 const char *icon_name)
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
128 {
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
129 g_object_set(G_OBJECT(mini_dialog), "icon_name", icon_name, NULL);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
130 }
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
131
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
132 struct _mini_dialog_button_clicked_cb_data
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
133 {
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
134 PidginMiniDialog *mini_dialog;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
135 PidginMiniDialogCallback callback;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
136 gpointer user_data;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
137 };
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
138
21407
dc5012153bfa Add pidgin_mini_dialog_get_num_children(), a convenient way to check how many
Will Thompson <will.thompson@collabora.co.uk>
parents: 21406
diff changeset
139 guint
dc5012153bfa Add pidgin_mini_dialog_get_num_children(), a convenient way to check how many
Will Thompson <will.thompson@collabora.co.uk>
parents: 21406
diff changeset
140 pidgin_mini_dialog_get_num_children(PidginMiniDialog *mini_dialog)
dc5012153bfa Add pidgin_mini_dialog_get_num_children(), a convenient way to check how many
Will Thompson <will.thompson@collabora.co.uk>
parents: 21406
diff changeset
141 {
dc5012153bfa Add pidgin_mini_dialog_get_num_children(), a convenient way to check how many
Will Thompson <will.thompson@collabora.co.uk>
parents: 21406
diff changeset
142 return g_list_length(mini_dialog->contents->children);
dc5012153bfa Add pidgin_mini_dialog_get_num_children(), a convenient way to check how many
Will Thompson <will.thompson@collabora.co.uk>
parents: 21406
diff changeset
143 }
dc5012153bfa Add pidgin_mini_dialog_get_num_children(), a convenient way to check how many
Will Thompson <will.thompson@collabora.co.uk>
parents: 21406
diff changeset
144
21406
7e07f5b271e5 Use an idle callback to destroy PidginMiniDialogs when a button is pressed.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21403
diff changeset
145 static gboolean
7e07f5b271e5 Use an idle callback to destroy PidginMiniDialogs when a button is pressed.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21403
diff changeset
146 idle_destroy_cb(GtkWidget *mini_dialog)
7e07f5b271e5 Use an idle callback to destroy PidginMiniDialogs when a button is pressed.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21403
diff changeset
147 {
7e07f5b271e5 Use an idle callback to destroy PidginMiniDialogs when a button is pressed.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21403
diff changeset
148 gtk_widget_destroy(mini_dialog);
7e07f5b271e5 Use an idle callback to destroy PidginMiniDialogs when a button is pressed.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21403
diff changeset
149 return FALSE;
7e07f5b271e5 Use an idle callback to destroy PidginMiniDialogs when a button is pressed.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21403
diff changeset
150 }
7e07f5b271e5 Use an idle callback to destroy PidginMiniDialogs when a button is pressed.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21403
diff changeset
151
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
152 static void
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
153 mini_dialog_button_clicked_cb(GtkButton *button,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
154 gpointer user_data)
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
155 {
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
156 struct _mini_dialog_button_clicked_cb_data *data = user_data;
21519
5123f25788f2 Don't crash when someone ignores an error. The mini-dialog was being
Will Thompson <will.thompson@collabora.co.uk>
parents: 21432
diff changeset
157 PidginMiniDialogPrivate *priv =
5123f25788f2 Don't crash when someone ignores an error. The mini-dialog was being
Will Thompson <will.thompson@collabora.co.uk>
parents: 21432
diff changeset
158 PIDGIN_MINI_DIALOG_GET_PRIVATE(data->mini_dialog);
5123f25788f2 Don't crash when someone ignores an error. The mini-dialog was being
Will Thompson <will.thompson@collabora.co.uk>
parents: 21432
diff changeset
159
5123f25788f2 Don't crash when someone ignores an error. The mini-dialog was being
Will Thompson <will.thompson@collabora.co.uk>
parents: 21432
diff changeset
160 /* Set up the destruction callback before calling the clicked callback,
5123f25788f2 Don't crash when someone ignores an error. The mini-dialog was being
Will Thompson <will.thompson@collabora.co.uk>
parents: 21432
diff changeset
161 * so that if the mini-dialog gets destroyed during the clicked callback
5123f25788f2 Don't crash when someone ignores an error. The mini-dialog was being
Will Thompson <will.thompson@collabora.co.uk>
parents: 21432
diff changeset
162 * the idle_destroy_cb is correctly removed by _finalize.
5123f25788f2 Don't crash when someone ignores an error. The mini-dialog was being
Will Thompson <will.thompson@collabora.co.uk>
parents: 21432
diff changeset
163 */
5123f25788f2 Don't crash when someone ignores an error. The mini-dialog was being
Will Thompson <will.thompson@collabora.co.uk>
parents: 21432
diff changeset
164 priv->idle_destroy_cb_id =
5123f25788f2 Don't crash when someone ignores an error. The mini-dialog was being
Will Thompson <will.thompson@collabora.co.uk>
parents: 21432
diff changeset
165 g_idle_add((GSourceFunc) idle_destroy_cb, data->mini_dialog);
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
166
22316
4345e7aaa7d4 Don't call NULL callbacks. Fixes #4901
Stu Tomlinson <stu@nosnilmot.com>
parents: 21926
diff changeset
167 if (data->callback != NULL)
4345e7aaa7d4 Don't call NULL callbacks. Fixes #4901
Stu Tomlinson <stu@nosnilmot.com>
parents: 21926
diff changeset
168 data->callback(data->mini_dialog, button, data->user_data);
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
169
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
170 }
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
171
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
172 static void
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
173 mini_dialog_button_destroy_cb(GtkButton *button,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
174 gpointer user_data)
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
175 {
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
176 struct _mini_dialog_button_clicked_cb_data *data = user_data;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
177 g_free(data);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
178 }
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
179
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
180 void
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
181 pidgin_mini_dialog_add_button(PidginMiniDialog *self,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
182 const char *text,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
183 PidginMiniDialogCallback clicked_cb,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
184 gpointer user_data)
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
185 {
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
186 PidginMiniDialogPrivate *priv = PIDGIN_MINI_DIALOG_GET_PRIVATE(self);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
187 struct _mini_dialog_button_clicked_cb_data *callback_data
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
188 = g_new0(struct _mini_dialog_button_clicked_cb_data, 1);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
189 GtkWidget *button = gtk_button_new();
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
190 GtkWidget *label = gtk_label_new(NULL);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
191 char *button_text =
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
192 g_strdup_printf("<span size=\"smaller\">%s</span>", text);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
193
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
194 gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), button_text);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
195 g_free(button_text);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
196
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
197 callback_data->mini_dialog = self;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
198 callback_data->callback = clicked_cb;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
199 callback_data->user_data = user_data;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
200 g_signal_connect(G_OBJECT(button), "clicked",
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
201 (GCallback) mini_dialog_button_clicked_cb, callback_data);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
202 g_signal_connect(G_OBJECT(button), "destroy",
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
203 (GCallback) mini_dialog_button_destroy_cb, callback_data);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
204
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
205 gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
206 gtk_container_add(GTK_CONTAINER(button), label);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
207
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
208 gtk_box_pack_end(GTK_BOX(priv->buttons), button, FALSE, FALSE,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
209 0);
21403
0f029f9a75e1 Make PidginMiniDialog do more things right when used as a GtkContainer. _add,
Will Thompson <will.thompson@collabora.co.uk>
parents: 21402
diff changeset
210 gtk_widget_show_all(GTK_WIDGET(button));
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
211 }
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
212
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
213 static void
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
214 pidgin_mini_dialog_get_property(GObject *object,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
215 guint property_id,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
216 GValue *value,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
217 GParamSpec *pspec)
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
218 {
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
219 PidginMiniDialog *self = PIDGIN_MINI_DIALOG(object);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
220 PidginMiniDialogPrivate *priv = PIDGIN_MINI_DIALOG_GET_PRIVATE(self);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
221
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
222 switch (property_id) {
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
223 case PROP_TITLE:
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
224 g_value_set_string(value, gtk_label_get_text(priv->title));
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
225 break;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
226 case PROP_DESCRIPTION:
21403
0f029f9a75e1 Make PidginMiniDialog do more things right when used as a GtkContainer. _add,
Will Thompson <will.thompson@collabora.co.uk>
parents: 21402
diff changeset
227 g_value_set_string(value, gtk_label_get_text(priv->desc));
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
228 break;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
229 case PROP_ICON_NAME:
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
230 {
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
231 gchar *icon_name = NULL;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
232 GtkIconSize size;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
233 gtk_image_get_stock(priv->icon, &icon_name, &size);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
234 g_value_set_string(value, icon_name);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
235 break;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
236 }
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
237 default:
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
238 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
239 }
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
240 }
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
241
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
242 static void
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
243 mini_dialog_set_title(PidginMiniDialog *self,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
244 const char *title)
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
245 {
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
246 PidginMiniDialogPrivate *priv = PIDGIN_MINI_DIALOG_GET_PRIVATE(self);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
247
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
248 char *title_esc = g_markup_escape_text(title, -1);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
249 char *title_markup = g_strdup_printf(
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
250 "<span weight=\"bold\" size=\"smaller\">%s</span>",
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
251 title_esc ? title_esc : "");
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
252
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
253 gtk_label_set_markup(priv->title, title_markup);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
254
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
255 g_free(title_esc);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
256 g_free(title_markup);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
257 }
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
258
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
259 static void
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
260 mini_dialog_set_description(PidginMiniDialog *self,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
261 const char *description)
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
262 {
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
263 PidginMiniDialogPrivate *priv = PIDGIN_MINI_DIALOG_GET_PRIVATE(self);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
264 if(description)
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
265 {
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
266 char *desc_esc = g_markup_escape_text(description, -1);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
267 char *desc_markup = g_strdup_printf(
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
268 "<span size=\"smaller\">%s</span>", desc_esc);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
269
21403
0f029f9a75e1 Make PidginMiniDialog do more things right when used as a GtkContainer. _add,
Will Thompson <will.thompson@collabora.co.uk>
parents: 21402
diff changeset
270 gtk_label_set_markup(priv->desc, desc_markup);
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
271
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
272 g_free(desc_esc);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
273 g_free(desc_markup);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
274
21412
2f818256ae62 Remove a redundant hbox around PidginMiniDialog's description label.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21409
diff changeset
275 gtk_widget_show(GTK_WIDGET(priv->desc));
21415
5203f3836da5 Really actually hide the description label inside a minidialog, even when
Will Thompson <will.thompson@collabora.co.uk>
parents: 21414
diff changeset
276 g_object_set(G_OBJECT(priv->desc), "no-show-all", FALSE, NULL);
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
277 }
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
278 else
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
279 {
21403
0f029f9a75e1 Make PidginMiniDialog do more things right when used as a GtkContainer. _add,
Will Thompson <will.thompson@collabora.co.uk>
parents: 21402
diff changeset
280 gtk_label_set_text(priv->desc, NULL);
21412
2f818256ae62 Remove a redundant hbox around PidginMiniDialog's description label.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21409
diff changeset
281 gtk_widget_hide(GTK_WIDGET(priv->desc));
21417
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
282 /* make calling show_all() on the minidialog not affect desc
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
283 * even though it's packed inside it.
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
284 */
21415
5203f3836da5 Really actually hide the description label inside a minidialog, even when
Will Thompson <will.thompson@collabora.co.uk>
parents: 21414
diff changeset
285 g_object_set(G_OBJECT(priv->desc), "no-show-all", TRUE, NULL);
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
286 }
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
287 }
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
288
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
289 static void
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
290 pidgin_mini_dialog_set_property(GObject *object,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
291 guint property_id,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
292 const GValue *value,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
293 GParamSpec *pspec)
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
294 {
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
295 PidginMiniDialog *self = PIDGIN_MINI_DIALOG(object);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
296 PidginMiniDialogPrivate *priv = PIDGIN_MINI_DIALOG_GET_PRIVATE(self);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
297
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
298 switch (property_id) {
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
299 case PROP_TITLE:
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
300 mini_dialog_set_title(self, g_value_get_string(value));
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
301 break;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
302 case PROP_DESCRIPTION:
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
303 mini_dialog_set_description(self, g_value_get_string(value));
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
304 break;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
305 case PROP_ICON_NAME:
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
306 gtk_image_set_from_stock(priv->icon, g_value_get_string(value),
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
307 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL));
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
308 break;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
309 default:
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
310 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
311 }
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
312 }
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
313
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
314 static void
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
315 pidgin_mini_dialog_finalize(GObject *object)
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
316 {
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
317 PidginMiniDialog *self = PIDGIN_MINI_DIALOG(object);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
318 PidginMiniDialogPrivate *priv = PIDGIN_MINI_DIALOG_GET_PRIVATE(self);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
319
21519
5123f25788f2 Don't crash when someone ignores an error. The mini-dialog was being
Will Thompson <will.thompson@collabora.co.uk>
parents: 21432
diff changeset
320 if (priv->idle_destroy_cb_id)
5123f25788f2 Don't crash when someone ignores an error. The mini-dialog was being
Will Thompson <will.thompson@collabora.co.uk>
parents: 21432
diff changeset
321 g_source_remove(priv->idle_destroy_cb_id);
5123f25788f2 Don't crash when someone ignores an error. The mini-dialog was being
Will Thompson <will.thompson@collabora.co.uk>
parents: 21432
diff changeset
322
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
323 g_free(priv);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
324 self->priv = NULL;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
325
21417
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
326 purple_prefs_disconnect_by_handle(self);
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
327
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
328 G_OBJECT_CLASS (pidgin_mini_dialog_parent_class)->finalize (object);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
329 }
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
330
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
331 static void
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
332 pidgin_mini_dialog_class_init(PidginMiniDialogClass *klass)
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
333 {
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
334 GObjectClass *object_class = G_OBJECT_CLASS(klass);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
335 GParamSpec *param_spec;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
336
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
337 object_class->get_property = pidgin_mini_dialog_get_property;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
338 object_class->set_property = pidgin_mini_dialog_set_property;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
339 object_class->finalize = pidgin_mini_dialog_finalize;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
340
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
341 param_spec = g_param_spec_string("title", "title",
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
342 "String specifying the mini-dialog's title", NULL,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
343 #if GTK_CHECK_VERSION(2,8,0)
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
344 G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB |
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
345 #endif
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
346 G_PARAM_READWRITE);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
347 g_object_class_install_property (object_class, PROP_TITLE, param_spec);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
348
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
349 param_spec = g_param_spec_string("description", "description",
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
350 "Description text for the mini-dialog, if desired", NULL,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
351 #if GTK_CHECK_VERSION(2,8,0)
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
352 G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB |
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
353 #endif
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
354 G_PARAM_READWRITE);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
355 g_object_class_install_property (object_class, PROP_DESCRIPTION, param_spec);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
356
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
357 param_spec = g_param_spec_string("icon-name", "icon-name",
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
358 "String specifying the Gtk stock name of the dialog's icon",
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
359 NULL,
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
360 #if GTK_CHECK_VERSION(2,8,0)
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
361 G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB |
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
362 #endif
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
363 G_PARAM_READWRITE);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
364 g_object_class_install_property (object_class, PROP_ICON_NAME, param_spec);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
365 }
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
366
21414
c972c9311221 De-magic-number (and correct) the width request of PidginMiniDialog's labels.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21412
diff changeset
367 /* 16 is the width of the icon, due to PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL */
c972c9311221 De-magic-number (and correct) the width request of PidginMiniDialog's labels.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21412
diff changeset
368 #define BLIST_WIDTH_OTHER_THAN_LABEL \
c972c9311221 De-magic-number (and correct) the width request of PidginMiniDialog's labels.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21412
diff changeset
369 ((PIDGIN_HIG_BOX_SPACE * 3) + 16)
c972c9311221 De-magic-number (and correct) the width request of PidginMiniDialog's labels.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21412
diff changeset
370
21417
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
371 #define BLIST_WIDTH_PREF \
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
372 (PIDGIN_PREFS_ROOT "/blist/width")
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
373
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
374 static void
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
375 blist_width_changed_cb(const char *name,
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
376 PurplePrefType type,
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
377 gconstpointer val,
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
378 gpointer data)
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
379 {
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
380 PidginMiniDialog *self = PIDGIN_MINI_DIALOG(data);
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
381 PidginMiniDialogPrivate *priv = PIDGIN_MINI_DIALOG_GET_PRIVATE(self);
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
382 guint blist_width = GPOINTER_TO_INT(val);
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
383 guint label_width = blist_width - BLIST_WIDTH_OTHER_THAN_LABEL;
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
384
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
385 gtk_widget_set_size_request(GTK_WIDGET(priv->title), label_width, -1);
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
386 gtk_widget_set_size_request(GTK_WIDGET(priv->desc), label_width, -1);
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
387 }
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
388
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
389 static void
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
390 pidgin_mini_dialog_init(PidginMiniDialog *self)
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
391 {
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
392 GtkBox *self_box = GTK_BOX(self);
21417
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
393 guint blist_width = purple_prefs_get_int(BLIST_WIDTH_PREF);
21414
c972c9311221 De-magic-number (and correct) the width request of PidginMiniDialog's labels.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21412
diff changeset
394 guint label_width = blist_width - BLIST_WIDTH_OTHER_THAN_LABEL;
21403
0f029f9a75e1 Make PidginMiniDialog do more things right when used as a GtkContainer. _add,
Will Thompson <will.thompson@collabora.co.uk>
parents: 21402
diff changeset
395
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
396 PidginMiniDialogPrivate *priv = g_new0(PidginMiniDialogPrivate, 1);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
397 self->priv = priv;
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
398
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
399 gtk_container_set_border_width(GTK_CONTAINER(self), PIDGIN_HIG_BOX_SPACE);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
400
21403
0f029f9a75e1 Make PidginMiniDialog do more things right when used as a GtkContainer. _add,
Will Thompson <will.thompson@collabora.co.uk>
parents: 21402
diff changeset
401 priv->title_box = GTK_BOX(gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE));
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
403 priv->icon = GTK_IMAGE(gtk_image_new());
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
404 gtk_misc_set_alignment(GTK_MISC(priv->icon), 0, 0);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
405
21412
2f818256ae62 Remove a redundant hbox around PidginMiniDialog's description label.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21409
diff changeset
406 priv->title = GTK_LABEL(gtk_label_new(NULL));
21414
c972c9311221 De-magic-number (and correct) the width request of PidginMiniDialog's labels.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21412
diff changeset
407 gtk_widget_set_size_request(GTK_WIDGET(priv->title), label_width, -1);
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
408 gtk_label_set_line_wrap(priv->title, TRUE);
22699
7e5d7ebcd24e Make the labels in the minidialogs selectable.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22491
diff changeset
409 gtk_label_set_selectable(priv->title, TRUE);
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
410 gtk_misc_set_alignment(GTK_MISC(priv->title), 0, 0);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
411
21403
0f029f9a75e1 Make PidginMiniDialog do more things right when used as a GtkContainer. _add,
Will Thompson <will.thompson@collabora.co.uk>
parents: 21402
diff changeset
412 gtk_box_pack_start(priv->title_box, GTK_WIDGET(priv->icon), FALSE, FALSE, 0);
0f029f9a75e1 Make PidginMiniDialog do more things right when used as a GtkContainer. _add,
Will Thompson <will.thompson@collabora.co.uk>
parents: 21402
diff changeset
413 gtk_box_pack_start(priv->title_box, GTK_WIDGET(priv->title), TRUE, TRUE, 0);
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
414
21412
2f818256ae62 Remove a redundant hbox around PidginMiniDialog's description label.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21409
diff changeset
415 priv->desc = GTK_LABEL(gtk_label_new(NULL));
21414
c972c9311221 De-magic-number (and correct) the width request of PidginMiniDialog's labels.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21412
diff changeset
416 gtk_widget_set_size_request(GTK_WIDGET(priv->desc), label_width, -1);
21403
0f029f9a75e1 Make PidginMiniDialog do more things right when used as a GtkContainer. _add,
Will Thompson <will.thompson@collabora.co.uk>
parents: 21402
diff changeset
417 gtk_label_set_line_wrap(priv->desc, TRUE);
0f029f9a75e1 Make PidginMiniDialog do more things right when used as a GtkContainer. _add,
Will Thompson <will.thompson@collabora.co.uk>
parents: 21402
diff changeset
418 gtk_misc_set_alignment(GTK_MISC(priv->desc), 0, 0);
22699
7e5d7ebcd24e Make the labels in the minidialogs selectable.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22491
diff changeset
419 gtk_label_set_selectable(priv->desc, TRUE);
21415
5203f3836da5 Really actually hide the description label inside a minidialog, even when
Will Thompson <will.thompson@collabora.co.uk>
parents: 21414
diff changeset
420 /* make calling show_all() on the minidialog not affect desc even though
5203f3836da5 Really actually hide the description label inside a minidialog, even when
Will Thompson <will.thompson@collabora.co.uk>
parents: 21414
diff changeset
421 * it's packed inside it.
5203f3836da5 Really actually hide the description label inside a minidialog, even when
Will Thompson <will.thompson@collabora.co.uk>
parents: 21414
diff changeset
422 */
5203f3836da5 Really actually hide the description label inside a minidialog, even when
Will Thompson <will.thompson@collabora.co.uk>
parents: 21414
diff changeset
423 g_object_set(G_OBJECT(priv->desc), "no-show-all", TRUE, NULL);
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
424
21417
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
425 purple_prefs_connect_callback(self, BLIST_WIDTH_PREF,
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
426 blist_width_changed_cb, self);
21bea7c72a80 Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21415
diff changeset
427
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
428 self->contents = GTK_BOX(gtk_vbox_new(FALSE, 0));
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
429
21403
0f029f9a75e1 Make PidginMiniDialog do more things right when used as a GtkContainer. _add,
Will Thompson <will.thompson@collabora.co.uk>
parents: 21402
diff changeset
430 priv->buttons = GTK_BOX(gtk_hbox_new(FALSE, 0));
0f029f9a75e1 Make PidginMiniDialog do more things right when used as a GtkContainer. _add,
Will Thompson <will.thompson@collabora.co.uk>
parents: 21402
diff changeset
431
0f029f9a75e1 Make PidginMiniDialog do more things right when used as a GtkContainer. _add,
Will Thompson <will.thompson@collabora.co.uk>
parents: 21402
diff changeset
432 gtk_box_pack_start(self_box, GTK_WIDGET(priv->title_box), FALSE, FALSE, 0);
21412
2f818256ae62 Remove a redundant hbox around PidginMiniDialog's description label.
Will Thompson <will.thompson@collabora.co.uk>
parents: 21409
diff changeset
433 gtk_box_pack_start(self_box, GTK_WIDGET(priv->desc), FALSE, FALSE, 0);
21402
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
434 gtk_box_pack_start(self_box, GTK_WIDGET(self->contents), TRUE, TRUE, 0);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
435 gtk_box_pack_start(self_box, GTK_WIDGET(priv->buttons), FALSE, FALSE, 0);
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
436
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
437 gtk_widget_show_all(GTK_WIDGET(self));
9fef5d307a27 Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff changeset
438 }