pidgin/pidgincontactcompletion.c

Fri, 05 Mar 2021 03:31:29 -0600

author
Gary Kramlich <grim@reaperworld.com>
date
Fri, 05 Mar 2021 03:31:29 -0600
changeset 40810
28d50eece92d
parent 40125
a7acc7b00d79
child 41086
631e6cba8635
permissions
-rw-r--r--

Create a PidginAvatar widget.

This does everything the existing code does, but trying to integrate right now
is kind of difficult. The plan is to use this in a new PidginInfoPane I have
started, but that change got very large so I just packed it into the end of
the existing info pane.

The only things that are not implement right now, are making menu items
insensitive and that's because we need to figure out a better want to handle
custom avatars for users.

Testing Done:
Ran locally.

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

39579
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /* pidgin
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 *
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Pidgin is the legal property of its developers, whose names are too numerous
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 * to list here. Please refer to the COPYRIGHT file distributed with this
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * source distribution.
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 *
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * (at your option) any later version.
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 *
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * GNU General Public License for more details.
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 *
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 */
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22 #include "pidgincontactcompletion.h"
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 #include <purple.h>
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26 struct _PidginContactCompletion {
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 GtkEntryCompletion parent;
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28 PurpleAccount *account;
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29 };
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 enum {
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 PIDGIN_CONTACT_COMPLETION_COLUMN_CONTACT,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 PIDGIN_CONTACT_COMPLETION_COLUMN_ACCOUNT,
39582
6c1ed1a7acf1 Fix a typo
Gary Kramlich <grim@reaperworld.com>
parents: 39579
diff changeset
34 PIDGIN_CONTACT_COMPLETION_N_COLUMNS,
39579
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 };
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 enum {
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38 PROP_0,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39 PROP_ACCOUNT,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 N_PROPERTIES
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 };
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 static GParamSpec *properties[N_PROPERTIES] = {0, };
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 G_DEFINE_TYPE(PidginContactCompletion, pidgin_contact_completion, GTK_TYPE_ENTRY_COMPLETION);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 /******************************************************************************
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 * Helpers
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 *****************************************************************************/
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 static void
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 pidgin_contact_completion_walk_contact_func(PurpleBlistNode *node, gpointer data) {
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 PurpleBuddy *buddy = PURPLE_BUDDY(node);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53 PurpleAccount *account = purple_buddy_get_account(buddy);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54 GtkListStore *store = GTK_LIST_STORE(data);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 GtkTreeIter iter;
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 const gchar *name;
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 name = purple_buddy_get_name(buddy);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 if(name == NULL) {
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 name = "";
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 }
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 gtk_list_store_append(store, &iter);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64 gtk_list_store_set(
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 store,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66 &iter,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 PIDGIN_CONTACT_COMPLETION_COLUMN_CONTACT, name,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68 PIDGIN_CONTACT_COMPLETION_COLUMN_ACCOUNT, account,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69 -1
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 );
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 }
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 static GtkTreeModel *
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 pidgin_contact_completion_create_model(void) {
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 GtkListStore *store = NULL;
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 store = gtk_list_store_new(
39582
6c1ed1a7acf1 Fix a typo
Gary Kramlich <grim@reaperworld.com>
parents: 39579
diff changeset
78 PIDGIN_CONTACT_COMPLETION_N_COLUMNS,
39579
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 G_TYPE_STRING,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80 PURPLE_TYPE_ACCOUNT
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81 );
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
82
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
83 purple_blist_walk(NULL,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
84 NULL,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
85 NULL,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
86 pidgin_contact_completion_walk_contact_func,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
87 store
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
88 );
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
89
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
90 return GTK_TREE_MODEL(store);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
91 }
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
92
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93 static gboolean
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94 pidgin_contact_completion_match_func(GtkEntryCompletion *completion,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
95 const gchar *key,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
96 GtkTreeIter *iter,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
97 gpointer data)
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
98 {
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
99 GtkTreeModel *model = NULL;
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
100 PidginContactCompletion *comp = PIDGIN_CONTACT_COMPLETION(completion);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
101 gchar *name = NULL;
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
102
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
103 model = gtk_entry_completion_get_model(completion);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
104
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
105 gtk_tree_model_get(
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
106 model,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
107 iter,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
108 PIDGIN_CONTACT_COMPLETION_COLUMN_CONTACT, &name,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
109 -1
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
110 );
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
111
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
112 if(name == NULL) {
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
113 return FALSE;
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
114 }
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
115
40125
a7acc7b00d79 Replace purple_str_has_{prefix,suffix} by g_str_has_{prefix,suffix}.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39584
diff changeset
116 if (!g_str_has_prefix(name, key)) {
39579
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
117 g_free(name);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
118 return FALSE;
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
119 }
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
120
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
121 if(PURPLE_IS_ACCOUNT(comp->account)) {
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
122 PurpleAccount *account = NULL;
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
123
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
124 gtk_tree_model_get(
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
125 model,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
126 iter,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
127 PIDGIN_CONTACT_COMPLETION_COLUMN_ACCOUNT, &account,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
128 -1
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
129 );
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
130
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
131 if(account != comp->account) {
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
132 g_object_unref(account);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
133 return FALSE;
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
134 }
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
135
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
136 g_object_unref(account);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
137 }
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
138
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
139 return TRUE;
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
140 }
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
141
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
142 /******************************************************************************
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
143 * GObject Implemention
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
144 *****************************************************************************/
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
145 static void
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
146 pidgin_contact_completion_init(PidginContactCompletion *comp) {
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
147 }
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
148
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
149 static void
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
150 pidgin_contact_completion_constructed(GObject *obj) {
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
151 GtkTreeModel *model = NULL;
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
152
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
153 G_OBJECT_CLASS(pidgin_contact_completion_parent_class)->constructed(obj);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
154
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
155 model = pidgin_contact_completion_create_model();
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
156
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
157 gtk_entry_completion_set_model(
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
158 GTK_ENTRY_COMPLETION(obj),
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
159 model
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
160 );
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
161
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
162 gtk_entry_completion_set_match_func(
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
163 GTK_ENTRY_COMPLETION(obj),
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
164 pidgin_contact_completion_match_func,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
165 NULL,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
166 NULL
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
167 );
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
168
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
169 gtk_entry_completion_set_text_column(
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
170 GTK_ENTRY_COMPLETION(obj),
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
171 PIDGIN_CONTACT_COMPLETION_COLUMN_CONTACT
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
172 );
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
173 }
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
174
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
175 static void
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
176 pidgin_contact_completion_get_property(GObject *obj,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
177 guint param_id,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
178 GValue *value,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
179 GParamSpec *pspec)
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
180 {
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
181 PidginContactCompletion *comp = PIDGIN_CONTACT_COMPLETION(obj);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
182
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
183 switch(param_id) {
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
184 case PROP_ACCOUNT:
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
185 g_value_set_object(value, pidgin_contact_completion_get_account(comp));
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
186 break;
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
187 default:
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
188 G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
189 break;
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
190 }
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
191 }
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
192
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
193 static void
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
194 pidgin_contact_completion_set_property(GObject *obj,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
195 guint param_id,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
196 const GValue *value,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
197 GParamSpec *pspec)
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
198 {
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
199 PidginContactCompletion *comp = PIDGIN_CONTACT_COMPLETION(obj);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
200
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
201 switch(param_id) {
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
202 case PROP_ACCOUNT:
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
203 pidgin_contact_completion_set_account(comp,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
204 g_value_get_object(value));
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
205 break;
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
206 default:
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
207 G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
208 break;
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
209 }
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
210 }
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
211
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
212 static void
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
213 pidgin_contact_completion_finalize(GObject *obj) {
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
214 PidginContactCompletion *comp = PIDGIN_CONTACT_COMPLETION(obj);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
215
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
216 g_object_unref(comp->account);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
217
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
218 G_OBJECT_CLASS(pidgin_contact_completion_parent_class)->finalize(obj);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
219 }
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
220
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
221 static void
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
222 pidgin_contact_completion_class_init(PidginContactCompletionClass *klass) {
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
223 GObjectClass *obj_class = G_OBJECT_CLASS(klass);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
224
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
225 /* The only solution I could find to make this work was to implement the
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
226 * constructed handler and chain up to the parent. If you find another,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
227 * better way, please implement it :)
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
228 */
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
229 obj_class->constructed = pidgin_contact_completion_constructed;
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
230
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
231 obj_class->get_property = pidgin_contact_completion_get_property;
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
232 obj_class->set_property = pidgin_contact_completion_set_property;
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
233 obj_class->finalize = pidgin_contact_completion_finalize;
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
234
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
235 properties[PROP_ACCOUNT] = g_param_spec_object(
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
236 "account",
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
237 "account",
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
238 "The account to filter by or NULL for no filtering",
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
239 PURPLE_TYPE_ACCOUNT,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
240 G_PARAM_READWRITE | G_PARAM_CONSTRUCT
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
241 );
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
242
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
243 g_object_class_install_properties(obj_class, N_PROPERTIES, properties);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
244 }
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
245
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
246 /******************************************************************************
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
247 * Public API
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
248 *****************************************************************************/
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
249 GtkEntryCompletion *
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
250 pidgin_contact_completion_new(void) {
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
251 return GTK_ENTRY_COMPLETION(g_object_new(PIDGIN_TYPE_CONTACT_COMPLETION, NULL));
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
252 }
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
253
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
254 PurpleAccount *
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
255 pidgin_contact_completion_get_account(PidginContactCompletion *completion) {
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
256 g_return_val_if_fail(PIDGIN_IS_CONTACT_COMPLETION(completion), NULL);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
257
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
258 return g_object_ref(completion->account);
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
259 }
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
260
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
261 void
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
262 pidgin_contact_completion_set_account(PidginContactCompletion *completion,
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
263 PurpleAccount *account)
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
264 {
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
265 g_return_if_fail(PIDGIN_IS_CONTACT_COMPLETION(completion));
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
266
39584
b8155feb19d5 Remove the doc comments as they're in the header file and use g_set_object as we're on glib 2.44 now
Gary Kramlich <grim@reaperworld.com>
parents: 39582
diff changeset
267 if(g_set_object(&completion->account, account)) {
b8155feb19d5 Remove the doc comments as they're in the header file and use g_set_object as we're on glib 2.44 now
Gary Kramlich <grim@reaperworld.com>
parents: 39582
diff changeset
268 g_object_notify_by_pspec(G_OBJECT(completion),
b8155feb19d5 Remove the doc comments as they're in the header file and use g_set_object as we're on glib 2.44 now
Gary Kramlich <grim@reaperworld.com>
parents: 39582
diff changeset
269 properties[PROP_ACCOUNT]);
39579
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
270 }
34e0b0e7df81 Finish up the invite dialog with contact completion and documentation for all.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
271 }

mercurial