Thu, 03 Oct 2019 10:34:22 +0200
Port purple_media_set_require_encryption api
|
38672
df4a6635745a
A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents:
38667
diff
changeset
|
1 | /* Purple is the legal property of its developers, whose names are too numerous |
|
df4a6635745a
A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents:
38667
diff
changeset
|
2 | * 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
|
3 | * source distribution. |
|
df4a6635745a
A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents:
38667
diff
changeset
|
4 | * |
|
df4a6635745a
A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents:
38667
diff
changeset
|
5 | * 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
|
6 | * 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
|
7 | * 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
|
8 | * (at your option) any later version. |
|
df4a6635745a
A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents:
38667
diff
changeset
|
9 | * |
|
df4a6635745a
A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents:
38667
diff
changeset
|
10 | * 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
|
11 | * 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
|
12 | * 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
|
13 | * GNU General Public License for more details. |
|
df4a6635745a
A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents:
38667
diff
changeset
|
14 | * |
|
df4a6635745a
A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents:
38667
diff
changeset
|
15 | * You should have received a copy of the GNU General Public License |
|
df4a6635745a
A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents:
38667
diff
changeset
|
16 | * along with this program; if not, write to the Free Software |
|
df4a6635745a
A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents:
38667
diff
changeset
|
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
df4a6635745a
A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents:
38667
diff
changeset
|
18 | */ |
| 38659 | 19 | #include <gdk-pixbuf/gdk-pixbuf.h> |
| 20 | #include <json-glib/json-glib.h> | |
|
39216
f6ab17b953df
Replace the WebkitWebView with Talkatu widgets. There's some bugs, but it mostly works
Gary Kramlich <grim@reaperworld.com>
parents:
38682
diff
changeset
|
21 | #include <talkatu.h> |
| 38659 | 22 | |
|
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
|
23 | #include "package_revision.h" |
| 38659 | 24 | #include "pidginabout.h" |
| 25 | #include "pidginresources.h" | |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
26 | #include "internal.h" |
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
27 | #include "gtkutils.h" |
| 38659 | 28 | |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
29 | #include <stdio.h> |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
30 | |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
31 | #ifdef HAVE_MESON_CONFIG |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
32 | #include "meson-config.h" |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
33 | #endif |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
34 | |
|
38682
898b14e03449
Hide the about window's structs since it's a final type
Gary Kramlich <grim@reaperworld.com>
parents:
38681
diff
changeset
|
35 | struct _PidginAboutDialog { |
|
898b14e03449
Hide the about window's structs since it's a final type
Gary Kramlich <grim@reaperworld.com>
parents:
38681
diff
changeset
|
36 | GtkDialog parent; |
|
898b14e03449
Hide the about window's structs since it's a final type
Gary Kramlich <grim@reaperworld.com>
parents:
38681
diff
changeset
|
37 | |
|
38666
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
38 | GtkWidget *close_button; |
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
39 | GtkWidget *application_name; |
| 38659 | 40 | GtkWidget *stack; |
| 41 | ||
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
42 | GtkWidget *main_scrolled_window; |
|
39216
f6ab17b953df
Replace the WebkitWebView with Talkatu widgets. There's some bugs, but it mostly works
Gary Kramlich <grim@reaperworld.com>
parents:
38682
diff
changeset
|
43 | GtkTextBuffer *main_buffer; |
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
44 | |
| 38662 | 45 | GtkWidget *developers_page; |
| 46 | GtkWidget *developers_treeview; | |
| 47 | GtkTreeStore *developers_store; | |
| 48 | ||
| 49 | GtkWidget *translators_page; | |
| 50 | GtkWidget *translators_treeview; | |
| 51 | GtkTreeStore *translators_store; | |
| 38659 | 52 | |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
53 | GtkWidget *build_info_page; |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
54 | GtkWidget *build_info_treeview; |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
55 | GtkTreeStore *build_info_store; |
| 38659 | 56 | }; |
| 57 | ||
| 58 | /****************************************************************************** | |
| 59 | * Helpers | |
| 60 | *****************************************************************************/ | |
| 61 | static void | |
|
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
|
62 | _pidgin_about_dialog_load_application_name(PidginAboutDialog *about) { |
|
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
|
63 | gchar *label = g_strdup_printf( |
|
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
|
64 | "%s %s", |
|
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
|
65 | PIDGIN_NAME, |
|
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 | VERSION |
|
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
|
67 | ); |
|
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 | |
|
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
|
69 | 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
|
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 | 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
|
72 | } |
|
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
|
73 | |
|
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
|
74 | static void |
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
75 | _pidgin_about_dialog_load_main_page(PidginAboutDialog *about) { |
|
39217
4c5b6c2e7007
use gtk_text_buffer_get_start_iter instead of looking up the insertion mark and all that
Gary Kramlich <grim@reaperworld.com>
parents:
39216
diff
changeset
|
76 | GtkTextIter start; |
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
77 | GInputStream *istream = NULL; |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
78 | GString *str = NULL; |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
79 | gchar buffer[8192]; |
|
39216
f6ab17b953df
Replace the WebkitWebView with Talkatu widgets. There's some bugs, but it mostly works
Gary Kramlich <grim@reaperworld.com>
parents:
38682
diff
changeset
|
80 | gssize read = 0, size = 0; |
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
81 | |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
82 | /* now load the html */ |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
83 | istream = g_resource_open_stream( |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
84 | pidgin_get_resource(), |
|
39216
f6ab17b953df
Replace the WebkitWebView with Talkatu widgets. There's some bugs, but it mostly works
Gary Kramlich <grim@reaperworld.com>
parents:
38682
diff
changeset
|
85 | "/im/pidgin/Pidgin/About/about.md", |
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
86 | G_RESOURCE_LOOKUP_FLAGS_NONE, |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
87 | NULL |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
88 | ); |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
89 | |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
90 | str = g_string_new(""); |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
91 | |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
92 | while((read = g_input_stream_read(istream, buffer, sizeof(buffer), NULL, NULL)) > 0) { |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
93 | g_string_append_len(str, (gchar *)buffer, read); |
|
39216
f6ab17b953df
Replace the WebkitWebView with Talkatu widgets. There's some bugs, but it mostly works
Gary Kramlich <grim@reaperworld.com>
parents:
38682
diff
changeset
|
94 | size += read; |
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
95 | } |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
96 | |
|
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
|
97 | gtk_text_buffer_get_start_iter(about->main_buffer, &start); |
|
39216
f6ab17b953df
Replace the WebkitWebView with Talkatu widgets. There's some bugs, but it mostly works
Gary Kramlich <grim@reaperworld.com>
parents:
38682
diff
changeset
|
98 | |
|
f6ab17b953df
Replace the WebkitWebView with Talkatu widgets. There's some bugs, but it mostly works
Gary Kramlich <grim@reaperworld.com>
parents:
38682
diff
changeset
|
99 | talkatu_markdown_buffer_insert_markdown( |
|
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
|
100 | TALKATU_MARKDOWN_BUFFER(about->main_buffer), |
|
39217
4c5b6c2e7007
use gtk_text_buffer_get_start_iter instead of looking up the insertion mark and all that
Gary Kramlich <grim@reaperworld.com>
parents:
39216
diff
changeset
|
101 | &start, |
|
39216
f6ab17b953df
Replace the WebkitWebView with Talkatu widgets. There's some bugs, but it mostly works
Gary Kramlich <grim@reaperworld.com>
parents:
38682
diff
changeset
|
102 | str->str, |
|
f6ab17b953df
Replace the WebkitWebView with Talkatu widgets. There's some bugs, but it mostly works
Gary Kramlich <grim@reaperworld.com>
parents:
38682
diff
changeset
|
103 | size |
|
f6ab17b953df
Replace the WebkitWebView with Talkatu widgets. There's some bugs, but it mostly works
Gary Kramlich <grim@reaperworld.com>
parents:
38682
diff
changeset
|
104 | ); |
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
105 | |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
106 | g_string_free(str, TRUE); |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
107 | |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
108 | g_input_stream_close(istream, NULL, NULL); |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
109 | } |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
110 | |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
111 | static void |
|
38681
ee42a17715ac
Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents:
38680
diff
changeset
|
112 | _pidgin_about_dialog_load_json(GtkTreeStore *store, const gchar *json_section) { |
| 38659 | 113 | GInputStream *istream = NULL; |
| 114 | GList *l = NULL, *sections = NULL; | |
| 115 | GError *error = NULL; | |
| 116 | JsonParser *parser = NULL; | |
| 117 | JsonNode *root_node = NULL; | |
| 118 | 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
|
119 | JsonArray *sections_array = NULL; |
| 38659 | 120 | |
|
38681
ee42a17715ac
Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents:
38680
diff
changeset
|
121 | /* get a stream to the credits resource */ |
| 38659 | 122 | istream = g_resource_open_stream( |
| 123 | pidgin_get_resource(), | |
|
38663
a463d40cb9ec
merged developers.json and translators.json to credits.json
Gary Kramlich <grim@reaperworld.com>
parents:
38662
diff
changeset
|
124 | "/im/pidgin/Pidgin/About/credits.json", |
| 38659 | 125 | G_RESOURCE_LOOKUP_FLAGS_NONE, |
| 126 | NULL | |
| 127 | ); | |
| 128 | ||
| 129 | /* create our parser */ | |
| 130 | parser = json_parser_new(); | |
| 131 | ||
| 132 | 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
|
133 | g_critical("%s", error->message); |
| 38659 | 134 | } |
| 135 | ||
| 136 | root_node = json_parser_get_root(parser); | |
| 137 | root_object = json_node_get_object(root_node); | |
| 138 | ||
|
38681
ee42a17715ac
Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents:
38680
diff
changeset
|
139 | 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
|
140 | sections = json_array_get_elements(sections_array); |
| 38659 | 141 | |
| 142 | for(l = sections; l; l = l->next) { | |
| 143 | GtkTreeIter section_iter; | |
| 144 | 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
|
145 | JsonArray *people = NULL; |
| 38659 | 146 | gchar *markup = NULL; |
|
38672
df4a6635745a
A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents:
38667
diff
changeset
|
147 | guint idx = 0, n_people = 0; |
| 38659 | 148 | |
| 149 | markup = g_strdup_printf( | |
| 150 | "<span font_weight=\"bold\" font_size=\"large\">%s</span>", | |
| 151 | json_object_get_string_member(section, "title") | |
| 152 | ); | |
| 153 | ||
|
38681
ee42a17715ac
Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents:
38680
diff
changeset
|
154 | gtk_tree_store_append(store, §ion_iter, NULL); |
| 38659 | 155 | gtk_tree_store_set( |
|
38681
ee42a17715ac
Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents:
38680
diff
changeset
|
156 | store, |
| 38659 | 157 | §ion_iter, |
| 158 | 0, markup, | |
| 159 | 1, 0.5f, | |
| 160 | -1 | |
| 161 | ); | |
| 162 | ||
| 163 | g_free(markup); | |
| 164 | ||
|
38672
df4a6635745a
A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents:
38667
diff
changeset
|
165 | 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
|
166 | n_people = json_array_get_length(people); |
| 38659 | 167 | |
|
38672
df4a6635745a
A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents:
38667
diff
changeset
|
168 | for(idx = 0; idx < n_people; idx++) { |
| 38659 | 169 | GtkTreeIter person_iter; |
| 170 | ||
|
38681
ee42a17715ac
Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents:
38680
diff
changeset
|
171 | gtk_tree_store_append(store, &person_iter, §ion_iter); |
| 38659 | 172 | gtk_tree_store_set( |
|
38681
ee42a17715ac
Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents:
38680
diff
changeset
|
173 | store, |
| 38662 | 174 | &person_iter, |
|
38672
df4a6635745a
A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents:
38667
diff
changeset
|
175 | 0, json_array_get_string_element(people, idx), |
| 38662 | 176 | 1, 0.5f, |
| 177 | -1 | |
| 178 | ); | |
| 179 | } | |
| 180 | } | |
| 181 | ||
| 182 | g_list_free(sections); | |
| 183 | ||
| 184 | /* clean up */ | |
| 185 | g_object_unref(G_OBJECT(parser)); | |
| 186 | ||
| 187 | g_input_stream_close(istream, NULL, NULL); | |
| 188 | } | |
| 189 | ||
| 190 | static void | |
|
38681
ee42a17715ac
Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents:
38680
diff
changeset
|
191 | _pidgin_about_dialog_load_developers(PidginAboutDialog *about) { |
|
39855
7c9c4d700ed2
Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
39533
diff
changeset
|
192 | _pidgin_about_dialog_load_json(about->developers_store, "developers"); |
|
38681
ee42a17715ac
Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents:
38680
diff
changeset
|
193 | } |
| 38662 | 194 | |
|
38681
ee42a17715ac
Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents:
38680
diff
changeset
|
195 | static void |
|
ee42a17715ac
Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents:
38680
diff
changeset
|
196 | _pidgin_about_dialog_load_translators(PidginAboutDialog *about) { |
|
39855
7c9c4d700ed2
Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
39533
diff
changeset
|
197 | _pidgin_about_dialog_load_json(about->translators_store, "languages"); |
| 38659 | 198 | } |
| 199 | ||
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
200 | static void |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
201 | _pidgin_about_dialog_add_build_args( |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
202 | PidginAboutDialog *about, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
203 | const gchar *title, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
204 | const gchar *build_args |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
205 | ) { |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
206 | GtkTreeIter section, value; |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
207 | gchar **splits = NULL; |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
208 | gchar *markup = NULL; |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
209 | gint idx = 0; |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
210 | |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
211 | markup = g_strdup_printf("<span font-weight=\"bold\">%s</span>", title); |
|
39855
7c9c4d700ed2
Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
39533
diff
changeset
|
212 | gtk_tree_store_append(about->build_info_store, §ion, NULL); |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
213 | gtk_tree_store_set( |
|
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
|
214 | about->build_info_store, |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
215 | §ion, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
216 | 0, markup, |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
217 | -1 |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
218 | ); |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
219 | g_free(markup); |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
220 | |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
221 | /* now walk through the arguments and add them */ |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
222 | splits = g_strsplit(build_args, " ", -1); |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
223 | for(idx = 0; splits[idx]; idx++) { |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
224 | gchar **value_split = g_strsplit(splits[idx], "=", 2); |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
225 | |
|
38672
df4a6635745a
A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents:
38667
diff
changeset
|
226 | if(value_split[0] == NULL || value_split[0][0] == '\0') { |
|
38667
f8ae2ff1c19b
Fix up the autotools support
Gary Kramlich <grim@reaperworld.com>
parents:
38666
diff
changeset
|
227 | continue; |
|
f8ae2ff1c19b
Fix up the autotools support
Gary Kramlich <grim@reaperworld.com>
parents:
38666
diff
changeset
|
228 | } |
|
f8ae2ff1c19b
Fix up the autotools support
Gary Kramlich <grim@reaperworld.com>
parents:
38666
diff
changeset
|
229 | |
|
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
|
230 | gtk_tree_store_append(about->build_info_store, &value, §ion); |
|
39913
ce96d4639dc7
Remove redundant conditions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39855
diff
changeset
|
231 | gtk_tree_store_set(about->build_info_store, &value, 0, value_split[0], |
|
ce96d4639dc7
Remove redundant conditions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39855
diff
changeset
|
232 | 1, value_split[1] ? value_split[1] : "", -1); |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
233 | |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
234 | g_strfreev(value_split); |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
235 | } |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
236 | |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
237 | g_strfreev(splits); |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
238 | } |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
239 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
240 | static void |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
241 | _pidgin_about_dialog_build_info_add_version( |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
242 | GtkTreeStore *store, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
243 | GtkTreeIter *section, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
244 | const gchar *title, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
245 | guint major, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
246 | guint minor, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
247 | guint micro |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
248 | ) { |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
249 | GtkTreeIter item; |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
250 | 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
|
251 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
252 | gtk_tree_store_append(store, &item, section); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
253 | gtk_tree_store_set( |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
254 | store, &item, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
255 | 0, title, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
256 | 1, version, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
257 | -1 |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
258 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
259 | g_free(version); |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
260 | } |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
261 | |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
262 | static void |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
263 | _pidgin_about_dialog_load_build_info(PidginAboutDialog *about) { |
|
38665
35676a9b7faa
Add the version to the application_name label and add the revision to build info
Gary Kramlich <grim@reaperworld.com>
parents:
38664
diff
changeset
|
264 | GtkTreeIter section, item; |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
265 | gchar *markup = NULL; |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
266 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
267 | /* create the section */ |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
268 | markup = g_strdup_printf( |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
269 | "<span font-weight=\"bold\">%s</span>", |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
270 | _("Build Information") |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
271 | ); |
|
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
|
272 | gtk_tree_store_append(about->build_info_store, §ion, NULL); |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
273 | gtk_tree_store_set( |
|
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
|
274 | about->build_info_store, |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
275 | §ion, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
276 | 0, markup, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
277 | -1 |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
278 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
279 | g_free(markup); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
280 | |
|
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
|
281 | /* add the commit hash */ |
|
39855
7c9c4d700ed2
Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
39533
diff
changeset
|
282 | gtk_tree_store_append(about->build_info_store, &item, §ion); |
|
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
|
283 | gtk_tree_store_set( |
|
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
|
284 | about->build_info_store, |
|
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
|
285 | &item, |
|
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
|
286 | 0, "Commit Hash", |
|
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
|
287 | 1, REVISION, |
|
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
|
288 | -1 |
|
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
|
289 | ); |
|
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
|
290 | |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
291 | /* add the purple version */ |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
292 | _pidgin_about_dialog_build_info_add_version( |
|
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
|
293 | about->build_info_store, |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
294 | §ion, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
295 | _("Purple Version"), |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
296 | PURPLE_MAJOR_VERSION, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
297 | PURPLE_MINOR_VERSION, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
298 | PURPLE_MICRO_VERSION |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
299 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
300 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
301 | /* add the glib version */ |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
302 | _pidgin_about_dialog_build_info_add_version( |
|
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
|
303 | about->build_info_store, |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
304 | §ion, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
305 | _("GLib Version"), |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
306 | GLIB_MAJOR_VERSION, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
307 | GLIB_MINOR_VERSION, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
308 | GLIB_MICRO_VERSION |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
309 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
310 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
311 | /* add the gtk version */ |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
312 | _pidgin_about_dialog_build_info_add_version( |
|
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
|
313 | about->build_info_store, |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
314 | §ion, |
|
38680
908fe478254b
Fix GTK capitalization
Gary Kramlich <grim@reaperworld.com>
parents:
38679
diff
changeset
|
315 | _("GTK+ Version"), |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
316 | GTK_MAJOR_VERSION, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
317 | GTK_MINOR_VERSION, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
318 | GTK_MICRO_VERSION |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
319 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
320 | } |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
321 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
322 | static void |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
323 | _pidgin_about_dialog_load_runtime_info(PidginAboutDialog *about) { |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
324 | GtkTreeIter section; |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
325 | gchar *markup = NULL; |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
326 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
327 | /* create the section */ |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
328 | markup = g_strdup_printf( |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
329 | "<span font-weight=\"bold\">%s</span>", |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
330 | _("Runtime Information") |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
331 | ); |
|
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
|
332 | gtk_tree_store_append(about->build_info_store, §ion, NULL); |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
333 | gtk_tree_store_set( |
|
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
|
334 | about->build_info_store, |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
335 | §ion, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
336 | 0, markup, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
337 | -1 |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
338 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
339 | g_free(markup); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
340 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
341 | /* add the purple version */ |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
342 | _pidgin_about_dialog_build_info_add_version( |
|
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
|
343 | about->build_info_store, |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
344 | §ion, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
345 | _("Purple Version"), |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
346 | purple_major_version, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
347 | purple_minor_version, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
348 | purple_micro_version |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
349 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
350 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
351 | /* add the glib version */ |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
352 | _pidgin_about_dialog_build_info_add_version( |
|
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
|
353 | about->build_info_store, |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
354 | §ion, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
355 | _("GLib Version"), |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
356 | glib_major_version, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
357 | glib_minor_version, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
358 | glib_micro_version |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
359 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
360 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
361 | /* add the gtk version */ |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
362 | _pidgin_about_dialog_build_info_add_version( |
|
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
|
363 | about->build_info_store, |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
364 | §ion, |
|
38680
908fe478254b
Fix GTK capitalization
Gary Kramlich <grim@reaperworld.com>
parents:
38679
diff
changeset
|
365 | _("GTK+ Version"), |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
366 | gtk_major_version, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
367 | gtk_minor_version, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
368 | gtk_micro_version |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
369 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
370 | } |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
371 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
372 | static void |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
373 | _pidgin_about_dialog_load_build_configuration(PidginAboutDialog *about) { |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
374 | #ifdef MESON_ARGS |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
375 | _pidgin_about_dialog_add_build_args(about, "Meson Arguments", MESON_ARGS); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
376 | #endif /* MESON_ARGS */ |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
377 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
378 | _pidgin_about_dialog_load_build_info(about); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
379 | _pidgin_about_dialog_load_runtime_info(about); |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
380 | } |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
381 | |
| 38659 | 382 | /****************************************************************************** |
| 383 | * Callbacks | |
| 384 | *****************************************************************************/ | |
| 385 | static void | |
|
38666
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
386 | _pidgin_about_dialog_close(GtkWidget *b, gpointer data) { |
|
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
387 | gtk_widget_destroy(GTK_WIDGET(data)); |
|
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
388 | } |
|
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
389 | |
| 38659 | 390 | /****************************************************************************** |
| 391 | * GObject Stuff | |
| 392 | *****************************************************************************/ | |
|
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
|
393 | G_DEFINE_TYPE(PidginAboutDialog, pidgin_about_dialog, GTK_TYPE_DIALOG); |
|
7c9c4d700ed2
Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
39533
diff
changeset
|
394 | |
| 38659 | 395 | static void |
| 396 | pidgin_about_dialog_class_init(PidginAboutDialogClass *klass) { | |
| 397 | GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); | |
| 398 | ||
| 399 | gtk_widget_class_set_template_from_resource( | |
| 400 | widget_class, | |
| 401 | "/im/pidgin/Pidgin/About/about.ui" | |
| 402 | ); | |
| 403 | ||
|
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
|
404 | gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, close_button); |
|
7c9c4d700ed2
Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
39533
diff
changeset
|
405 | gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, application_name); |
|
7c9c4d700ed2
Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
39533
diff
changeset
|
406 | gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, stack); |
| 38659 | 407 | |
|
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
|
408 | gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, main_scrolled_window); |
|
7c9c4d700ed2
Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
39533
diff
changeset
|
409 | gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, main_buffer); |
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
410 | |
|
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
|
411 | gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, developers_page); |
|
7c9c4d700ed2
Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
39533
diff
changeset
|
412 | gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, developers_store); |
|
7c9c4d700ed2
Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
39533
diff
changeset
|
413 | gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, developers_treeview); |
| 38662 | 414 | |
|
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
|
415 | gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, translators_page); |
|
7c9c4d700ed2
Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
39533
diff
changeset
|
416 | gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, translators_store); |
|
7c9c4d700ed2
Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
39533
diff
changeset
|
417 | gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, translators_treeview); |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
418 | |
|
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
|
419 | gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, build_info_page); |
|
7c9c4d700ed2
Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
39533
diff
changeset
|
420 | gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, build_info_store); |
|
7c9c4d700ed2
Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
39533
diff
changeset
|
421 | gtk_widget_class_bind_template_child(widget_class, PidginAboutDialog, build_info_treeview); |
| 38659 | 422 | } |
| 423 | ||
| 424 | static void | |
| 425 | pidgin_about_dialog_init(PidginAboutDialog *about) { | |
| 426 | gtk_widget_init_template(GTK_WIDGET(about)); | |
| 427 | ||
|
38666
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
428 | /* wire up the close button */ |
|
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
429 | g_signal_connect( |
|
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
|
430 | about->close_button, |
|
38666
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
431 | "clicked", |
|
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
432 | G_CALLBACK(_pidgin_about_dialog_close), |
|
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
433 | about |
|
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
434 | ); |
|
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
435 | |
|
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
|
436 | /* setup the application name 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
|
437 | _pidgin_about_dialog_load_application_name(about); |
|
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
|
438 | |
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
439 | /* setup the main page */ |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
440 | _pidgin_about_dialog_load_main_page(about); |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
441 | |
| 38662 | 442 | /* setup the developers stuff */ |
| 443 | _pidgin_about_dialog_load_developers(about); | |
|
39855
7c9c4d700ed2
Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
39533
diff
changeset
|
444 | gtk_tree_view_expand_all(GTK_TREE_VIEW(about->developers_treeview)); |
| 38662 | 445 | |
| 446 | /* setup the translators stuff */ | |
| 447 | _pidgin_about_dialog_load_translators(about); | |
|
39855
7c9c4d700ed2
Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
39533
diff
changeset
|
448 | gtk_tree_view_expand_all(GTK_TREE_VIEW(about->translators_treeview)); |
| 38659 | 449 | |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
450 | /* setup the build info page */ |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
451 | _pidgin_about_dialog_load_build_configuration(about); |
|
39855
7c9c4d700ed2
Get rid of the private struct in PidginAbout box and a few other cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
39533
diff
changeset
|
452 | gtk_tree_view_expand_all(GTK_TREE_VIEW(about->build_info_treeview)); |
| 38659 | 453 | } |
| 454 | ||
| 455 | GtkWidget * | |
| 456 | pidgin_about_dialog_new(void) { | |
| 457 | GtkWidget *about = NULL; | |
| 458 | ||
| 459 | about = g_object_new( | |
| 460 | PIDGIN_TYPE_ABOUT_DIALOG, | |
| 461 | "title", "About Pidgin", | |
| 462 | NULL | |
| 463 | ); | |
| 464 | ||
| 465 | return about; | |
| 466 | } | |
| 467 |