pidgin/pidginabout.c

Thu, 31 Jul 2025 16:55:45 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Thu, 31 Jul 2025 16:55:45 -0500
changeset 43296
5eab84f697de
parent 43260
d5b9da0df929
permissions
-rw-r--r--

Remove searching from Purple.ProtocolContacts

This is being moved to Purple.ProtocolDirectory and being implemented in a
different way.

Testing Done:
Called in the turtles.

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

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
42410
563e7a17c220 Fix possible clash of config headers
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42251
diff changeset
23 #include <purpleconfig.h>
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
24
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 #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
26
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 #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
28
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29 #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
30
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
31 #include <adwaita.h>
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32
40496
6941fece679b phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
33 #include "pidginabout.h"
6941fece679b phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
34
42457
d9c2194dbc2b Fix build information when config uses lists
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42448
diff changeset
35 #ifdef HAVE_MESON_CONFIG
d9c2194dbc2b Fix build information when config uses lists
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42448
diff changeset
36 #include "meson-config.h"
d9c2194dbc2b Fix build information when config uses lists
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42448
diff changeset
37 #endif
d9c2194dbc2b Fix build information when config uses lists
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42448
diff changeset
38
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
39 #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
40 #include "pidgincore.h"
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 #include "pidginresources.h"
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42
38682
898b14e03449 Hide the about window's structs since it's a final type
Gary Kramlich <grim@reaperworld.com>
parents: 38681
diff changeset
43 struct _PidginAboutDialog {
43133
4ce7dac0de47 Make PidginAbout subclass AdwWindow instead of GtkDialog
Gary Kramlich <grim@reaperworld.com>
parents: 43123
diff changeset
44 AdwWindow parent;
38682
898b14e03449 Hide the about window's structs since it's a final type
Gary Kramlich <grim@reaperworld.com>
parents: 38681
diff changeset
45
38664
253a9bbc3317 Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 38663
diff changeset
46 GtkWidget *application_name;
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47
42020
c99700b694ed Replace Developer/Translator GtkTreeView by Adwaita in About dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42019
diff changeset
48 AdwPreferencesPage *developers_page;
38662
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
49
42020
c99700b694ed Replace Developer/Translator GtkTreeView by Adwaita in About dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42019
diff changeset
50 AdwPreferencesPage *translators_page;
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
52 AdwPreferencesGroup *build_info_group;
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
53 AdwPreferencesGroup *runtime_info_group;
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
54 AdwPreferencesGroup *gtk_settings_group;
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
55 AdwPreferencesGroup *plugin_search_paths_group;
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
56 AdwPreferencesGroup *conf_path_info_group;
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
57 AdwPreferencesGroup *build_args_group;
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 };
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 /******************************************************************************
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 * Helpers
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 *****************************************************************************/
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
64 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
65 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
66
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
67 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
68
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
69 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
70 }
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
71
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
72 static void
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
73 pidgin_about_dialog_group_add_row(AdwPreferencesGroup *group,
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
74 const char *title, const char *value)
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
75 {
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
76 GtkWidget *row = adw_action_row_new();
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
77
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
78 adw_preferences_row_set_title(ADW_PREFERENCES_ROW(row), title);
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
79
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
80 if(value != NULL) {
42457
d9c2194dbc2b Fix build information when config uses lists
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42448
diff changeset
81 adw_action_row_set_subtitle(ADW_ACTION_ROW(row), value);
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
82 }
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
83
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
84 adw_preferences_group_add(group, row);
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
85 }
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
86
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
87 static void
42020
c99700b694ed Replace Developer/Translator GtkTreeView by Adwaita in About dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42019
diff changeset
88 pidgin_about_dialog_load_json(AdwPreferencesPage *page,
c99700b694ed Replace Developer/Translator GtkTreeView by Adwaita in About dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42019
diff changeset
89 const char *json_section)
c99700b694ed Replace Developer/Translator GtkTreeView by Adwaita in About dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42019
diff changeset
90 {
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
91 GInputStream *istream = NULL;
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
92 GList *l = NULL, *sections = NULL;
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93 GError *error = NULL;
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94 JsonParser *parser = NULL;
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
95 JsonNode *root_node = NULL;
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
96 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
97 JsonArray *sections_array = NULL;
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
98
38681
ee42a17715ac Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents: 38680
diff changeset
99 /* 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
100 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
101 "/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
102 G_RESOURCE_LOOKUP_FLAGS_NONE, NULL);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
103
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
104 /* create our parser */
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
105 parser = json_parser_new();
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
106
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
107 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
108 g_critical("%s", error->message);
42182
3fc2d2b7b7a8 Fix leaked errors
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42094
diff changeset
109 g_clear_error(&error);
3fc2d2b7b7a8 Fix leaked errors
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42094
diff changeset
110 return;
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
111 }
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
112
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
113 root_node = json_parser_get_root(parser);
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
114 root_object = json_node_get_object(root_node);
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
115
38681
ee42a17715ac Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents: 38680
diff changeset
116 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
117 sections = json_array_get_elements(sections_array);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
118
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
119 for(l = sections; l; l = l->next) {
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
120 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
121 JsonArray *people = NULL;
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
122 const gchar *title = NULL;
42020
c99700b694ed Replace Developer/Translator GtkTreeView by Adwaita in About dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42019
diff changeset
123 AdwPreferencesGroup *group = NULL;
c99700b694ed Replace Developer/Translator GtkTreeView by Adwaita in About dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42019
diff changeset
124 guint n_people = 0;
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
125
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
126 title = json_object_get_string_member(section, "title");
42020
c99700b694ed Replace Developer/Translator GtkTreeView by Adwaita in About dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42019
diff changeset
127 group = ADW_PREFERENCES_GROUP(adw_preferences_group_new());
c99700b694ed Replace Developer/Translator GtkTreeView by Adwaita in About dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42019
diff changeset
128 adw_preferences_group_set_title(group, title);
c99700b694ed Replace Developer/Translator GtkTreeView by Adwaita in About dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42019
diff changeset
129 adw_preferences_page_add(page, group);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
130
38672
df4a6635745a A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents: 38667
diff changeset
131 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
132 n_people = json_array_get_length(people);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
133
42020
c99700b694ed Replace Developer/Translator GtkTreeView by Adwaita in About dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42019
diff changeset
134 for(guint idx = 0; idx < n_people; idx++) {
c99700b694ed Replace Developer/Translator GtkTreeView by Adwaita in About dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42019
diff changeset
135 const char *name = json_array_get_string_element(people, idx);
c99700b694ed Replace Developer/Translator GtkTreeView by Adwaita in About dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42019
diff changeset
136 pidgin_about_dialog_group_add_row(group, name, NULL);
38662
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
137 }
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
138 }
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
139
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
140 g_list_free(sections);
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
141
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
142 /* clean up */
42592
6b65c0e4ba15 Remove unnecessary casts for GObject methods
Gary Kramlich <grim@reaperworld.com>
parents: 42575
diff changeset
143 g_object_unref(parser);
38662
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
144
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
145 g_input_stream_close(istream, NULL, NULL);
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
146 }
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
147
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
148 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
149 pidgin_about_dialog_load_developers(PidginAboutDialog *about) {
42020
c99700b694ed Replace Developer/Translator GtkTreeView by Adwaita in About dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42019
diff changeset
150 pidgin_about_dialog_load_json(about->developers_page, "developers");
38681
ee42a17715ac Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents: 38680
diff changeset
151 }
38662
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
152
38681
ee42a17715ac Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents: 38680
diff changeset
153 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
154 pidgin_about_dialog_load_translators(PidginAboutDialog *about) {
42020
c99700b694ed Replace Developer/Translator GtkTreeView by Adwaita in About dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42019
diff changeset
155 pidgin_about_dialog_load_json(about->translators_page, "languages");
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
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
158 static void
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
159 pidgin_about_dialog_build_info_add_version(AdwPreferencesGroup *group,
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
160 const gchar *title,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
161 guint major,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
162 guint minor,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
163 guint micro)
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
164 {
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
165 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
166
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
167 pidgin_about_dialog_group_add_row(group, title, version);
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
168
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
169 g_free(version);
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
170 }
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
171
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
172 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
173 pidgin_about_dialog_load_build_info(PidginAboutDialog *about) {
42564
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
174 /* add the cpu */
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
175 pidgin_about_dialog_group_add_row(about->build_info_group,
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
176 _("CPU"),
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
177 PURPLE_BUILD_CPU);
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
178
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
179 /* add the architecture */
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
180 pidgin_about_dialog_group_add_row(about->build_info_group,
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
181 _("Architecture"),
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
182 PURPLE_BUILD_ARCHITECTURE);
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
183
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
184 /* add the endianness */
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
185 pidgin_about_dialog_group_add_row(about->build_info_group,
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
186 _("Endianness"),
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
187 PURPLE_BUILD_ENDIANNESS);
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
188
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
189 /* add the commit hash */
42564
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
190 pidgin_about_dialog_group_add_row(about->build_info_group,
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
191 _("Commit Hash"), REVISION);
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
192
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
193 /* add the purple version */
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
194 pidgin_about_dialog_build_info_add_version(about->build_info_group,
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
195 _("Purple Version"),
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
196 PURPLE_MAJOR_VERSION,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
197 PURPLE_MINOR_VERSION,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
198 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
199
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
200 /* add the glib version */
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
201 pidgin_about_dialog_build_info_add_version(about->build_info_group,
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
202 _("GLib Version"),
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
203 GLIB_MAJOR_VERSION,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
204 GLIB_MINOR_VERSION,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
205 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
206
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
207 /* add the gtk version */
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
208 pidgin_about_dialog_build_info_add_version(about->build_info_group,
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
209 _("GTK Version"),
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
210 GTK_MAJOR_VERSION,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
211 GTK_MINOR_VERSION,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
212 GTK_MICRO_VERSION);
42564
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
213
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
214 /* add the adwaita version */
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
215 pidgin_about_dialog_build_info_add_version(about->build_info_group,
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
216 _("Adwaita Version"),
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
217 ADW_MAJOR_VERSION,
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
218 ADW_MINOR_VERSION,
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
219 ADW_MICRO_VERSION);
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
220 }
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
221
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
222 static char *
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
223 pidgin_about_dialog_copy_build_info(void) {
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
224 char *info = NULL;
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
225
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
226 info = g_strdup_printf(
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
227 "Build Information\n"
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
228 "=================\n"
42564
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
229 "CPU: %s\n"
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
230 "Architecture: %s\n"
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
231 "Endianness: %s\n"
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
232 "Commit Hash: %s\n"
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
233 "Purple Version: %u.%u.%u\n"
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
234 "GLib Version: %u.%u.%u\n"
42564
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
235 "GTK Version: %u.%u.%u\n"
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
236 "Adwaita Version: %u.%u.%u\n",
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
237 PURPLE_BUILD_CPU, PURPLE_BUILD_ARCHITECTURE, PURPLE_BUILD_ENDIANNESS,
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
238 REVISION,
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
239 PURPLE_MAJOR_VERSION, PURPLE_MINOR_VERSION, PURPLE_MICRO_VERSION,
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
240 GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION,
42564
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
241 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION,
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
242 ADW_MAJOR_VERSION, ADW_MINOR_VERSION, ADW_MICRO_VERSION);
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
243
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
244 return info;
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
245 }
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
246
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
247 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
248 pidgin_about_dialog_load_runtime_info(PidginAboutDialog *about) {
43260
d5b9da0df929 Add the operating system to the runtime information
Gary Kramlich <grim@reaperworld.com>
parents: 43133
diff changeset
249 char *value = NULL;
d5b9da0df929 Add the operating system to the runtime information
Gary Kramlich <grim@reaperworld.com>
parents: 43133
diff changeset
250
d5b9da0df929 Add the operating system to the runtime information
Gary Kramlich <grim@reaperworld.com>
parents: 43133
diff changeset
251 /* add the operating system */
d5b9da0df929 Add the operating system to the runtime information
Gary Kramlich <grim@reaperworld.com>
parents: 43133
diff changeset
252 value = g_get_os_info(G_OS_INFO_KEY_PRETTY_NAME);
d5b9da0df929 Add the operating system to the runtime information
Gary Kramlich <grim@reaperworld.com>
parents: 43133
diff changeset
253 pidgin_about_dialog_group_add_row(about->runtime_info_group,
d5b9da0df929 Add the operating system to the runtime information
Gary Kramlich <grim@reaperworld.com>
parents: 43133
diff changeset
254 _("Operating System"),
d5b9da0df929 Add the operating system to the runtime information
Gary Kramlich <grim@reaperworld.com>
parents: 43133
diff changeset
255 value);
d5b9da0df929 Add the operating system to the runtime information
Gary Kramlich <grim@reaperworld.com>
parents: 43133
diff changeset
256 g_clear_pointer(&value, g_free);
d5b9da0df929 Add the operating system to the runtime information
Gary Kramlich <grim@reaperworld.com>
parents: 43133
diff changeset
257
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
258 /* add the purple version */
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
259 pidgin_about_dialog_build_info_add_version(about->runtime_info_group,
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
260 _("Purple Version"),
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
261 purple_major_version,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
262 purple_minor_version,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
263 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
264
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
265 /* add the glib version */
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
266 pidgin_about_dialog_build_info_add_version(about->runtime_info_group,
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
267 _("GLib Version"),
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
268 glib_major_version,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
269 glib_minor_version,
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
270 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
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 gtk version */
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
273 pidgin_about_dialog_build_info_add_version(about->runtime_info_group,
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
274 _("GTK Version"),
41525
87e0e009f5c1 Convert some stuff in PidginAbout that was renamed in GTK4
Gary Kramlich <grim@reaperworld.com>
parents: 41372
diff changeset
275 gtk_get_major_version(),
87e0e009f5c1 Convert some stuff in PidginAbout that was renamed in GTK4
Gary Kramlich <grim@reaperworld.com>
parents: 41372
diff changeset
276 gtk_get_minor_version(),
87e0e009f5c1 Convert some stuff in PidginAbout that was renamed in GTK4
Gary Kramlich <grim@reaperworld.com>
parents: 41372
diff changeset
277 gtk_get_micro_version());
42564
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
278
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
279 /* add the adwaita version */
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
280 pidgin_about_dialog_build_info_add_version(about->runtime_info_group,
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
281 _("Adwaita Version"),
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
282 adw_get_major_version(),
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
283 adw_get_minor_version(),
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
284 adw_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
285 }
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
286
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
287 static char *
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
288 pidgin_about_dialog_copy_runtime_info(void) {
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
289 char *info = NULL;
43260
d5b9da0df929 Add the operating system to the runtime information
Gary Kramlich <grim@reaperworld.com>
parents: 43133
diff changeset
290 char *os_name = NULL;
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
291
43260
d5b9da0df929 Add the operating system to the runtime information
Gary Kramlich <grim@reaperworld.com>
parents: 43133
diff changeset
292 os_name = g_get_os_info(G_OS_INFO_KEY_PRETTY_NAME);
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
293 info = g_strdup_printf(
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
294 "Runtime Information\n"
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
295 "===================\n"
43260
d5b9da0df929 Add the operating system to the runtime information
Gary Kramlich <grim@reaperworld.com>
parents: 43133
diff changeset
296 "Operating System: %s\n"
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
297 "Purple Version: %u.%u.%u\n"
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
298 "GLib Version: %u.%u.%u\n"
42564
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
299 "GTK Version: %u.%u.%u\n"
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
300 "Adwaita Version: %u.%u.%u\n",
43260
d5b9da0df929 Add the operating system to the runtime information
Gary Kramlich <grim@reaperworld.com>
parents: 43133
diff changeset
301 os_name,
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
302 purple_major_version, purple_minor_version, purple_micro_version,
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
303 glib_major_version, glib_minor_version, glib_micro_version,
42564
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
304 gtk_get_major_version(), gtk_get_minor_version(), gtk_get_micro_version(),
867b39d2bc08 Add the cpu, cpu_family, and endianness of the host machine to the about dialog
Gary Kramlich <grim@reaperworld.com>
parents: 42473
diff changeset
305 adw_get_major_version(), adw_get_minor_version(), adw_get_micro_version());
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
306
43260
d5b9da0df929 Add the operating system to the runtime information
Gary Kramlich <grim@reaperworld.com>
parents: 43133
diff changeset
307 g_free(os_name);
d5b9da0df929 Add the operating system to the runtime information
Gary Kramlich <grim@reaperworld.com>
parents: 43133
diff changeset
308
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
309 return info;
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
310 }
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
311
38661
cf4073d0d648 A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents: 38660
diff changeset
312 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
313 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
314 gchar *cursor_theme_name = NULL, *theme_name = NULL;
41595
61d8f39f3d70 Port about dialog to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41525
diff changeset
315 gchar *icon_theme_name = NULL;
40605
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
316 gchar *im_module = NULL;
41595
61d8f39f3d70 Port about dialog to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41525
diff changeset
317 gchar *sound_theme_name = NULL;
40605
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
318 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
319 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
320
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
321 /* 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
322 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
323 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
324 "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
325 "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
326 "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
327 "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
328 "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
329 "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
330 "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
331 "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
332 NULL);
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
333
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
334 pidgin_about_dialog_group_add_row(
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
335 about->gtk_settings_group,
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
336 "gtk-cursor-theme-name",
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
337 (cursor_theme_name != NULL) ? cursor_theme_name : _("(not set)"));
40605
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
338
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
339 pidgin_about_dialog_group_add_row(
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
340 about->gtk_settings_group,
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
341 "gtk-enable-animations",
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
342 enable_animations ? _("yes") : _("no"));
40605
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
343
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
344 pidgin_about_dialog_group_add_row(
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
345 about->gtk_settings_group,
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
346 "gtk-icon-theme-name",
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
347 (icon_theme_name != NULL) ? icon_theme_name : _("(not set)"));
40605
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
348
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
349 pidgin_about_dialog_group_add_row(
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
350 about->gtk_settings_group,
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
351 "gtk-im-module",
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
352 (im_module != NULL) ? im_module : _("(not set)"));
40605
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
353
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
354 pidgin_about_dialog_group_add_row(
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
355 about->gtk_settings_group,
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
356 "gtk-shell-shows-app-menu",
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
357 shell_shows_app_menu ? _("yes") : _("no"));
40605
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
358
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
359 pidgin_about_dialog_group_add_row(
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
360 about->gtk_settings_group,
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
361 "gtk-shell-shows-menubar",
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
362 shell_shows_menubar ? _("yes") : _("no"));
40605
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
363
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
364 pidgin_about_dialog_group_add_row(
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
365 about->gtk_settings_group,
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
366 "gtk-sound-theme-name",
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
367 (sound_theme_name != NULL) ? sound_theme_name : _("(not set)"));
40605
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
368
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
369 pidgin_about_dialog_group_add_row(
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
370 about->gtk_settings_group,
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
371 "gtk-theme-name",
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
372 (theme_name != NULL) ? theme_name : _("(not set)"));
40605
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 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
375 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
376 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
377 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
378 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
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
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
381 static char *
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
382 pidgin_about_dialog_copy_gtk_settings(void) {
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
383 char *cursor_theme_name = NULL, *theme_name = NULL;
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
384 char *icon_theme_name = NULL;
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
385 char *im_module = NULL;
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
386 char *sound_theme_name = NULL;
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
387 gboolean enable_animations = FALSE;
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
388 gboolean shell_shows_app_menu = FALSE, shell_shows_menubar = FALSE;
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
389 GString *info = NULL;
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
390
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
391 /* get the settings we're interested in */
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
392 g_object_get(
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
393 gtk_settings_get_default(),
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
394 "gtk-cursor-theme-name", &cursor_theme_name,
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
395 "gtk-enable-animations", &enable_animations,
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
396 "gtk-icon-theme-name", &icon_theme_name,
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
397 "gtk-im-module", &im_module,
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
398 "gtk-shell-shows-app-menu", &shell_shows_app_menu,
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
399 "gtk-shell-shows-menubar", &shell_shows_menubar,
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
400 "gtk-sound-theme-name", &sound_theme_name,
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
401 "gtk-theme-name", &theme_name,
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
402 NULL);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
403
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
404 info = g_string_new(
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
405 "GTK Settings\n"
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
406 "============\n");
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
407
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
408 g_string_append_printf(
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
409 info, "gtk-cursor-theme-name: %s\n",
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
410 (cursor_theme_name != NULL) ? cursor_theme_name : _("(not set)"));
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
411
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
412 g_string_append_printf(info, "gtk-enable-animations: %s\n",
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
413 enable_animations ? _("yes") : _("no"));
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
414
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
415 g_string_append_printf(
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
416 info, "gtk-icon-theme-name: %s\n",
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
417 (icon_theme_name != NULL) ? icon_theme_name : _("(not set)"));
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
418
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
419 g_string_append_printf(info, "gtk-im-module: %s\n",
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
420 (im_module != NULL) ? im_module : _("(not set)"));
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
421
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
422 g_string_append_printf(info, "gtk-shell-shows-app-menu: %s\n",
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
423 shell_shows_app_menu ? _("yes") : _("no"));
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
424
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
425 g_string_append_printf(info, "gtk-shell-shows-menubar: %s\n",
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
426 shell_shows_menubar ? _("yes") : _("no"));
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
427
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
428 g_string_append_printf(
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
429 info, "gtk-sound-theme-name: %s\n",
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
430 (sound_theme_name != NULL) ? sound_theme_name : _("(not set)"));
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
431
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
432 g_string_append_printf(info, "gtk-theme-name: %s\n",
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
433 (theme_name != NULL) ? theme_name : _("(not set)"));
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
434
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
435 g_free(cursor_theme_name);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
436 g_free(icon_theme_name);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
437 g_free(im_module);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
438 g_free(sound_theme_name);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
439 g_free(theme_name);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
440
43123
4d3b58b6cf06 Use g_string_free_and_steal
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 43080
diff changeset
441 return g_string_free_and_steal(info);
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
442 }
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
443
40605
db61db6af817 Add a bunch of interesting properties from gtk-settings to the about box
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
444 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
445 pidgin_about_dialog_load_plugin_search_paths(PidginAboutDialog *about) {
41008
dc06703548a1 Update everything for GPlugin 0.33.0
Gary Kramlich <grim@reaperworld.com>
parents: 40830
diff changeset
446 GList *paths = NULL;
dc06703548a1 Update everything for GPlugin 0.33.0
Gary Kramlich <grim@reaperworld.com>
parents: 40830
diff changeset
447 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
448
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
449 /* add the search paths */
41008
dc06703548a1 Update everything for GPlugin 0.33.0
Gary Kramlich <grim@reaperworld.com>
parents: 40830
diff changeset
450 paths = gplugin_manager_get_paths(manager);
dc06703548a1 Update everything for GPlugin 0.33.0
Gary Kramlich <grim@reaperworld.com>
parents: 40830
diff changeset
451 while(paths != NULL) {
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
452 pidgin_about_dialog_group_add_row(about->plugin_search_paths_group,
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
453 paths->data, NULL);
41008
dc06703548a1 Update everything for GPlugin 0.33.0
Gary Kramlich <grim@reaperworld.com>
parents: 40830
diff changeset
454
dc06703548a1 Update everything for GPlugin 0.33.0
Gary Kramlich <grim@reaperworld.com>
parents: 40830
diff changeset
455 paths = paths->next;
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
456 }
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
457 }
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
458
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
459 static char *
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
460 pidgin_about_dialog_copy_plugin_search_paths(void) {
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
461 GList *paths = NULL;
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
462 GPluginManager *manager = gplugin_manager_get_default();
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
463 GString *info = NULL;
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
464
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
465 info = g_string_new(
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
466 "Plugin Search Paths\n"
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
467 "===================\n");
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
468
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
469 /* add the search paths */
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
470 paths = gplugin_manager_get_paths(manager);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
471 while(paths != NULL) {
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
472 g_string_append_printf(info, "- %s\n", (char *)paths->data);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
473
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
474 paths = paths->next;
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
475 }
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
476
43123
4d3b58b6cf06 Use g_string_free_and_steal
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 43080
diff changeset
477 return g_string_free_and_steal(info);
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
478 }
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
479
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
480 static void
40830
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
481 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
482 /* add the cache directory path */
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
483 pidgin_about_dialog_group_add_row(about->conf_path_info_group, _("Cache"),
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
484 purple_cache_dir());
40830
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
485
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
486 /* add the config directory path */
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
487 pidgin_about_dialog_group_add_row(about->conf_path_info_group,
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
488 _("Configuration"), purple_config_dir());
40830
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
489
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
490 /* add the data directory path */
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
491 pidgin_about_dialog_group_add_row(about->conf_path_info_group, _("Data"),
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
492 purple_data_dir());
42473
c2cb3f628555 Update a bunch of gettext stuff
Gary Kramlich <grim@reaperworld.com>
parents: 42457
diff changeset
493
c2cb3f628555 Update a bunch of gettext stuff
Gary Kramlich <grim@reaperworld.com>
parents: 42457
diff changeset
494 /* add the locale directory path */
c2cb3f628555 Update a bunch of gettext stuff
Gary Kramlich <grim@reaperworld.com>
parents: 42457
diff changeset
495 pidgin_about_dialog_group_add_row(about->conf_path_info_group, _("Locale"),
c2cb3f628555 Update a bunch of gettext stuff
Gary Kramlich <grim@reaperworld.com>
parents: 42457
diff changeset
496 purple_get_locale_dir());
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
497 }
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
498
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
499 static char *
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
500 pidgin_about_dialog_copy_conf_path_info(void) {
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
501 char *info = NULL;
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
502
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
503 info = g_strdup_printf(
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
504 "Runtime Directories\n"
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
505 "===================\n"
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
506 "Cache: %s\n"
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
507 "Configuration: %s\n"
42473
c2cb3f628555 Update a bunch of gettext stuff
Gary Kramlich <grim@reaperworld.com>
parents: 42457
diff changeset
508 "Data: %s\n"
c2cb3f628555 Update a bunch of gettext stuff
Gary Kramlich <grim@reaperworld.com>
parents: 42457
diff changeset
509 "Locale: %s\n",
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
510 purple_cache_dir(),
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
511 purple_config_dir(),
42473
c2cb3f628555 Update a bunch of gettext stuff
Gary Kramlich <grim@reaperworld.com>
parents: 42457
diff changeset
512 purple_data_dir(),
c2cb3f628555 Update a bunch of gettext stuff
Gary Kramlich <grim@reaperworld.com>
parents: 42457
diff changeset
513 purple_get_locale_dir());
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
514
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
515 return info;
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
516 }
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
517
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
518 static void
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
519 pidgin_about_dialog_add_build_args(PidginAboutDialog *about,
42457
d9c2194dbc2b Fix build information when config uses lists
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42448
diff changeset
520 const PurpleKeyValuePair build_args[])
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
521 {
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
522 /* Walk through the arguments and add them */
42457
d9c2194dbc2b Fix build information when config uses lists
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42448
diff changeset
523 for(gint idx = 0; build_args[idx].key != NULL; idx++) {
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
524 pidgin_about_dialog_group_add_row(about->build_args_group,
42457
d9c2194dbc2b Fix build information when config uses lists
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42448
diff changeset
525 build_args[idx].key,
d9c2194dbc2b Fix build information when config uses lists
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42448
diff changeset
526 build_args[idx].value);
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
527 }
40830
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
528 }
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
529
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
530 static char *
42457
d9c2194dbc2b Fix build information when config uses lists
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42448
diff changeset
531 pidgin_about_dialog_copy_build_args(const PurpleKeyValuePair build_args[]) {
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
532 GString *info = NULL;
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
533
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
534 info = g_string_new(
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
535 "Meson Arguments\n"
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
536 "===============\n");
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
537
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
538 /* Walk through the arguments and add them */
42457
d9c2194dbc2b Fix build information when config uses lists
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42448
diff changeset
539 for(gint idx = 0; build_args[idx].key != NULL; idx++) {
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
540 char *value = NULL;
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
541
42457
d9c2194dbc2b Fix build information when config uses lists
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42448
diff changeset
542 if(build_args[idx].value != NULL) {
d9c2194dbc2b Fix build information when config uses lists
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42448
diff changeset
543 value = purple_unescape_text(build_args[idx].value);
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
544 } else {
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
545 value = NULL;
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
546 }
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
547
42457
d9c2194dbc2b Fix build information when config uses lists
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42448
diff changeset
548 g_string_append_printf(info, "%s: %s\n", build_args[idx].key, value);
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
549
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
550 g_free(value);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
551 }
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
552
43123
4d3b58b6cf06 Use g_string_free_and_steal
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 43080
diff changeset
553 return g_string_free_and_steal(info);
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
554 }
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
555
40830
628ec6b8efd4 Add configuration directory path to help window
TANWEER ALI <tanweerali908@gmail.com>
parents: 40605
diff changeset
556 static void
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
557 pidgin_about_dialog_load_build_configuration(PidginAboutDialog *about) {
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
558 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
559 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
560 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
561 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
562 pidgin_about_dialog_load_conf_path_info(about);
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
563
42457
d9c2194dbc2b Fix build information when config uses lists
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42448
diff changeset
564 #ifdef HAVE_MESON_CONFIG
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
565 pidgin_about_dialog_add_build_args(about, MESON_ARGS);
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
566 gtk_widget_set_visible(GTK_WIDGET(about->build_args_group), TRUE);
42457
d9c2194dbc2b Fix build information when config uses lists
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42448
diff changeset
567 #endif /* HAVE_MESON_CONFIG */
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
568 }
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
569
38659
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 * Callbacks
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
572 *****************************************************************************/
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
573 static void
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
574 pidgin_about_dialog_copy_button_cb(GtkButton *button,
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
575 gpointer data)
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
576 {
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
577 PidginAboutDialog *about = NULL;
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
578 GdkClipboard *clipboard = NULL;
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
579 char *info = NULL;
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
580
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
581 about = PIDGIN_ABOUT_DIALOG(gtk_widget_get_root(GTK_WIDGET(button)));
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
582
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
583 if(data == about->build_info_group) {
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
584 info = pidgin_about_dialog_copy_build_info();
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
585 } else if(data == about->runtime_info_group) {
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
586 info = pidgin_about_dialog_copy_runtime_info();
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
587 } else if(data == about->gtk_settings_group) {
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
588 info = pidgin_about_dialog_copy_gtk_settings();
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
589 } else if(data == about->plugin_search_paths_group) {
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
590 info = pidgin_about_dialog_copy_plugin_search_paths();
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
591 } else if(data == about->conf_path_info_group) {
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
592 info = pidgin_about_dialog_copy_conf_path_info();
42457
d9c2194dbc2b Fix build information when config uses lists
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42448
diff changeset
593 #ifdef HAVE_MESON_CONFIG
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
594 } else if(data == about->build_args_group) {
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
595 info = pidgin_about_dialog_copy_build_args(MESON_ARGS);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
596 #endif
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
597 } else {
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
598 GString *everything = g_string_new(NULL);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
599
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
600 info = pidgin_about_dialog_copy_build_info();
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
601 g_string_append(everything, info);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
602 g_string_append_c(everything, '\n');
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
603 g_free(info);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
604
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
605 info = pidgin_about_dialog_copy_runtime_info();
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
606 g_string_append(everything, info);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
607 g_string_append_c(everything, '\n');
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
608 g_free(info);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
609
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
610 info = pidgin_about_dialog_copy_conf_path_info();
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
611 g_string_append(everything, info);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
612 g_string_append_c(everything, '\n');
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
613 g_free(info);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
614
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
615 info = pidgin_about_dialog_copy_gtk_settings();
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
616 g_string_append(everything, info);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
617 g_string_append_c(everything, '\n');
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
618 g_free(info);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
619
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
620 info = pidgin_about_dialog_copy_plugin_search_paths();
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
621 g_string_append(everything, info);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
622 g_free(info);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
623
42457
d9c2194dbc2b Fix build information when config uses lists
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42448
diff changeset
624 #ifdef HAVE_MESON_CONFIG
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
625 g_string_append_c(everything, '\n');
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
626 info = pidgin_about_dialog_copy_build_args(MESON_ARGS);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
627 g_string_append(everything, info);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
628 g_free(info);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
629 #endif
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
630
43123
4d3b58b6cf06 Use g_string_free_and_steal
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 43080
diff changeset
631 info = g_string_free_and_steal(everything);
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
632 }
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
633
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
634 clipboard = gtk_widget_get_clipboard(GTK_WIDGET(about));
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
635 gdk_clipboard_set_text(clipboard, info);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
636
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
637 g_free(info);
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
638 }
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
639
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
640 /******************************************************************************
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
641 * GObject Implementation
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
642 *****************************************************************************/
43133
4ce7dac0de47 Make PidginAbout subclass AdwWindow instead of GtkDialog
Gary Kramlich <grim@reaperworld.com>
parents: 43123
diff changeset
643 G_DEFINE_FINAL_TYPE(PidginAboutDialog, pidgin_about_dialog, ADW_TYPE_WINDOW)
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
644
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
645 static void
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
646 pidgin_about_dialog_class_init(PidginAboutDialogClass *klass) {
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
647 GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
648
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
649 gtk_widget_class_set_template_from_resource(
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
650 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
651 "/im/pidgin/Pidgin3/About/about.ui"
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
652 );
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
653
41372
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
654 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
655 application_name);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
656
41372
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
657 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
42020
c99700b694ed Replace Developer/Translator GtkTreeView by Adwaita in About dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42019
diff changeset
658 developers_page);
38662
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
659
41372
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
660 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
42020
c99700b694ed Replace Developer/Translator GtkTreeView by Adwaita in About dialog
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42019
diff changeset
661 translators_page);
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
662
41372
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
663 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
664 build_info_group);
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
665 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
666 runtime_info_group);
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
667 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
668 gtk_settings_group);
41372
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
669 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
42019
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
670 plugin_search_paths_group);
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
671 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
672 conf_path_info_group);
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
673 gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog,
d9f258656fc6 Replace GtkTreeView in Build Information with Adwaita widgets
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42016
diff changeset
674 build_args_group);
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
675
41372
e3d28548e01d Some random about dialog cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 41307
diff changeset
676 gtk_widget_class_bind_template_callback(widget_class,
42022
b4747dfd7c34 Add copy button to Build Information sections
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42020
diff changeset
677 pidgin_about_dialog_copy_button_cb);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
678 }
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
679
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
680 static void
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
681 pidgin_about_dialog_init(PidginAboutDialog *about) {
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
682 gtk_widget_init_template(GTK_WIDGET(about));
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
683
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
684 /* 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
685 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
686
38662
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
687 /* 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
688 pidgin_about_dialog_load_developers(about);
38662
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
689
808d7958b434 Add the translators
Gary Kramlich <grim@reaperworld.com>
parents: 38661
diff changeset
690 /* 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
691 pidgin_about_dialog_load_translators(about);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
692
38660
d6a4308481c7 Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents: 38659
diff changeset
693 /* 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
694 pidgin_about_dialog_load_build_configuration(about);
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
695 }
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
696
40530
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
697 /******************************************************************************
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
698 * Public API
ac5c0a85971e Cleanup pidginabout.[ch] and add the plugin searchs paths to it
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
699 *****************************************************************************/
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
700 GtkWidget *
43080
dd2d26e6c6f9 Set the application on all windows
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42836
diff changeset
701 pidgin_about_dialog_new(GtkApplication *application) {
41307
685bab46fad2 Move the singleton handling of the about dialog to the action handler.
Gary Kramlich <grim@reaperworld.com>
parents: 41219
diff changeset
702 return g_object_new(
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
703 PIDGIN_TYPE_ABOUT_DIALOG,
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
704 "title", "About Pidgin",
43080
dd2d26e6c6f9 Set the application on all windows
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42836
diff changeset
705 "application", application,
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
706 NULL
41219
17dd0210fae7 Make the about dialog into a singleton
Gary Kramlich <grim@reaperworld.com>
parents: 41178
diff changeset
707 );
38659
7772f66662f0 Lots of tweaking/wiring
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
708 }

mercurial