Tue, 27 Jul 2021 02:24:48 -0500
Use Meson summary() function.
Now that we require at least 0.52, we can use Meson's builtin summary printing to display the results of configuration.
Testing Done:
Configured with defaults, and with pixmaps disabled to trigger the warning: https://asciinema.org/a/mV2oxOoVCJNdmrPwgqqUJ3mkU?t=17
Reviewed at https://reviews.imfreedom.org/r/848/
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
1 | /* pidgin |
| 8113 | 2 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
3 | * Pidgin is the legal property of its developers, whose names are too numerous |
|
8146
4961c9c5fd61
[gaim-migrate @ 8854]
John Silvestri <john.silvestri@gmail.com>
parents:
8143
diff
changeset
|
4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
4961c9c5fd61
[gaim-migrate @ 8854]
John Silvestri <john.silvestri@gmail.com>
parents:
8143
diff
changeset
|
5 | * source distribution. |
| 8113 | 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify | |
| 8 | * it under the terms of the GNU General Public License as published by | |
| 9 | * the Free Software Foundation; either version 2 of the License, or | |
| 10 | * (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU General Public License | |
| 18 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18122
diff
changeset
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 8113 | 20 | */ |
| 21 | ||
|
40439
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
22 | #include <glib/gi18n-lib.h> |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
23 | |
|
40496
6941fece679b
phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
24 | #include <gtk/gtk.h> |
|
6941fece679b
phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
25 | |
|
6941fece679b
phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
26 | #include <purple.h> |
|
6941fece679b
phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
27 | |
|
6941fece679b
phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
28 | #include "gtkroomlist.h" |
|
6941fece679b
phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
29 | |
| 8113 | 30 | #include "gtkutils.h" |
|
39785
aa7e3b71802d
Split pidgin_account_option_menu into its own files.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
31 | #include "pidginaccountchooser.h" |
|
15883
969b74a3e27a
According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@pidgin.im>
parents:
15882
diff
changeset
|
32 | #include "pidginstock.h" |
|
21903
5b5ad54ae1da
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21741
diff
changeset
|
33 | |
|
40250
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
34 | #define PIDGIN_TYPE_ROOMLIST_DIALOG (pidgin_roomlist_dialog_get_type()) |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
35 | G_DECLARE_FINAL_TYPE(PidginRoomlistDialog, pidgin_roomlist_dialog, PIDGIN, |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
36 | ROOMLIST_DIALOG, GtkDialog) |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
37 | |
|
40898
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
38 | #define PIDGIN_ROOMLIST_UI_DATA "pidgin-ui" |
|
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
39 | |
|
40250
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
40 | struct _PidginRoomlistDialog { |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
41 | GtkDialog parent; |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
42 | |
| 8113 | 43 | GtkWidget *account_widget; |
| 44 | GtkWidget *progress; | |
| 45 | GtkWidget *sw; | |
| 46 | ||
| 8199 | 47 | GtkWidget *stop_button; |
| 8113 | 48 | GtkWidget *list_button; |
|
12896
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
49 | GtkWidget *add_button; |
| 8199 | 50 | GtkWidget *join_button; |
| 8113 | 51 | GtkWidget *close_button; |
| 52 | ||
| 15884 | 53 | PurpleAccount *account; |
| 54 | PurpleRoomlist *roomlist; | |
| 8230 | 55 | |
| 56 | gboolean pg_needs_pulse; | |
| 57 | guint pg_update_to; | |
|
40250
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
58 | }; |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
59 | |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
60 | G_DEFINE_TYPE(PidginRoomlistDialog, pidgin_roomlist_dialog, GTK_TYPE_DIALOG) |
| 14649 | 61 | |
|
39556
622bf98df0ac
Remove unnecessary struct tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38707
diff
changeset
|
62 | typedef struct { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
63 | PidginRoomlistDialog *dialog; |
| 14649 | 64 | GtkTreeStore *model; |
| 65 | GtkWidget *tree; | |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35454
diff
changeset
|
66 | GHashTable *cats; /* Meow. */ |
| 14649 | 67 | gint num_rooms, total_rooms; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
68 | } PidginRoomlist; |
| 8113 | 69 | |
| 70 | enum { | |
| 71 | NAME_COLUMN = 0, | |
| 72 | ROOM_COLUMN, | |
| 73 | NUM_OF_COLUMNS, | |
| 74 | }; | |
| 75 | ||
| 76 | static gint delete_win_cb(GtkWidget *w, GdkEventAny *e, gpointer d) | |
| 77 | { | |
|
40250
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
78 | PidginRoomlistDialog *dialog = PIDGIN_ROOMLIST_DIALOG(w); |
| 8113 | 79 | |
| 15884 | 80 | if (dialog->roomlist && purple_roomlist_get_in_progress(dialog->roomlist)) |
| 81 | purple_roomlist_cancel_get_list(dialog->roomlist); | |
| 8199 | 82 | |
|
23918
ae3c8eb64659
Fix a race related to closing the roomlist window and do some minor cleanup.
Daniel Atallah <datallah@pidgin.im>
parents:
22131
diff
changeset
|
83 | if (dialog->pg_update_to > 0) |
|
38433
361c801c4536
Remove purple_timeout_* function usage
Mike Ruprecht <cmaiku@gmail.com>
parents:
37879
diff
changeset
|
84 | g_source_remove(dialog->pg_update_to); |
|
23918
ae3c8eb64659
Fix a race related to closing the roomlist window and do some minor cleanup.
Daniel Atallah <datallah@pidgin.im>
parents:
22131
diff
changeset
|
85 | |
| 8230 | 86 | if (dialog->roomlist) { |
|
40898
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
87 | PidginRoomlist *rl = NULL; |
|
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
88 | |
|
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
89 | rl = g_object_get_data(G_OBJECT(dialog->roomlist), |
|
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
90 | PIDGIN_ROOMLIST_UI_DATA); |
|
23918
ae3c8eb64659
Fix a race related to closing the roomlist window and do some minor cleanup.
Daniel Atallah <datallah@pidgin.im>
parents:
22131
diff
changeset
|
91 | |
|
ae3c8eb64659
Fix a race related to closing the roomlist window and do some minor cleanup.
Daniel Atallah <datallah@pidgin.im>
parents:
22131
diff
changeset
|
92 | if (dialog->pg_update_to > 0) |
| 8230 | 93 | /* yes, that's right, unref it twice. */ |
|
34932
1b74e5c63144
Use g_object_{ref|unref} instead of purple_roomlist_{ref|unref}
Ankit Vani <a@nevitus.org>
parents:
33271
diff
changeset
|
94 | g_object_unref(dialog->roomlist); |
|
23918
ae3c8eb64659
Fix a race related to closing the roomlist window and do some minor cleanup.
Daniel Atallah <datallah@pidgin.im>
parents:
22131
diff
changeset
|
95 | |
|
ae3c8eb64659
Fix a race related to closing the roomlist window and do some minor cleanup.
Daniel Atallah <datallah@pidgin.im>
parents:
22131
diff
changeset
|
96 | if (rl) |
|
ae3c8eb64659
Fix a race related to closing the roomlist window and do some minor cleanup.
Daniel Atallah <datallah@pidgin.im>
parents:
22131
diff
changeset
|
97 | rl->dialog = NULL; |
|
34932
1b74e5c63144
Use g_object_{ref|unref} instead of purple_roomlist_{ref|unref}
Ankit Vani <a@nevitus.org>
parents:
33271
diff
changeset
|
98 | g_object_unref(dialog->roomlist); |
| 8230 | 99 | } |
| 100 | ||
|
23918
ae3c8eb64659
Fix a race related to closing the roomlist window and do some minor cleanup.
Daniel Atallah <datallah@pidgin.im>
parents:
22131
diff
changeset
|
101 | dialog->progress = NULL; |
| 8113 | 102 | |
| 103 | return FALSE; | |
| 104 | } | |
| 105 | ||
|
39787
af7ae86ee287
Remove callback from account chooser constructor.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39786
diff
changeset
|
106 | static void |
|
40534
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
107 | dialog_select_account_cb(GtkWidget *w, PidginRoomlistDialog *dialog) { |
|
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
108 | PidginAccountChooser *chooser = PIDGIN_ACCOUNT_CHOOSER(w); |
|
39787
af7ae86ee287
Remove callback from account chooser constructor.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39786
diff
changeset
|
109 | PurpleAccount *account = pidgin_account_chooser_get_selected(chooser); |
|
28704
0c1d6f63740f
When switching the account in the Disco / Room List dialogs, kill the visible
Paul Aurich <darkrain42@pidgin.im>
parents:
26574
diff
changeset
|
110 | gboolean change = (account != dialog->account); |
| 8113 | 111 | dialog->account = account; |
|
28704
0c1d6f63740f
When switching the account in the Disco / Room List dialogs, kill the visible
Paul Aurich <darkrain42@pidgin.im>
parents:
26574
diff
changeset
|
112 | |
|
0c1d6f63740f
When switching the account in the Disco / Room List dialogs, kill the visible
Paul Aurich <darkrain42@pidgin.im>
parents:
26574
diff
changeset
|
113 | if (change && dialog->roomlist) { |
|
40898
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
114 | PidginRoomlist *rl = NULL; |
|
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
115 | |
|
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
116 | rl = g_object_get_data(G_OBJECT(dialog->roomlist), |
|
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
117 | PIDGIN_ROOMLIST_UI_DATA); |
|
28704
0c1d6f63740f
When switching the account in the Disco / Room List dialogs, kill the visible
Paul Aurich <darkrain42@pidgin.im>
parents:
26574
diff
changeset
|
118 | if (rl->tree) { |
|
0c1d6f63740f
When switching the account in the Disco / Room List dialogs, kill the visible
Paul Aurich <darkrain42@pidgin.im>
parents:
26574
diff
changeset
|
119 | gtk_widget_destroy(rl->tree); |
|
0c1d6f63740f
When switching the account in the Disco / Room List dialogs, kill the visible
Paul Aurich <darkrain42@pidgin.im>
parents:
26574
diff
changeset
|
120 | rl->tree = NULL; |
|
0c1d6f63740f
When switching the account in the Disco / Room List dialogs, kill the visible
Paul Aurich <darkrain42@pidgin.im>
parents:
26574
diff
changeset
|
121 | } |
|
34932
1b74e5c63144
Use g_object_{ref|unref} instead of purple_roomlist_{ref|unref}
Ankit Vani <a@nevitus.org>
parents:
33271
diff
changeset
|
122 | g_object_unref(dialog->roomlist); |
|
28704
0c1d6f63740f
When switching the account in the Disco / Room List dialogs, kill the visible
Paul Aurich <darkrain42@pidgin.im>
parents:
26574
diff
changeset
|
123 | dialog->roomlist = NULL; |
|
0c1d6f63740f
When switching the account in the Disco / Room List dialogs, kill the visible
Paul Aurich <darkrain42@pidgin.im>
parents:
26574
diff
changeset
|
124 | } |
| 8113 | 125 | } |
| 126 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
127 | static void list_button_cb(GtkButton *button, PidginRoomlistDialog *dialog) |
| 8113 | 128 | { |
| 15884 | 129 | PurpleConnection *gc; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
130 | PidginRoomlist *rl; |
| 8113 | 131 | |
| 15884 | 132 | gc = purple_account_get_connection(dialog->account); |
| 8113 | 133 | if (!gc) |
| 134 | return; | |
| 135 | ||
| 8199 | 136 | if (dialog->roomlist != NULL) { |
|
40898
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
137 | rl = g_object_get_data(G_OBJECT(dialog->roomlist), |
|
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
138 | PIDGIN_ROOMLIST_UI_DATA); |
|
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
139 | |
| 8199 | 140 | gtk_widget_destroy(rl->tree); |
|
34932
1b74e5c63144
Use g_object_{ref|unref} instead of purple_roomlist_{ref|unref}
Ankit Vani <a@nevitus.org>
parents:
33271
diff
changeset
|
141 | g_object_unref(dialog->roomlist); |
| 8199 | 142 | } |
| 143 | ||
| 15884 | 144 | dialog->roomlist = purple_roomlist_get_list(gc); |
| 9159 | 145 | if (!dialog->roomlist) |
| 146 | return; | |
|
34932
1b74e5c63144
Use g_object_{ref|unref} instead of purple_roomlist_{ref|unref}
Ankit Vani <a@nevitus.org>
parents:
33271
diff
changeset
|
147 | g_object_ref(dialog->roomlist); |
|
40898
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
148 | |
|
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
149 | rl = g_object_get_data(G_OBJECT(dialog->roomlist), |
|
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
150 | PIDGIN_ROOMLIST_UI_DATA); |
| 8113 | 151 | rl->dialog = dialog; |
| 8199 | 152 | |
|
40250
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
153 | gtk_widget_set_sensitive(dialog->account_widget, FALSE); |
| 8199 | 154 | |
| 155 | gtk_container_add(GTK_CONTAINER(dialog->sw), rl->tree); | |
| 156 | ||
| 15884 | 157 | /* some protocols (not bundled with libpurple) finish getting their |
| 15350 | 158 | * room list immediately */ |
| 15884 | 159 | if(purple_roomlist_get_in_progress(dialog->roomlist)) { |
| 15350 | 160 | gtk_widget_set_sensitive(dialog->stop_button, TRUE); |
| 161 | gtk_widget_set_sensitive(dialog->list_button, FALSE); | |
| 162 | } else { | |
| 163 | gtk_widget_set_sensitive(dialog->stop_button, FALSE); | |
| 164 | gtk_widget_set_sensitive(dialog->list_button, TRUE); | |
| 165 | } | |
|
12896
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
166 | gtk_widget_set_sensitive(dialog->add_button, FALSE); |
| 8199 | 167 | gtk_widget_set_sensitive(dialog->join_button, FALSE); |
| 8113 | 168 | } |
| 169 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
170 | static void stop_button_cb(GtkButton *button, PidginRoomlistDialog *dialog) |
| 8113 | 171 | { |
| 15884 | 172 | purple_roomlist_cancel_get_list(dialog->roomlist); |
| 8199 | 173 | |
|
40250
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
174 | gtk_widget_set_sensitive(dialog->account_widget, TRUE); |
| 8199 | 175 | |
| 176 | gtk_widget_set_sensitive(dialog->stop_button, FALSE); | |
| 177 | gtk_widget_set_sensitive(dialog->list_button, TRUE); | |
|
12896
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
178 | gtk_widget_set_sensitive(dialog->add_button, FALSE); |
| 8199 | 179 | gtk_widget_set_sensitive(dialog->join_button, FALSE); |
| 8113 | 180 | } |
| 181 | ||
| 182 | struct _menu_cb_info { | |
| 15884 | 183 | PurpleRoomlist *list; |
| 184 | PurpleRoomlistRoom *room; | |
| 8113 | 185 | }; |
| 186 | ||
| 8199 | 187 | static void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
188 | selection_changed_cb(GtkTreeSelection *selection, PidginRoomlist *grl) { |
| 8199 | 189 | GtkTreeIter iter; |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12286
diff
changeset
|
190 | GValue val; |
| 15884 | 191 | PurpleRoomlistRoom *room; |
| 8199 | 192 | static struct _menu_cb_info *info; |
|
23918
ae3c8eb64659
Fix a race related to closing the roomlist window and do some minor cleanup.
Daniel Atallah <datallah@pidgin.im>
parents:
22131
diff
changeset
|
193 | PidginRoomlistDialog *dialog = grl->dialog; |
| 8199 | 194 | |
| 195 | if (gtk_tree_selection_get_selected(selection, NULL, &iter)) { | |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12286
diff
changeset
|
196 | val.g_type = 0; |
| 8199 | 197 | gtk_tree_model_get_value(GTK_TREE_MODEL(grl->model), &iter, ROOM_COLUMN, &val); |
| 198 | room = g_value_get_pointer(&val); | |
|
35021
eaf8156d3c5e
Renamed purple_roomlist_room_get_type to *_get_room_type, purple_roomlist_field_get_type to *_get_field_type
Ankit Vani <a@nevitus.org>
parents:
34932
diff
changeset
|
199 | if (!room || !(purple_roomlist_room_get_room_type(room) & PURPLE_ROOMLIST_ROOMTYPE_ROOM)) { |
| 8199 | 200 | gtk_widget_set_sensitive(dialog->join_button, FALSE); |
|
12896
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
201 | gtk_widget_set_sensitive(dialog->add_button, FALSE); |
| 8199 | 202 | return; |
| 203 | } | |
| 204 | ||
| 205 | info = g_new0(struct _menu_cb_info, 1); | |
| 206 | info->list = dialog->roomlist; | |
| 207 | info->room = room; | |
| 208 | ||
| 8377 | 209 | g_object_set_data_full(G_OBJECT(dialog->join_button), "room-info", |
|
12896
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
210 | info, g_free); |
|
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
211 | g_object_set_data(G_OBJECT(dialog->add_button), "room-info", info); |
| 8199 | 212 | |
|
12896
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
213 | gtk_widget_set_sensitive(dialog->add_button, TRUE); |
| 8199 | 214 | gtk_widget_set_sensitive(dialog->join_button, TRUE); |
| 215 | } else { | |
|
12896
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
216 | gtk_widget_set_sensitive(dialog->add_button, FALSE); |
| 8199 | 217 | gtk_widget_set_sensitive(dialog->join_button, FALSE); |
| 218 | } | |
| 219 | } | |
| 220 | ||
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
221 | static void |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
222 | do_add_room_cb(G_GNUC_UNUSED GtkWidget *w, struct _menu_cb_info *info) |
|
12896
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
223 | { |
| 15185 | 224 | char *name; |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
225 | PurpleAccount *account = purple_roomlist_get_account(info->list); |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
226 | PurpleConnection *gc = purple_account_get_connection(account); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36424
diff
changeset
|
227 | PurpleProtocol *protocol = NULL; |
| 15185 | 228 | |
| 229 | if(gc != NULL) | |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
230 | protocol = purple_connection_get_protocol(gc); |
| 15185 | 231 | |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39556
diff
changeset
|
232 | if(protocol != NULL && PURPLE_PROTOCOL_IMPLEMENTS(protocol, ROOMLIST, room_serialize)) |
| 36719 | 233 | name = purple_protocol_roomlist_iface_room_serialize(protocol, info->room); |
| 15185 | 234 | else |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
235 | name = g_strdup(purple_roomlist_room_get_name(info->room)); |
| 15185 | 236 | |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
237 | purple_blist_request_add_chat(account, NULL, NULL, name); |
| 15185 | 238 | |
| 239 | g_free(name); | |
|
12896
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
240 | } |
|
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
241 | |
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
242 | static void |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
243 | add_room_to_blist_cb(GtkButton *button, G_GNUC_UNUSED gpointer data) |
|
12896
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
244 | { |
|
23918
ae3c8eb64659
Fix a race related to closing the roomlist window and do some minor cleanup.
Daniel Atallah <datallah@pidgin.im>
parents:
22131
diff
changeset
|
245 | struct _menu_cb_info *info = g_object_get_data(G_OBJECT(button), "room-info"); |
|
12896
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
246 | |
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
247 | if(info != NULL) { |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
248 | do_add_room_cb(NULL, info); |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
249 | } |
|
12896
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
250 | } |
|
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
251 | |
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
252 | static void |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
253 | do_join_cb(G_GNUC_UNUSED GtkWidget *w, struct _menu_cb_info *info) |
| 8113 | 254 | { |
| 15884 | 255 | purple_roomlist_room_join(info->list, info->room); |
| 8199 | 256 | } |
| 8113 | 257 | |
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
258 | static void |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
259 | join_button_cb(GtkButton *button, G_GNUC_UNUSED gpointer data) |
| 8199 | 260 | { |
|
23918
ae3c8eb64659
Fix a race related to closing the roomlist window and do some minor cleanup.
Daniel Atallah <datallah@pidgin.im>
parents:
22131
diff
changeset
|
261 | struct _menu_cb_info *info = g_object_get_data(G_OBJECT(button), "room-info"); |
|
12896
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
262 | |
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
263 | if(info != NULL) { |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
264 | do_join_cb(NULL, info); |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
265 | } |
| 8113 | 266 | } |
| 267 | ||
| 268 | static void row_activated_cb(GtkTreeView *tv, GtkTreePath *path, GtkTreeViewColumn *arg2, | |
| 15884 | 269 | PurpleRoomlist *list) |
| 8113 | 270 | { |
|
40898
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
271 | PidginRoomlist *grl = NULL; |
| 8113 | 272 | GtkTreeIter iter; |
| 15884 | 273 | PurpleRoomlistRoom *room; |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12286
diff
changeset
|
274 | GValue val; |
| 8113 | 275 | struct _menu_cb_info info; |
| 276 | ||
|
40898
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
277 | grl = g_object_get_data(G_OBJECT(list), PIDGIN_ROOMLIST_UI_DATA); |
|
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
278 | |
| 8113 | 279 | gtk_tree_model_get_iter(GTK_TREE_MODEL(grl->model), &iter, path); |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12286
diff
changeset
|
280 | val.g_type = 0; |
| 8113 | 281 | gtk_tree_model_get_value(GTK_TREE_MODEL(grl->model), &iter, ROOM_COLUMN, &val); |
| 282 | room = g_value_get_pointer(&val); | |
|
35021
eaf8156d3c5e
Renamed purple_roomlist_room_get_type to *_get_room_type, purple_roomlist_field_get_type to *_get_field_type
Ankit Vani <a@nevitus.org>
parents:
34932
diff
changeset
|
283 | if (!room || !(purple_roomlist_room_get_room_type(room) & PURPLE_ROOMLIST_ROOMTYPE_ROOM)) |
| 8113 | 284 | return; |
| 285 | ||
| 286 | info.list = list; | |
| 287 | info.room = room; | |
| 288 | ||
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
289 | do_join_cb(NULL, &info); |
| 8113 | 290 | } |
| 291 | ||
| 15884 | 292 | static gboolean room_click_cb(GtkWidget *tv, GdkEventButton *event, PurpleRoomlist *list) |
| 8113 | 293 | { |
| 294 | GtkTreePath *path; | |
|
40898
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
295 | PidginRoomlist *grl = NULL; |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12286
diff
changeset
|
296 | GValue val; |
| 15884 | 297 | PurpleRoomlistRoom *room; |
| 8113 | 298 | GtkTreeIter iter; |
| 299 | GtkWidget *menu; | |
|
40943
5ba96262ca35
Drop icons from Room List popup menu.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40942
diff
changeset
|
300 | GtkWidget *menuitem; |
| 8113 | 301 | static struct _menu_cb_info info; /* XXX? */ |
| 302 | ||
|
38705
62a7a975251a
Use gdk_event_triggers_context_menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38583
diff
changeset
|
303 | if (!gdk_event_triggers_context_menu((GdkEvent *)event)) |
| 8113 | 304 | return FALSE; |
| 305 | ||
|
40898
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
306 | grl = g_object_get_data(G_OBJECT(list), PIDGIN_ROOMLIST_UI_DATA); |
|
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
307 | |
| 8113 | 308 | /* Here we figure out which room was clicked */ |
| 309 | if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(tv), event->x, event->y, &path, NULL, NULL, NULL)) | |
| 310 | return FALSE; | |
| 311 | gtk_tree_model_get_iter(GTK_TREE_MODEL(grl->model), &iter, path); | |
| 312 | gtk_tree_path_free(path); | |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12286
diff
changeset
|
313 | val.g_type = 0; |
| 8113 | 314 | gtk_tree_model_get_value (GTK_TREE_MODEL(grl->model), &iter, ROOM_COLUMN, &val); |
| 315 | room = g_value_get_pointer(&val); | |
| 316 | ||
|
35021
eaf8156d3c5e
Renamed purple_roomlist_room_get_type to *_get_room_type, purple_roomlist_field_get_type to *_get_field_type
Ankit Vani <a@nevitus.org>
parents:
34932
diff
changeset
|
317 | if (!room || !(purple_roomlist_room_get_room_type(room) & PURPLE_ROOMLIST_ROOMTYPE_ROOM)) |
| 8113 | 318 | return FALSE; |
| 319 | ||
| 320 | info.list = list; | |
| 321 | info.room = room; | |
| 322 | ||
| 323 | menu = gtk_menu_new(); | |
|
40943
5ba96262ca35
Drop icons from Room List popup menu.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40942
diff
changeset
|
324 | |
|
5ba96262ca35
Drop icons from Room List popup menu.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40942
diff
changeset
|
325 | menuitem = gtk_menu_item_new_with_mnemonic(_("_Join")); |
|
5ba96262ca35
Drop icons from Room List popup menu.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40942
diff
changeset
|
326 | g_signal_connect(G_OBJECT(menuitem), "activate", |
|
5ba96262ca35
Drop icons from Room List popup menu.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40942
diff
changeset
|
327 | G_CALLBACK(do_join_cb), &info); |
|
5ba96262ca35
Drop icons from Room List popup menu.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40942
diff
changeset
|
328 | gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); |
|
5ba96262ca35
Drop icons from Room List popup menu.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40942
diff
changeset
|
329 | |
|
5ba96262ca35
Drop icons from Room List popup menu.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40942
diff
changeset
|
330 | menuitem = gtk_menu_item_new_with_mnemonic(_("_Add")); |
|
5ba96262ca35
Drop icons from Room List popup menu.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40942
diff
changeset
|
331 | g_signal_connect(G_OBJECT(menuitem), "activate", |
|
5ba96262ca35
Drop icons from Room List popup menu.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40942
diff
changeset
|
332 | G_CALLBACK(do_add_room_cb), &info); |
|
5ba96262ca35
Drop icons from Room List popup menu.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40942
diff
changeset
|
333 | gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); |
| 8113 | 334 | |
| 335 | gtk_widget_show_all(menu); | |
|
38707
6f4d3ab2f2ed
Use gtk_menu_popup_at_pointer instead of gtk_menu_popup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38705
diff
changeset
|
336 | gtk_menu_popup_at_pointer(GTK_MENU(menu), (GdkEvent *)event); |
| 8113 | 337 | |
| 338 | return FALSE; | |
| 339 | } | |
| 340 | ||
| 341 | static void row_expanded_cb(GtkTreeView *treeview, GtkTreeIter *arg1, GtkTreePath *arg2, gpointer user_data) | |
| 342 | { | |
| 15884 | 343 | PurpleRoomlist *list = user_data; |
| 344 | PurpleRoomlistRoom *category; | |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12286
diff
changeset
|
345 | GValue val; |
| 8113 | 346 | |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12286
diff
changeset
|
347 | val.g_type = 0; |
| 8113 | 348 | gtk_tree_model_get_value(gtk_tree_view_get_model(treeview), arg1, ROOM_COLUMN, &val); |
| 8584 | 349 | category = g_value_get_pointer(&val); |
| 8113 | 350 | |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
351 | if (!purple_roomlist_room_get_expanded_once(category)) { |
| 15884 | 352 | purple_roomlist_expand_category(list, category); |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
353 | purple_roomlist_room_set_expanded_once(category, TRUE); |
| 8113 | 354 | } |
| 355 | } | |
| 356 | ||
|
21494
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
357 | #define SMALL_SPACE 6 |
|
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
358 | |
|
21903
5b5ad54ae1da
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21741
diff
changeset
|
359 | static gboolean |
|
40942
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
360 | pidgin_roomlist_query_tooltip(GtkWidget *widget, int x, int y, |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
361 | gboolean keyboard_mode, GtkTooltip *tooltip, |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
362 | gpointer data) |
|
21494
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
363 | { |
|
40942
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
364 | PurpleRoomlist *list = data; |
|
40898
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
365 | PidginRoomlist *grl = NULL; |
|
40942
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
366 | GtkTreePath *path = NULL; |
|
21494
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
367 | PurpleRoomlistRoom *room; |
|
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
368 | GtkTreeIter iter; |
|
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
369 | GValue val; |
|
40942
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
370 | gchar *name, *tmp; |
|
21494
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
371 | GString *tooltip_text = NULL; |
|
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
372 | GList *l, *k; |
|
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
373 | gint j; |
|
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
374 | gboolean first = TRUE; |
|
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
375 | |
|
40898
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
376 | grl = g_object_get_data(G_OBJECT(list), PIDGIN_ROOMLIST_UI_DATA); |
|
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
377 | |
|
40942
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
378 | if (keyboard_mode) { |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
379 | GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widget)); |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
380 | if (!gtk_tree_selection_get_selected(selection, NULL, &iter)) { |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
381 | return FALSE; |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
382 | } |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
383 | path = gtk_tree_model_get_path(GTK_TREE_MODEL(grl->model), &iter); |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
384 | } else { |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
385 | gint bx, by; |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
386 | |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
387 | gtk_tree_view_convert_widget_to_bin_window_coords(GTK_TREE_VIEW(widget), |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
388 | x, y, &bx, &by); |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
389 | gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(widget), bx, by, &path, |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
390 | NULL, NULL, NULL); |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
391 | if (path == NULL) { |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
392 | return FALSE; |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
393 | } |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
394 | |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
395 | if (!gtk_tree_model_get_iter(GTK_TREE_MODEL(grl->model), &iter, path)) { |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
396 | gtk_tree_path_free(path); |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
397 | return FALSE; |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
398 | } |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
399 | } |
|
21494
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
400 | |
|
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
401 | val.g_type = 0; |
|
40942
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
402 | gtk_tree_model_get_value(GTK_TREE_MODEL(grl->model), &iter, ROOM_COLUMN, |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
403 | &val); |
|
21494
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
404 | room = g_value_get_pointer(&val); |
|
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
405 | |
|
40942
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
406 | if (!room || |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
407 | !(purple_roomlist_room_get_room_type(room) & PURPLE_ROOMLIST_ROOMTYPE_ROOM)) |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
408 | { |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
409 | gtk_tree_path_free(path); |
|
21494
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
410 | return FALSE; |
|
40942
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
411 | } |
|
21494
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
412 | |
|
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
413 | tooltip_text = g_string_new(""); |
|
40942
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
414 | |
|
21494
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
415 | gtk_tree_model_get(GTK_TREE_MODEL(grl->model), &iter, NAME_COLUMN, &name, -1); |
|
40942
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
416 | tmp = g_markup_escape_text(name, -1); |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
417 | g_free(name); |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
418 | g_string_append_printf( |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
419 | tooltip_text, "<span size='x-large' weight='bold'>%s</span>\n", tmp); |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
420 | g_free(tmp); |
|
21494
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
421 | |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
422 | for (j = NUM_OF_COLUMNS, |
|
40942
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
423 | l = purple_roomlist_room_get_fields(room), |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
424 | k = purple_roomlist_get_fields(list); |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
425 | l && k; |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
426 | j++, l = l->next, k = k->next) |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
427 | { |
|
21494
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
428 | PurpleRoomlistField *f = k->data; |
|
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
429 | gchar *label; |
|
40942
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
430 | if (purple_roomlist_field_get_hidden(f)) { |
|
21494
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
431 | continue; |
|
40942
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
432 | } |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
433 | label = g_markup_escape_text(purple_roomlist_field_get_label(f), -1); |
|
35021
eaf8156d3c5e
Renamed purple_roomlist_room_get_type to *_get_room_type, purple_roomlist_field_get_type to *_get_field_type
Ankit Vani <a@nevitus.org>
parents:
34932
diff
changeset
|
434 | switch (purple_roomlist_field_get_field_type(f)) { |
|
21494
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
435 | case PURPLE_ROOMLIST_FIELD_BOOL: |
|
40942
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
436 | g_string_append_printf( |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
437 | tooltip_text, "%s<b>%s:</b> %s", first ? "" : "\n", label, |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
438 | l->data ? "True" : "False"); |
|
21494
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
439 | break; |
|
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
440 | case PURPLE_ROOMLIST_FIELD_INT: |
|
40942
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
441 | g_string_append_printf( |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
442 | tooltip_text, "%s<b>%s:</b> %d", first ? "" : "\n", label, |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
443 | GPOINTER_TO_INT(l->data)); |
|
21494
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
444 | break; |
|
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
445 | case PURPLE_ROOMLIST_FIELD_STRING: |
|
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
446 | tmp = g_markup_escape_text((char *)l->data, -1); |
|
40942
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
447 | g_string_append_printf( |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
448 | tooltip_text, "%s<b>%s:</b> %s", first ? "" : "\n", label, |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
449 | tmp); |
|
21494
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
450 | g_free(tmp); |
|
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
451 | break; |
|
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
452 | } |
|
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
453 | first = FALSE; |
|
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
454 | g_free(label); |
|
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
455 | } |
|
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
456 | |
|
40942
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
457 | gtk_tooltip_set_markup(tooltip, tooltip_text->str); |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
458 | gtk_tree_view_set_tooltip_row(GTK_TREE_VIEW(widget), tooltip, path); |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
459 | g_string_free(tooltip_text, TRUE); |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
460 | gtk_tree_path_free(path); |
|
21494
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
461 | |
|
21903
5b5ad54ae1da
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21741
diff
changeset
|
462 | return TRUE; |
|
21494
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
463 | } |
|
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
464 | |
| 15884 | 465 | static gboolean account_filter_func(PurpleAccount *account) |
| 8113 | 466 | { |
|
23918
ae3c8eb64659
Fix a race related to closing the roomlist window and do some minor cleanup.
Daniel Atallah <datallah@pidgin.im>
parents:
22131
diff
changeset
|
467 | PurpleConnection *conn = purple_account_get_connection(account); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36424
diff
changeset
|
468 | PurpleProtocol *protocol = NULL; |
|
8939
ec2ecc652447
[gaim-migrate @ 9709]
Mark Doliner <markdoliner@pidgin.im>
parents:
8937
diff
changeset
|
469 | |
|
24863
68c109ca0089
Fix a crash that happens when accessing the roomlist for an account that's
Paul Aurich <darkrain42@pidgin.im>
parents:
23918
diff
changeset
|
470 | if (conn && PURPLE_CONNECTION_IS_CONNECTED(conn)) |
|
36623
caaadef03507
Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
471 | protocol = purple_connection_get_protocol(conn); |
|
8939
ec2ecc652447
[gaim-migrate @ 9709]
Mark Doliner <markdoliner@pidgin.im>
parents:
8937
diff
changeset
|
472 | |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39556
diff
changeset
|
473 | return (protocol && PURPLE_PROTOCOL_IMPLEMENTS(protocol, ROOMLIST, get_list)); |
|
8939
ec2ecc652447
[gaim-migrate @ 9709]
Mark Doliner <markdoliner@pidgin.im>
parents:
8937
diff
changeset
|
474 | } |
|
ec2ecc652447
[gaim-migrate @ 9709]
Mark Doliner <markdoliner@pidgin.im>
parents:
8937
diff
changeset
|
475 | |
|
ec2ecc652447
[gaim-migrate @ 9709]
Mark Doliner <markdoliner@pidgin.im>
parents:
8937
diff
changeset
|
476 | gboolean |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
477 | pidgin_roomlist_is_showable() |
|
8939
ec2ecc652447
[gaim-migrate @ 9709]
Mark Doliner <markdoliner@pidgin.im>
parents:
8937
diff
changeset
|
478 | { |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
479 | GList *c; |
| 15884 | 480 | PurpleConnection *gc; |
| 8113 | 481 | |
| 15884 | 482 | for (c = purple_connections_get_all(); c != NULL; c = c->next) { |
|
8939
ec2ecc652447
[gaim-migrate @ 9709]
Mark Doliner <markdoliner@pidgin.im>
parents:
8937
diff
changeset
|
483 | gc = c->data; |
|
ec2ecc652447
[gaim-migrate @ 9709]
Mark Doliner <markdoliner@pidgin.im>
parents:
8937
diff
changeset
|
484 | |
| 15884 | 485 | if (account_filter_func(purple_connection_get_account(gc))) |
|
8939
ec2ecc652447
[gaim-migrate @ 9709]
Mark Doliner <markdoliner@pidgin.im>
parents:
8937
diff
changeset
|
486 | return TRUE; |
|
ec2ecc652447
[gaim-migrate @ 9709]
Mark Doliner <markdoliner@pidgin.im>
parents:
8937
diff
changeset
|
487 | } |
|
ec2ecc652447
[gaim-migrate @ 9709]
Mark Doliner <markdoliner@pidgin.im>
parents:
8937
diff
changeset
|
488 | |
|
ec2ecc652447
[gaim-migrate @ 9709]
Mark Doliner <markdoliner@pidgin.im>
parents:
8937
diff
changeset
|
489 | return FALSE; |
| 8113 | 490 | } |
| 491 | ||
|
40250
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
492 | static void |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
493 | pidgin_roomlist_dialog_class_init(PidginRoomlistDialogClass *klass) |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
494 | { |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
495 | GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
496 | |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
497 | gtk_widget_class_set_template_from_resource( |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
498 | widget_class, "/im/pidgin/Pidgin/Roomlist/roomlist.ui"); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
499 | |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
500 | gtk_widget_class_bind_template_child(widget_class, PidginRoomlistDialog, |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
501 | account_widget); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
502 | gtk_widget_class_bind_template_child(widget_class, PidginRoomlistDialog, |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
503 | add_button); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
504 | gtk_widget_class_bind_template_child(widget_class, PidginRoomlistDialog, |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
505 | close_button); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
506 | gtk_widget_class_bind_template_child(widget_class, PidginRoomlistDialog, |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
507 | join_button); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
508 | gtk_widget_class_bind_template_child(widget_class, PidginRoomlistDialog, |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
509 | list_button); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
510 | gtk_widget_class_bind_template_child(widget_class, PidginRoomlistDialog, |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
511 | progress); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
512 | gtk_widget_class_bind_template_child(widget_class, PidginRoomlistDialog, |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
513 | stop_button); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
514 | gtk_widget_class_bind_template_child(widget_class, PidginRoomlistDialog, |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
515 | sw); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
516 | |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
517 | gtk_widget_class_bind_template_callback(widget_class, |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
518 | add_room_to_blist_cb); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
519 | gtk_widget_class_bind_template_callback(widget_class, delete_win_cb); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
520 | gtk_widget_class_bind_template_callback(widget_class, |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
521 | dialog_select_account_cb); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
522 | gtk_widget_class_bind_template_callback(widget_class, join_button_cb); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
523 | gtk_widget_class_bind_template_callback(widget_class, list_button_cb); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
524 | gtk_widget_class_bind_template_callback(widget_class, stop_button_cb); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
525 | } |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
526 | |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
527 | static void |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
528 | pidgin_roomlist_dialog_init(PidginRoomlistDialog *self) |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
529 | { |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
530 | gtk_widget_init_template(GTK_WIDGET(self)); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
531 | |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
532 | pidgin_account_chooser_set_filter_func( |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
533 | PIDGIN_ACCOUNT_CHOOSER(self->account_widget), |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
534 | account_filter_func); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
535 | } |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
536 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
537 | static PidginRoomlistDialog * |
| 15884 | 538 | pidgin_roomlist_dialog_new_with_account(PurpleAccount *account) |
| 8113 | 539 | { |
|
40534
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
540 | PidginRoomlistDialog *dialog = NULL; |
|
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
541 | PidginAccountChooser *chooser = NULL; |
| 8113 | 542 | |
|
40250
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
543 | dialog = g_object_new(PIDGIN_TYPE_ROOMLIST_DIALOG, NULL); |
|
8937
b436e9cbd701
[gaim-migrate @ 9707]
Mark Doliner <markdoliner@pidgin.im>
parents:
8584
diff
changeset
|
544 | dialog->account = account; |
| 8113 | 545 | |
|
40534
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
546 | chooser = PIDGIN_ACCOUNT_CHOOSER(dialog->account_widget); |
|
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
547 | |
|
40250
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
548 | if (!account) { |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
549 | /* This is normally NULL, and we normally don't care what the |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
550 | * first selected item is */ |
|
40534
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
551 | dialog->account = pidgin_account_chooser_get_selected(chooser); |
|
40250
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
552 | } else { |
|
40534
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
553 | pidgin_account_chooser_set_selected(chooser, account); |
|
40250
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
554 | } |
| 8199 | 555 | |
| 556 | /* show the dialog window and return the dialog */ | |
|
40250
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
557 | gtk_widget_show(GTK_WIDGET(dialog)); |
| 8199 | 558 | |
| 8113 | 559 | return dialog; |
| 560 | } | |
| 561 | ||
| 15884 | 562 | void pidgin_roomlist_dialog_show_with_account(PurpleAccount *account) |
| 8352 | 563 | { |
|
23918
ae3c8eb64659
Fix a race related to closing the roomlist window and do some minor cleanup.
Daniel Atallah <datallah@pidgin.im>
parents:
22131
diff
changeset
|
564 | PidginRoomlistDialog *dialog = pidgin_roomlist_dialog_new_with_account(account); |
| 8352 | 565 | |
| 566 | if (!dialog) | |
| 567 | return; | |
| 568 | ||
| 569 | list_button_cb(GTK_BUTTON(dialog->list_button), dialog); | |
| 570 | } | |
| 571 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
572 | void pidgin_roomlist_dialog_show(void) |
| 8113 | 573 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
574 | pidgin_roomlist_dialog_new_with_account(NULL); |
| 8113 | 575 | } |
| 576 | ||
| 577 | static void int_cell_data_func(GtkTreeViewColumn *col, GtkCellRenderer *renderer, | |
| 578 | GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) | |
| 579 | { | |
| 580 | gchar buf[16]; | |
| 581 | int myint; | |
| 582 | ||
| 583 | gtk_tree_model_get(model, iter, GPOINTER_TO_INT(user_data), &myint, -1); | |
| 584 | ||
| 585 | if (myint) | |
| 586 | g_snprintf(buf, sizeof(buf), "%d", myint); | |
| 587 | else | |
| 588 | buf[0] = '\0'; | |
| 589 | ||
| 590 | g_object_set(renderer, "text", buf, NULL); | |
| 591 | } | |
| 592 | ||
| 593 | /* this sorts backwards on purpose, so that clicking name sorts a-z, while clicking users sorts | |
| 594 | infinity-0. you can still click again to reverse it on any of them. */ | |
| 595 | static gint int_sort_func(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer user_data) | |
| 596 | { | |
| 597 | int c, d; | |
| 598 | ||
| 599 | c = d = 0; | |
| 600 | ||
| 601 | gtk_tree_model_get(model, a, GPOINTER_TO_INT(user_data), &c, -1); | |
| 602 | gtk_tree_model_get(model, b, GPOINTER_TO_INT(user_data), &d, -1); | |
| 603 | ||
| 604 | if (c == d) | |
| 605 | return 0; | |
| 606 | else if (c > d) | |
| 607 | return -1; | |
| 608 | else | |
| 609 | return 1; | |
| 610 | } | |
| 611 | ||
|
11490
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
612 | static gboolean |
|
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
613 | _search_func(GtkTreeModel *model, gint column, const gchar *key, GtkTreeIter *iter, gpointer search_data) |
|
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
614 | { |
|
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
615 | gboolean result; |
|
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
616 | gchar *name, *fold, *fkey; |
|
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
617 | |
|
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
618 | gtk_tree_model_get(model, iter, column, &name, -1); |
|
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
619 | fold = g_utf8_casefold(name, -1); |
|
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
620 | fkey = g_utf8_casefold(key, -1); |
|
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
621 | |
|
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
622 | result = (g_strstr_len(fold, strlen(fold), fkey) == NULL); |
|
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
623 | |
|
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
624 | g_free(fold); |
|
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
625 | g_free(fkey); |
|
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
626 | g_free(name); |
|
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
627 | |
|
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
628 | return result; |
|
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
629 | } |
|
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
630 | |
| 15884 | 631 | static void pidgin_roomlist_set_fields(PurpleRoomlist *list, GList *fields) |
| 8113 | 632 | { |
|
40898
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
633 | PidginRoomlist *grl = NULL; |
| 8113 | 634 | gint columns = NUM_OF_COLUMNS; |
| 635 | int j; | |
| 636 | GtkTreeStore *model; | |
| 637 | GtkWidget *tree; | |
| 638 | GtkCellRenderer *renderer; | |
| 639 | GtkTreeViewColumn *column; | |
| 8199 | 640 | GtkTreeSelection *selection; |
| 8113 | 641 | GList *l; |
| 642 | GType *types; | |
| 643 | ||
|
40898
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
644 | grl = g_object_get_data(G_OBJECT(list), PIDGIN_ROOMLIST_UI_DATA); |
| 8113 | 645 | g_return_if_fail(grl != NULL); |
| 646 | ||
| 647 | columns += g_list_length(fields); | |
| 648 | types = g_new(GType, columns); | |
| 649 | ||
| 650 | types[NAME_COLUMN] = G_TYPE_STRING; | |
| 651 | types[ROOM_COLUMN] = G_TYPE_POINTER; | |
| 652 | ||
| 653 | for (j = NUM_OF_COLUMNS, l = fields; l; l = l->next, j++) { | |
| 15884 | 654 | PurpleRoomlistField *f = l->data; |
| 8113 | 655 | |
|
35021
eaf8156d3c5e
Renamed purple_roomlist_room_get_type to *_get_room_type, purple_roomlist_field_get_type to *_get_field_type
Ankit Vani <a@nevitus.org>
parents:
34932
diff
changeset
|
656 | switch (purple_roomlist_field_get_field_type(f)) { |
| 15884 | 657 | case PURPLE_ROOMLIST_FIELD_BOOL: |
| 8113 | 658 | types[j] = G_TYPE_BOOLEAN; |
| 659 | break; | |
| 15884 | 660 | case PURPLE_ROOMLIST_FIELD_INT: |
| 8113 | 661 | types[j] = G_TYPE_INT; |
| 662 | break; | |
| 15884 | 663 | case PURPLE_ROOMLIST_FIELD_STRING: |
| 8113 | 664 | types[j] = G_TYPE_STRING; |
| 665 | break; | |
| 666 | } | |
| 667 | } | |
| 668 | ||
| 669 | model = gtk_tree_store_newv(columns, types); | |
| 670 | g_free(types); | |
| 671 | ||
| 672 | tree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model)); | |
| 673 | ||
| 8199 | 674 | selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)); |
| 675 | g_signal_connect(G_OBJECT(selection), "changed", | |
| 676 | G_CALLBACK(selection_changed_cb), grl); | |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13448
diff
changeset
|
677 | |
| 8113 | 678 | g_object_unref(model); |
| 679 | ||
| 680 | grl->model = model; | |
| 681 | grl->tree = tree; | |
| 682 | gtk_widget_show(grl->tree); | |
| 683 | ||
| 684 | renderer = gtk_cell_renderer_text_new(); | |
| 685 | column = gtk_tree_view_column_new_with_attributes(_("Name"), renderer, | |
| 686 | "text", NAME_COLUMN, NULL); | |
| 687 | gtk_tree_view_column_set_sizing(GTK_TREE_VIEW_COLUMN(column), | |
| 688 | GTK_TREE_VIEW_COLUMN_GROW_ONLY); | |
| 689 | gtk_tree_view_column_set_resizable(GTK_TREE_VIEW_COLUMN(column), TRUE); | |
| 690 | gtk_tree_view_column_set_sort_column_id(GTK_TREE_VIEW_COLUMN(column), NAME_COLUMN); | |
| 691 | gtk_tree_view_column_set_reorderable(GTK_TREE_VIEW_COLUMN(column), TRUE); | |
| 692 | gtk_tree_view_append_column(GTK_TREE_VIEW(tree), column); | |
| 693 | ||
| 694 | for (j = NUM_OF_COLUMNS, l = fields; l; l = l->next, j++) { | |
| 15884 | 695 | PurpleRoomlistField *f = l->data; |
| 8113 | 696 | |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
697 | if (purple_roomlist_field_get_hidden(f)) |
| 8113 | 698 | continue; |
| 699 | ||
| 700 | renderer = gtk_cell_renderer_text_new(); | |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
701 | column = gtk_tree_view_column_new_with_attributes( |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
702 | purple_roomlist_field_get_label(f), renderer, |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
703 | "text", j, NULL); |
| 8113 | 704 | gtk_tree_view_column_set_sizing(GTK_TREE_VIEW_COLUMN(column), |
| 705 | GTK_TREE_VIEW_COLUMN_GROW_ONLY); | |
| 706 | gtk_tree_view_column_set_resizable(GTK_TREE_VIEW_COLUMN(column), TRUE); | |
| 707 | gtk_tree_view_column_set_sort_column_id(GTK_TREE_VIEW_COLUMN(column), j); | |
| 708 | gtk_tree_view_column_set_reorderable(GTK_TREE_VIEW_COLUMN(column), TRUE); | |
|
35021
eaf8156d3c5e
Renamed purple_roomlist_room_get_type to *_get_room_type, purple_roomlist_field_get_type to *_get_field_type
Ankit Vani <a@nevitus.org>
parents:
34932
diff
changeset
|
709 | if (purple_roomlist_field_get_field_type(f) == PURPLE_ROOMLIST_FIELD_INT) { |
| 8113 | 710 | gtk_tree_view_column_set_cell_data_func(column, renderer, int_cell_data_func, |
| 711 | GINT_TO_POINTER(j), NULL); | |
| 712 | gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(model), j, int_sort_func, | |
| 713 | GINT_TO_POINTER(j), NULL); | |
| 714 | } | |
| 715 | gtk_tree_view_append_column(GTK_TREE_VIEW(tree), column); | |
| 716 | } | |
| 717 | ||
| 718 | g_signal_connect(G_OBJECT(tree), "button-press-event", G_CALLBACK(room_click_cb), list); | |
| 719 | g_signal_connect(G_OBJECT(tree), "row-expanded", G_CALLBACK(row_expanded_cb), list); | |
| 720 | g_signal_connect(G_OBJECT(tree), "row-activated", G_CALLBACK(row_activated_cb), list); | |
|
40956
f6fb635537b0
Remove all custom tooltip code.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40943
diff
changeset
|
721 | |
|
40942
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
722 | gtk_widget_set_has_tooltip(tree, TRUE); |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
723 | g_signal_connect(G_OBJECT(tree), "query-tooltip", |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
724 | G_CALLBACK(pidgin_roomlist_query_tooltip), list); |
|
11490
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
725 | |
|
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
726 | /* Enable CTRL+F searching */ |
|
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
727 | gtk_tree_view_set_search_column(GTK_TREE_VIEW(tree), NAME_COLUMN); |
|
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
728 | gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(tree), _search_func, NULL, NULL); |
|
7a4f16625f66
[gaim-migrate @ 13733]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11243
diff
changeset
|
729 | |
| 8113 | 730 | } |
| 731 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
732 | static gboolean pidgin_progress_bar_pulse(gpointer data) |
| 8230 | 733 | { |
| 15884 | 734 | PurpleRoomlist *list = data; |
|
40898
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
735 | PidginRoomlist *rl = NULL; |
| 8230 | 736 | |
|
40898
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
737 | rl = g_object_get_data(G_OBJECT(list), PIDGIN_ROOMLIST_UI_DATA); |
| 8230 | 738 | if (!rl || !rl->dialog || !rl->dialog->pg_needs_pulse) { |
|
13448
27832a91b988
[gaim-migrate @ 15822]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12896
diff
changeset
|
739 | if (rl && rl->dialog) |
|
23918
ae3c8eb64659
Fix a race related to closing the roomlist window and do some minor cleanup.
Daniel Atallah <datallah@pidgin.im>
parents:
22131
diff
changeset
|
740 | rl->dialog->pg_update_to = 0; |
|
34932
1b74e5c63144
Use g_object_{ref|unref} instead of purple_roomlist_{ref|unref}
Ankit Vani <a@nevitus.org>
parents:
33271
diff
changeset
|
741 | g_object_unref(list); |
| 8230 | 742 | return FALSE; |
| 743 | } | |
| 744 | ||
| 745 | gtk_progress_bar_pulse(GTK_PROGRESS_BAR(rl->dialog->progress)); | |
| 746 | rl->dialog->pg_needs_pulse = FALSE; | |
| 747 | return TRUE; | |
| 748 | } | |
| 749 | ||
| 15884 | 750 | static void pidgin_roomlist_add_room(PurpleRoomlist *list, PurpleRoomlistRoom *room) |
| 8113 | 751 | { |
|
40898
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
752 | PidginRoomlist *rl = NULL; |
| 8113 | 753 | GtkTreeRowReference *rr, *parentrr = NULL; |
| 754 | GtkTreePath *path; | |
| 755 | GtkTreeIter iter, parent, child; | |
| 756 | GList *l, *k; | |
| 757 | int j; | |
| 758 | gboolean append = TRUE; | |
| 759 | ||
|
40898
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
760 | rl = g_object_get_data(G_OBJECT(list), PIDGIN_ROOMLIST_UI_DATA); |
|
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
761 | |
| 8113 | 762 | rl->total_rooms++; |
|
35021
eaf8156d3c5e
Renamed purple_roomlist_room_get_type to *_get_room_type, purple_roomlist_field_get_type to *_get_field_type
Ankit Vani <a@nevitus.org>
parents:
34932
diff
changeset
|
763 | if (purple_roomlist_room_get_room_type(room) == PURPLE_ROOMLIST_ROOMTYPE_ROOM) |
| 8113 | 764 | rl->num_rooms++; |
| 765 | ||
| 766 | if (rl->dialog) { | |
|
23918
ae3c8eb64659
Fix a race related to closing the roomlist window and do some minor cleanup.
Daniel Atallah <datallah@pidgin.im>
parents:
22131
diff
changeset
|
767 | if (rl->dialog->pg_update_to == 0) { |
|
34932
1b74e5c63144
Use g_object_{ref|unref} instead of purple_roomlist_{ref|unref}
Ankit Vani <a@nevitus.org>
parents:
33271
diff
changeset
|
768 | g_object_ref(list); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
769 | rl->dialog->pg_update_to = g_timeout_add(100, pidgin_progress_bar_pulse, list); |
| 8230 | 770 | gtk_progress_bar_pulse(GTK_PROGRESS_BAR(rl->dialog->progress)); |
|
23918
ae3c8eb64659
Fix a race related to closing the roomlist window and do some minor cleanup.
Daniel Atallah <datallah@pidgin.im>
parents:
22131
diff
changeset
|
771 | } else |
| 8230 | 772 | rl->dialog->pg_needs_pulse = TRUE; |
| 8113 | 773 | } |
|
23918
ae3c8eb64659
Fix a race related to closing the roomlist window and do some minor cleanup.
Daniel Atallah <datallah@pidgin.im>
parents:
22131
diff
changeset
|
774 | |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
775 | if (purple_roomlist_room_get_parent(room)) { |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
776 | parentrr = g_hash_table_lookup(rl->cats, purple_roomlist_room_get_parent(room)); |
| 8113 | 777 | path = gtk_tree_row_reference_get_path(parentrr); |
| 778 | if (path) { | |
| 15884 | 779 | PurpleRoomlistRoom *tmproom = NULL; |
| 8113 | 780 | |
| 781 | gtk_tree_model_get_iter(GTK_TREE_MODEL(rl->model), &parent, path); | |
| 782 | gtk_tree_path_free(path); | |
| 783 | ||
| 784 | if (gtk_tree_model_iter_children(GTK_TREE_MODEL(rl->model), &child, &parent)) { | |
| 785 | gtk_tree_model_get(GTK_TREE_MODEL(rl->model), &child, ROOM_COLUMN, &tmproom, -1); | |
| 786 | if (!tmproom) | |
| 787 | append = FALSE; | |
| 788 | } | |
| 789 | } | |
| 790 | } | |
| 791 | ||
| 792 | if (append) | |
| 793 | gtk_tree_store_append(rl->model, &iter, (parentrr ? &parent : NULL)); | |
| 794 | else | |
| 795 | iter = child; | |
| 796 | ||
|
35021
eaf8156d3c5e
Renamed purple_roomlist_room_get_type to *_get_room_type, purple_roomlist_field_get_type to *_get_field_type
Ankit Vani <a@nevitus.org>
parents:
34932
diff
changeset
|
797 | if (purple_roomlist_room_get_room_type(room) & PURPLE_ROOMLIST_ROOMTYPE_CATEGORY) |
| 8113 | 798 | gtk_tree_store_append(rl->model, &child, &iter); |
| 799 | ||
| 800 | path = gtk_tree_model_get_path(GTK_TREE_MODEL(rl->model), &iter); | |
| 801 | ||
|
35021
eaf8156d3c5e
Renamed purple_roomlist_room_get_type to *_get_room_type, purple_roomlist_field_get_type to *_get_field_type
Ankit Vani <a@nevitus.org>
parents:
34932
diff
changeset
|
802 | if (purple_roomlist_room_get_room_type(room) & PURPLE_ROOMLIST_ROOMTYPE_CATEGORY) { |
| 8113 | 803 | rr = gtk_tree_row_reference_new(GTK_TREE_MODEL(rl->model), path); |
| 804 | g_hash_table_insert(rl->cats, room, rr); | |
| 805 | } | |
| 806 | ||
| 807 | gtk_tree_path_free(path); | |
| 808 | ||
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
809 | gtk_tree_store_set(rl->model, &iter, NAME_COLUMN, purple_roomlist_room_get_name(room), -1); |
| 8113 | 810 | gtk_tree_store_set(rl->model, &iter, ROOM_COLUMN, room, -1); |
| 811 | ||
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
812 | for (j = NUM_OF_COLUMNS, |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
813 | l = purple_roomlist_room_get_fields(room), |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
814 | k = purple_roomlist_get_fields(list); |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
815 | l && k; j++, l = l->next, k = k->next) |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
816 | { |
| 15884 | 817 | PurpleRoomlistField *f = k->data; |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
818 | if (purple_roomlist_field_get_hidden(f)) |
| 8113 | 819 | continue; |
| 820 | gtk_tree_store_set(rl->model, &iter, j, l->data, -1); | |
| 821 | } | |
| 822 | } | |
| 823 | ||
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
824 | static void |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
825 | pidgin_roomlist_in_progress(GObject *obj, G_GNUC_UNUSED GParamSpec *pspec, |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
826 | gpointer data) |
| 8113 | 827 | { |
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
828 | PurpleRoomlist *list = PURPLE_ROOMLIST(obj); |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
829 | PidginRoomlist *rl = data; |
| 8113 | 830 | |
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
831 | if (purple_roomlist_get_in_progress(list)) { |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
832 | if (rl->dialog->account_widget) { |
| 8199 | 833 | gtk_widget_set_sensitive(rl->dialog->account_widget, FALSE); |
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
834 | } |
| 8199 | 835 | gtk_widget_set_sensitive(rl->dialog->stop_button, TRUE); |
| 836 | gtk_widget_set_sensitive(rl->dialog->list_button, FALSE); | |
| 8113 | 837 | } else { |
| 8230 | 838 | rl->dialog->pg_needs_pulse = FALSE; |
| 8113 | 839 | gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(rl->dialog->progress), 0.0); |
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
840 | if (rl->dialog->account_widget) { |
| 8199 | 841 | gtk_widget_set_sensitive(rl->dialog->account_widget, TRUE); |
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
842 | } |
| 8199 | 843 | gtk_widget_set_sensitive(rl->dialog->stop_button, FALSE); |
| 844 | gtk_widget_set_sensitive(rl->dialog->list_button, TRUE); | |
| 8113 | 845 | } |
| 846 | } | |
| 847 | ||
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
848 | static void |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
849 | pidgin_roomlist_destroy(PidginRoomlist *rl) |
| 8113 | 850 | { |
| 851 | g_hash_table_destroy(rl->cats); | |
| 852 | g_free(rl); | |
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
853 | } |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
854 | |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
855 | static void |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
856 | pidgin_roomlist_new(PurpleRoomlist *list) |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
857 | { |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
858 | PidginRoomlist *rl = g_new0(PidginRoomlist, 1); |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
859 | |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
860 | g_object_set_data_full(G_OBJECT(list), PIDGIN_ROOMLIST_UI_DATA, rl, |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
861 | (GDestroyNotify)pidgin_roomlist_destroy); |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
862 | |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
863 | rl->cats = g_hash_table_new_full( |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
864 | NULL, NULL, NULL, (GDestroyNotify)gtk_tree_row_reference_free); |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
865 | |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
866 | g_signal_connect(list, "notify::in-progress", |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
867 | G_CALLBACK(pidgin_roomlist_in_progress), rl); |
| 8113 | 868 | } |
| 869 | ||
| 15884 | 870 | static PurpleRoomlistUiOps ops = { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
871 | pidgin_roomlist_dialog_show_with_account, |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
872 | pidgin_roomlist_new, |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
873 | pidgin_roomlist_set_fields, |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
874 | pidgin_roomlist_add_room, |
|
16752
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16254
diff
changeset
|
875 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16254
diff
changeset
|
876 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16254
diff
changeset
|
877 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16254
diff
changeset
|
878 | NULL |
| 8113 | 879 | }; |
| 880 | ||
| 881 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
882 | void pidgin_roomlist_init(void) |
| 8113 | 883 | { |
| 15884 | 884 | purple_roomlist_set_ui_ops(&ops); |
| 8113 | 885 | } |