pidgin/pidginabout.c

Tue, 23 Aug 2022 01:58:39 -0500

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Tue, 23 Aug 2022 01:58:39 -0500
branch
gtk4
changeset 41573
2c4955b639a1
parent 41525
87e0e009f5c1
child 41595
61d8f39f3d70
permissions
-rw-r--r--

Port add contact notification to GTK4

Testing Done:
Compiled only; I don't have a menu to trigger the demo action.

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

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(),
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
92 "/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
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(),
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
124 "/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
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"),
41525
87e0e009f5c1 Convert some stuff in PidginAbout that was renamed in GTK4
Gary Kramlich <grim@reaperworld.com>
parents: 41372
diff changeset
317 gtk_get_major_version(),
87e0e009f5c1 Convert some stuff in PidginAbout that was renamed in GTK4
Gary Kramlich <grim@reaperworld.com>
parents: 41372
diff changeset
318 gtk_get_minor_version(),
87e0e009f5c1 Convert some stuff in PidginAbout that was renamed in GTK4
Gary Kramlich <grim@reaperworld.com>
parents: 41372
diff changeset
319 gtk_get_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
40605
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
323 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
324 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
325 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
326 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
327 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
328 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
329 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
330 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
331 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
332
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
333 /* 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
334 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
335 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
336 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
337 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
338 -1);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
339 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
340
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
341 /* 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
342 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
343 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
344 "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
345 "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
346 "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
347 "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
348 "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
349 "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
350 "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
351 "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
352 "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
353 "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
354 NULL);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
355
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_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
357 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
358 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
359 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
360 -1);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
361
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_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
363 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
364 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
365 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
366 -1);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
367
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_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
369 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
370 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
371 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
372 -1);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
373
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_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
375 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
376 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
377 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
378 -1);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
379
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_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
381 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
382 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
383 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
384 -1);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
385
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_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
387 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
388 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
389 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
390 -1);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
391
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_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
393 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
394 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
395 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
396 -1);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
397
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_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
399 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
400 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
401 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
402 -1);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
403
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_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
405 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
406 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
407 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
408 -1);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
409
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_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
411 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
412 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
413 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
414 -1);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
415
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
416 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
417 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
418 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
419 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
420 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
421 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
422 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
423 }
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
424
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
425 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
426 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
427 GtkTreeIter section;
41008
dc06703548a1 Update everything for GPlugin 0.33.0
Gary Kramlich <grim@reaperworld.com>
parents: 40830
diff changeset
428 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
429 gchar *markup = NULL;
41008
dc06703548a1 Update everything for GPlugin 0.33.0
Gary Kramlich <grim@reaperworld.com>
parents: 40830
diff changeset
430 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
431
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
432 /* create the section */
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
433 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
434 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
435 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
436 0, markup,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
437 -1);
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
438 g_free(markup);
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
439
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
440 /* add the search paths */
41008
dc06703548a1 Update everything for GPlugin 0.33.0
Gary Kramlich <grim@reaperworld.com>
parents: 40830
diff changeset
441 paths = gplugin_manager_get_paths(manager);
dc06703548a1 Update everything for GPlugin 0.33.0
Gary Kramlich <grim@reaperworld.com>
parents: 40830
diff changeset
442 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
443 GtkTreeIter iter;
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 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
446 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
447 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
448 -1);
41008
dc06703548a1 Update everything for GPlugin 0.33.0
Gary Kramlich <grim@reaperworld.com>
parents: 40830
diff changeset
449
dc06703548a1 Update everything for GPlugin 0.33.0
Gary Kramlich <grim@reaperworld.com>
parents: 40830
diff changeset
450 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
451 }
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
452 }
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
453
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
454 static void
40830
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
455 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
456 GtkTreeIter section, iter;
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
457 gchar *markup = NULL;
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
458 const gchar *path = NULL;
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
459
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
460 /* create the section */
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
461 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
462 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
463 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
464 0, markup,
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
465 -1);
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
466 g_free(markup);
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
467
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
468 /* add the cache directory path */
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
469 path = purple_cache_dir();
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
470 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
471 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
472 0, _("Cache"),
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
473 1, (gchar*)path,
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
474 -1);
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
475
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
476 /* add the config directory path */
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
477 path = purple_config_dir();
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
478 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
479 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
480 0, _("Configuration"),
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
481 1, (gchar*)path,
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
482 -1);
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
483
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
484 /* add the data directory path */
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
485 path = purple_data_dir();
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
486 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
487 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
488 0, _("Data"),
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
489 1, (gchar*)path,
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
490 -1);
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
491 }
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
492
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
493 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
494 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
495 #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
496 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
497 #endif /* MESON_ARGS */
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
498
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_info(about);
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
500 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
501 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
502 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
503 pidgin_about_dialog_load_conf_path_info(about);
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
504 }
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
505
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
506 /******************************************************************************
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
507 * Callbacks
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
508 *****************************************************************************/
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
509 static void
41372
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
510 pidgin_about_dialog_response_cb(GtkDialog *dialog, gint response_id,
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
511 G_GNUC_UNUSED gpointer data)
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
512 {
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
513 switch(response_id) {
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
514 case GTK_RESPONSE_CLOSE:
41525
87e0e009f5c1 Convert some stuff in PidginAbout that was renamed in GTK4
Gary Kramlich <grim@reaperworld.com>
parents: 41372
diff changeset
515 gtk_window_destroy(GTK_WINDOW(dialog));
41372
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
516 break;
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
517 }
38666
c0bf67926a79 Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents: 38665
diff changeset
518 }
c0bf67926a79 Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents: 38665
diff changeset
519
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
520 /******************************************************************************
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
521 * GObject Implementation
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
522 *****************************************************************************/
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
523 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
524
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
525 static void
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
526 pidgin_about_dialog_class_init(PidginAboutDialogClass *klass) {
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
527 GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
528
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
529 gtk_widget_class_set_template_from_resource(
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
530 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
531 "/im/pidgin/Pidgin3/About/about.ui"
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
532 );
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
533
41372
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
534 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
535 close_button);
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
536 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
537 application_name);
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
538 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
539 stack);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
540
41372
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
541 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
542 main_scrolled_window);
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
543 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
544 main_buffer);
38664
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
545
41372
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
546 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
547 developers_page);
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
548 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
549 developers_store);
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
550 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
551 developers_treeview);
38662
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
552
41372
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
553 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
554 translators_page);
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
555 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
556 translators_store);
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
557 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
558 translators_treeview);
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
559
41372
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
560 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
561 build_info_page);
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
562 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
563 build_info_store);
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
564 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
565 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
566
41372
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
567 gtk_widget_class_bind_template_callback(widget_class,
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
568 pidgin_about_dialog_response_cb);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
569 }
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
570
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
571 static void
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
572 pidgin_about_dialog_init(PidginAboutDialog *about) {
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
573 gtk_widget_init_template(GTK_WIDGET(about));
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
574
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
575 /* 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
576 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
577
38664
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
578 /* 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
579 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
580
38662
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
581 /* 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
582 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
583 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
584
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
585 /* 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
586 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
587 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
588
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
589 /* 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
590 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
591 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
592 }
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
593
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
594 /******************************************************************************
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
595 * Public API
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
596 *****************************************************************************/
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
597 GtkWidget *
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
598 pidgin_about_dialog_new(void) {
41307
685bab46fad2 Move the singleton handling of the about dialog to the action handler.
Gary Kramlich <grim@reaperworld.com>
parents: 41219
diff changeset
599 return g_object_new(
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
600 PIDGIN_TYPE_ABOUT_DIALOG,
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
601 "title", "About Pidgin",
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
602 NULL
41219
17dd0210fae7 Make the about dialog into a singleton
Gary Kramlich <grim@reaperworld.com>
parents: 41178
diff changeset
603 );
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
604 }

mercurial