From eed55110772fb38b5ba7c148e0c277401c96e9b6 Mon Sep 17 00:00:00 2001 From: rbuj Date: Sun, 17 Feb 2019 22:20:08 +0100 Subject: Read authors (updated) and documenters (updated) from eom.about gresource --- data/Makefile.am | 1 + data/eom.about | 3 +++ src/eom-window.c | 68 +++++++++++++++++++++++++-------------------------- src/eom.gresource.xml | 1 + 4 files changed, 38 insertions(+), 35 deletions(-) create mode 100644 data/eom.about diff --git a/data/Makefile.am b/data/Makefile.am index 8f092f1..99711a3 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -35,6 +35,7 @@ EXTRA_DIST = \ eom-preferences-dialog.ui \ eom-ui.xml \ metadata-sidebar.ui \ + eom.about \ $(DESKTOP_IN_FILES) \ $(appdata_in_files) diff --git a/data/eom.about b/data/eom.about new file mode 100644 index 0000000..1229c84 --- /dev/null +++ b/data/eom.about @@ -0,0 +1,3 @@ +[About] +Authors=Akshay Gupta ;Alexander Pyhalov ;Alexandre Rostovtsev ;Alexei Sorokin ;Arik Devens ;Björn Weber ;Boris Egorov ;Claudio Saavedra ;Debarshi Ray ;Elias Aebi ;Emmanuel Pacaud ;Federico Mena-Quintero ;Felix Riemann ;Adam Erdman ;Javier Sánchez ;Jens Finke ;Laszlo Boros ;Lucas Rocha ;Lutz Mxc3xbcller ;Marcel Dijkstra ;Martin Baulig ;Martin Wimpress ;Michael Meeks ;Mike Gabriel ;Pablo Barciela ;Paolo Borelli ;Perberos ;Philip Van Hoof ;Piotr Drąg ;Russell Haley ;Scott Balneaves ;Sorokin Alexei ;Steev Klimaszewski ;Stefano Karapetsas ;Steve Zesch ;Tim Gerla ;Timm Bäder ;Trinh Anh Ngoc ;Victor Kareh ;Vlad Orlov ;Wolfgang Ulbrich ;Wu Xiaotian ;Yaakov Selkowitz ;ZenWalker ; +Documenters=Eliot Landrum ;Federico Mena-Quintero ;Sun Microsystems;MATE Documentation Team; diff --git a/src/eom-window.c b/src/eom-window.c index bc5ca59..7b748c8 100644 --- a/src/eom-window.c +++ b/src/eom-window.c @@ -2519,6 +2519,9 @@ eom_window_cmd_help (GtkAction *action, gpointer user_data) eom_util_show_help (NULL, GTK_WINDOW (window)); } +#define ABOUT_GROUP "About" +#define EMAILIFY(string) (g_strdelimit ((string), "%", '@')) + static void eom_window_cmd_about (GtkAction *action, gpointer user_data) { @@ -2526,38 +2529,6 @@ eom_window_cmd_about (GtkAction *action, gpointer user_data) g_return_if_fail (EOM_IS_WINDOW (user_data)); - static const char *authors[] = { - "Perberos ", - "Steve Zesch ", - "Stefano Karapetsas ", - "", - "Claudio Saavedra (maintainer)", - "Felix Riemann (maintainer)", - "", - "Lucas Rocha ", - "Tim Gerla ", - "Philip Van Hoof ", - "Paolo Borelli ", - "Jens Finke ", - "Martin Baulig ", - "Arik Devens ", - "Michael Meeks ", - "Federico Mena-Quintero ", - "Lutz M\xc3\xbcller ", - NULL - }; - - static const char *documenters[] = { - "Eliot Landrum ", - "Federico Mena-Quintero ", - "Sun GNOME Documentation Team ", - NULL - }; - - const char *translators; - - translators = _("translator-credits"); - const char *license[] = { N_("This program is free software; you can redistribute it and/or modify " "it under the terms of the GNU General Public License as published by " @@ -2573,9 +2544,34 @@ eom_window_cmd_about (GtkAction *action, gpointer user_data) }; char *license_trans; + GKeyFile *key_file; + GBytes *bytes; + const guint8 *data; + gsize data_len; + GError *error = NULL; + char **authors, **documenters; + gsize n_authors = 0, n_documenters = 0 , i; + + bytes = g_resources_lookup_data ("/org/mate/eom/ui/eom.about", G_RESOURCE_LOOKUP_FLAGS_NONE, &error); + g_assert_no_error (error); + + data = g_bytes_get_data (bytes, &data_len); + key_file = g_key_file_new (); + g_key_file_load_from_data (key_file, (const char *) data, data_len, 0, &error); + g_assert_no_error (error); + + authors = g_key_file_get_string_list (key_file, ABOUT_GROUP, "Authors", &n_authors, NULL); + documenters = g_key_file_get_string_list (key_file, ABOUT_GROUP, "Documenters", &n_documenters, NULL); + + g_key_file_free (key_file); + g_bytes_unref (bytes); + + for (i = 0; i < n_authors; ++i) + authors[i] = EMAILIFY (authors[i]); + for (i = 0; i < n_documenters; ++i) + documenters[i] = EMAILIFY (documenters[i]); - license_trans = g_strconcat (_(license[0]), "\n", _(license[1]), "\n", - _(license[2]), "\n", NULL); + license_trans = g_strconcat (_(license[0]), "\n", _(license[1]), "\n", _(license[2]), "\n", NULL); window = EOM_WINDOW (user_data); @@ -2589,13 +2585,15 @@ eom_window_cmd_about (GtkAction *action, gpointer user_data) "comments",_("The MATE image viewer."), "authors", authors, "documenters", documenters, - "translator-credits", translators, + "translator-credits", _("translator-credits"), "website", "http://www.mate-desktop.org/", "logo-icon-name", "eom", "wrap-license", TRUE, "license", license_trans, NULL); + g_strfreev (authors); + g_strfreev (documenters); g_free (license_trans); } diff --git a/src/eom.gresource.xml b/src/eom.gresource.xml index 1904e8c..f06d5c7 100644 --- a/src/eom.gresource.xml +++ b/src/eom.gresource.xml @@ -7,6 +7,7 @@ eom-preferences-dialog.ui eom-ui.xml metadata-sidebar.ui + eom.about pixmaps/thumbnail-frame.png -- cgit v1.2.1