Tue, 22 May 2018 09:57:25 -0500
gtkaccount: Fix accidental double-space
|
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> | |
| 21 | ||
|
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
|
22 | #include "package_revision.h" |
| 38659 | 23 | #include "pidginabout.h" |
| 24 | #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
|
25 | #include "internal.h" |
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
26 | #include "gtkutils.h" |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
27 | #include "gtkwebview.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 | |
|
898b14e03449
Hide the about window's structs since it's a final type
Gary Kramlich <grim@reaperworld.com>
parents:
38681
diff
changeset
|
38 | /*< private >*/ |
|
898b14e03449
Hide the about window's structs since it's a final type
Gary Kramlich <grim@reaperworld.com>
parents:
38681
diff
changeset
|
39 | PidginAboutDialogPrivate *priv; |
|
898b14e03449
Hide the about window's structs since it's a final type
Gary Kramlich <grim@reaperworld.com>
parents:
38681
diff
changeset
|
40 | }; |
|
898b14e03449
Hide the about window's structs since it's a final type
Gary Kramlich <grim@reaperworld.com>
parents:
38681
diff
changeset
|
41 | |
|
898b14e03449
Hide the about window's structs since it's a final type
Gary Kramlich <grim@reaperworld.com>
parents:
38681
diff
changeset
|
42 | struct _PidginAboutDialogClass { |
|
898b14e03449
Hide the about window's structs since it's a final type
Gary Kramlich <grim@reaperworld.com>
parents:
38681
diff
changeset
|
43 | GtkDialogClass parent; |
|
898b14e03449
Hide the about window's structs since it's a final type
Gary Kramlich <grim@reaperworld.com>
parents:
38681
diff
changeset
|
44 | |
|
898b14e03449
Hide the about window's structs since it's a final type
Gary Kramlich <grim@reaperworld.com>
parents:
38681
diff
changeset
|
45 | void (*_pidgin_reserved1)(void); |
|
898b14e03449
Hide the about window's structs since it's a final type
Gary Kramlich <grim@reaperworld.com>
parents:
38681
diff
changeset
|
46 | void (*_pidgin_reserved2)(void); |
|
898b14e03449
Hide the about window's structs since it's a final type
Gary Kramlich <grim@reaperworld.com>
parents:
38681
diff
changeset
|
47 | void (*_pidgin_reserved3)(void); |
|
898b14e03449
Hide the about window's structs since it's a final type
Gary Kramlich <grim@reaperworld.com>
parents:
38681
diff
changeset
|
48 | void (*_pidgin_reserved4)(void); |
|
898b14e03449
Hide the about window's structs since it's a final type
Gary Kramlich <grim@reaperworld.com>
parents:
38681
diff
changeset
|
49 | }; |
|
898b14e03449
Hide the about window's structs since it's a final type
Gary Kramlich <grim@reaperworld.com>
parents:
38681
diff
changeset
|
50 | |
| 38659 | 51 | struct _PidginAboutDialogPrivate { |
|
38666
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
52 | GtkWidget *close_button; |
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
53 | GtkWidget *application_name; |
| 38659 | 54 | GtkWidget *stack; |
| 55 | ||
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
56 | GtkWidget *main_scrolled_window; |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
57 | |
| 38662 | 58 | GtkWidget *developers_page; |
| 59 | GtkWidget *developers_treeview; | |
| 60 | GtkTreeStore *developers_store; | |
| 61 | ||
| 62 | GtkWidget *translators_page; | |
| 63 | GtkWidget *translators_treeview; | |
| 64 | GtkTreeStore *translators_store; | |
| 38659 | 65 | |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
66 | GtkWidget *build_info_page; |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
67 | 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
|
68 | GtkTreeStore *build_info_store; |
| 38659 | 69 | }; |
| 70 | ||
| 71 | /****************************************************************************** | |
| 72 | * Helpers | |
| 73 | *****************************************************************************/ | |
| 74 | 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
|
75 | _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
|
76 | 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
|
77 | "%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
|
78 | 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
|
79 | 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
|
80 | ); |
|
35676a9b7faa
Add the version to the application_name label and add the revision to build info
Gary Kramlich <grim@reaperworld.com>
parents:
38664
diff
changeset
|
81 | |
|
35676a9b7faa
Add the version to the application_name label and add the revision to build info
Gary Kramlich <grim@reaperworld.com>
parents:
38664
diff
changeset
|
82 | gtk_label_set_text(GTK_LABEL(about->priv->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
|
83 | |
|
35676a9b7faa
Add the version to the application_name label and add the revision to build info
Gary Kramlich <grim@reaperworld.com>
parents:
38664
diff
changeset
|
84 | 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
|
85 | } |
|
35676a9b7faa
Add the version to the application_name label and add the revision to build info
Gary Kramlich <grim@reaperworld.com>
parents:
38664
diff
changeset
|
86 | |
|
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
|
87 | static void |
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
88 | _pidgin_about_dialog_load_main_page(PidginAboutDialog *about) { |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
89 | GtkWidget *webview = NULL; |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
90 | GInputStream *istream = NULL; |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
91 | GString *str = NULL; |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
92 | gchar buffer[8192]; |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
93 | gssize read = 0; |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
94 | |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
95 | /* create our webview */ |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
96 | webview = pidgin_webview_new(FALSE); |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
97 | pidgin_setup_webview(webview); |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
98 | pidgin_webview_set_format_functions(PIDGIN_WEBVIEW(webview), PIDGIN_WEBVIEW_ALL ^ PIDGIN_WEBVIEW_SMILEY); |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
99 | |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
100 | gtk_container_add(GTK_CONTAINER(about->priv->main_scrolled_window), webview); |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
101 | |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
102 | /* now load the html */ |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
103 | istream = g_resource_open_stream( |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
104 | pidgin_get_resource(), |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
105 | "/im/pidgin/Pidgin/About/about.html", |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
106 | G_RESOURCE_LOOKUP_FLAGS_NONE, |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
107 | NULL |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
108 | ); |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
109 | |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
110 | str = g_string_new(""); |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
111 | |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
112 | 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
|
113 | g_string_append_len(str, (gchar *)buffer, read); |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
114 | } |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
115 | |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
116 | pidgin_webview_append_html(PIDGIN_WEBVIEW(webview), str->str); |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
117 | |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
118 | g_string_free(str, TRUE); |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
119 | |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
120 | 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
|
121 | } |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
122 | |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
123 | static void |
|
38681
ee42a17715ac
Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents:
38680
diff
changeset
|
124 | _pidgin_about_dialog_load_json(GtkTreeStore *store, const gchar *json_section) { |
| 38659 | 125 | GInputStream *istream = NULL; |
| 126 | GList *l = NULL, *sections = NULL; | |
| 127 | GError *error = NULL; | |
| 128 | JsonParser *parser = NULL; | |
| 129 | JsonNode *root_node = NULL; | |
| 130 | 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
|
131 | JsonArray *sections_array = NULL; |
| 38659 | 132 | |
|
38681
ee42a17715ac
Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents:
38680
diff
changeset
|
133 | /* get a stream to the credits resource */ |
| 38659 | 134 | istream = g_resource_open_stream( |
| 135 | pidgin_get_resource(), | |
|
38663
a463d40cb9ec
merged developers.json and translators.json to credits.json
Gary Kramlich <grim@reaperworld.com>
parents:
38662
diff
changeset
|
136 | "/im/pidgin/Pidgin/About/credits.json", |
| 38659 | 137 | G_RESOURCE_LOOKUP_FLAGS_NONE, |
| 138 | NULL | |
| 139 | ); | |
| 140 | ||
| 141 | /* create our parser */ | |
| 142 | parser = json_parser_new(); | |
| 143 | ||
| 144 | 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
|
145 | g_critical("%s", error->message); |
| 38659 | 146 | } |
| 147 | ||
| 148 | root_node = json_parser_get_root(parser); | |
| 149 | root_object = json_node_get_object(root_node); | |
| 150 | ||
|
38681
ee42a17715ac
Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents:
38680
diff
changeset
|
151 | 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
|
152 | sections = json_array_get_elements(sections_array); |
| 38659 | 153 | |
| 154 | for(l = sections; l; l = l->next) { | |
| 155 | GtkTreeIter section_iter; | |
| 156 | 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
|
157 | JsonArray *people = NULL; |
| 38659 | 158 | gchar *markup = NULL; |
|
38672
df4a6635745a
A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents:
38667
diff
changeset
|
159 | guint idx = 0, n_people = 0; |
| 38659 | 160 | |
| 161 | markup = g_strdup_printf( | |
| 162 | "<span font_weight=\"bold\" font_size=\"large\">%s</span>", | |
| 163 | json_object_get_string_member(section, "title") | |
| 164 | ); | |
| 165 | ||
|
38681
ee42a17715ac
Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents:
38680
diff
changeset
|
166 | gtk_tree_store_append(store, §ion_iter, NULL); |
| 38659 | 167 | 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
|
168 | store, |
| 38659 | 169 | §ion_iter, |
| 170 | 0, markup, | |
| 171 | 1, 0.5f, | |
| 172 | -1 | |
| 173 | ); | |
| 174 | ||
| 175 | g_free(markup); | |
| 176 | ||
|
38672
df4a6635745a
A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents:
38667
diff
changeset
|
177 | 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
|
178 | n_people = json_array_get_length(people); |
| 38659 | 179 | |
|
38672
df4a6635745a
A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents:
38667
diff
changeset
|
180 | for(idx = 0; idx < n_people; idx++) { |
| 38659 | 181 | GtkTreeIter person_iter; |
| 182 | ||
|
38681
ee42a17715ac
Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents:
38680
diff
changeset
|
183 | gtk_tree_store_append(store, &person_iter, §ion_iter); |
| 38659 | 184 | 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
|
185 | store, |
| 38662 | 186 | &person_iter, |
|
38672
df4a6635745a
A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents:
38667
diff
changeset
|
187 | 0, json_array_get_string_element(people, idx), |
| 38662 | 188 | 1, 0.5f, |
| 189 | -1 | |
| 190 | ); | |
| 191 | } | |
| 192 | } | |
| 193 | ||
| 194 | g_list_free(sections); | |
| 195 | ||
| 196 | /* clean up */ | |
| 197 | g_object_unref(G_OBJECT(parser)); | |
| 198 | ||
| 199 | g_input_stream_close(istream, NULL, NULL); | |
| 200 | } | |
| 201 | ||
| 202 | static void | |
|
38681
ee42a17715ac
Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents:
38680
diff
changeset
|
203 | _pidgin_about_dialog_load_developers(PidginAboutDialog *about) { |
|
ee42a17715ac
Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents:
38680
diff
changeset
|
204 | _pidgin_about_dialog_load_json(about->priv->developers_store, "developers"); |
|
ee42a17715ac
Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents:
38680
diff
changeset
|
205 | } |
| 38662 | 206 | |
|
38681
ee42a17715ac
Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents:
38680
diff
changeset
|
207 | static void |
|
ee42a17715ac
Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents:
38680
diff
changeset
|
208 | _pidgin_about_dialog_load_translators(PidginAboutDialog *about) { |
|
ee42a17715ac
Create a helper function for loading the developers and translators
Gary Kramlich <grim@reaperworld.com>
parents:
38680
diff
changeset
|
209 | _pidgin_about_dialog_load_json(about->priv->translators_store, "languages"); |
| 38659 | 210 | } |
| 211 | ||
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
212 | static void |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
213 | _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
|
214 | PidginAboutDialog *about, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
215 | const gchar *title, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
216 | 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
|
217 | ) { |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
218 | GtkTreeIter section, value; |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
219 | 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
|
220 | gchar *markup = NULL; |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
221 | gint idx = 0; |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
222 | |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
223 | markup = g_strdup_printf("<span font-weight=\"bold\">%s</span>", title); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
224 | gtk_tree_store_append(about->priv->build_info_store, §ion, NULL); |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
225 | gtk_tree_store_set( |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
226 | about->priv->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
|
227 | §ion, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
228 | 0, markup, |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
229 | -1 |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
230 | ); |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
231 | g_free(markup); |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
232 | |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
233 | /* 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
|
234 | splits = g_strsplit(build_args, " ", -1); |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
235 | for(idx = 0; splits[idx]; idx++) { |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
236 | gchar **value_split = g_strsplit(splits[idx], "=", 2); |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
237 | |
|
38672
df4a6635745a
A bunch of updates from review comments
Gary Kramlich <grim@reaperworld.com>
parents:
38667
diff
changeset
|
238 | 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
|
239 | continue; |
|
f8ae2ff1c19b
Fix up the autotools support
Gary Kramlich <grim@reaperworld.com>
parents:
38666
diff
changeset
|
240 | } |
|
f8ae2ff1c19b
Fix up the autotools support
Gary Kramlich <grim@reaperworld.com>
parents:
38666
diff
changeset
|
241 | |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
242 | gtk_tree_store_append(about->priv->build_info_store, &value, §ion); |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
243 | gtk_tree_store_set( |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
244 | about->priv->build_info_store, |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
245 | &value, |
|
38667
f8ae2ff1c19b
Fix up the autotools support
Gary Kramlich <grim@reaperworld.com>
parents:
38666
diff
changeset
|
246 | 0, value_split[0] ? value_split[0] : "", |
|
f8ae2ff1c19b
Fix up the autotools support
Gary Kramlich <grim@reaperworld.com>
parents:
38666
diff
changeset
|
247 | 1, value_split[1] ? value_split[1] : "", |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
248 | -1 |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
249 | ); |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
250 | |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
251 | g_strfreev(value_split); |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
252 | } |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
253 | |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
254 | 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
|
255 | } |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
256 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
257 | static void |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
258 | _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
|
259 | GtkTreeStore *store, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
260 | GtkTreeIter *section, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
261 | const gchar *title, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
262 | guint major, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
263 | guint minor, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
264 | guint micro |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
265 | ) { |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
266 | GtkTreeIter item; |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
267 | 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
|
268 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
269 | 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
|
270 | 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
|
271 | store, &item, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
272 | 0, title, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
273 | 1, version, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
274 | -1 |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
275 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
276 | g_free(version); |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
277 | } |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
278 | |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
279 | static void |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
280 | _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
|
281 | 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
|
282 | gchar *markup = NULL; |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
283 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
284 | /* create the section */ |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
285 | 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
|
286 | "<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
|
287 | _("Build Information") |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
288 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
289 | gtk_tree_store_append(about->priv->build_info_store, §ion, NULL); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
290 | 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
|
291 | about->priv->build_info_store, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
292 | §ion, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
293 | 0, markup, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
294 | -1 |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
295 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
296 | g_free(markup); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
297 | |
|
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
|
298 | /* add the 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
|
299 | gtk_tree_store_append(about->priv->build_info_store, &item, §ion); |
|
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
|
300 | gtk_tree_store_set( |
|
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
|
301 | about->priv->build_info_store, |
|
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
|
302 | &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
|
303 | 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
|
304 | 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
|
305 | -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
|
306 | ); |
|
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
|
307 | |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
308 | /* 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
|
309 | _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
|
310 | about->priv->build_info_store, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
311 | §ion, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
312 | _("Purple Version"), |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
313 | PURPLE_MAJOR_VERSION, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
314 | PURPLE_MINOR_VERSION, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
315 | PURPLE_MICRO_VERSION |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
316 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
317 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
318 | /* 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
|
319 | _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
|
320 | about->priv->build_info_store, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
321 | §ion, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
322 | _("GLib Version"), |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
323 | GLIB_MAJOR_VERSION, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
324 | GLIB_MINOR_VERSION, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
325 | GLIB_MICRO_VERSION |
|
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 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
328 | /* 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
|
329 | _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
|
330 | about->priv->build_info_store, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
331 | §ion, |
|
38680
908fe478254b
Fix GTK capitalization
Gary Kramlich <grim@reaperworld.com>
parents:
38679
diff
changeset
|
332 | _("GTK+ Version"), |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
333 | GTK_MAJOR_VERSION, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
334 | GTK_MINOR_VERSION, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
335 | GTK_MICRO_VERSION |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
336 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
337 | } |
|
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 | static void |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
340 | _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
|
341 | GtkTreeIter section; |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
342 | gchar *markup = NULL; |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
343 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
344 | /* create the section */ |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
345 | 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
|
346 | "<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
|
347 | _("Runtime Information") |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
348 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
349 | gtk_tree_store_append(about->priv->build_info_store, §ion, NULL); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
350 | 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
|
351 | about->priv->build_info_store, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
352 | §ion, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
353 | 0, markup, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
354 | -1 |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
355 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
356 | g_free(markup); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
357 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
358 | /* 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
|
359 | _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
|
360 | about->priv->build_info_store, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
361 | §ion, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
362 | _("Purple Version"), |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
363 | purple_major_version, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
364 | purple_minor_version, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
365 | purple_micro_version |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
366 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
367 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
368 | /* 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
|
369 | _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
|
370 | about->priv->build_info_store, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
371 | §ion, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
372 | _("GLib Version"), |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
373 | glib_major_version, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
374 | glib_minor_version, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
375 | glib_micro_version |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
376 | ); |
|
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 | /* 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
|
379 | _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
|
380 | about->priv->build_info_store, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
381 | §ion, |
|
38680
908fe478254b
Fix GTK capitalization
Gary Kramlich <grim@reaperworld.com>
parents:
38679
diff
changeset
|
382 | _("GTK+ Version"), |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
383 | gtk_major_version, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
384 | gtk_minor_version, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
385 | gtk_micro_version |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
386 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
387 | } |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
388 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
389 | static void |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
390 | _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
|
391 | #ifdef MESON_ARGS |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
392 | _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
|
393 | #endif /* MESON_ARGS */ |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
394 | #ifdef CONFIG_ARGS |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
395 | _pidgin_about_dialog_add_build_args(about, "Configure Arguments", CONFIG_ARGS); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
396 | #endif /* CONFIG_ARGS */ |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
397 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
398 | _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
|
399 | _pidgin_about_dialog_load_runtime_info(about); |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
400 | } |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
401 | |
| 38659 | 402 | /****************************************************************************** |
| 403 | * Callbacks | |
| 404 | *****************************************************************************/ | |
| 405 | static void | |
|
38666
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
406 | _pidgin_about_dialog_close(GtkWidget *b, gpointer data) { |
|
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
407 | gtk_widget_destroy(GTK_WIDGET(data)); |
|
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
408 | } |
|
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
409 | |
| 38659 | 410 | /****************************************************************************** |
| 411 | * GObject Stuff | |
| 412 | *****************************************************************************/ | |
| 413 | G_DEFINE_TYPE_WITH_PRIVATE(PidginAboutDialog, pidgin_about_dialog, GTK_TYPE_DIALOG); | |
| 414 | ||
| 415 | static void | |
| 416 | pidgin_about_dialog_class_init(PidginAboutDialogClass *klass) { | |
| 417 | GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); | |
| 418 | ||
| 419 | gtk_widget_class_set_template_from_resource( | |
| 420 | widget_class, | |
| 421 | "/im/pidgin/Pidgin/About/about.ui" | |
| 422 | ); | |
| 423 | ||
|
38666
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
424 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, close_button); |
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
425 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, application_name); |
| 38659 | 426 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, stack); |
| 427 | ||
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
428 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, main_scrolled_window); |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
429 | |
| 38662 | 430 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, developers_page); |
| 431 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, developers_store); | |
| 432 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, developers_treeview); | |
| 433 | ||
| 434 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, translators_page); | |
| 435 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, translators_store); | |
| 436 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, translators_treeview); | |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
437 | |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
438 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, build_info_page); |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
439 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, build_info_store); |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
440 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, build_info_treeview); |
| 38659 | 441 | } |
| 442 | ||
| 443 | static void | |
| 444 | pidgin_about_dialog_init(PidginAboutDialog *about) { | |
| 445 | about->priv = pidgin_about_dialog_get_instance_private(about); | |
| 446 | ||
| 447 | gtk_widget_init_template(GTK_WIDGET(about)); | |
| 448 | ||
|
38666
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
449 | /* wire up the close button */ |
|
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
450 | g_signal_connect( |
|
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
451 | about->priv->close_button, |
|
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
452 | "clicked", |
|
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
453 | G_CALLBACK(_pidgin_about_dialog_close), |
|
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
454 | about |
|
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
455 | ); |
|
c0bf67926a79
Wire up the close button
Gary Kramlich <grim@reaperworld.com>
parents:
38665
diff
changeset
|
456 | |
|
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
|
457 | /* 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
|
458 | _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
|
459 | |
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
460 | /* setup the main page */ |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
461 | _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
|
462 | |
| 38662 | 463 | /* setup the developers stuff */ |
| 464 | _pidgin_about_dialog_load_developers(about); | |
| 465 | gtk_tree_view_expand_all(GTK_TREE_VIEW(about->priv->developers_treeview)); | |
| 466 | ||
| 467 | /* setup the translators stuff */ | |
| 468 | _pidgin_about_dialog_load_translators(about); | |
| 469 | gtk_tree_view_expand_all(GTK_TREE_VIEW(about->priv->translators_treeview)); | |
| 38659 | 470 | |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
471 | /* 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
|
472 | _pidgin_about_dialog_load_build_configuration(about); |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
473 | gtk_tree_view_expand_all(GTK_TREE_VIEW(about->priv->build_info_treeview)); |
| 38659 | 474 | } |
| 475 | ||
| 476 | GtkWidget * | |
| 477 | pidgin_about_dialog_new(void) { | |
| 478 | GtkWidget *about = NULL; | |
| 479 | ||
| 480 | about = g_object_new( | |
| 481 | PIDGIN_TYPE_ABOUT_DIALOG, | |
| 482 | "title", "About Pidgin", | |
| 483 | NULL | |
| 484 | ); | |
| 485 | ||
| 486 | return about; | |
| 487 | } | |
| 488 |