pidgin/pidginprotocolchooser.c

Fri, 25 Mar 2022 02:51:58 -0500

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Fri, 25 Mar 2022 02:51:58 -0500
changeset 41314
0dc72eacd8bf
parent 41187
3d60432b8a05
child 41645
fb8bfbd95195
permissions
-rw-r--r--

Replace PURPLE_CALLBACK by G_CALLBACK

Another straight search-and-replace for 'easy' review.

Testing Done:
Compile only.

Reviewed at https://reviews.imfreedom.org/r/1371/

40297
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * Pidgin - Internet Messenger
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * Pidgin is the legal property of its developers, whose names are too numerous
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * source distribution.
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 *
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * (at your option) any later version.
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 *
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 * GNU General Public License for more details.
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 *
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 * along with this program; if not, write to the Free Software
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22 */
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 #include "pidginprotocolchooser.h"
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26 #include "pidginprotocolstore.h"
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28 /******************************************************************************
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29 * Structs
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 *****************************************************************************/
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 struct _PidginProtocolChooser {
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 GtkComboBox parent;
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33
40787
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
34 GtkTreeModel *model;
40297
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 };
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 /******************************************************************************
40787
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
38 * Callbacks
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
39 *****************************************************************************/
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
40 static void
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
41 pidgin_protocol_chooser_model_changed_cb(GObject *obj, GParamSpec *pspec,
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
42 gpointer data)
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
43 {
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
44 GtkComboBox *combo = GTK_COMBO_BOX(obj);
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
45 GtkTreeModel *model = gtk_combo_box_get_model(combo);
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
46 GtkTreeIter iter;
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
47
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
48 /* When the model for the combobox changes, select the first item. */
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
49 if(gtk_tree_model_get_iter_first(model, &iter)) {
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
50 gtk_combo_box_set_active_iter(combo, &iter);
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
51 }
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
52 }
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
53
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
54 /******************************************************************************
40297
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 * GObject Implementation
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 *****************************************************************************/
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 G_DEFINE_TYPE(PidginProtocolChooser, pidgin_protocol_chooser,
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 GTK_TYPE_COMBO_BOX)
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 static void
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 pidgin_protocol_chooser_class_init(PidginProtocolChooserClass *klass)
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 {
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 gtk_widget_class_set_template_from_resource(widget_class,
41030
ec8b76f3bf0a Fix the resource path so we can use the automatic stuff that GtkApplication supports
Gary Kramlich <grim@reaperworld.com>
parents: 40787
diff changeset
66 "/im/pidgin/Pidgin3/Protocols/chooser.ui");
40297
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68 gtk_widget_class_bind_template_child(widget_class, PidginProtocolChooser,
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69 model);
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 }
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72 static void
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 pidgin_protocol_chooser_init(PidginProtocolChooser *chooser) {
40787
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
74 g_signal_connect_object(G_OBJECT(chooser), "notify::model",
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
75 G_CALLBACK(pidgin_protocol_chooser_model_changed_cb),
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
76 chooser, G_CONNECT_AFTER);
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
77
40297
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78 gtk_widget_init_template(GTK_WIDGET(chooser));
40787
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
79
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
80 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(chooser->model),
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
81 PIDGIN_PROTOCOL_STORE_COLUMN_NAME,
8a5a20a49e9b Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents: 40741
diff changeset
82 GTK_SORT_ASCENDING);
41187
3d60432b8a05 Clean up some stuff in PidginProtocolChooser.
Gary Kramlich <grim@reaperworld.com>
parents: 41030
diff changeset
83
3d60432b8a05 Clean up some stuff in PidginProtocolChooser.
Gary Kramlich <grim@reaperworld.com>
parents: 41030
diff changeset
84 gtk_combo_box_set_id_column(GTK_COMBO_BOX(chooser),
3d60432b8a05 Clean up some stuff in PidginProtocolChooser.
Gary Kramlich <grim@reaperworld.com>
parents: 41030
diff changeset
85 PIDGIN_PROTOCOL_STORE_COLUMN_ID);
40297
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
86 }
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
87
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
88 /******************************************************************************
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
89 * Public API
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
90 *****************************************************************************/
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
91 GtkWidget *
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
92 pidgin_protocol_chooser_new(void) {
41187
3d60432b8a05 Clean up some stuff in PidginProtocolChooser.
Gary Kramlich <grim@reaperworld.com>
parents: 41030
diff changeset
93 return g_object_new(PIDGIN_TYPE_PROTOCOL_CHOOSER, NULL);
40297
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94 }
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
95
40299
e2f8638bac5a Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents: 40297
diff changeset
96 PurpleProtocol *
e2f8638bac5a Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents: 40297
diff changeset
97 pidgin_protocol_chooser_get_selected(PidginProtocolChooser *chooser) {
e2f8638bac5a Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents: 40297
diff changeset
98 GtkTreeIter iter;
e2f8638bac5a Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents: 40297
diff changeset
99 PurpleProtocol *protocol = NULL;
e2f8638bac5a Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents: 40297
diff changeset
100
e2f8638bac5a Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents: 40297
diff changeset
101 g_return_val_if_fail(PIDGIN_IS_PROTOCOL_CHOOSER(chooser), NULL);
e2f8638bac5a Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents: 40297
diff changeset
102
e2f8638bac5a Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents: 40297
diff changeset
103 if(gtk_combo_box_get_active_iter(GTK_COMBO_BOX(chooser), &iter)) {
e2f8638bac5a Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents: 40297
diff changeset
104 gtk_tree_model_get(GTK_TREE_MODEL(chooser->model), &iter,
e2f8638bac5a Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents: 40297
diff changeset
105 PIDGIN_PROTOCOL_STORE_COLUMN_PROTOCOL, &protocol,
e2f8638bac5a Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents: 40297
diff changeset
106 -1);
e2f8638bac5a Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents: 40297
diff changeset
107 }
e2f8638bac5a Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents: 40297
diff changeset
108
e2f8638bac5a Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents: 40297
diff changeset
109 return protocol;
e2f8638bac5a Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents: 40297
diff changeset
110 }
e2f8638bac5a Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents: 40297
diff changeset
111
41187
3d60432b8a05 Clean up some stuff in PidginProtocolChooser.
Gary Kramlich <grim@reaperworld.com>
parents: 41030
diff changeset
112 const gchar *
40741
850137e8737c Select the proper protocol in the account editor.
Gary Kramlich <grim@reaperworld.com>
parents: 40299
diff changeset
113 pidgin_protocol_chooser_get_selected_id(PidginProtocolChooser *chooser) {
40297
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
114 g_return_val_if_fail(PIDGIN_IS_PROTOCOL_CHOOSER(chooser), NULL);
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
115
41187
3d60432b8a05 Clean up some stuff in PidginProtocolChooser.
Gary Kramlich <grim@reaperworld.com>
parents: 41030
diff changeset
116 return gtk_combo_box_get_active_id(GTK_COMBO_BOX(chooser));
40297
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
117 }
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
118
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
119 void
40741
850137e8737c Select the proper protocol in the account editor.
Gary Kramlich <grim@reaperworld.com>
parents: 40299
diff changeset
120 pidgin_protocol_chooser_set_selected_id(PidginProtocolChooser *chooser,
850137e8737c Select the proper protocol in the account editor.
Gary Kramlich <grim@reaperworld.com>
parents: 40299
diff changeset
121 const gchar *id)
40297
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
122 {
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
123 g_return_if_fail(PIDGIN_IS_PROTOCOL_CHOOSER(chooser));
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
124
41187
3d60432b8a05 Clean up some stuff in PidginProtocolChooser.
Gary Kramlich <grim@reaperworld.com>
parents: 41030
diff changeset
125 if(id != NULL) {
3d60432b8a05 Clean up some stuff in PidginProtocolChooser.
Gary Kramlich <grim@reaperworld.com>
parents: 41030
diff changeset
126 gtk_combo_box_set_active_id(GTK_COMBO_BOX(chooser), id);
3d60432b8a05 Clean up some stuff in PidginProtocolChooser.
Gary Kramlich <grim@reaperworld.com>
parents: 41030
diff changeset
127 } else {
3d60432b8a05 Clean up some stuff in PidginProtocolChooser.
Gary Kramlich <grim@reaperworld.com>
parents: 41030
diff changeset
128 GtkTreeIter first;
40297
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
129
41187
3d60432b8a05 Clean up some stuff in PidginProtocolChooser.
Gary Kramlich <grim@reaperworld.com>
parents: 41030
diff changeset
130 gtk_tree_model_get_iter_first(chooser->model, &first);
3d60432b8a05 Clean up some stuff in PidginProtocolChooser.
Gary Kramlich <grim@reaperworld.com>
parents: 41030
diff changeset
131 gtk_combo_box_set_active_iter(GTK_COMBO_BOX(chooser), &first);
3d60432b8a05 Clean up some stuff in PidginProtocolChooser.
Gary Kramlich <grim@reaperworld.com>
parents: 41030
diff changeset
132 }
40297
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
133
082c07053a79 Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
134 }

mercurial