Skip to content
Permalink
Browse files

Read authors (updated) from atril.about gresource

  • Loading branch information...
rbuj authored and raveit65 committed Feb 18, 2019
1 parent 9a4748b commit a67e572e17b4c81793e6b4f37cedcb3a1e2a4efe
Showing with 32 additions and 21 deletions.
  1. +1 −0 shell/Makefile.am
  2. +2 −0 shell/atril.about
  3. +1 −0 shell/atril.gresource.xml
  4. +28 −21 shell/ev-window.c
@@ -152,6 +152,7 @@ atrild_LDADD= \
endif

EXTRA_DIST = \
atril.about \
atril.css \
atril-ui.xml \
atril-toolbar.xml \
@@ -0,0 +1,2 @@
[About]
Authors=Adam Erdman <hekel%archlinux.info>;Alejandro Piñeiro <apinheiro%igalia.com>;Alexander Ovchinnikov <sanek23994%gmail.com>;Alexander van der Meij <alexandervdm%gliese.me>;Alexei Sorokin <sor.alexei%meowr.ru>;Andrey Gursky <andrey.gursky%e-mail.ua>;Antia Puentes <apuentes%igalia.com>;Avishkar Gupta <rootavish%gmail.com>;Balló György <ballogyor%gmail.com>;Baurzhan Muftakhidinov <baurthefirst%gmail.com>;Brent Hull <bhull2010%live.com>;Bryan Clark <clarkbw%gnome.org>;Carlos Garcia Campos <carlosgc%gnome.org>;Christian Persch <chpe%gnome.org>;Clement Lefebvre <clement.lefebvre%linuxmint.com>;Colomban Wendling <cwendling%hypra.fr>;Cormac Walsh <cormac.walsh%protonmail.com>;Cosimo Cecchi <cosimoc%gnome.org>;Daniel Glöckner <daniel-gl%gmx.net>;Eli Schwartz <eschwartz%archlinux.org>;Gabriel Cormier-Affleck <bl0ckedusersoft%gmail.com>;Geert Braekmans <brakarov%outlook.com>;Germán Poo-Caamaño <gpoo%gnome.org>;Giovanni Campagna <gcampagna%src.gnome.org>;Giselle Machado <giselle.mnr%gmail.com>;Hib Eris <hib%hiberis.nl>;Jason Crain <jason%aquaticape.us>;Joanmarie Diggs <jdiggs%igalia.com>;Jonathan Blandford <jrb%gnome.org>;JosephMcc <mccullarjoseph%gmail.com>;José Aliste <jaliste%gnome.org>;Justin Willmert <justin%jdjlab.com>;Lars Mueller <cobinja%yahoo.de>;Lubos Koudelka <koudelka.lubos%email.cz>;Marcel Dijkstra <marcel.dykstra%gmail.com>;Marco Pesenti Gritti <marco%gnome.org>;Marcus Comstedt <marcus%mc.pp.se>;Marek Kasik <mkasik%redhat.com>;Martin Kretzschmar <m_kretzschmar%gmx.net>;Martin Wimpress <martin%mate-desktop.org>;Matthew Petroff <matthew%mpetroff.net>;Matvey Soloviev <msoloviev%cs.cornell.edu>;Michał Bień <michal1.bien%gmail.com>;Mickael Albertus <mickael.albertus%gmail.com>;Nelson Benitez Leon <nbenitezl%gmail.com>;Nickolay V. Shmyrev <nshmyrev%yandex.ru>;Owen W. Taylor <otaylor%fishsoup.net>;Oz N Tiram <nahumoz%gmail.com>;Pablo Barciela <scow%riseup.net>;Perberos <perberos%gmail.com>;Peter Moser <pitiz29a%gmail.com>;Piotr Drąg <piotrdrag%gmail.com>;Robert Buj <robert.buj%gmail.com>;Sander Sweers <infirit%gmail.com>;Steev Klimaszewski <steev%gentoo.org>;Stefano Karapetsas <stefano%karapetsas.com>;Steve Zesch <stevezesch2%gmail.com>;Tobias Mueller <muelli%cryptobitch.de>;Vlad Orlov <monsta%inbox.ru>;William Jon McCann <jmccann%redhat.com>;Wolfgang Ulbrich <mate%raveit.de>;Wouter Bolsterlee <wbolster%gnome.org>;Wu Xiaotian <yetist%gmail.com>;Xiao-Long Chen <chenxiaolong%cxl.epac.to>;ZenWalker <scow%riseup.net>;
@@ -20,6 +20,7 @@
<file alias="ui/atril.xml" compressed="true" preprocess="xml-stripblanks">atril-ui.xml</file>
<file alias="ui/toolbar.xml" compressed="true" preprocess="xml-stripblanks">atril-toolbar.xml</file>
<file alias="ui/atril.css" compressed="true">atril.css</file>
<file compressed="true">atril.about</file>
</gresource>
</gresources>

@@ -5298,25 +5298,12 @@ build_comments_string (EvDocument *document)
return comments;
}

#define ABOUT_GROUP "About"
#define EMAILIFY(string) (g_strdelimit ((string), "%", '@'))

static void
ev_window_cmd_help_about (GtkAction *action, EvWindow *ev_window)
{
const char *authors[] = {
"Martin Kretzschmar <m_kretzschmar@gmx.net>",
"Jonathan Blandford <jrb@gnome.org>",
"Marco Pesenti Gritti <marco@gnome.org>",
"Nickolay V. Shmyrev <nshmyrev@yandex.ru>",
"Bryan Clark <clarkbw@gnome.org>",
"Carlos Garcia Campos <carlosgc@gnome.org>",
"Wouter Bolsterlee <wbolster@gnome.org>",
"Christian Persch <chpe" "\100" "gnome.org>",
"Perberos <perberos@gmail.com>",
"Stefano Karapetsas <stefano@karapetsas.com>",
"Steve Zesch <stevezesch2@gmail.com>",
"Avishkar Gupta <avishkar.gupta.delhi@gmail.com>",
NULL
};

const char *documenters[] = {
"MATE Documentation Team",
"GNOME Documentation Team",
@@ -5337,15 +5324,34 @@ ev_window_cmd_help_about (GtkAction *action, EvWindow *ev_window)
"51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n")
};

char *license_trans;
char *comments;
char *license_trans, *comments;
GKeyFile *key_file;
GBytes *bytes;
const guint8 *data;
gsize data_len;
GError *error = NULL;
char **authors;
gsize n_authors = 0, i;

bytes = g_resources_lookup_data ("/org/mate/atril/shell/atril.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);

g_key_file_free (key_file);
g_bytes_unref (bytes);

for (i = 0; i < n_authors; ++i)
authors[i] = EMAILIFY (authors[i]);

#ifdef ENABLE_NLS
const char **p;

for (p = authors; *p; ++p)
*p = _(*p);

for (p = documenters; *p; ++p)
*p = _(*p);
#endif
@@ -5371,6 +5377,7 @@ ev_window_cmd_help_about (GtkAction *action, EvWindow *ev_window)
"wrap-license", TRUE,
NULL);

g_strfreev (authors);
g_free (comments);
g_free (license_trans);
}

0 comments on commit a67e572

Please sign in to comment.
You can’t perform that action at this time.