Thu, 10 Feb 2022 22:18:50 -0600
Convert the usage of GdkRGBA in the whiteboard to use floats instead of doubles
Testing Done:
Compiled and verified there was no mention of `GdkRGBA` in the logs for `pidginwhiteboard.c`
Reviewed at https://reviews.imfreedom.org/r/1300/
|
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; | |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
44 | GtkWidget *tree; |
| 8113 | 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; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
64 | } PidginRoomlist; |
| 8113 | 65 | |
| 66 | enum { | |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
67 | ROOM_COLUMN = 0, |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
68 | NAME_COLUMN, |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
69 | DESCRIPTION_COLUMN, |
| 8113 | 70 | NUM_OF_COLUMNS, |
| 71 | }; | |
| 72 | ||
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
73 | static gboolean |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
74 | _search_func(GtkTreeModel *model, gint column, const gchar *key, |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
75 | GtkTreeIter *iter, gpointer search_data) |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
76 | { |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
77 | gboolean result; |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
78 | gchar *name, *fold, *fkey; |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
79 | |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
80 | gtk_tree_model_get(model, iter, column, &name, -1); |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
81 | fold = g_utf8_casefold(name, -1); |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
82 | fkey = g_utf8_casefold(key, -1); |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
83 | |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
84 | result = (g_strstr_len(fold, strlen(fold), fkey) == NULL); |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
85 | |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
86 | g_free(fold); |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
87 | g_free(fkey); |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
88 | g_free(name); |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
89 | |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
90 | return result; |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
91 | } |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
92 | |
| 8113 | 93 | static gint delete_win_cb(GtkWidget *w, GdkEventAny *e, gpointer d) |
| 94 | { | |
|
40250
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
95 | PidginRoomlistDialog *dialog = PIDGIN_ROOMLIST_DIALOG(w); |
| 8113 | 96 | |
| 15884 | 97 | if (dialog->roomlist && purple_roomlist_get_in_progress(dialog->roomlist)) |
| 98 | purple_roomlist_cancel_get_list(dialog->roomlist); | |
| 8199 | 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 | if (dialog->pg_update_to > 0) |
|
38433
361c801c4536
Remove purple_timeout_* function usage
Mike Ruprecht <cmaiku@gmail.com>
parents:
37879
diff
changeset
|
101 | 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
|
102 | |
| 8230 | 103 | 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
|
104 | 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
|
105 | |
|
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
106 | 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
|
107 | 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
|
108 | |
|
ae3c8eb64659
Fix a race related to closing the roomlist window and do some minor cleanup.
Daniel Atallah <datallah@pidgin.im>
parents:
22131
diff
changeset
|
109 | if (dialog->pg_update_to > 0) |
| 8230 | 110 | /* 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
|
111 | 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
|
112 | |
|
ae3c8eb64659
Fix a race related to closing the roomlist window and do some minor cleanup.
Daniel Atallah <datallah@pidgin.im>
parents:
22131
diff
changeset
|
113 | 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
|
114 | 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
|
115 | g_object_unref(dialog->roomlist); |
| 8230 | 116 | } |
| 117 | ||
|
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
|
118 | dialog->progress = NULL; |
| 8113 | 119 | |
| 120 | return FALSE; | |
| 121 | } | |
| 122 | ||
|
39787
af7ae86ee287
Remove callback from account chooser constructor.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39786
diff
changeset
|
123 | static void |
|
40534
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
124 | 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
|
125 | 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
|
126 | 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
|
127 | gboolean change = (account != dialog->account); |
| 8113 | 128 | 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
|
129 | |
|
0c1d6f63740f
When switching the account in the Disco / Room List dialogs, kill the visible
Paul Aurich <darkrain42@pidgin.im>
parents:
26574
diff
changeset
|
130 | 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
|
131 | 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
|
132 | |
|
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
133 | 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
|
134 | PIDGIN_ROOMLIST_UI_DATA); |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
135 | |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
136 | g_clear_object(&rl->model); |
|
34932
1b74e5c63144
Use g_object_{ref|unref} instead of purple_roomlist_{ref|unref}
Ankit Vani <a@nevitus.org>
parents:
33271
diff
changeset
|
137 | 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
|
138 | 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
|
139 | } |
| 8113 | 140 | } |
| 141 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
142 | static void list_button_cb(GtkButton *button, PidginRoomlistDialog *dialog) |
| 8113 | 143 | { |
| 15884 | 144 | PurpleConnection *gc; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
145 | PidginRoomlist *rl; |
| 8113 | 146 | |
| 15884 | 147 | gc = purple_account_get_connection(dialog->account); |
| 8113 | 148 | if (!gc) |
| 149 | return; | |
| 150 | ||
| 8199 | 151 | 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
|
152 | 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
|
153 | 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
|
154 | |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
155 | g_clear_object(&rl->model); |
|
34932
1b74e5c63144
Use g_object_{ref|unref} instead of purple_roomlist_{ref|unref}
Ankit Vani <a@nevitus.org>
parents:
33271
diff
changeset
|
156 | g_object_unref(dialog->roomlist); |
| 8199 | 157 | } |
| 158 | ||
| 15884 | 159 | dialog->roomlist = purple_roomlist_get_list(gc); |
| 9159 | 160 | if (!dialog->roomlist) |
| 161 | return; | |
|
34932
1b74e5c63144
Use g_object_{ref|unref} instead of purple_roomlist_{ref|unref}
Ankit Vani <a@nevitus.org>
parents:
33271
diff
changeset
|
162 | 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
|
163 | |
|
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
164 | 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
|
165 | PIDGIN_ROOMLIST_UI_DATA); |
| 8113 | 166 | rl->dialog = dialog; |
| 8199 | 167 | |
|
40250
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
168 | gtk_widget_set_sensitive(dialog->account_widget, FALSE); |
| 8199 | 169 | |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
170 | gtk_tree_view_set_model(GTK_TREE_VIEW(dialog->tree), |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
171 | GTK_TREE_MODEL(rl->model)); |
| 8199 | 172 | |
| 15884 | 173 | /* some protocols (not bundled with libpurple) finish getting their |
| 15350 | 174 | * room list immediately */ |
| 15884 | 175 | if(purple_roomlist_get_in_progress(dialog->roomlist)) { |
| 15350 | 176 | gtk_widget_set_sensitive(dialog->stop_button, TRUE); |
| 177 | gtk_widget_set_sensitive(dialog->list_button, FALSE); | |
| 178 | } else { | |
| 179 | gtk_widget_set_sensitive(dialog->stop_button, FALSE); | |
| 180 | gtk_widget_set_sensitive(dialog->list_button, TRUE); | |
| 181 | } | |
|
12896
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
182 | gtk_widget_set_sensitive(dialog->add_button, FALSE); |
| 8199 | 183 | gtk_widget_set_sensitive(dialog->join_button, FALSE); |
| 8113 | 184 | } |
| 185 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
186 | static void stop_button_cb(GtkButton *button, PidginRoomlistDialog *dialog) |
| 8113 | 187 | { |
| 15884 | 188 | purple_roomlist_cancel_get_list(dialog->roomlist); |
| 8199 | 189 | |
|
40250
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
190 | gtk_widget_set_sensitive(dialog->account_widget, TRUE); |
| 8199 | 191 | |
| 192 | gtk_widget_set_sensitive(dialog->stop_button, FALSE); | |
| 193 | gtk_widget_set_sensitive(dialog->list_button, TRUE); | |
|
12896
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
194 | gtk_widget_set_sensitive(dialog->add_button, FALSE); |
| 8199 | 195 | gtk_widget_set_sensitive(dialog->join_button, FALSE); |
| 8113 | 196 | } |
| 197 | ||
| 198 | struct _menu_cb_info { | |
| 15884 | 199 | PurpleRoomlist *list; |
| 200 | PurpleRoomlistRoom *room; | |
| 8113 | 201 | }; |
| 202 | ||
| 8199 | 203 | static void |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
204 | selection_changed_cb(GtkTreeSelection *selection, |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
205 | PidginRoomlistDialog *dialog) |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
206 | { |
| 8199 | 207 | GtkTreeIter iter; |
| 15884 | 208 | PurpleRoomlistRoom *room; |
| 8199 | 209 | static struct _menu_cb_info *info; |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
210 | PidginRoomlist *grl = NULL; |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
211 | |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
212 | grl = g_object_get_data(G_OBJECT(dialog->roomlist), |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
213 | PIDGIN_ROOMLIST_UI_DATA); |
| 8199 | 214 | |
| 215 | if (gtk_tree_selection_get_selected(selection, NULL, &iter)) { | |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
216 | gtk_tree_model_get(GTK_TREE_MODEL(grl->model), &iter, |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
217 | ROOM_COLUMN, &room, |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
218 | -1); |
| 8199 | 219 | |
| 220 | info = g_new0(struct _menu_cb_info, 1); | |
| 221 | info->list = dialog->roomlist; | |
| 222 | info->room = room; | |
| 223 | ||
| 8377 | 224 | 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
|
225 | info, g_free); |
|
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
226 | g_object_set_data(G_OBJECT(dialog->add_button), "room-info", info); |
| 8199 | 227 | |
|
12896
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
228 | gtk_widget_set_sensitive(dialog->add_button, TRUE); |
| 8199 | 229 | gtk_widget_set_sensitive(dialog->join_button, TRUE); |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
230 | |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
231 | g_object_unref(room); |
| 8199 | 232 | } else { |
|
12896
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
233 | gtk_widget_set_sensitive(dialog->add_button, FALSE); |
| 8199 | 234 | gtk_widget_set_sensitive(dialog->join_button, FALSE); |
| 235 | } | |
| 236 | } | |
| 237 | ||
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
238 | static void |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
239 | 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
|
240 | { |
| 15185 | 241 | char *name; |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
242 | PurpleAccount *account = purple_roomlist_get_account(info->list); |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
243 | PurpleConnection *gc = purple_account_get_connection(account); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36424
diff
changeset
|
244 | PurpleProtocol *protocol = NULL; |
| 15185 | 245 | |
|
41028
943b2cb45314
Separate PurpleProtocolRoomlist into its own file and modernize it.
Gary Kramlich <grim@reaperworld.com>
parents:
41012
diff
changeset
|
246 | 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
|
247 | 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
|
248 | } |
| 15185 | 249 | |
|
41028
943b2cb45314
Separate PurpleProtocolRoomlist into its own file and modernize it.
Gary Kramlich <grim@reaperworld.com>
parents:
41012
diff
changeset
|
250 | 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
|
251 | 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
|
252 | info->room); |
|
943b2cb45314
Separate PurpleProtocolRoomlist into its own file and modernize it.
Gary Kramlich <grim@reaperworld.com>
parents:
41012
diff
changeset
|
253 | } else { |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
254 | 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
|
255 | } |
| 15185 | 256 | |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
31321
diff
changeset
|
257 | purple_blist_request_add_chat(account, NULL, NULL, name); |
| 15185 | 258 | |
| 259 | g_free(name); | |
|
12896
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
260 | } |
|
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
261 | |
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
262 | static void |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
263 | 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
|
264 | { |
|
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
|
265 | 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
|
266 | |
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
267 | if(info != NULL) { |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
268 | do_add_room_cb(NULL, info); |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
269 | } |
|
12896
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
270 | } |
|
d368037a2bb7
[gaim-migrate @ 15249]
Peter Lawler <pidgin@bleeter.id.au>
parents:
12600
diff
changeset
|
271 | |
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
272 | static void |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
273 | do_join_cb(G_GNUC_UNUSED GtkWidget *w, struct _menu_cb_info *info) { |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
274 | purple_roomlist_join_room(info->list, info->room); |
| 8199 | 275 | } |
| 8113 | 276 | |
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
277 | static void |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
278 | join_button_cb(GtkButton *button, G_GNUC_UNUSED gpointer 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
|
279 | 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
|
280 | |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
281 | purple_roomlist_join_room(info->list, info->room); |
| 8113 | 282 | } |
| 283 | ||
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
284 | static void |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
285 | row_activated_cb(GtkTreeView *tv, GtkTreePath *path, GtkTreeViewColumn *arg2, |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
286 | gpointer data) |
| 8113 | 287 | { |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
288 | PidginRoomlistDialog *dialog = 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
|
289 | PidginRoomlist *grl = NULL; |
| 8113 | 290 | GtkTreeIter iter; |
| 15884 | 291 | PurpleRoomlistRoom *room; |
| 8113 | 292 | struct _menu_cb_info info; |
| 293 | ||
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
294 | grl = g_object_get_data(G_OBJECT(dialog->roomlist), PIDGIN_ROOMLIST_UI_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
|
295 | |
| 8113 | 296 | gtk_tree_model_get_iter(GTK_TREE_MODEL(grl->model), &iter, path); |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
297 | gtk_tree_model_get(GTK_TREE_MODEL(grl->model), &iter, ROOM_COLUMN, &room, -1); |
| 8113 | 298 | |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
299 | info.list = dialog->roomlist; |
| 8113 | 300 | info.room = room; |
| 301 | ||
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
302 | do_join_cb(NULL, &info); |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
303 | |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
304 | g_clear_object(&room); |
| 8113 | 305 | } |
| 306 | ||
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
307 | static gboolean |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
308 | room_click_cb(GtkWidget *tv, GdkEventButton *event, gpointer data) { |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
309 | PidginRoomlistDialog *dialog = data; |
| 8113 | 310 | 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
|
311 | PidginRoomlist *grl = NULL; |
| 15884 | 312 | PurpleRoomlistRoom *room; |
| 8113 | 313 | GtkTreeIter iter; |
| 314 | GtkWidget *menu; | |
|
40943
5ba96262ca35
Drop icons from Room List popup menu.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40942
diff
changeset
|
315 | GtkWidget *menuitem; |
| 8113 | 316 | static struct _menu_cb_info info; /* XXX? */ |
| 317 | ||
|
38705
62a7a975251a
Use gdk_event_triggers_context_menu.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38583
diff
changeset
|
318 | if (!gdk_event_triggers_context_menu((GdkEvent *)event)) |
| 8113 | 319 | return FALSE; |
| 320 | ||
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
321 | grl = g_object_get_data(G_OBJECT(dialog->roomlist), PIDGIN_ROOMLIST_UI_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
|
322 | |
| 8113 | 323 | /* Here we figure out which room was clicked */ |
| 324 | if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(tv), event->x, event->y, &path, NULL, NULL, NULL)) | |
| 325 | return FALSE; | |
| 326 | gtk_tree_model_get_iter(GTK_TREE_MODEL(grl->model), &iter, path); | |
| 327 | gtk_tree_path_free(path); | |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
328 | gtk_tree_model_get(GTK_TREE_MODEL(grl->model), &iter, ROOM_COLUMN, &room, -1); |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
329 | |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
330 | info.list = dialog->roomlist; |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
331 | info.room = room; |
| 8113 | 332 | |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
333 | /* The current implementation isn't expecting a ref to unref the one we got |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
334 | * when we pulled the room out of the model. |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
335 | */ |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
336 | g_clear_object(&room); |
| 8113 | 337 | |
| 338 | 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
|
339 | |
|
5ba96262ca35
Drop icons from Room List popup menu.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40942
diff
changeset
|
340 | 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
|
341 | 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
|
342 | 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
|
343 | 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
|
344 | |
|
5ba96262ca35
Drop icons from Room List popup menu.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40942
diff
changeset
|
345 | 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
|
346 | 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
|
347 | 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
|
348 | gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); |
| 8113 | 349 | |
| 350 | 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
|
351 | gtk_menu_popup_at_pointer(GTK_MENU(menu), (GdkEvent *)event); |
| 8113 | 352 | |
| 353 | return FALSE; | |
| 354 | } | |
| 355 | ||
|
21494
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
356 | #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
|
357 | |
|
21903
5b5ad54ae1da
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21741
diff
changeset
|
358 | static gboolean |
|
40942
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
359 | 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
|
360 | 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
|
361 | 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
|
362 | { |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
363 | PidginRoomlistDialog *dialog = 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
|
364 | PidginRoomlist *grl = NULL; |
|
40942
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
365 | 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
|
366 | GtkTreeIter iter; |
|
40942
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
367 | 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
|
368 | 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
|
369 | |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
370 | grl = g_object_get_data(G_OBJECT(dialog->roomlist), PIDGIN_ROOMLIST_UI_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
|
371 | |
|
40942
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
372 | if (keyboard_mode) { |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
373 | 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
|
374 | 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
|
375 | return FALSE; |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
376 | } |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
377 | 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
|
378 | } else { |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
379 | gint bx, by; |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
380 | |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
381 | 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
|
382 | x, y, &bx, &by); |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
383 | 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
|
384 | NULL, NULL, NULL); |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
385 | if (path == NULL) { |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
386 | return FALSE; |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
387 | } |
|
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 | 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
|
390 | 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
|
391 | return FALSE; |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
392 | } |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
393 | } |
|
21494
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
394 | |
|
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
395 | 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
|
396 | |
|
21494
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
397 | 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
|
398 | 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
|
399 | g_free(name); |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
400 | g_string_append_printf( |
|
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
401 | 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
|
402 | 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
|
403 | |
|
40942
ff8ec7c55f5f
Use standard GTK tooltips for room list.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40898
diff
changeset
|
404 | 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
|
405 | 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
|
406 | 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
|
407 | 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
|
408 | |
|
21903
5b5ad54ae1da
Some utility functions for showing tooltips. This is used by the buddylist,
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21741
diff
changeset
|
409 | 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
|
410 | } |
|
c7368d0f5d5a
Add tooltips when hovering over rooms in the roomlist so the full channel
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20147
diff
changeset
|
411 | |
| 15884 | 412 | static gboolean account_filter_func(PurpleAccount *account) |
| 8113 | 413 | { |
|
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
|
414 | PurpleConnection *conn = purple_account_get_connection(account); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36424
diff
changeset
|
415 | PurpleProtocol *protocol = NULL; |
|
8939
ec2ecc652447
[gaim-migrate @ 9709]
Mark Doliner <markdoliner@pidgin.im>
parents:
8937
diff
changeset
|
416 | |
|
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
|
417 | 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
|
418 | protocol = purple_connection_get_protocol(conn); |
|
8939
ec2ecc652447
[gaim-migrate @ 9709]
Mark Doliner <markdoliner@pidgin.im>
parents:
8937
diff
changeset
|
419 | |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39556
diff
changeset
|
420 | return (protocol && PURPLE_PROTOCOL_IMPLEMENTS(protocol, ROOMLIST, get_list)); |
|
8939
ec2ecc652447
[gaim-migrate @ 9709]
Mark Doliner <markdoliner@pidgin.im>
parents:
8937
diff
changeset
|
421 | } |
|
ec2ecc652447
[gaim-migrate @ 9709]
Mark Doliner <markdoliner@pidgin.im>
parents:
8937
diff
changeset
|
422 | |
|
ec2ecc652447
[gaim-migrate @ 9709]
Mark Doliner <markdoliner@pidgin.im>
parents:
8937
diff
changeset
|
423 | gboolean |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
424 | pidgin_roomlist_is_showable() |
|
8939
ec2ecc652447
[gaim-migrate @ 9709]
Mark Doliner <markdoliner@pidgin.im>
parents:
8937
diff
changeset
|
425 | { |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
426 | GList *c; |
| 15884 | 427 | PurpleConnection *gc; |
| 8113 | 428 | |
| 15884 | 429 | 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
|
430 | gc = c->data; |
|
ec2ecc652447
[gaim-migrate @ 9709]
Mark Doliner <markdoliner@pidgin.im>
parents:
8937
diff
changeset
|
431 | |
| 15884 | 432 | if (account_filter_func(purple_connection_get_account(gc))) |
|
8939
ec2ecc652447
[gaim-migrate @ 9709]
Mark Doliner <markdoliner@pidgin.im>
parents:
8937
diff
changeset
|
433 | return TRUE; |
|
ec2ecc652447
[gaim-migrate @ 9709]
Mark Doliner <markdoliner@pidgin.im>
parents:
8937
diff
changeset
|
434 | } |
|
ec2ecc652447
[gaim-migrate @ 9709]
Mark Doliner <markdoliner@pidgin.im>
parents:
8937
diff
changeset
|
435 | |
|
ec2ecc652447
[gaim-migrate @ 9709]
Mark Doliner <markdoliner@pidgin.im>
parents:
8937
diff
changeset
|
436 | return FALSE; |
| 8113 | 437 | } |
| 438 | ||
|
40250
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
439 | static void |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
440 | pidgin_roomlist_dialog_class_init(PidginRoomlistDialogClass *klass) |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
441 | { |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
442 | GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
443 | |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
444 | 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
|
445 | 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
|
446 | |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
447 | 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
|
448 | account_widget); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
449 | gtk_widget_class_bind_template_child(widget_class, PidginRoomlistDialog, |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
450 | tree); |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
451 | gtk_widget_class_bind_template_child(widget_class, PidginRoomlistDialog, |
|
40250
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
452 | add_button); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
453 | 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
|
454 | close_button); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
455 | 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
|
456 | join_button); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
457 | 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
|
458 | list_button); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
459 | 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
|
460 | progress); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
461 | 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
|
462 | stop_button); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
463 | |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
464 | gtk_widget_class_bind_template_callback(widget_class, |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
465 | add_room_to_blist_cb); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
466 | gtk_widget_class_bind_template_callback(widget_class, delete_win_cb); |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
467 | gtk_widget_class_bind_template_callback(widget_class, row_activated_cb); |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
468 | gtk_widget_class_bind_template_callback(widget_class, room_click_cb); |
|
40250
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
469 | gtk_widget_class_bind_template_callback(widget_class, |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
470 | dialog_select_account_cb); |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
471 | gtk_widget_class_bind_template_callback(widget_class, |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
472 | selection_changed_cb); |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
473 | gtk_widget_class_bind_template_callback(widget_class, |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
474 | pidgin_roomlist_query_tooltip); |
|
40250
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
475 | 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
|
476 | 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
|
477 | 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
|
478 | } |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
479 | |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
480 | static void |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
481 | pidgin_roomlist_dialog_init(PidginRoomlistDialog *self) |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
482 | { |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
483 | gtk_widget_init_template(GTK_WIDGET(self)); |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
484 | |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
485 | pidgin_account_chooser_set_filter_func( |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
486 | PIDGIN_ACCOUNT_CHOOSER(self->account_widget), |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
487 | account_filter_func); |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
488 | |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
489 | gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(self->tree), |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
490 | _search_func, NULL, NULL); |
|
40250
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
491 | } |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
492 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
493 | static PidginRoomlistDialog * |
| 15884 | 494 | pidgin_roomlist_dialog_new_with_account(PurpleAccount *account) |
| 8113 | 495 | { |
|
40534
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
496 | PidginRoomlistDialog *dialog = NULL; |
|
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
497 | PidginAccountChooser *chooser = NULL; |
| 8113 | 498 | |
|
40250
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
499 | dialog = g_object_new(PIDGIN_TYPE_ROOMLIST_DIALOG, NULL); |
|
8937
b436e9cbd701
[gaim-migrate @ 9707]
Mark Doliner <markdoliner@pidgin.im>
parents:
8584
diff
changeset
|
500 | dialog->account = account; |
| 8113 | 501 | |
|
40534
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
502 | 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
|
503 | |
|
40250
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
504 | if (!account) { |
|
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
505 | /* 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
|
506 | * 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
|
507 | 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
|
508 | } else { |
|
40534
8dad2981fb86
Separate the AccountChooser from its model and move options to filters
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
509 | pidgin_account_chooser_set_selected(chooser, account); |
|
40250
19acef70137d
Convert PidginRoomlistDialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
510 | } |
| 8199 | 511 | |
| 512 | /* 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
|
513 | gtk_widget_show(GTK_WIDGET(dialog)); |
| 8199 | 514 | |
| 8113 | 515 | return dialog; |
| 516 | } | |
| 517 | ||
| 15884 | 518 | void pidgin_roomlist_dialog_show_with_account(PurpleAccount *account) |
| 8352 | 519 | { |
|
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
|
520 | PidginRoomlistDialog *dialog = pidgin_roomlist_dialog_new_with_account(account); |
| 8352 | 521 | |
| 522 | if (!dialog) | |
| 523 | return; | |
| 524 | ||
| 525 | list_button_cb(GTK_BUTTON(dialog->list_button), dialog); | |
| 526 | } | |
| 527 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
528 | void pidgin_roomlist_dialog_show(void) |
| 8113 | 529 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
530 | pidgin_roomlist_dialog_new_with_account(NULL); |
| 8113 | 531 | } |
| 532 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
533 | static gboolean pidgin_progress_bar_pulse(gpointer data) |
| 8230 | 534 | { |
| 15884 | 535 | 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
|
536 | PidginRoomlist *rl = NULL; |
| 8230 | 537 | |
|
40898
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
538 | rl = g_object_get_data(G_OBJECT(list), PIDGIN_ROOMLIST_UI_DATA); |
| 8230 | 539 | if (!rl || !rl->dialog || !rl->dialog->pg_needs_pulse) { |
|
13448
27832a91b988
[gaim-migrate @ 15822]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12896
diff
changeset
|
540 | 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
|
541 | 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
|
542 | g_object_unref(list); |
| 8230 | 543 | return FALSE; |
| 544 | } | |
| 545 | ||
| 546 | gtk_progress_bar_pulse(GTK_PROGRESS_BAR(rl->dialog->progress)); | |
| 547 | rl->dialog->pg_needs_pulse = FALSE; | |
| 548 | return TRUE; | |
| 549 | } | |
| 550 | ||
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
551 | static void |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
552 | pidgin_roomlist_add_room(PurpleRoomlist *list, PurpleRoomlistRoom *room) { |
|
40898
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
553 | PidginRoomlist *rl = NULL; |
| 8113 | 554 | GtkTreePath *path; |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
555 | GtkTreeIter iter; |
| 8113 | 556 | |
|
40898
06e5a2a8f49a
Replace purple_roomlist_[gs]et_ui_data with g_object_[gs]et_data
Gary Kramlich <grim@reaperworld.com>
parents:
40534
diff
changeset
|
557 | 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
|
558 | |
| 8113 | 559 | 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
|
560 | 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
|
561 | g_object_ref(list); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
562 | rl->dialog->pg_update_to = g_timeout_add(100, pidgin_progress_bar_pulse, list); |
| 8230 | 563 | 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
|
564 | } else |
| 8230 | 565 | rl->dialog->pg_needs_pulse = TRUE; |
| 8113 | 566 | } |
|
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
|
567 | |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
568 | gtk_tree_store_append(rl->model, &iter, NULL); |
| 8113 | 569 | |
| 570 | path = gtk_tree_model_get_path(GTK_TREE_MODEL(rl->model), &iter); | |
| 571 | ||
| 572 | gtk_tree_path_free(path); | |
| 573 | ||
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
574 | gtk_tree_store_set( |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
575 | rl->model, &iter, |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
576 | ROOM_COLUMN, room, |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
577 | NAME_COLUMN, purple_roomlist_room_get_name(room), |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
578 | DESCRIPTION_COLUMN, purple_roomlist_room_get_description(room), |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
579 | -1); |
| 8113 | 580 | } |
| 581 | ||
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
582 | static void |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
583 | 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
|
584 | gpointer data) |
| 8113 | 585 | { |
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
586 | PurpleRoomlist *list = PURPLE_ROOMLIST(obj); |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
587 | PidginRoomlist *rl = data; |
| 8113 | 588 | |
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
589 | if (purple_roomlist_get_in_progress(list)) { |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
590 | if (rl->dialog->account_widget) { |
| 8199 | 591 | 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
|
592 | } |
| 8199 | 593 | gtk_widget_set_sensitive(rl->dialog->stop_button, TRUE); |
| 594 | gtk_widget_set_sensitive(rl->dialog->list_button, FALSE); | |
| 8113 | 595 | } else { |
| 8230 | 596 | rl->dialog->pg_needs_pulse = FALSE; |
| 8113 | 597 | 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
|
598 | if (rl->dialog->account_widget) { |
| 8199 | 599 | 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
|
600 | } |
| 8199 | 601 | gtk_widget_set_sensitive(rl->dialog->stop_button, FALSE); |
| 602 | gtk_widget_set_sensitive(rl->dialog->list_button, TRUE); | |
| 8113 | 603 | } |
| 604 | } | |
| 605 | ||
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
606 | static void |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
607 | pidgin_roomlist_destroy(PidginRoomlist *rl) |
| 8113 | 608 | { |
| 609 | g_free(rl); | |
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
610 | } |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
611 | |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
612 | static void |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
613 | pidgin_roomlist_new(PurpleRoomlist *list) |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
614 | { |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
615 | PidginRoomlist *rl = g_new0(PidginRoomlist, 1); |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
616 | |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
617 | 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
|
618 | (GDestroyNotify)pidgin_roomlist_destroy); |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
619 | |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
620 | rl->model = gtk_tree_store_new(3, G_TYPE_OBJECT, G_TYPE_STRING, |
|
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
621 | G_TYPE_STRING); |
|
40977
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
622 | |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
623 | g_signal_connect(list, "notify::in-progress", |
|
dd0f04c5d212
Cleanup RoomList UI ops
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40956
diff
changeset
|
624 | G_CALLBACK(pidgin_roomlist_in_progress), rl); |
| 8113 | 625 | } |
| 626 | ||
| 15884 | 627 | static PurpleRoomlistUiOps ops = { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
628 | pidgin_roomlist_dialog_show_with_account, |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
629 | pidgin_roomlist_new, |
|
41349
15aeaa1e84ec
Rework the way roomlists work so we can more easily port them to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
630 | NULL, |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
631 | 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
|
632 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16254
diff
changeset
|
633 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16254
diff
changeset
|
634 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16254
diff
changeset
|
635 | NULL |
| 8113 | 636 | }; |
| 637 | ||
| 638 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
639 | void pidgin_roomlist_init(void) |
| 8113 | 640 | { |
| 15884 | 641 | purple_roomlist_set_ui_ops(&ops); |
| 8113 | 642 | } |