Sun, 03 Nov 2024 00:05:44 -0500
remove purple3-url-handler.desktop.in.in
The application that did the launching was removed long ago. Also this should
be implemented by the user interfaces and they might provide separate files to
groups schemas as well.
Testing Done:
Called in the turtles.
Reviewed at https://reviews.imfreedom.org/r/3640/
|
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 | |
|
42410
563e7a17c220
Fix possible clash of config headers
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42231
diff
changeset
|
29 | #include <purpleconfig.h> |
|
41867
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | #include "pidginui.h" |
|
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 "gtkrequest.h" |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | #include "gtkwhiteboard.h" |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | #include "pidgincore.h" |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
36 | #include "pidgindebug.h" |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | #include "pidginprefs.h" |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | #include "pidginprivate.h" |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | struct _PidginUi { |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | PurpleUi parent; |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | }; |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 | |
|
42575
580339aa47cc
Make sure all of the final types in pidgin are defined as such
Gary Kramlich <grim@reaperworld.com>
parents:
42571
diff
changeset
|
44 | G_DEFINE_FINAL_TYPE(PidginUi, pidgin_ui, PURPLE_TYPE_UI) |
|
41867
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
45 | |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
46 | /****************************************************************************** |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
47 | * Helpers |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
48 | *****************************************************************************/ |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
49 | static void |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
50 | pidgin_ui_add_protocol_theme_paths(PurpleProtocol *protocol) { |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | GdkDisplay *display = NULL; |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
52 | GtkIconTheme *theme = NULL; |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
53 | const gchar *path = NULL; |
|
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 | display = gdk_display_get_default(); |
|
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 | theme = gtk_icon_theme_get_for_display(display); |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
58 | |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
59 | path = purple_protocol_get_icon_search_path(protocol); |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
60 | if(path != NULL) { |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
61 | gtk_icon_theme_add_search_path(theme, path); |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
62 | } |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
63 | |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
64 | path = purple_protocol_get_icon_resource_path(protocol); |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
65 | if(path != NULL) { |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
66 | gtk_icon_theme_add_resource_path(theme, path); |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
67 | } |
|
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 | |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
70 | /****************************************************************************** |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
71 | * Callbacks |
|
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 | static void |
|
43035
c6caa9bd7afe
Update Pidgin for the Purple.ProtocolManager deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42913
diff
changeset
|
74 | pidgin_ui_protocol_added_cb(G_GNUC_UNUSED PurpleProtocolManager *manager, |
|
c6caa9bd7afe
Update Pidgin for the Purple.ProtocolManager deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42913
diff
changeset
|
75 | PurpleProtocol *protocol) |
|
41867
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
76 | { |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
77 | pidgin_ui_add_protocol_theme_paths(protocol); |
|
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 | |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
80 | /****************************************************************************** |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
81 | * PurpleUi Implementation |
|
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 | static void |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
84 | 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
|
85 | pidgin_prefs_init(); |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
86 | } |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
87 | |
|
41873
98c20aec9aba
Make PurpleUi.start return a gboolean and GError
Gary Kramlich <grim@reaperworld.com>
parents:
41867
diff
changeset
|
88 | static gboolean |
|
42435
ecf0fdfc8363
Add a get_history_adapter method to PurpleUi and implement in Pidgin and Finch
Gary Kramlich <grim@reaperworld.com>
parents:
42410
diff
changeset
|
89 | pidgin_ui_start(G_GNUC_UNUSED PurpleUi *ui, G_GNUC_UNUSED GError **error) { |
|
41867
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
90 | PurpleProtocolManager *protocol_manager = NULL; |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
91 | GdkDisplay *display = NULL; |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
92 | GtkIconTheme *theme = NULL; |
|
43035
c6caa9bd7afe
Update Pidgin for the Purple.ProtocolManager deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42913
diff
changeset
|
93 | GListModel *protocol_model = NULL; |
|
41867
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
94 | gchar *path; |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
95 | |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
96 | pidgin_debug_init(); |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
97 | |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
98 | display = gdk_display_get_default(); |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
99 | theme = gtk_icon_theme_get_for_display(display); |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
100 | |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
101 | 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
|
102 | gtk_icon_theme_add_search_path(theme, path); |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
103 | g_free(path); |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
104 | |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
105 | /* 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
|
106 | * if it was found after initial startup. |
|
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 | protocol_manager = purple_protocol_manager_get_default(); |
|
43035
c6caa9bd7afe
Update Pidgin for the Purple.ProtocolManager deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42913
diff
changeset
|
109 | protocol_model = G_LIST_MODEL(protocol_manager); |
|
c6caa9bd7afe
Update Pidgin for the Purple.ProtocolManager deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42913
diff
changeset
|
110 | g_signal_connect(protocol_manager, "added", |
|
c6caa9bd7afe
Update Pidgin for the Purple.ProtocolManager deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42913
diff
changeset
|
111 | G_CALLBACK(pidgin_ui_protocol_added_cb), NULL); |
|
41867
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
112 | |
|
43035
c6caa9bd7afe
Update Pidgin for the Purple.ProtocolManager deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42913
diff
changeset
|
113 | /* Add the icon paths for all the protocols that libpurple found during |
|
c6caa9bd7afe
Update Pidgin for the Purple.ProtocolManager deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42913
diff
changeset
|
114 | * start up. |
|
41867
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
115 | */ |
|
43035
c6caa9bd7afe
Update Pidgin for the Purple.ProtocolManager deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42913
diff
changeset
|
116 | for(guint i = 0; i < g_list_model_get_n_items(protocol_model); i++) { |
|
c6caa9bd7afe
Update Pidgin for the Purple.ProtocolManager deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42913
diff
changeset
|
117 | PurpleProtocol *protocol = NULL; |
|
c6caa9bd7afe
Update Pidgin for the Purple.ProtocolManager deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42913
diff
changeset
|
118 | |
|
c6caa9bd7afe
Update Pidgin for the Purple.ProtocolManager deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42913
diff
changeset
|
119 | protocol = g_list_model_get_item(protocol_model, i); |
|
c6caa9bd7afe
Update Pidgin for the Purple.ProtocolManager deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42913
diff
changeset
|
120 | pidgin_ui_add_protocol_theme_paths(protocol); |
|
c6caa9bd7afe
Update Pidgin for the Purple.ProtocolManager deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42913
diff
changeset
|
121 | g_clear_object(&protocol); |
|
c6caa9bd7afe
Update Pidgin for the Purple.ProtocolManager deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
42913
diff
changeset
|
122 | } |
|
41867
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 | /* Set the UI operation structures. */ |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
125 | 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
|
126 | 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
|
127 | |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
128 | pidgin_request_init(); |
|
41873
98c20aec9aba
Make PurpleUi.start return a gboolean and GError
Gary Kramlich <grim@reaperworld.com>
parents:
41867
diff
changeset
|
129 | |
|
98c20aec9aba
Make PurpleUi.start return a gboolean and GError
Gary Kramlich <grim@reaperworld.com>
parents:
41867
diff
changeset
|
130 | return TRUE; |
|
41867
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 | static void |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
134 | pidgin_ui_stop(G_GNUC_UNUSED PurpleUi *ui) { |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
135 | /* 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
|
136 | * (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
|
137 | * shut down. */ |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
138 | pidgin_request_uninit(); |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
139 | pidgin_debug_window_hide(); |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
140 | pidgin_debug_uninit(); |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
141 | |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
142 | /* and end it all... */ |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
143 | g_application_quit(g_application_get_default()); |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
144 | } |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
145 | |
|
42777
8b4f02641aa9
The first steps of making the conversation manager persistent
Gary Kramlich <grim@reaperworld.com>
parents:
42764
diff
changeset
|
146 | static PurpleConversationManager * |
|
8b4f02641aa9
The first steps of making the conversation manager persistent
Gary Kramlich <grim@reaperworld.com>
parents:
42764
diff
changeset
|
147 | pidgin_ui_get_conversation_manager(G_GNUC_UNUSED PurpleUi *ui) { |
|
8b4f02641aa9
The first steps of making the conversation manager persistent
Gary Kramlich <grim@reaperworld.com>
parents:
42764
diff
changeset
|
148 | PurpleConversationManager *manager = NULL; |
|
8b4f02641aa9
The first steps of making the conversation manager persistent
Gary Kramlich <grim@reaperworld.com>
parents:
42764
diff
changeset
|
149 | char *filename = NULL; |
|
8b4f02641aa9
The first steps of making the conversation manager persistent
Gary Kramlich <grim@reaperworld.com>
parents:
42764
diff
changeset
|
150 | |
|
8b4f02641aa9
The first steps of making the conversation manager persistent
Gary Kramlich <grim@reaperworld.com>
parents:
42764
diff
changeset
|
151 | filename = g_build_filename(purple_config_dir(), "conversations.db", NULL); |
|
8b4f02641aa9
The first steps of making the conversation manager persistent
Gary Kramlich <grim@reaperworld.com>
parents:
42764
diff
changeset
|
152 | manager = purple_conversation_manager_new(filename); |
|
8b4f02641aa9
The first steps of making the conversation manager persistent
Gary Kramlich <grim@reaperworld.com>
parents:
42764
diff
changeset
|
153 | g_free(filename); |
|
8b4f02641aa9
The first steps of making the conversation manager persistent
Gary Kramlich <grim@reaperworld.com>
parents:
42764
diff
changeset
|
154 | |
|
8b4f02641aa9
The first steps of making the conversation manager persistent
Gary Kramlich <grim@reaperworld.com>
parents:
42764
diff
changeset
|
155 | return manager; |
|
8b4f02641aa9
The first steps of making the conversation manager persistent
Gary Kramlich <grim@reaperworld.com>
parents:
42764
diff
changeset
|
156 | } |
|
8b4f02641aa9
The first steps of making the conversation manager persistent
Gary Kramlich <grim@reaperworld.com>
parents:
42764
diff
changeset
|
157 | |
|
41867
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
158 | static gpointer |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
159 | 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
|
160 | GSettingsBackend *backend = NULL; |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
161 | char *config = 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 | 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
|
164 | backend = g_keyfile_settings_backend_new(config, "/", NULL); |
|
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 | g_free(config); |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
167 | |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
168 | return backend; |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
169 | } |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
170 | |
|
42435
ecf0fdfc8363
Add a get_history_adapter method to PurpleUi and implement in Pidgin and Finch
Gary Kramlich <grim@reaperworld.com>
parents:
42410
diff
changeset
|
171 | static PurpleHistoryAdapter * |
|
ecf0fdfc8363
Add a get_history_adapter method to PurpleUi and implement in Pidgin and Finch
Gary Kramlich <grim@reaperworld.com>
parents:
42410
diff
changeset
|
172 | pidgin_ui_get_history_adapter(G_GNUC_UNUSED PurpleUi *ui) { |
|
ecf0fdfc8363
Add a get_history_adapter method to PurpleUi and implement in Pidgin and Finch
Gary Kramlich <grim@reaperworld.com>
parents:
42410
diff
changeset
|
173 | PurpleHistoryAdapter *adapter = NULL; |
|
ecf0fdfc8363
Add a get_history_adapter method to PurpleUi and implement in Pidgin and Finch
Gary Kramlich <grim@reaperworld.com>
parents:
42410
diff
changeset
|
174 | char *filename = NULL; |
|
ecf0fdfc8363
Add a get_history_adapter method to PurpleUi and implement in Pidgin and Finch
Gary Kramlich <grim@reaperworld.com>
parents:
42410
diff
changeset
|
175 | |
|
ecf0fdfc8363
Add a get_history_adapter method to PurpleUi and implement in Pidgin and Finch
Gary Kramlich <grim@reaperworld.com>
parents:
42410
diff
changeset
|
176 | g_mkdir_with_parents(purple_config_dir(), 0700); |
|
ecf0fdfc8363
Add a get_history_adapter method to PurpleUi and implement in Pidgin and Finch
Gary Kramlich <grim@reaperworld.com>
parents:
42410
diff
changeset
|
177 | |
|
ecf0fdfc8363
Add a get_history_adapter method to PurpleUi and implement in Pidgin and Finch
Gary Kramlich <grim@reaperworld.com>
parents:
42410
diff
changeset
|
178 | filename = g_build_filename(purple_config_dir(), "history.db", NULL); |
|
ecf0fdfc8363
Add a get_history_adapter method to PurpleUi and implement in Pidgin and Finch
Gary Kramlich <grim@reaperworld.com>
parents:
42410
diff
changeset
|
179 | adapter = purple_sqlite_history_adapter_new(filename); |
|
ecf0fdfc8363
Add a get_history_adapter method to PurpleUi and implement in Pidgin and Finch
Gary Kramlich <grim@reaperworld.com>
parents:
42410
diff
changeset
|
180 | g_free(filename); |
|
ecf0fdfc8363
Add a get_history_adapter method to PurpleUi and implement in Pidgin and Finch
Gary Kramlich <grim@reaperworld.com>
parents:
42410
diff
changeset
|
181 | |
|
ecf0fdfc8363
Add a get_history_adapter method to PurpleUi and implement in Pidgin and Finch
Gary Kramlich <grim@reaperworld.com>
parents:
42410
diff
changeset
|
182 | return adapter; |
|
ecf0fdfc8363
Add a get_history_adapter method to PurpleUi and implement in Pidgin and Finch
Gary Kramlich <grim@reaperworld.com>
parents:
42410
diff
changeset
|
183 | } |
|
ecf0fdfc8363
Add a get_history_adapter method to PurpleUi and implement in Pidgin and Finch
Gary Kramlich <grim@reaperworld.com>
parents:
42410
diff
changeset
|
184 | |
|
42475
ce06ca18db9b
Integrate PurplePresenceManager with the core and uis
Gary Kramlich <grim@reaperworld.com>
parents:
42435
diff
changeset
|
185 | static PurplePresenceManager * |
|
ce06ca18db9b
Integrate PurplePresenceManager with the core and uis
Gary Kramlich <grim@reaperworld.com>
parents:
42435
diff
changeset
|
186 | pidgin_ui_get_presence_manager(G_GNUC_UNUSED PurpleUi *ui) { |
|
ce06ca18db9b
Integrate PurplePresenceManager with the core and uis
Gary Kramlich <grim@reaperworld.com>
parents:
42435
diff
changeset
|
187 | PurplePresenceManager *manager = NULL; |
|
42571
722be3b1a8aa
Redesign the presence manager a bit
Gary Kramlich <grim@reaperworld.com>
parents:
42553
diff
changeset
|
188 | char *path = NULL; |
|
42475
ce06ca18db9b
Integrate PurplePresenceManager with the core and uis
Gary Kramlich <grim@reaperworld.com>
parents:
42435
diff
changeset
|
189 | |
|
ce06ca18db9b
Integrate PurplePresenceManager with the core and uis
Gary Kramlich <grim@reaperworld.com>
parents:
42435
diff
changeset
|
190 | g_mkdir_with_parents(purple_config_dir(), 0700); |
|
ce06ca18db9b
Integrate PurplePresenceManager with the core and uis
Gary Kramlich <grim@reaperworld.com>
parents:
42435
diff
changeset
|
191 | |
|
42571
722be3b1a8aa
Redesign the presence manager a bit
Gary Kramlich <grim@reaperworld.com>
parents:
42553
diff
changeset
|
192 | path = g_build_filename(purple_config_dir(), "presences", NULL); |
|
722be3b1a8aa
Redesign the presence manager a bit
Gary Kramlich <grim@reaperworld.com>
parents:
42553
diff
changeset
|
193 | manager = purple_presence_manager_new(path); |
|
722be3b1a8aa
Redesign the presence manager a bit
Gary Kramlich <grim@reaperworld.com>
parents:
42553
diff
changeset
|
194 | g_free(path); |
|
42475
ce06ca18db9b
Integrate PurplePresenceManager with the core and uis
Gary Kramlich <grim@reaperworld.com>
parents:
42435
diff
changeset
|
195 | |
|
ce06ca18db9b
Integrate PurplePresenceManager with the core and uis
Gary Kramlich <grim@reaperworld.com>
parents:
42435
diff
changeset
|
196 | return manager; |
|
ce06ca18db9b
Integrate PurplePresenceManager with the core and uis
Gary Kramlich <grim@reaperworld.com>
parents:
42435
diff
changeset
|
197 | } |
|
ce06ca18db9b
Integrate PurplePresenceManager with the core and uis
Gary Kramlich <grim@reaperworld.com>
parents:
42435
diff
changeset
|
198 | |
|
41867
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
199 | /****************************************************************************** |
|
42913
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
200 | * OpenURI Implementation |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
201 | *****************************************************************************/ |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
202 | static void |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
203 | pidgin_ui_open_uri_cb(GObject *source, GAsyncResult *result, gpointer data) { |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
204 | GError *error = NULL; |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
205 | GTask *task = data; |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
206 | gboolean success = FALSE; |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
207 | |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
208 | success = gtk_uri_launcher_launch_finish(GTK_URI_LAUNCHER(source), result, |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
209 | &error); |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
210 | |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
211 | if(!success) { |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
212 | g_task_return_error(task, error); |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
213 | } else { |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
214 | g_task_return_boolean(task, success); |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
215 | } |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
216 | |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
217 | g_clear_object(&source); |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
218 | g_clear_object(&task); |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
219 | } |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
220 | |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
221 | static void |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
222 | pidgin_ui_open_uri(PurpleUi *ui, const char *uri, GCancellable *cancellable, |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
223 | GAsyncReadyCallback callback, gpointer data) |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
224 | { |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
225 | GTask *task = NULL; |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
226 | GtkUriLauncher *launcher = NULL; |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
227 | |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
228 | if(purple_strempty(uri)) { |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
229 | g_task_report_new_error(ui, callback, data, pidgin_ui_open_uri, |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
230 | PIDGIN_UI_ERROR, 0, _("No URI provided")); |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
231 | |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
232 | return; |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
233 | } |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
234 | |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
235 | task = g_task_new(ui, cancellable, callback, data); |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
236 | g_task_set_source_tag(task, pidgin_ui_open_uri); |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
237 | |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
238 | launcher = gtk_uri_launcher_new(uri); |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
239 | |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
240 | gtk_uri_launcher_launch(launcher, NULL, cancellable, pidgin_ui_open_uri_cb, |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
241 | task); |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
242 | } |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
243 | |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
244 | static gboolean |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
245 | pidgin_ui_open_uri_finish(PurpleUi *ui, GAsyncResult *result, GError **error) { |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
246 | g_return_val_if_fail(PIDGIN_IS_UI(ui), FALSE); |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
247 | |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
248 | g_return_val_if_fail(g_async_result_is_tagged(result, pidgin_ui_open_uri), |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
249 | FALSE); |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
250 | |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
251 | return g_task_propagate_boolean(G_TASK(result), error); |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
252 | } |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
253 | |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
254 | /****************************************************************************** |
|
41867
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
255 | * GObject Implementation |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
256 | *****************************************************************************/ |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
257 | static void |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
258 | pidgin_ui_init(G_GNUC_UNUSED PidginUi *ui) { |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
259 | } |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
260 | |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
261 | static void |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
262 | pidgin_ui_class_init(PidginUiClass *klass) { |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
263 | PurpleUiClass *ui_class = PURPLE_UI_CLASS(klass); |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
264 | |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
265 | ui_class->prefs_init = pidgin_ui_prefs_init; |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
266 | ui_class->start = pidgin_ui_start; |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
267 | ui_class->stop = pidgin_ui_stop; |
|
42777
8b4f02641aa9
The first steps of making the conversation manager persistent
Gary Kramlich <grim@reaperworld.com>
parents:
42764
diff
changeset
|
268 | ui_class->get_conversation_manager = pidgin_ui_get_conversation_manager; |
|
41867
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
269 | ui_class->get_settings_backend = pidgin_ui_get_settings_backend; |
|
42435
ecf0fdfc8363
Add a get_history_adapter method to PurpleUi and implement in Pidgin and Finch
Gary Kramlich <grim@reaperworld.com>
parents:
42410
diff
changeset
|
270 | ui_class->get_history_adapter = pidgin_ui_get_history_adapter; |
|
42475
ce06ca18db9b
Integrate PurplePresenceManager with the core and uis
Gary Kramlich <grim@reaperworld.com>
parents:
42435
diff
changeset
|
271 | ui_class->get_presence_manager = pidgin_ui_get_presence_manager; |
|
42913
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
272 | |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
273 | ui_class->open_uri = pidgin_ui_open_uri; |
|
3da85f0c0ee6
Implement Purple.Ui.open_uri_async in Pidgin.Ui
Gary Kramlich <grim@reaperworld.com>
parents:
42833
diff
changeset
|
274 | ui_class->open_uri_finish = pidgin_ui_open_uri_finish; |
|
41867
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
275 | } |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
276 | |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
277 | /****************************************************************************** |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
278 | * Public UI |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
279 | *****************************************************************************/ |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
280 | PurpleUi * |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
281 | pidgin_ui_new(void) { |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
282 | return g_object_new( |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
283 | PIDGIN_TYPE_UI, |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
284 | "id", "pidgin3", |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
285 | "name", PIDGIN_NAME, |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
286 | "version", VERSION, |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
287 | "website", "https://pidgin.im", |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
288 | "support-website", "https://pidgin.im/contact/", |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
289 | "client-type", "pc", |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
290 | NULL); |
|
5375c1d58c50
Create PurpleUi that merges PurpleCoreUiOps and PurpleUiInfo
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
291 | } |