pidgin/pidginui.c

Sat, 05 Nov 2022 05:33:16 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Sat, 05 Nov 2022 05:33:16 -0500
changeset 41897
180e63127ef9
parent 41873
98c20aec9aba
child 41958
76d1633b8ec0
permissions
-rw-r--r--

Remove gtkconn.[ch]

This was supposed to be doing the auto reconnect stuff, but apparently we've
been reconnecting on accident when we set an accounts idle status. This forces
the status of the account from offline to an online status, which then makes it
reconnect.

This is clearly a bug, but a happy accident for now as we're working on
re-architecting auto-reconnect.

Testing Done:
Use the demo account action to trigger a temporary connection failure and was surprised when the account reconnected.

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

41867
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * Pidgin - Internet Messenger
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * Pidgin is the legal property of its developers, whose names are too numerous
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * source distribution.
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 *
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * (at your option) any later version.
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 *
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 * GNU General Public License for more details.
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 *
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 * along with this program; if not, see <https://www.gnu.org/licenses/>.
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 */
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #include <glib.h>
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 #include <glib/gi18n.h>
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26 #define G_SETTINGS_ENABLE_BACKEND
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 #include <gio/gsettingsbackend.h>
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29 #ifdef HAVE_CONFIG_H
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 # include <config.h>
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 #endif
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 #include "pidginui.h"
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 #include "gtkaccount.h"
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36 #include "gtkblist.h"
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 #include "gtkconv.h"
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38 #include "gtkidle.h"
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39 #include "gtkmedia.h"
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 #include "gtknotify.h"
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 #include "gtkprivacy.h"
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 #include "gtkroomlist.h"
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 #include "gtkrequest.h"
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44 #include "gtkwhiteboard.h"
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 #include "gtkxfer.h"
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 #include "pidgincore.h"
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 #include "pidgindebug.h"
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 #include "pidginprefs.h"
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 #include "pidginprivate.h"
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 struct _PidginUi {
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 PurpleUi parent;
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53 };
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 G_DEFINE_TYPE(PidginUi, pidgin_ui, PURPLE_TYPE_UI)
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 /******************************************************************************
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 * Helpers
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 *****************************************************************************/
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 static gboolean
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 pidgin_history_init(GError **error) {
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 PurpleHistoryManager *manager = NULL;
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 PurpleHistoryAdapter *adapter = NULL;
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64 gchar *filename = NULL;
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 const gchar *id = NULL;
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 manager = purple_history_manager_get_default();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69 /* Attempt to create the config_dir. We don't care about the result as the
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 * logging adapter will fail with a better error than us failing to create
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 * the directory.
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72 */
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 g_mkdir_with_parents(purple_config_dir(), 0700);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 filename = g_build_filename(purple_config_dir(), "history.db", NULL);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76 adapter = purple_sqlite_history_adapter_new(filename);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 g_free(filename);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 id = purple_history_adapter_get_id(adapter);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80 if(!purple_history_manager_register(manager, adapter, error)) {
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81 g_clear_object(&adapter);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
82
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
83 return FALSE;
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
84 }
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
85
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
86 /* The manager adds a ref to the adapter on registration, so we can remove
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
87 * our reference.
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
88 */
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
89 g_clear_object(&adapter);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
90
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
91 return purple_history_manager_set_active(manager, id, error);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
92 }
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94 static void
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
95 pidgin_ui_add_protocol_theme_paths(PurpleProtocol *protocol) {
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
96 GdkDisplay *display = NULL;
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
97 GtkIconTheme *theme = NULL;
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
98 const gchar *path = NULL;
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
99
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
100 display = gdk_display_get_default();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
101
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
102 theme = gtk_icon_theme_get_for_display(display);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
103
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
104 path = purple_protocol_get_icon_search_path(protocol);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
105 if(path != NULL) {
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
106 gtk_icon_theme_add_search_path(theme, path);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
107 }
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
108
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
109 path = purple_protocol_get_icon_resource_path(protocol);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
110 if(path != NULL) {
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
111 gtk_icon_theme_add_resource_path(theme, path);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
112 }
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
113 }
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
114
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
115 /******************************************************************************
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
116 * Callbacks
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
117 *****************************************************************************/
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
118 static void
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
119 pidgin_ui_protocol_foreach_theme_cb(PurpleProtocol *protocol,
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
120 G_GNUC_UNUSED gpointer data)
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
121 {
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
122 pidgin_ui_add_protocol_theme_paths(protocol);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
123 }
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
124
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
125 static void
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
126 pidgin_ui_protocol_registered_cb(G_GNUC_UNUSED PurpleProtocolManager *manager,
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
127 PurpleProtocol *protocol)
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
128 {
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
129 pidgin_ui_add_protocol_theme_paths(protocol);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
130 }
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
131
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
132 /******************************************************************************
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
133 * PurpleUi Implementation
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
134 *****************************************************************************/
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
135 static void
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
136 pidgin_ui_prefs_init(G_GNUC_UNUSED PurpleUi *ui) {
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
137 pidgin_prefs_init();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
138 }
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
139
41873
98c20aec9aba Make PurpleUi.start return a gboolean and GError
Gary Kramlich <grim@reaperworld.com>
parents: 41867
diff changeset
140 static gboolean
98c20aec9aba Make PurpleUi.start return a gboolean and GError
Gary Kramlich <grim@reaperworld.com>
parents: 41867
diff changeset
141 pidgin_ui_start(G_GNUC_UNUSED PurpleUi *ui, GError **error) {
41867
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
142 PurpleProtocolManager *protocol_manager = NULL;
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
143 GdkDisplay *display = NULL;
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
144 GtkIconTheme *theme = NULL;
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
145 gchar *path;
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
146
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
147 pidgin_debug_init();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
148
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
149 display = gdk_display_get_default();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
150 theme = gtk_icon_theme_get_for_display(display);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
151
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
152 path = g_build_filename(PURPLE_DATADIR, "pidgin", "icons", NULL);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
153 gtk_icon_theme_add_search_path(theme, path);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
154 g_free(path);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
155
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
156 /* Add a callback for when a protocol is registered to add its icon paths
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
157 * if it was found after initial startup.
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
158 */
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
159 protocol_manager = purple_protocol_manager_get_default();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
160 g_signal_connect(protocol_manager, "registered",
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
161 G_CALLBACK(pidgin_ui_protocol_registered_cb), NULL);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
162
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
163 /* Add the icon paths for all the protocols that libpurple found at start
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
164 * up.
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
165 */
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
166 purple_protocol_manager_foreach(protocol_manager,
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
167 pidgin_ui_protocol_foreach_theme_cb, NULL);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
168
41873
98c20aec9aba Make PurpleUi.start return a gboolean and GError
Gary Kramlich <grim@reaperworld.com>
parents: 41867
diff changeset
169 if(!pidgin_history_init(error)) {
98c20aec9aba Make PurpleUi.start return a gboolean and GError
Gary Kramlich <grim@reaperworld.com>
parents: 41867
diff changeset
170 const char *error_message = "unknown";
98c20aec9aba Make PurpleUi.start return a gboolean and GError
Gary Kramlich <grim@reaperworld.com>
parents: 41867
diff changeset
171
98c20aec9aba Make PurpleUi.start return a gboolean and GError
Gary Kramlich <grim@reaperworld.com>
parents: 41867
diff changeset
172 if(error != NULL && *error != NULL) {
98c20aec9aba Make PurpleUi.start return a gboolean and GError
Gary Kramlich <grim@reaperworld.com>
parents: 41867
diff changeset
173 error_message = (*error)->message;
98c20aec9aba Make PurpleUi.start return a gboolean and GError
Gary Kramlich <grim@reaperworld.com>
parents: 41867
diff changeset
174 }
98c20aec9aba Make PurpleUi.start return a gboolean and GError
Gary Kramlich <grim@reaperworld.com>
parents: 41867
diff changeset
175
98c20aec9aba Make PurpleUi.start return a gboolean and GError
Gary Kramlich <grim@reaperworld.com>
parents: 41867
diff changeset
176 g_critical("failed to initialize the history api: %s", error_message);
98c20aec9aba Make PurpleUi.start return a gboolean and GError
Gary Kramlich <grim@reaperworld.com>
parents: 41867
diff changeset
177
98c20aec9aba Make PurpleUi.start return a gboolean and GError
Gary Kramlich <grim@reaperworld.com>
parents: 41867
diff changeset
178 return FALSE;
41867
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
179 }
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
180
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
181 /* Set the UI operation structures. */
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
182 purple_xfers_set_ui_ops(pidgin_xfers_get_ui_ops());
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
183 purple_blist_set_ui(PIDGIN_TYPE_BUDDY_LIST);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
184 purple_notify_set_ui_ops(pidgin_notify_get_ui_ops());
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
185 purple_request_set_ui_ops(pidgin_request_get_ui_ops());
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
186 purple_whiteboard_set_ui_ops(pidgin_whiteboard_get_ui_ops());
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
187 purple_idle_set_ui(pidgin_idle_new());
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
188
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
189 pidgin_accounts_init();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
190 pidgin_request_init();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
191 pidgin_blist_init();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
192 pidgin_conversations_init();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
193 pidgin_commands_init();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
194 pidgin_privacy_init();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
195 pidgin_xfers_init();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
196 pidgin_roomlist_init();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
197 pidgin_medias_init();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
198 pidgin_notify_init();
41873
98c20aec9aba Make PurpleUi.start return a gboolean and GError
Gary Kramlich <grim@reaperworld.com>
parents: 41867
diff changeset
199
98c20aec9aba Make PurpleUi.start return a gboolean and GError
Gary Kramlich <grim@reaperworld.com>
parents: 41867
diff changeset
200 return TRUE;
41867
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
201 }
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
202
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
203 static void
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
204 pidgin_ui_stop(G_GNUC_UNUSED PurpleUi *ui) {
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
205 /* Be sure to close all windows that are not attached to anything
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
206 * (e.g., the debug window), or they may access things after they are
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
207 * shut down. */
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
208 pidgin_notify_uninit();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
209 pidgin_commands_uninit();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
210 pidgin_conversations_uninit();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
211 pidgin_blist_uninit();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
212 pidgin_request_uninit();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
213 pidgin_accounts_uninit();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
214 pidgin_xfers_uninit();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
215 pidgin_debug_window_hide();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
216 pidgin_debug_uninit();
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
217
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
218 /* and end it all... */
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
219 g_application_quit(g_application_get_default());
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
220 }
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
221
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
222 static gpointer
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
223 pidgin_ui_get_settings_backend(G_GNUC_UNUSED PurpleUi *ui) {
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
224 GSettingsBackend *backend = NULL;
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
225 char *config = NULL;
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
226
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
227 config = g_build_filename(purple_config_dir(), "pidgin3.ini", NULL);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
228 backend = g_keyfile_settings_backend_new(config, "/", NULL);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
229
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
230 g_free(config);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
231
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
232 return backend;
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
233 }
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
234
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
235 /******************************************************************************
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
236 * GObject Implementation
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
237 *****************************************************************************/
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
238 static void
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
239 pidgin_ui_init(G_GNUC_UNUSED PidginUi *ui) {
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
240 }
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
241
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
242 static void
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
243 pidgin_ui_class_init(PidginUiClass *klass) {
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
244 PurpleUiClass *ui_class = PURPLE_UI_CLASS(klass);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
245
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
246 ui_class->prefs_init = pidgin_ui_prefs_init;
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
247 ui_class->start = pidgin_ui_start;
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
248 ui_class->stop = pidgin_ui_stop;
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
249 ui_class->get_settings_backend = pidgin_ui_get_settings_backend;
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
250 }
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
251
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
252 /******************************************************************************
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
253 * Public UI
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
254 *****************************************************************************/
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
255 PurpleUi *
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
256 pidgin_ui_new(void) {
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
257 return g_object_new(
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
258 PIDGIN_TYPE_UI,
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
259 "id", "pidgin3",
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
260 "name", PIDGIN_NAME,
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
261 "version", VERSION,
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
262 "website", "https://pidgin.im",
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
263 "support-website", "https://pidgin.im/contact/",
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
264 "client-type", "pc",
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
265 NULL);
5375c1d58c50 Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
266 }

mercurial