pidgin/pidginabout.c

Thu, 27 Jan 2022 20:28:17 -0600

author
Gary Kramlich <grim@reaperworld.com>
date
Thu, 27 Jan 2022 20:28:17 -0600
changeset 41257
e6484f5be7c9
parent 41219
17dd0210fae7
child 41307
685bab46fad2
permissions
-rw-r--r--

Update potfiles to reflect reality

Testing Done:
Ran `ninja pidgin-pot`

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

40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
1 /*
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
2 * Pidgin - Internet Messenger
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
4 *
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
5 * Pidgin is the legal property of its developers, whose names are too numerous
38672
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
7 * source distribution.
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
8 *
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
9 * This program is free software; you can redistribute it and/or modify
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
10 * it under the terms of the GNU General Public License as published by
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
12 * (at your option) any later version.
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
13 *
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
14 * This program is distributed in the hope that it will be useful,
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
17 * GNU General Public License for more details.
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
18 *
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
19 * You should have received a copy of the GNU General Public License
40539
2941deda6d8d Use an https link to gnu.org in the license file headers
Gary Kramlich <grim@reaperworld.com>
parents: 40530
diff changeset
20 * along with this program; if not, see <https://www.gnu.org/licenses/>.
38672
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
21 */
40439
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 39913
diff changeset
22
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 39913
diff changeset
23 #ifdef HAVE_CONFIG_H
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 39913
diff changeset
24 # include <config.h>
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 39913
diff changeset
25 #endif
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 39913
diff changeset
26
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
27 #ifdef HAVE_MESON_CONFIG
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
28 #include "meson-config.h"
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
29 #endif
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
30
40439
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 39913
diff changeset
31 #include <glib/gi18n-lib.h>
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 39913
diff changeset
32
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 #include <gdk-pixbuf/gdk-pixbuf.h>
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
34
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 #include <json-glib/json-glib.h>
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
36
39216
f6ab17b953df Replace the WebkitWebView with Talkatu widgets. There's some bugs, but it mostly works
Gary Kramlich <grim@reaperworld.com>
parents: 38682
diff changeset
37 #include <talkatu.h>
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38
40496
6941fece679b phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
39 #include "pidginabout.h"
6941fece679b phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
40
38665
35676a9b7faa Add the version to the application_name label and add the revision to build info
Gary Kramlich <grim@reaperworld.com>
parents: 38664
diff changeset
41 #include "package_revision.h"
40496
6941fece679b phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
42 #include "gtkutils.h"
6941fece679b phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
43 #include "pidgincore.h"
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44 #include "pidginresources.h"
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45
38682
898b14e03449 Hide the about window's structs since it's a final type
Gary Kramlich <grim@reaperworld.com>
parents: 38681
diff changeset
46 struct _PidginAboutDialog {
898b14e03449 Hide the about window's structs since it's a final type
Gary Kramlich <grim@reaperworld.com>
parents: 38681
diff changeset
47 GtkDialog parent;
898b14e03449 Hide the about window's structs since it's a final type
Gary Kramlich <grim@reaperworld.com>
parents: 38681
diff changeset
48
38666
c0bf67926a79 Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents: 38665
diff changeset
49 GtkWidget *close_button;
38664
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
50 GtkWidget *application_name;
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 GtkWidget *stack;
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52
38664
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
53 GtkWidget *main_scrolled_window;
39216
f6ab17b953df Replace the WebkitWebView with Talkatu widgets. There's some bugs, but it mostly works
Gary Kramlich <grim@reaperworld.com>
parents: 38682
diff changeset
54 GtkTextBuffer *main_buffer;
38664
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
55
38662
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
56 GtkWidget *developers_page;
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
57 GtkWidget *developers_treeview;
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
58 GtkTreeStore *developers_store;
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
59
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
60 GtkWidget *translators_page;
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
61 GtkWidget *translators_treeview;
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
62 GtkTreeStore *translators_store;
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
64 GtkWidget *build_info_page;
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
65 GtkWidget *build_info_treeview;
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
66 GtkTreeStore *build_info_store;
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 };
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69 /******************************************************************************
41219
17dd0210fae7 Make the about dialog into a singleton
Gary Kramlich <grim@reaperworld.com>
parents: 41178
diff changeset
70 * Globals
17dd0210fae7 Make the about dialog into a singleton
Gary Kramlich <grim@reaperworld.com>
parents: 41178
diff changeset
71 *****************************************************************************/
17dd0210fae7 Make the about dialog into a singleton
Gary Kramlich <grim@reaperworld.com>
parents: 41178
diff changeset
72 static GtkWidget *about_dialog = NULL;
17dd0210fae7 Make the about dialog into a singleton
Gary Kramlich <grim@reaperworld.com>
parents: 41178
diff changeset
73
17dd0210fae7 Make the about dialog into a singleton
Gary Kramlich <grim@reaperworld.com>
parents: 41178
diff changeset
74 /******************************************************************************
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 * Helpers
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76 *****************************************************************************/
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
78 pidgin_about_dialog_load_application_name(PidginAboutDialog *about) {
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
79 gchar *label = g_strdup_printf("%s %s", PIDGIN_NAME, VERSION);
38665
35676a9b7faa Add the version to the application_name label and add the revision to build info
Gary Kramlich <grim@reaperworld.com>
parents: 38664
diff changeset
80
39855
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
81 gtk_label_set_text(GTK_LABEL(about->application_name), label);
38665
35676a9b7faa Add the version to the application_name label and add the revision to build info
Gary Kramlich <grim@reaperworld.com>
parents: 38664
diff changeset
82
35676a9b7faa Add the version to the application_name label and add the revision to build info
Gary Kramlich <grim@reaperworld.com>
parents: 38664
diff changeset
83 g_free(label);
35676a9b7faa Add the version to the application_name label and add the revision to build info
Gary Kramlich <grim@reaperworld.com>
parents: 38664
diff changeset
84 }
35676a9b7faa Add the version to the application_name label and add the revision to build info
Gary Kramlich <grim@reaperworld.com>
parents: 38664
diff changeset
85
35676a9b7faa Add the version to the application_name label and add the revision to build info
Gary Kramlich <grim@reaperworld.com>
parents: 38664
diff changeset
86 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
87 pidgin_about_dialog_load_main_page(PidginAboutDialog *about) {
39217
4c5b6c2e7007 use gtk_text_buffer_get_start_iter instead of looking up the insertion mark and all that
Gary Kramlich <grim@reaperworld.com>
parents: 39216
diff changeset
88 GtkTextIter start;
38664
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
89 GInputStream *istream = NULL;
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
90 GString *str = NULL;
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
91 TalkatuMarkdownBuffer *md_buffer = NULL;
38664
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
92 gchar buffer[8192];
39216
f6ab17b953df Replace the WebkitWebView with Talkatu widgets. There's some bugs, but it mostly works
Gary Kramlich <grim@reaperworld.com>
parents: 38682
diff changeset
93 gssize read = 0, size = 0;
38664
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
94
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
95 /* now load the html */
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
96 istream = g_resource_open_stream(pidgin_get_resource(),
41030
ec8b76f3bf0a Fix the resource path so we can use the automatic stuff that GtkApplication supports
Gary Kramlich <grim@reaperworld.com>
parents: 41008
diff changeset
97 "/im/pidgin/Pidgin3/About/about.md",
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
98 G_RESOURCE_LOOKUP_FLAGS_NONE, NULL);
38664
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
99
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
100 str = g_string_new("");
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
101
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
102 while((read = g_input_stream_read(istream, buffer, sizeof(buffer), NULL, NULL)) > 0) {
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
103 g_string_append_len(str, (gchar *)buffer, read);
39216
f6ab17b953df Replace the WebkitWebView with Talkatu widgets. There's some bugs, but it mostly works
Gary Kramlich <grim@reaperworld.com>
parents: 38682
diff changeset
104 size += read;
38664
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
105 }
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
106
39855
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
107 gtk_text_buffer_get_start_iter(about->main_buffer, &start);
39216
f6ab17b953df Replace the WebkitWebView with Talkatu widgets. There's some bugs, but it mostly works
Gary Kramlich <grim@reaperworld.com>
parents: 38682
diff changeset
108
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
109 md_buffer = TALKATU_MARKDOWN_BUFFER(about->main_buffer);
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
110 talkatu_markdown_buffer_insert_markdown(md_buffer, &start, str->str, size);
38664
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
111
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
112 g_string_free(str, TRUE);
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
113
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
114 g_input_stream_close(istream, NULL, NULL);
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
115 }
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
116
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
117 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
118 pidgin_about_dialog_load_json(GtkTreeStore *store, const gchar *json_section) {
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
119 GInputStream *istream = NULL;
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
120 GList *l = NULL, *sections = NULL;
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
121 GError *error = NULL;
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
122 JsonParser *parser = NULL;
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
123 JsonNode *root_node = NULL;
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
124 JsonObject *root_object = NULL;
38681
ee42a17715ac Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents: 38680
diff changeset
125 JsonArray *sections_array = NULL;
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
126
38681
ee42a17715ac Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents: 38680
diff changeset
127 /* get a stream to the credits resource */
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
128 istream = g_resource_open_stream(pidgin_get_resource(),
41030
ec8b76f3bf0a Fix the resource path so we can use the automatic stuff that GtkApplication supports
Gary Kramlich <grim@reaperworld.com>
parents: 41008
diff changeset
129 "/im/pidgin/Pidgin3/About/credits.json",
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
130 G_RESOURCE_LOOKUP_FLAGS_NONE, NULL);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
131
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
132 /* create our parser */
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
133 parser = json_parser_new();
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
134
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
135 if(!json_parser_load_from_stream(parser, istream, NULL, &error)) {
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
136 g_critical("%s", error->message);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
137 }
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
138
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
139 root_node = json_parser_get_root(parser);
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
140 root_object = json_node_get_object(root_node);
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
141
38681
ee42a17715ac Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents: 38680
diff changeset
142 sections_array = json_object_get_array_member(root_object, json_section);
ee42a17715ac Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents: 38680
diff changeset
143 sections = json_array_get_elements(sections_array);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
144
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
145 for(l = sections; l; l = l->next) {
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
146 GtkTreeIter section_iter;
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
147 JsonObject *section = json_node_get_object(l->data);
38672
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
148 JsonArray *people = NULL;
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
149 gchar *markup = NULL;
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
150 const gchar *title = NULL;
38672
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
151 guint idx = 0, n_people = 0;
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
152
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
153 title = json_object_get_string_member(section, "title");
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
154 markup = g_strdup_printf("<b><big>%s</big></b>", title);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
155
38681
ee42a17715ac Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents: 38680
diff changeset
156 gtk_tree_store_append(store, &section_iter, NULL);
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
157 gtk_tree_store_set(store, &section_iter,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
158 0, markup,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
159 1, 0.5f,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
160 -1);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
161
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
162 g_free(markup);
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
163
38672
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
164 people = json_object_get_array_member(section, "people");
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
165 n_people = json_array_get_length(people);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
166
38672
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
167 for(idx = 0; idx < n_people; idx++) {
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
168 GtkTreeIter person_iter;
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
169
38681
ee42a17715ac Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents: 38680
diff changeset
170 gtk_tree_store_append(store, &person_iter, &section_iter);
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
171 gtk_tree_store_set(store, &person_iter,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
172 0, json_array_get_string_element(people, idx),
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
173 1, 0.5f,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
174 -1);
38662
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
175 }
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
176 }
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
177
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
178 g_list_free(sections);
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
179
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
180 /* clean up */
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
181 g_object_unref(G_OBJECT(parser));
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
182
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
183 g_input_stream_close(istream, NULL, NULL);
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
184 }
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
185
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
186 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
187 pidgin_about_dialog_load_developers(PidginAboutDialog *about) {
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
188 pidgin_about_dialog_load_json(about->developers_store, "developers");
38681
ee42a17715ac Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents: 38680
diff changeset
189 }
38662
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
190
38681
ee42a17715ac Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents: 38680
diff changeset
191 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
192 pidgin_about_dialog_load_translators(PidginAboutDialog *about) {
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
193 pidgin_about_dialog_load_json(about->translators_store, "languages");
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
194 }
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
195
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
196 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
197 pidgin_about_dialog_add_build_args(PidginAboutDialog *about, const gchar *title,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
198 const gchar *build_args)
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
199 {
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
200 GtkTreeIter section, value;
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
201 gchar **splits = NULL;
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
202 gchar *markup = NULL;
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
203 gint idx = 0;
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
204
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
205 markup = g_strdup_printf("<b>%s</b>", title);
39855
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
206 gtk_tree_store_append(about->build_info_store, &section, NULL);
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
207 gtk_tree_store_set(about->build_info_store, &section,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
208 0, markup,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
209 -1);
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
210 g_free(markup);
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
211
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
212 /* now walk through the arguments and add them */
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
213 splits = g_strsplit(build_args, " ", -1);
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
214 for(idx = 0; splits[idx]; idx++) {
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
215 gchar **value_split = g_strsplit(splits[idx], "=", 2);
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
216
38672
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
217 if(value_split[0] == NULL || value_split[0][0] == '\0') {
38667
f8ae2ff1c19b Fix up the autotools support
Gary Kramlich <grim@reaperworld.com>
parents: 38666
diff changeset
218 continue;
f8ae2ff1c19b Fix up the autotools support
Gary Kramlich <grim@reaperworld.com>
parents: 38666
diff changeset
219 }
f8ae2ff1c19b Fix up the autotools support
Gary Kramlich <grim@reaperworld.com>
parents: 38666
diff changeset
220
39855
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
221 gtk_tree_store_append(about->build_info_store, &value, &section);
39913
ce96d4639dc7 Remove redundant conditions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39855
diff changeset
222 gtk_tree_store_set(about->build_info_store, &value, 0, value_split[0],
ce96d4639dc7 Remove redundant conditions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39855
diff changeset
223 1, value_split[1] ? value_split[1] : "", -1);
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
224
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
225 g_strfreev(value_split);
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
226 }
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
227
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
228 g_strfreev(splits);
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
229 }
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
230
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
231 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
232 pidgin_about_dialog_build_info_add_version(GtkTreeStore *store,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
233 GtkTreeIter *section,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
234 const gchar *title,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
235 guint major,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
236 guint minor,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
237 guint micro)
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
238 {
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
239 GtkTreeIter item;
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
240 gchar *version = g_strdup_printf("%u.%u.%u", major, minor, micro);
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
241
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
242 gtk_tree_store_append(store, &item, section);
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
243 gtk_tree_store_set(store, &item,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
244 0, title,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
245 1, version,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
246 -1);
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
247 g_free(version);
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
248 }
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
249
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
250 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
251 pidgin_about_dialog_load_build_info(PidginAboutDialog *about) {
38665
35676a9b7faa Add the version to the application_name label and add the revision to build info
Gary Kramlich <grim@reaperworld.com>
parents: 38664
diff changeset
252 GtkTreeIter section, item;
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
253 gchar *markup = NULL;
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
254
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
255 /* create the section */
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
256 markup = g_strdup_printf("<b>%s</b>", _("Build Information"));
39855
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
257 gtk_tree_store_append(about->build_info_store, &section, NULL);
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
258 gtk_tree_store_set(about->build_info_store, &section,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
259 0, markup,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
260 -1);
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
261 g_free(markup);
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
262
38665
35676a9b7faa Add the version to the application_name label and add the revision to build info
Gary Kramlich <grim@reaperworld.com>
parents: 38664
diff changeset
263 /* add the commit hash */
39855
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
264 gtk_tree_store_append(about->build_info_store, &item, &section);
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
265 gtk_tree_store_set(about->build_info_store, &item,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
266 0, "Commit Hash",
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
267 1, REVISION,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
268 -1);
38665
35676a9b7faa Add the version to the application_name label and add the revision to build info
Gary Kramlich <grim@reaperworld.com>
parents: 38664
diff changeset
269
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
270 /* add the purple version */
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
271 pidgin_about_dialog_build_info_add_version(about->build_info_store,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
272 &section, _("Purple Version"),
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
273 PURPLE_MAJOR_VERSION,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
274 PURPLE_MINOR_VERSION,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
275 PURPLE_MICRO_VERSION);
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
276
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
277 /* add the glib version */
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
278 pidgin_about_dialog_build_info_add_version(about->build_info_store,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
279 &section, _("GLib Version"),
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
280 GLIB_MAJOR_VERSION,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
281 GLIB_MINOR_VERSION,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
282 GLIB_MICRO_VERSION);
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
283
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
284 /* add the gtk version */
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
285 pidgin_about_dialog_build_info_add_version(about->build_info_store,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
286 &section, _("GTK Version"),
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
287 GTK_MAJOR_VERSION,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
288 GTK_MINOR_VERSION,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
289 GTK_MICRO_VERSION);
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
290 }
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
291
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
292 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
293 pidgin_about_dialog_load_runtime_info(PidginAboutDialog *about) {
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
294 GtkTreeIter section;
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
295 gchar *markup = NULL;
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
296
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
297 /* create the section */
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
298 markup = g_strdup_printf("<b>%s</b>", _("Runtime Information"));
39855
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
299 gtk_tree_store_append(about->build_info_store, &section, NULL);
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
300 gtk_tree_store_set(about->build_info_store, &section,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
301 0, markup,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
302 -1);
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
303 g_free(markup);
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
304
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
305 /* add the purple version */
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
306 pidgin_about_dialog_build_info_add_version(about->build_info_store,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
307 &section, _("Purple Version"),
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
308 purple_major_version,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
309 purple_minor_version,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
310 purple_micro_version);
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
311
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
312 /* add the glib version */
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
313 pidgin_about_dialog_build_info_add_version(about->build_info_store,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
314 &section, _("GLib Version"),
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
315 glib_major_version,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
316 glib_minor_version,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
317 glib_micro_version);
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
318
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
319 /* add the gtk version */
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
320 pidgin_about_dialog_build_info_add_version(about->build_info_store,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
321 &section, _("GTK Version"),
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
322 gtk_major_version,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
323 gtk_minor_version,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
324 gtk_micro_version);
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
325 }
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
326
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
327 static void
40605
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
328 pidgin_about_dialog_load_gtk_settings(PidginAboutDialog *about) {
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
329 GtkTreeIter section, iter;
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
330 gchar *markup = NULL;
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
331 gchar *cursor_theme_name = NULL, *theme_name = NULL;
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
332 gchar *icon_theme_name = NULL, *fallback_icon_theme = NULL;
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
333 gchar *im_module = NULL;
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
334 gchar *key_theme_name = NULL, *sound_theme_name = NULL;
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
335 gboolean enable_animations = FALSE;
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
336 gboolean shell_shows_app_menu = FALSE, shell_shows_menubar = FALSE;
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
337
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
338 /* create the section */
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
339 markup = g_strdup_printf("<b>%s</b>", _("GTK Settings"));
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
340 gtk_tree_store_append(about->build_info_store, &section, NULL);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
341 gtk_tree_store_set(about->build_info_store, &section,
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
342 0, markup,
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
343 -1);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
344 g_free(markup);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
345
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
346 /* get the settings we're interested in */
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
347 g_object_get(
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
348 gtk_settings_get_default(),
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
349 "gtk-cursor-theme-name", &cursor_theme_name,
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
350 "gtk-enable-animations", &enable_animations,
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
351 "gtk-fallback-icon-theme", &fallback_icon_theme,
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
352 "gtk-icon-theme-name", &icon_theme_name,
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
353 "gtk-im-module", &im_module,
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
354 "gtk-key-theme-name", &key_theme_name,
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
355 "gtk-shell-shows-app-menu", &shell_shows_app_menu,
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
356 "gtk-shell-shows-menubar", &shell_shows_menubar,
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
357 "gtk-sound-theme-name", &sound_theme_name,
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
358 "gtk-theme-name", &theme_name,
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
359 NULL);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
360
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
361 gtk_tree_store_append(about->build_info_store, &iter, &section);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
362 gtk_tree_store_set(about->build_info_store, &iter,
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
363 0, "gtk-cursor-theme-name",
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
364 1, (cursor_theme_name != NULL) ? cursor_theme_name : _("(not set)"),
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
365 -1);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
366
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
367 gtk_tree_store_append(about->build_info_store, &iter, &section);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
368 gtk_tree_store_set(about->build_info_store, &iter,
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
369 0, "gtk-enable-animations",
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
370 1, enable_animations ? _("yes") : _("no"),
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
371 -1);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
372
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
373 gtk_tree_store_append(about->build_info_store, &iter, &section);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
374 gtk_tree_store_set(about->build_info_store, &iter,
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
375 0, "gtk-fallback-icon-theme",
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
376 1, (fallback_icon_theme != NULL) ? fallback_icon_theme : _("(not set)"),
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
377 -1);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
378
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
379 gtk_tree_store_append(about->build_info_store, &iter, &section);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
380 gtk_tree_store_set(about->build_info_store, &iter,
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
381 0, "gtk-icon-theme-name",
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
382 1, (icon_theme_name != NULL) ? icon_theme_name : _("(not set)"),
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
383 -1);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
384
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
385 gtk_tree_store_append(about->build_info_store, &iter, &section);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
386 gtk_tree_store_set(about->build_info_store, &iter,
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
387 0, "gtk-im-module",
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
388 1, (im_module != NULL) ? im_module : _("(not set)"),
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
389 -1);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
390
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
391 gtk_tree_store_append(about->build_info_store, &iter, &section);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
392 gtk_tree_store_set(about->build_info_store, &iter,
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
393 0, "gtk-key-theme-name",
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
394 1, (key_theme_name != NULL) ? key_theme_name : _("(not set)"),
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
395 -1);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
396
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
397 gtk_tree_store_append(about->build_info_store, &iter, &section);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
398 gtk_tree_store_set(about->build_info_store, &iter,
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
399 0, "gtk-shell-shows-app-menu",
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
400 1, shell_shows_app_menu ? _("yes") : _("no"),
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
401 -1);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
402
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
403 gtk_tree_store_append(about->build_info_store, &iter, &section);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
404 gtk_tree_store_set(about->build_info_store, &iter,
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
405 0, "gtk-shell-shows-menubar",
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
406 1, shell_shows_menubar ? _("yes") : _("no"),
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
407 -1);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
408
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
409 gtk_tree_store_append(about->build_info_store, &iter, &section);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
410 gtk_tree_store_set(about->build_info_store, &iter,
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
411 0, "gtk-sound-theme-name",
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
412 1, (sound_theme_name != NULL) ? sound_theme_name : _("(not set)"),
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
413 -1);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
414
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
415 gtk_tree_store_append(about->build_info_store, &iter, &section);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
416 gtk_tree_store_set(about->build_info_store, &iter,
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
417 0, "gtk-theme-name",
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
418 1, (theme_name != NULL) ? theme_name : _("(not set)"),
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
419 -1);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
420
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
421 g_free(cursor_theme_name);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
422 g_free(fallback_icon_theme);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
423 g_free(icon_theme_name);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
424 g_free(im_module);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
425 g_free(key_theme_name);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
426 g_free(sound_theme_name);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
427 g_free(theme_name);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
428 }
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
429
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
430 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
431 pidgin_about_dialog_load_plugin_search_paths(PidginAboutDialog *about) {
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
432 GtkTreeIter section;
41008
dc06703548a1 Update everything for GPlugin 0.33.0
Gary Kramlich <grim@reaperworld.com>
parents: 40830
diff changeset
433 GList *paths = NULL;
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
434 gchar *markup = NULL;
41008
dc06703548a1 Update everything for GPlugin 0.33.0
Gary Kramlich <grim@reaperworld.com>
parents: 40830
diff changeset
435 GPluginManager *manager = gplugin_manager_get_default();
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
436
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
437 /* create the section */
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
438 markup = g_strdup_printf("<b>%s</b>", _("Plugin Search Paths"));
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
439 gtk_tree_store_append(about->build_info_store, &section, NULL);
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
440 gtk_tree_store_set(about->build_info_store, &section,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
441 0, markup,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
442 -1);
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
443 g_free(markup);
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
444
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
445 /* add the search paths */
41008
dc06703548a1 Update everything for GPlugin 0.33.0
Gary Kramlich <grim@reaperworld.com>
parents: 40830
diff changeset
446 paths = gplugin_manager_get_paths(manager);
dc06703548a1 Update everything for GPlugin 0.33.0
Gary Kramlich <grim@reaperworld.com>
parents: 40830
diff changeset
447 while(paths != NULL) {
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
448 GtkTreeIter iter;
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
449
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
450 gtk_tree_store_append(about->build_info_store, &iter, &section);
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
451 gtk_tree_store_set(about->build_info_store, &iter,
41008
dc06703548a1 Update everything for GPlugin 0.33.0
Gary Kramlich <grim@reaperworld.com>
parents: 40830
diff changeset
452 0, (gchar*)(paths->data),
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
453 -1);
41008
dc06703548a1 Update everything for GPlugin 0.33.0
Gary Kramlich <grim@reaperworld.com>
parents: 40830
diff changeset
454
dc06703548a1 Update everything for GPlugin 0.33.0
Gary Kramlich <grim@reaperworld.com>
parents: 40830
diff changeset
455 paths = paths->next;
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
456 }
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
457 }
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
458
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
459 static void
40830
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
460 pidgin_about_dialog_load_conf_path_info(PidginAboutDialog *about) {
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
461 GtkTreeIter section, iter;
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
462 gchar *markup = NULL;
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
463 const gchar *path = NULL;
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
464
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
465 /* create the section */
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
466 markup = g_strdup_printf("<b>%s</b>", _("Runtime Directories"));
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
467 gtk_tree_store_append(about->build_info_store, &section, NULL);
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
468 gtk_tree_store_set(about->build_info_store, &section,
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
469 0, markup,
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
470 -1);
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
471 g_free(markup);
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
472
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
473 /* add the cache directory path */
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
474 path = purple_cache_dir();
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
475 gtk_tree_store_append(about->build_info_store, &iter, &section);
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
476 gtk_tree_store_set(about->build_info_store, &iter,
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
477 0, _("Cache"),
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
478 1, (gchar*)path,
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
479 -1);
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
480
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
481 /* add the config directory path */
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
482 path = purple_config_dir();
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
483 gtk_tree_store_append(about->build_info_store, &iter, &section);
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
484 gtk_tree_store_set(about->build_info_store, &iter,
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
485 0, _("Configuration"),
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
486 1, (gchar*)path,
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
487 -1);
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
488
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
489 /* add the data directory path */
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
490 path = purple_data_dir();
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
491 gtk_tree_store_append(about->build_info_store, &iter, &section);
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
492 gtk_tree_store_set(about->build_info_store, &iter,
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
493 0, _("Data"),
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
494 1, (gchar*)path,
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
495 -1);
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
496 }
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
497
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
498 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
499 pidgin_about_dialog_load_build_configuration(PidginAboutDialog *about) {
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
500 #ifdef MESON_ARGS
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
501 pidgin_about_dialog_add_build_args(about, _("Meson Arguments"), MESON_ARGS);
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
502 #endif /* MESON_ARGS */
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
503
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
504 pidgin_about_dialog_load_build_info(about);
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
505 pidgin_about_dialog_load_runtime_info(about);
40605
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
506 pidgin_about_dialog_load_gtk_settings(about);
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
507 pidgin_about_dialog_load_plugin_search_paths(about);
40830
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
508 pidgin_about_dialog_load_conf_path_info(about);
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
509 }
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
510
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
511 /******************************************************************************
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
512 * Callbacks
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
513 *****************************************************************************/
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
514 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
515 pidgin_about_dialog_close(GtkWidget *b, gpointer data) {
38666
c0bf67926a79 Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents: 38665
diff changeset
516 gtk_widget_destroy(GTK_WIDGET(data));
c0bf67926a79 Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents: 38665
diff changeset
517 }
c0bf67926a79 Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents: 38665
diff changeset
518
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
519 /******************************************************************************
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
520 * GObject Implementation
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
521 *****************************************************************************/
39855
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
522 G_DEFINE_TYPE(PidginAboutDialog, pidgin_about_dialog, GTK_TYPE_DIALOG);
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
523
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
524 static void
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
525 pidgin_about_dialog_class_init(PidginAboutDialogClass *klass) {
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
526 GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
527
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
528 gtk_widget_class_set_template_from_resource(
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
529 widget_class,
41030
ec8b76f3bf0a Fix the resource path so we can use the automatic stuff that GtkApplication supports
Gary Kramlich <grim@reaperworld.com>
parents: 41008
diff changeset
530 "/im/pidgin/Pidgin3/About/about.ui"
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
531 );
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
532
39855
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
533 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, close_button);
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
534 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, application_name);
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
535 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, stack);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
536
39855
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
537 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, main_scrolled_window);
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
538 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, main_buffer);
38664
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
539
39855
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
540 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, developers_page);
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
541 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, developers_store);
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
542 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, developers_treeview);
38662
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
543
39855
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
544 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, translators_page);
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
545 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, translators_store);
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
546 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, translators_treeview);
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
547
39855
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
548 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, build_info_page);
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
549 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, build_info_store);
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
550 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, build_info_treeview);
41178
f47c2b18648e Connect the close signal of the about dialog in the template instead of C code
Gary Kramlich <grim@reaperworld.com>
parents: 41030
diff changeset
551
f47c2b18648e Connect the close signal of the about dialog in the template instead of C code
Gary Kramlich <grim@reaperworld.com>
parents: 41030
diff changeset
552 gtk_widget_class_bind_template_callback(widget_class, pidgin_about_dialog_close);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
553 }
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
554
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
555 static void
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
556 pidgin_about_dialog_init(PidginAboutDialog *about) {
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
557 gtk_widget_init_template(GTK_WIDGET(about));
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
558
38665
35676a9b7faa Add the version to the application_name label and add the revision to build info
Gary Kramlich <grim@reaperworld.com>
parents: 38664
diff changeset
559 /* setup the application name label */
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
560 pidgin_about_dialog_load_application_name(about);
38665
35676a9b7faa Add the version to the application_name label and add the revision to build info
Gary Kramlich <grim@reaperworld.com>
parents: 38664
diff changeset
561
38664
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
562 /* setup the main page */
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
563 pidgin_about_dialog_load_main_page(about);
38664
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
564
38662
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
565 /* setup the developers stuff */
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
566 pidgin_about_dialog_load_developers(about);
39855
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
567 gtk_tree_view_expand_all(GTK_TREE_VIEW(about->developers_treeview));
38662
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
568
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
569 /* setup the translators stuff */
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
570 pidgin_about_dialog_load_translators(about);
39855
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
571 gtk_tree_view_expand_all(GTK_TREE_VIEW(about->translators_treeview));
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
572
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
573 /* setup the build info page */
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
574 pidgin_about_dialog_load_build_configuration(about);
39855
7c9c4d700ed2 Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 39533
diff changeset
575 gtk_tree_view_expand_all(GTK_TREE_VIEW(about->build_info_treeview));
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
576 }
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
577
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
578 /******************************************************************************
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
579 * Public API
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
580 *****************************************************************************/
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
581 GtkWidget *
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
582 pidgin_about_dialog_new(void) {
41219
17dd0210fae7 Make the about dialog into a singleton
Gary Kramlich <grim@reaperworld.com>
parents: 41178
diff changeset
583 if(GTK_IS_WIDGET(about_dialog)) {
17dd0210fae7 Make the about dialog into a singleton
Gary Kramlich <grim@reaperworld.com>
parents: 41178
diff changeset
584 return about_dialog;
17dd0210fae7 Make the about dialog into a singleton
Gary Kramlich <grim@reaperworld.com>
parents: 41178
diff changeset
585 }
17dd0210fae7 Make the about dialog into a singleton
Gary Kramlich <grim@reaperworld.com>
parents: 41178
diff changeset
586
17dd0210fae7 Make the about dialog into a singleton
Gary Kramlich <grim@reaperworld.com>
parents: 41178
diff changeset
587 about_dialog = g_object_new(
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
588 PIDGIN_TYPE_ABOUT_DIALOG,
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
589 "title", "About Pidgin",
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
590 NULL
41219
17dd0210fae7 Make the about dialog into a singleton
Gary Kramlich <grim@reaperworld.com>
parents: 41178
diff changeset
591 );
17dd0210fae7 Make the about dialog into a singleton
Gary Kramlich <grim@reaperworld.com>
parents: 41178
diff changeset
592
17dd0210fae7 Make the about dialog into a singleton
Gary Kramlich <grim@reaperworld.com>
parents: 41178
diff changeset
593 g_object_add_weak_pointer(G_OBJECT(about_dialog),
17dd0210fae7 Make the about dialog into a singleton
Gary Kramlich <grim@reaperworld.com>
parents: 41178
diff changeset
594 (gpointer)&about_dialog);
17dd0210fae7 Make the about dialog into a singleton
Gary Kramlich <grim@reaperworld.com>
parents: 41178
diff changeset
595
17dd0210fae7 Make the about dialog into a singleton
Gary Kramlich <grim@reaperworld.com>
parents: 41178
diff changeset
596 return about_dialog;
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
597 }
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
598

mercurial