pidgin/pidginabout.c

Sat, 07 Nov 2020 02:21:44 -0600

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Sat, 07 Nov 2020 02:21:44 -0600
changeset 40588
abf38be27d21
parent 40539
2941deda6d8d
child 40605
db61db6af817
permissions
-rw-r--r--

Rename a few things in Jabber SI xfer to be clearer.

A small followup to the previous review, which I noticed while working on Bonjour's version.

Testing Done:
compile only.

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

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 /******************************************************************************
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 * Helpers
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 *****************************************************************************/
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
73 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
74 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
75
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
76 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
77
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
78 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
79 }
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
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
81 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
82 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
83 GtkTextIter start;
38664
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
84 GInputStream *istream = NULL;
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
85 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
86 TalkatuMarkdownBuffer *md_buffer = NULL;
38664
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
87 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
88 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
89
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
90 /* 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
91 istream = g_resource_open_stream(pidgin_get_resource(),
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
92 "/im/pidgin/Pidgin/About/about.md",
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
93 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
94
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
95 str = g_string_new("");
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
96
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
97 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
98 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
99 size += read;
38664
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
100 }
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
101
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
102 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
103
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
104 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
105 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
106
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
107 g_string_free(str, TRUE);
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
108
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
109 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
110 }
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 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
113 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
114 GInputStream *istream = NULL;
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
115 GList *l = NULL, *sections = NULL;
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
116 GError *error = NULL;
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
117 JsonParser *parser = NULL;
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
118 JsonNode *root_node = NULL;
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
119 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
120 JsonArray *sections_array = NULL;
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
121
38681
ee42a17715ac Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents: 38680
diff changeset
122 /* 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
123 istream = g_resource_open_stream(pidgin_get_resource(),
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
124 "/im/pidgin/Pidgin/About/credits.json",
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
125 G_RESOURCE_LOOKUP_FLAGS_NONE, NULL);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
126
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
127 /* create our parser */
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
128 parser = json_parser_new();
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
129
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
130 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
131 g_critical("%s", error->message);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
132 }
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
133
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
134 root_node = json_parser_get_root(parser);
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
135 root_object = json_node_get_object(root_node);
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
136
38681
ee42a17715ac Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents: 38680
diff changeset
137 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
138 sections = json_array_get_elements(sections_array);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
139
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
140 for(l = sections; l; l = l->next) {
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
141 GtkTreeIter section_iter;
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
142 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
143 JsonArray *people = NULL;
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
144 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
145 const gchar *title = NULL;
38672
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
146 guint idx = 0, n_people = 0;
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
147
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
148 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
149 markup = g_strdup_printf("<b><big>%s</big></b>", title);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
150
38681
ee42a17715ac Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents: 38680
diff changeset
151 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
152 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
153 0, markup,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
154 1, 0.5f,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
155 -1);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
156
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
157 g_free(markup);
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
158
38672
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
159 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
160 n_people = json_array_get_length(people);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
161
38672
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
162 for(idx = 0; idx < n_people; idx++) {
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
163 GtkTreeIter person_iter;
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
164
38681
ee42a17715ac Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents: 38680
diff changeset
165 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
166 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
167 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
168 1, 0.5f,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
169 -1);
38662
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
170 }
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
171 }
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
172
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
173 g_list_free(sections);
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
174
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
175 /* clean up */
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
176 g_object_unref(G_OBJECT(parser));
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_input_stream_close(istream, NULL, NULL);
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
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
181 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
182 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
183 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
184 }
38662
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
185
38681
ee42a17715ac Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents: 38680
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_translators(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->translators_store, "languages");
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
189 }
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
190
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
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_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
193 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
194 {
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
195 GtkTreeIter section, value;
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
196 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
197 gchar *markup = NULL;
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
198 gint idx = 0;
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
199
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
200 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
201 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
202 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
203 0, markup,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
204 -1);
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
205 g_free(markup);
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
206
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
207 /* 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
208 splits = g_strsplit(build_args, " ", -1);
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
209 for(idx = 0; splits[idx]; idx++) {
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
210 gchar **value_split = g_strsplit(splits[idx], "=", 2);
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
211
38672
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
212 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
213 continue;
f8ae2ff1c19b Fix up the autotools support
Gary Kramlich <grim@reaperworld.com>
parents: 38666
diff changeset
214 }
f8ae2ff1c19b Fix up the autotools support
Gary Kramlich <grim@reaperworld.com>
parents: 38666
diff changeset
215
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
216 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
217 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
218 1, value_split[1] ? value_split[1] : "", -1);
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
219
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
220 g_strfreev(value_split);
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
221 }
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
222
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
223 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
224 }
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
225
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
226 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
227 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
228 GtkTreeIter *section,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
229 const gchar *title,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
230 guint major,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
231 guint minor,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
232 guint micro)
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
233 {
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
234 GtkTreeIter item;
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
235 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
236
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
237 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
238 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
239 0, title,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
240 1, version,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
241 -1);
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
242 g_free(version);
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
243 }
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
244
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
245 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
246 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
247 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
248 gchar *markup = NULL;
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
249
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
250 /* 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
251 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
252 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
253 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
254 0, markup,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
255 -1);
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
256 g_free(markup);
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
257
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
258 /* 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
259 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
260 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
261 0, "Commit Hash",
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
262 1, REVISION,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
263 -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
264
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
265 /* 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
266 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
267 &section, _("Purple Version"),
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
268 PURPLE_MAJOR_VERSION,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
269 PURPLE_MINOR_VERSION,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
270 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
271
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
272 /* 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
273 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
274 &section, _("GLib Version"),
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
275 GLIB_MAJOR_VERSION,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
276 GLIB_MINOR_VERSION,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
277 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
278
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
279 /* 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
280 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
281 &section, _("GTK Version"),
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
282 GTK_MAJOR_VERSION,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
283 GTK_MINOR_VERSION,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
284 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
285 }
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
286
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
287 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
288 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
289 GtkTreeIter section;
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
290 gchar *markup = NULL;
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 /* 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
293 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
294 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
295 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
296 0, markup,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
297 -1);
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
298 g_free(markup);
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
299
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
300 /* 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
301 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
302 &section, _("Purple Version"),
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
303 purple_major_version,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
304 purple_minor_version,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
305 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
306
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
307 /* 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
308 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
309 &section, _("GLib Version"),
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
310 glib_major_version,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
311 glib_minor_version,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
312 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
313
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
314 /* 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
315 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
316 &section, _("GTK Version"),
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
317 gtk_major_version,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
318 gtk_minor_version,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
319 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
320 }
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
321
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
322 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
323 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
324 GtkTreeIter section;
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
325 GList *path = NULL;
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
326 gchar *markup = NULL;
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
327
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
328 /* create the section */
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
329 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
330 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
331 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
332 0, markup,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
333 -1);
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
334 g_free(markup);
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
335
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
336 /* add the search paths */
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
337 for(path = gplugin_manager_get_paths(); path != NULL; path = path->next) {
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
338 GtkTreeIter iter;
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
339
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
340 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
341 gtk_tree_store_set(about->build_info_store, &iter,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
342 0, (gchar*)path->data,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
343 -1);
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
344 }
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
345 }
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
346
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
347 static void
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
348 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
349 #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
350 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
351 #endif /* MESON_ARGS */
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
352
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
353 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
354 pidgin_about_dialog_load_runtime_info(about);
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
355 pidgin_about_dialog_load_plugin_search_paths(about);
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
356 }
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
357
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
358 /******************************************************************************
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
359 * Callbacks
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
360 *****************************************************************************/
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
361 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
362 pidgin_about_dialog_close(GtkWidget *b, gpointer data) {
38666
c0bf67926a79 Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents: 38665
diff changeset
363 gtk_widget_destroy(GTK_WIDGET(data));
c0bf67926a79 Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents: 38665
diff changeset
364 }
c0bf67926a79 Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents: 38665
diff changeset
365
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
366 /******************************************************************************
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
367 * GObject Implementation
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
368 *****************************************************************************/
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
369 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
370
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
371 static void
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
372 pidgin_about_dialog_class_init(PidginAboutDialogClass *klass) {
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
373 GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
374
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
375 gtk_widget_class_set_template_from_resource(
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
376 widget_class,
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
377 "/im/pidgin/Pidgin/About/about.ui"
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
378 );
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
379
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
380 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
381 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
382 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, stack);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
383
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
384 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
385 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
386
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
387 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
388 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
389 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
390
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
391 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
392 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
393 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
394
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
395 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
396 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
397 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, build_info_treeview);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
398 }
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
399
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
400 static void
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
401 pidgin_about_dialog_init(PidginAboutDialog *about) {
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
402 gtk_widget_init_template(GTK_WIDGET(about));
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
403
38666
c0bf67926a79 Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents: 38665
diff changeset
404 /* wire up the close button */
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
405 g_signal_connect(about->close_button, "clicked",
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
406 G_CALLBACK(pidgin_about_dialog_close), about);
38666
c0bf67926a79 Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents: 38665
diff changeset
407
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
408 /* 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
409 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
410
38664
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
411 /* 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
412 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
413
38662
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
414 /* 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
415 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
416 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
417
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
418 /* 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
419 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
420 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
421
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
422 /* 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
423 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
424 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
425 }
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
426
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
427 /******************************************************************************
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
428 * Public API
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
429 *****************************************************************************/
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
430 GtkWidget *
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
431 pidgin_about_dialog_new(void) {
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
432 return GTK_WIDGET(g_object_new(
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
433 PIDGIN_TYPE_ABOUT_DIALOG,
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
434 "title", "About Pidgin",
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
435 NULL
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
436 ));
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
437 }
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
438

mercurial