Thu, 17 Aug 2017 22:17:36 -0500
Add the version to the application_name label and add the revision to build info
| 38659 | 1 | #include <gdk-pixbuf/gdk-pixbuf.h> |
| 2 | #include <json-glib/json-glib.h> | |
| 3 | ||
|
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
|
4 | #include "package_revision.h" |
| 38659 | 5 | #include "pidginabout.h" |
| 6 | #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
|
7 | #include "internal.h" |
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
8 | #include "gtkutils.h" |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
9 | #include "gtkwebview.h" |
| 38659 | 10 | |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
11 | #include <stdio.h> |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
12 | |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
13 | #include "config.h" |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
14 | #ifdef HAVE_MESON_CONFIG |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
15 | #include "meson-config.h" |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
16 | #else |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
17 | #error HAVE_MESON_CONFIG is not defined |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
18 | #endif |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
19 | |
| 38659 | 20 | struct _PidginAboutDialogPrivate { |
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
21 | GtkWidget *application_name; |
| 38659 | 22 | GtkWidget *stack; |
| 23 | ||
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
24 | GtkWidget *main_scrolled_window; |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
25 | |
| 38662 | 26 | GtkWidget *developers_button; |
| 27 | GtkWidget *developers_page; | |
| 28 | GtkWidget *developers_treeview; | |
| 29 | GtkTreeStore *developers_store; | |
| 30 | ||
| 31 | GtkWidget *translators_button; | |
| 32 | GtkWidget *translators_page; | |
| 33 | GtkWidget *translators_treeview; | |
| 34 | GtkTreeStore *translators_store; | |
| 38659 | 35 | |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
36 | GtkWidget *build_info_button; |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
37 | GtkWidget *build_info_page; |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
38 | 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
|
39 | GtkTreeStore *build_info_store; |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
40 | |
| 38659 | 41 | gboolean switching_pages; |
| 42 | }; | |
| 43 | ||
| 44 | /****************************************************************************** | |
| 45 | * Helpers | |
| 46 | *****************************************************************************/ | |
| 47 | static void | |
| 48 | _pidgin_about_dialog_switch_page(PidginAboutDialog *about, const gchar *name) { | |
| 49 | about->priv->switching_pages = TRUE; | |
| 50 | ||
| 51 | gtk_stack_set_visible_child_name(GTK_STACK(about->priv->stack), name); | |
| 52 | ||
| 38662 | 53 | /* now figure out if developers button is active */ |
| 38659 | 54 | gtk_toggle_button_set_active( |
| 38662 | 55 | GTK_TOGGLE_BUTTON(about->priv->developers_button), |
| 56 | g_str_equal("developers", name) | |
| 57 | ); | |
| 58 | ||
| 59 | /* is the translators button active? */ | |
| 60 | gtk_toggle_button_set_active( | |
| 61 | GTK_TOGGLE_BUTTON(about->priv->translators_button), | |
| 62 | g_str_equal("translators", name) | |
| 38659 | 63 | ); |
| 64 | ||
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
65 | /* is the build info button active? */ |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
66 | gtk_toggle_button_set_active( |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
67 | GTK_TOGGLE_BUTTON(about->priv->build_info_button), |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
68 | g_str_equal("build-info", name) |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
69 | ); |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
70 | |
| 38659 | 71 | about->priv->switching_pages = FALSE; |
| 72 | } | |
| 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 |
| 38662 | 124 | _pidgin_about_dialog_load_developers(PidginAboutDialog *about) { |
| 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; | |
| 38662 | 131 | JsonArray *developers = NULL; |
| 38659 | 132 | |
| 38662 | 133 | /* get a stream to the developers 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 | ||
| 38662 | 151 | developers = json_object_get_array_member(root_object, "developers"); |
| 152 | sections = json_array_get_elements(developers); | |
| 38659 | 153 | |
| 154 | for(l = sections; l; l = l->next) { | |
| 155 | GtkTreeIter section_iter; | |
| 156 | GList *ll = NULL, *people = NULL; | |
| 157 | JsonObject *section = json_node_get_object(l->data); | |
| 158 | JsonArray *people_array = NULL; | |
| 159 | gchar *markup = NULL; | |
| 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 | ||
| 38662 | 166 | gtk_tree_store_append(about->priv->developers_store, §ion_iter, NULL); |
| 38659 | 167 | gtk_tree_store_set( |
| 38662 | 168 | about->priv->developers_store, |
| 38659 | 169 | §ion_iter, |
| 170 | 0, markup, | |
| 171 | 1, 0.5f, | |
| 172 | -1 | |
| 173 | ); | |
| 174 | ||
| 175 | g_free(markup); | |
| 176 | ||
| 177 | people_array = json_object_get_array_member(section, "people"); | |
| 178 | people = json_array_get_elements(people_array); | |
| 179 | ||
| 180 | for(ll = people; ll; ll = ll->next) { | |
| 181 | GtkTreeIter person_iter; | |
| 182 | gchar *markup = g_strdup(json_node_get_string(ll->data)); | |
| 183 | ||
| 38662 | 184 | gtk_tree_store_append(about->priv->developers_store, &person_iter, §ion_iter); |
| 38659 | 185 | gtk_tree_store_set( |
| 38662 | 186 | about->priv->developers_store, |
| 187 | &person_iter, | |
| 188 | 0, markup, | |
| 189 | 1, 0.5f, | |
| 190 | -1 | |
| 191 | ); | |
| 192 | ||
| 193 | g_free(markup); | |
| 194 | } | |
| 195 | ||
| 196 | g_list_free(people); | |
| 197 | } | |
| 198 | ||
| 199 | g_list_free(sections); | |
| 200 | ||
| 201 | /* clean up */ | |
| 202 | g_object_unref(G_OBJECT(parser)); | |
| 203 | ||
| 204 | g_input_stream_close(istream, NULL, NULL); | |
| 205 | } | |
| 206 | ||
| 207 | static void | |
| 208 | _pidgin_about_dialog_load_translators(PidginAboutDialog *about) { | |
| 209 | GInputStream *istream = NULL; | |
| 210 | GList *l = NULL, *sections = NULL; | |
| 211 | GError *error = NULL; | |
| 212 | JsonParser *parser = NULL; | |
| 213 | JsonNode *root_node = NULL; | |
| 214 | JsonObject *root_object = NULL; | |
| 215 | JsonArray *languages = NULL; | |
| 216 | ||
| 217 | /* get a stream to the developers resource */ | |
| 218 | istream = g_resource_open_stream( | |
| 219 | pidgin_get_resource(), | |
|
38663
a463d40cb9ec
merged developers.json and translators.json to credits.json
Gary Kramlich <grim@reaperworld.com>
parents:
38662
diff
changeset
|
220 | "/im/pidgin/Pidgin/About/credits.json", |
| 38662 | 221 | G_RESOURCE_LOOKUP_FLAGS_NONE, |
| 222 | NULL | |
| 223 | ); | |
| 224 | ||
| 225 | /* create our parser */ | |
| 226 | parser = json_parser_new(); | |
| 227 | ||
| 228 | if(!json_parser_load_from_stream(parser, istream, NULL, &error)) { | |
| 229 | g_critical("%s", error->message); | |
| 230 | } | |
| 231 | ||
| 232 | root_node = json_parser_get_root(parser); | |
| 233 | root_object = json_node_get_object(root_node); | |
| 234 | ||
| 235 | languages = json_object_get_array_member(root_object, "languages"); | |
| 236 | sections = json_array_get_elements(languages); | |
| 237 | ||
| 238 | for(l = sections; l; l = l->next) { | |
| 239 | GtkTreeIter section_iter; | |
| 240 | GList *ll = NULL, *people = NULL; | |
| 241 | JsonObject *section = json_node_get_object(l->data); | |
| 242 | JsonArray *people_array = NULL; | |
| 243 | gchar *markup = NULL; | |
| 244 | ||
| 245 | markup = g_strdup_printf( | |
| 246 | "<span font_weight=\"bold\" font_size=\"large\">%s</span>", | |
| 247 | json_object_get_string_member(section, "title") | |
| 248 | ); | |
| 249 | ||
| 250 | gtk_tree_store_append(about->priv->translators_store, §ion_iter, NULL); | |
| 251 | gtk_tree_store_set( | |
| 252 | about->priv->translators_store, | |
| 253 | §ion_iter, | |
| 254 | 0, markup, | |
| 255 | 1, 0.5f, | |
| 256 | -1 | |
| 257 | ); | |
| 258 | ||
| 259 | g_free(markup); | |
| 260 | ||
| 261 | people_array = json_object_get_array_member(section, "people"); | |
| 262 | people = json_array_get_elements(people_array); | |
| 263 | ||
| 264 | for(ll = people; ll; ll = ll->next) { | |
| 265 | GtkTreeIter person_iter; | |
| 266 | gchar *markup = g_strdup(json_node_get_string(ll->data)); | |
| 267 | ||
| 268 | gtk_tree_store_append(about->priv->translators_store, &person_iter, §ion_iter); | |
| 269 | gtk_tree_store_set( | |
| 270 | about->priv->translators_store, | |
| 38659 | 271 | &person_iter, |
| 272 | 0, markup, | |
| 273 | 1, 0.5f, | |
| 274 | -1 | |
| 275 | ); | |
| 276 | ||
| 277 | g_free(markup); | |
| 278 | } | |
| 279 | ||
| 280 | g_list_free(people); | |
| 281 | } | |
| 282 | ||
| 283 | g_list_free(sections); | |
| 284 | ||
| 285 | /* clean up */ | |
| 286 | g_object_unref(G_OBJECT(parser)); | |
| 287 | ||
| 288 | g_input_stream_close(istream, NULL, NULL); | |
| 289 | } | |
| 290 | ||
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
291 | static void |
|
38661
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_add_build_args( |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
293 | PidginAboutDialog *about, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
294 | const gchar *title, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
295 | 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
|
296 | ) { |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
297 | GtkTreeIter section, value; |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
298 | 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
|
299 | gchar *markup = NULL; |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
300 | gint idx = 0; |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
301 | |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
302 | 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
|
303 | 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
|
304 | gtk_tree_store_set( |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
305 | 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
|
306 | §ion, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
307 | 0, markup, |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
308 | -1 |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
309 | ); |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
310 | g_free(markup); |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
311 | |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
312 | /* 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
|
313 | splits = g_strsplit(build_args, " ", -1); |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
314 | for(idx = 0; splits[idx]; idx++) { |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
315 | gchar **value_split = g_strsplit(splits[idx], "=", 2); |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
316 | |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
317 | 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
|
318 | gtk_tree_store_set( |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
319 | about->priv->build_info_store, |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
320 | &value, |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
321 | 0, value_split[0], |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
322 | 1, value_split[1], |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
323 | -1 |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
324 | ); |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
325 | |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
326 | g_strfreev(value_split); |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
327 | } |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
328 | |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
329 | 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
|
330 | } |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
331 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
332 | static void |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
333 | _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
|
334 | GtkTreeStore *store, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
335 | GtkTreeIter *section, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
336 | const gchar *title, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
337 | guint major, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
338 | guint minor, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
339 | guint micro |
|
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 | GtkTreeIter item; |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
342 | 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
|
343 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
344 | 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
|
345 | 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
|
346 | store, &item, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
347 | 0, title, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
348 | 1, version, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
349 | -1 |
|
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 | g_free(version); |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
352 | } |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
353 | |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
354 | static void |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
355 | _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
|
356 | 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
|
357 | gchar *markup = NULL; |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
358 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
359 | /* create the section */ |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
360 | 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
|
361 | "<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
|
362 | _("Build Information") |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
363 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
364 | 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
|
365 | 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
|
366 | 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
|
367 | §ion, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
368 | 0, markup, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
369 | -1 |
|
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 | g_free(markup); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
372 | |
|
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
|
373 | /* 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
|
374 | 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
|
375 | 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
|
376 | 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
|
377 | &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
|
378 | 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
|
379 | 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
|
380 | -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
|
381 | ); |
|
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
|
382 | |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
383 | /* 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
|
384 | _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
|
385 | 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
|
386 | §ion, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
387 | _("Purple Version"), |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
388 | PURPLE_MAJOR_VERSION, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
389 | PURPLE_MINOR_VERSION, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
390 | PURPLE_MICRO_VERSION |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
391 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
392 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
393 | /* 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
|
394 | _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
|
395 | 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
|
396 | §ion, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
397 | _("GLib Version"), |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
398 | GLIB_MAJOR_VERSION, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
399 | GLIB_MINOR_VERSION, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
400 | GLIB_MICRO_VERSION |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
401 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
402 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
403 | /* 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
|
404 | _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
|
405 | 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
|
406 | §ion, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
407 | _("Gtk+ Version"), |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
408 | GTK_MAJOR_VERSION, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
409 | GTK_MINOR_VERSION, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
410 | GTK_MICRO_VERSION |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
411 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
412 | } |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
413 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
414 | static void |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
415 | _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
|
416 | GtkTreeIter section; |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
417 | gchar *markup = NULL; |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
418 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
419 | /* create the section */ |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
420 | 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
|
421 | "<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
|
422 | _("Runtime Information") |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
423 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
424 | 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
|
425 | 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
|
426 | 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
|
427 | §ion, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
428 | 0, markup, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
429 | -1 |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
430 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
431 | g_free(markup); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
432 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
433 | /* 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
|
434 | _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
|
435 | 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
|
436 | §ion, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
437 | _("Purple Version"), |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
438 | purple_major_version, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
439 | purple_minor_version, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
440 | purple_micro_version |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
441 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
442 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
443 | /* 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
|
444 | _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
|
445 | 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
|
446 | §ion, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
447 | _("GLib Version"), |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
448 | glib_major_version, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
449 | glib_minor_version, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
450 | glib_micro_version |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
451 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
452 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
453 | /* 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
|
454 | _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
|
455 | 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
|
456 | §ion, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
457 | _("Gtk+ Version"), |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
458 | gtk_major_version, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
459 | gtk_minor_version, |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
460 | gtk_micro_version |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
461 | ); |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
462 | } |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
463 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
464 | static void |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
465 | _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
|
466 | #ifdef MESON_ARGS |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
467 | _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
|
468 | #endif /* MESON_ARGS */ |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
469 | #ifdef CONFIG_ARGS |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
470 | _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
|
471 | #endif /* CONFIG_ARGS */ |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
472 | |
|
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
473 | _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
|
474 | _pidgin_about_dialog_load_runtime_info(about); |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
475 | } |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
476 | |
| 38659 | 477 | /****************************************************************************** |
| 478 | * Callbacks | |
| 479 | *****************************************************************************/ | |
| 480 | static void | |
| 38662 | 481 | _pidgin_about_dialog_toggle_developers(GtkToggleButton *b, gpointer d) { |
| 38659 | 482 | PidginAboutDialog *about = d; |
| 483 | gboolean show = FALSE; | |
| 484 | ||
| 485 | if(about->priv->switching_pages) | |
| 486 | return; | |
| 487 | ||
| 488 | show = gtk_toggle_button_get_active(b); | |
| 489 | ||
| 38662 | 490 | _pidgin_about_dialog_switch_page(d, show ? "developers" : "main"); |
| 491 | } | |
| 492 | ||
| 493 | static void | |
| 494 | _pidgin_about_dialog_toggle_translators(GtkToggleButton *b, gpointer d) { | |
| 495 | PidginAboutDialog *about = d; | |
| 496 | gboolean show = FALSE; | |
| 497 | ||
| 498 | if(about->priv->switching_pages) | |
| 499 | return; | |
| 500 | ||
| 501 | show = gtk_toggle_button_get_active(b); | |
| 502 | ||
| 503 | _pidgin_about_dialog_switch_page(d, show ? "translators" : "main"); | |
| 38659 | 504 | } |
| 505 | ||
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
506 | static void |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
507 | _pidgin_about_dialog_toggle_build_info(GtkToggleButton *b, gpointer d) { |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
508 | PidginAboutDialog *about = d; |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
509 | gboolean show = FALSE; |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
510 | |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
511 | if(about->priv->switching_pages) |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
512 | return; |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
513 | |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
514 | show = gtk_toggle_button_get_active(b); |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
515 | |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
516 | _pidgin_about_dialog_switch_page(d, show ? "build-info" : "main"); |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
517 | } |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
518 | |
| 38659 | 519 | /****************************************************************************** |
| 520 | * GObject Stuff | |
| 521 | *****************************************************************************/ | |
| 522 | G_DEFINE_TYPE_WITH_PRIVATE(PidginAboutDialog, pidgin_about_dialog, GTK_TYPE_DIALOG); | |
| 523 | ||
| 524 | static void | |
| 525 | pidgin_about_dialog_class_init(PidginAboutDialogClass *klass) { | |
| 526 | GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); | |
| 527 | ||
| 528 | gtk_widget_class_set_template_from_resource( | |
| 529 | widget_class, | |
| 530 | "/im/pidgin/Pidgin/About/about.ui" | |
| 531 | ); | |
| 532 | ||
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
533 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, application_name); |
| 38659 | 534 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, stack); |
| 535 | ||
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
536 | 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
|
537 | |
| 38662 | 538 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, developers_button); |
| 539 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, developers_page); | |
| 540 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, developers_store); | |
| 541 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, developers_treeview); | |
| 542 | ||
| 543 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, translators_button); | |
| 544 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, translators_page); | |
| 545 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, translators_store); | |
| 546 | 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
|
547 | |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
548 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, build_info_button); |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
549 | 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
|
550 | 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
|
551 | gtk_widget_class_bind_template_child_private(widget_class, PidginAboutDialog, build_info_treeview); |
| 38659 | 552 | } |
| 553 | ||
| 554 | static void | |
| 555 | pidgin_about_dialog_init(PidginAboutDialog *about) { | |
| 556 | about->priv = pidgin_about_dialog_get_instance_private(about); | |
| 557 | ||
| 558 | about->priv->switching_pages = FALSE; | |
| 559 | ||
| 560 | gtk_widget_init_template(GTK_WIDGET(about)); | |
| 561 | ||
|
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
|
562 | /* 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
|
563 | _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
|
564 | |
|
38664
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
565 | /* setup the main page */ |
|
253a9bbc3317
Clean up the main page on the about dialog
Gary Kramlich <grim@reaperworld.com>
parents:
38663
diff
changeset
|
566 | _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
|
567 | |
| 38662 | 568 | /* setup the developers stuff */ |
| 38659 | 569 | g_signal_connect( |
| 38662 | 570 | about->priv->developers_button, |
| 38659 | 571 | "toggled", |
| 38662 | 572 | G_CALLBACK(_pidgin_about_dialog_toggle_developers), |
| 38659 | 573 | about |
| 574 | ); | |
| 575 | ||
| 38662 | 576 | _pidgin_about_dialog_load_developers(about); |
| 577 | gtk_tree_view_expand_all(GTK_TREE_VIEW(about->priv->developers_treeview)); | |
| 578 | ||
| 579 | /* setup the translators stuff */ | |
| 580 | g_signal_connect( | |
| 581 | about->priv->translators_button, | |
| 582 | "toggled", | |
| 583 | G_CALLBACK(_pidgin_about_dialog_toggle_translators), | |
| 584 | about | |
| 585 | ); | |
| 586 | ||
| 587 | _pidgin_about_dialog_load_translators(about); | |
| 588 | gtk_tree_view_expand_all(GTK_TREE_VIEW(about->priv->translators_treeview)); | |
| 38659 | 589 | |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
590 | /* setup the build info page */ |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
591 | g_signal_connect( |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
592 | about->priv->build_info_button, |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
593 | "toggled", |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
594 | G_CALLBACK(_pidgin_about_dialog_toggle_build_info), |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
595 | about |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
596 | ); |
|
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
597 | |
|
38661
cf4073d0d648
A bunch more tweaks and added build and runtime library versions
Gary Kramlich <grim@reaperworld.com>
parents:
38660
diff
changeset
|
598 | _pidgin_about_dialog_load_build_configuration(about); |
|
38660
d6a4308481c7
Get the meson arguments working
Gary Kramlich <grim@reaperworld.com>
parents:
38659
diff
changeset
|
599 | gtk_tree_view_expand_all(GTK_TREE_VIEW(about->priv->build_info_treeview)); |
| 38659 | 600 | } |
| 601 | ||
| 602 | GtkWidget * | |
| 603 | pidgin_about_dialog_new(void) { | |
| 604 | GtkWidget *about = NULL; | |
| 605 | ||
| 606 | about = g_object_new( | |
| 607 | PIDGIN_TYPE_ABOUT_DIALOG, | |
| 608 | "title", "About Pidgin", | |
| 609 | NULL | |
| 610 | ); | |
| 611 | ||
| 612 | return about; | |
| 613 | } | |
| 614 |