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