Mercurial > pidgin.yaz
annotate pidgin/minidialog.c @ 27154:cb3e89f5a2d5
disapproval of revision '31f78d91abb7452e597bbd0f20f910c6cbb56099'
This is annoying me and wasn't helpful for the Adium bug.
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Sat, 27 Jun 2009 17:50:35 +0000 |
parents | 1a94a964bddf |
children | 2dcff225172e |
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 | 27 #include "internal.h" |
28 | |
26588
1a94a964bddf
More updates for GTK+ 3.0. This only fixes the single-includes. Fixing all
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22699
diff
changeset
|
29 #include <gtk/gtk.h> |
21402
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
30 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
31 #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
|
32 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
33 #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
|
34 #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
|
35 #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
|
36 |
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
|
37 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
|
38 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
|
39 |
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 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
|
41 |
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 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
|
43 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
|
44 { |
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 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
|
46 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
|
47 } |
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 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
|
50 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
|
51 { |
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 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
|
53 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
|
54 { |
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 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
|
56 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
|
57 (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
|
58 (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
|
59 (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
|
60 (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
|
61 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
|
62 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
|
63 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
|
64 (GInstanceInitFunc) pidgin_mini_dialog_init, |
21926 | 65 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
|
66 }; |
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 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
|
68 "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
|
69 } |
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 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
|
71 } |
21402
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
72 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
73 enum |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
74 { |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
75 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
|
76 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
|
77 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
|
78 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
79 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
|
80 } HazeConnectionProperties; |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
81 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
82 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
|
83 { |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
84 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
|
85 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
|
86 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
|
87 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
|
88 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
|
89 |
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 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
|
91 } PidginMiniDialogPrivate; |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
92 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
93 #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
|
94 ((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
|
95 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
96 PidginMiniDialog * |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
97 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
|
98 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
|
99 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
|
100 { |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
101 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
|
102 "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
|
103 "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
|
104 "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
|
105 NULL); |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
106 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
107 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
|
108 } |
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 void |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
111 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
|
112 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
|
113 { |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
114 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
|
115 } |
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 void |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
118 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
|
119 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
|
120 { |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
121 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
|
122 } |
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 void |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
125 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
|
126 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
|
127 { |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
128 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
|
129 } |
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 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
|
132 { |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
133 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
|
134 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
|
135 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
|
136 }; |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
137 |
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
|
138 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
|
139 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
|
140 { |
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 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
|
142 } |
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 |
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
|
144 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
|
145 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
|
146 { |
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 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
|
148 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
|
149 } |
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 |
21402
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
151 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
|
152 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
|
153 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
|
154 { |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
155 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
|
156 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
|
157 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
|
158 |
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 /* 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
|
160 * 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
|
161 * 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
|
162 */ |
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 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
|
164 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
|
165 |
22316
4345e7aaa7d4
Don't call NULL callbacks. Fixes #4901
Stu Tomlinson <stu@nosnilmot.com>
parents:
21926
diff
changeset
|
166 if (data->callback != NULL) |
4345e7aaa7d4
Don't call NULL callbacks. Fixes #4901
Stu Tomlinson <stu@nosnilmot.com>
parents:
21926
diff
changeset
|
167 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
|
168 |
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 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
|
172 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
|
173 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
|
174 { |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
175 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
|
176 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
|
177 } |
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 void |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
180 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
|
181 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
|
182 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
|
183 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
|
184 { |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
185 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
|
186 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
|
187 = 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
|
188 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
|
189 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
|
190 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
|
191 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
|
192 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
193 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
|
194 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
|
195 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
196 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
|
197 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
|
198 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
|
199 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
|
200 (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
|
201 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
|
202 (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
|
203 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
204 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
|
205 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
|
206 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
207 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
|
208 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
|
209 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
|
210 } |
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 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
|
213 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
|
214 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
|
215 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
|
216 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
|
217 { |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
218 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
|
219 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
|
220 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
221 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
|
222 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
|
223 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
|
224 break; |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
225 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
|
226 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
|
227 break; |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
228 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
|
229 { |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
230 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
|
231 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
|
232 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
|
233 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
|
234 break; |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
235 } |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
236 default: |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
237 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
|
238 } |
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 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
|
242 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
|
243 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
|
244 { |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
245 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
|
246 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
247 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
|
248 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
|
249 "<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
|
250 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
|
251 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
252 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
|
253 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
254 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
|
255 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
|
256 } |
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 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
|
259 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
|
260 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
|
261 { |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
262 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
|
263 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
|
264 { |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
265 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
|
266 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
|
267 "<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
|
268 |
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
|
269 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
|
270 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
271 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
|
272 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
|
273 |
21412
2f818256ae62
Remove a redundant hbox around PidginMiniDialog's description label.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21409
diff
changeset
|
274 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
|
275 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
|
276 } |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
277 else |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
278 { |
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
|
279 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
|
280 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
|
281 /* 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
|
282 * 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
|
283 */ |
21415
5203f3836da5
Really actually hide the description label inside a minidialog, even when
Will Thompson <will.thompson@collabora.co.uk>
parents:
21414
diff
changeset
|
284 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
|
285 } |
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 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
|
289 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
|
290 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
|
291 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
|
292 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
|
293 { |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
294 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
|
295 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
|
296 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
297 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
|
298 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
|
299 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
|
300 break; |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
301 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
|
302 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
|
303 break; |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
304 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
|
305 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
|
306 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
|
307 break; |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
308 default: |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
309 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
|
310 } |
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 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
|
314 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
|
315 { |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
316 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
|
317 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
|
318 |
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
|
319 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
|
320 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
|
321 |
21402
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
322 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
|
323 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
|
324 |
21417
21bea7c72a80
Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21415
diff
changeset
|
325 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
|
326 |
21402
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
327 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
|
328 } |
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 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
|
331 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
|
332 { |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
333 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
|
334 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
|
335 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
336 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
|
337 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
|
338 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
|
339 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
340 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
|
341 "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
|
342 #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
|
343 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
|
344 #endif |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
345 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
|
346 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
|
347 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
348 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
|
349 "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
|
350 #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
|
351 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
|
352 #endif |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
353 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
|
354 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
|
355 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
356 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
|
357 "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
|
358 NULL, |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
359 #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
|
360 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
|
361 #endif |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
362 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
|
363 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
|
364 } |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
365 |
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
|
366 /* 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
|
367 #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
|
368 ((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
|
369 |
21417
21bea7c72a80
Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21415
diff
changeset
|
370 #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
|
371 (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
|
372 |
21bea7c72a80
Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21415
diff
changeset
|
373 static void |
21bea7c72a80
Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21415
diff
changeset
|
374 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
|
375 PurplePrefType type, |
21bea7c72a80
Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21415
diff
changeset
|
376 gconstpointer val, |
21bea7c72a80
Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21415
diff
changeset
|
377 gpointer data) |
21bea7c72a80
Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21415
diff
changeset
|
378 { |
21bea7c72a80
Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21415
diff
changeset
|
379 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
|
380 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
|
381 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
|
382 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
|
383 |
21bea7c72a80
Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21415
diff
changeset
|
384 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
|
385 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
|
386 } |
21bea7c72a80
Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21415
diff
changeset
|
387 |
21402
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
388 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
|
389 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
|
390 { |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
391 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
|
392 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
|
393 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
|
394 |
21402
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
395 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
|
396 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
|
397 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
398 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
|
399 |
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
|
400 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
|
401 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
402 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
|
403 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
|
404 |
21412
2f818256ae62
Remove a redundant hbox around PidginMiniDialog's description label.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21409
diff
changeset
|
405 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
|
406 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
|
407 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
|
408 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
|
409 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
|
410 |
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
|
411 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
|
412 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
|
413 |
21412
2f818256ae62
Remove a redundant hbox around PidginMiniDialog's description label.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21409
diff
changeset
|
414 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
|
415 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
|
416 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
|
417 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
|
418 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
|
419 /* 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
|
420 * 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
|
421 */ |
5203f3836da5
Really actually hide the description label inside a minidialog, even when
Will Thompson <will.thompson@collabora.co.uk>
parents:
21414
diff
changeset
|
422 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
|
423 |
21417
21bea7c72a80
Make mini-dialogs follow the blist's size changes.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21415
diff
changeset
|
424 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
|
425 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
|
426 |
21402
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
427 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
|
428 |
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
|
429 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
|
430 |
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 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
|
432 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
|
433 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
|
434 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
|
435 |
9fef5d307a27
Create a PidginMiniDialog widget; make pidgin_make_mini_dialog() in gtkutils.c
Will Thompson <will.thompson@collabora.co.uk>
parents:
diff
changeset
|
436 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
|
437 } |