From 53791817d5609e3b7e1631219c9ee9cd1d485cf6 Mon Sep 17 00:00:00 2001 From: rbuj Date: Sun, 17 Feb 2019 15:38:23 +0100 Subject: Read authors and documenters fom caja.about file --- src/Makefile.am | 6 +++ src/caja-window-menus.c | 137 ++++++++++-------------------------------------- src/caja.about | 3 ++ 3 files changed, 37 insertions(+), 109 deletions(-) create mode 100644 src/caja.about diff --git a/src/Makefile.am b/src/Makefile.am index eed28d9c..06bd831d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -197,6 +197,11 @@ caja_connect_server_SOURCES = \ $(NULL) +aboutdir = $(datadir)/caja +about_DATA = \ + caja.about \ + $(NULL) + if ENABLE_SELF_CHECK TESTS=check-caja endif @@ -224,6 +229,7 @@ EXTRA_DIST = \ $(server_in_files) \ $(ui_DATA) \ check-caja \ + $(about_DATA) \ $(desktop_in_files) \ $(NULL) diff --git a/src/caja-window-menus.c b/src/caja-window-menus.c index d67fc2a1..b82059fd 100644 --- a/src/caja-window-menus.c +++ b/src/caja-window-menus.c @@ -506,113 +506,13 @@ action_backgrounds_and_emblems_callback (GtkAction *action, caja_property_browser_show (gtk_window_get_screen (window)); } +#define ABOUT_GROUP "About" +#define EMAILIFY(string) (g_strdelimit ((string), "%", '@')) + static void action_about_caja_callback (GtkAction *action, gpointer user_data) { - const gchar *authors[] = - { - "Adam Erdman ", - "Alexander Larsson", - "Alexander van der Meij ", - "Alexandru Pandelea ", - "Alexei Sorokin ", - "Ali Abdin", - "Anders Carlsson", - "Andrea Azzarone ", - "Andy Hertzfeld", - "Arlo Rose", - "Balló György ", - "Benjamin Valentin ", - "Boris Egorov ", - "Brent Hull ", - "Chen Donghai ", - "Clement Lefebvre ", - "Clément Masci", - "Colomban Wendling ", - "Cosimo Cecchi ", - "Dan Bravender ", - "Darin Adler", - "David Camp", - "E.S. Quinn ", - "Elan Ruusamäe ", - "Eli Goldberg", - "Elias Aebi ", - "Elliot Lee", - "Eskil Heyn Olsen", - "Ettore Perazzoli", - "Felipe Barriga Richards ", - "Franco Tortoriello ", - "Galik ", - "Gene Z. Ragan", - "George Lebl", - "Ian McKellar", - "Ikey Doherty ", - "J Shane Culpepper", - "James Willcox", - "Jan Arne Petersen", - "Jan Niklas Hasse ", - "Jasmine Hassan ", - "Joanmarie Diggs ", - "John Harper", - "John Sullivan", - "Josh Barrow", - "Jury Verrigni ", - "Lars R. Damerow ", - "Laszlo Boros ", - "Lionel Landwerlin ", - "Luke Yelavich ", - "Maciej Stachowiak", - "Marcel Dijkstra ", - "Mark McLoughlin", - "Martin Matuska ", - "Martin Pieuchot ", - "Martin Wimpress ", - "Mathieu Lacage", - "Max Eliaser ", - "Michael Catanzaro ", - "Mike Engber", - "Mike Fleming", - "Mike Gabriel ", - "Moritz Bruder ", - "Nelson Marques ", - "Obata Akio ", - "Pablo Barciela ", - "Pavel Cisler", - "Perberos ", - "Phillip Susi ", - "Piotr Drąg ", - "Ramiro Estrugo", - "Raph Levien", - "Rebecca Schulman", - "Robey Pointer", - "Robin * Slomkowski", - "Samuel Thibault ", - "Sander Sweers ", - "Sargastic ", - "Scott Balneaves ", - "Seth Nickell", - "Stefano Karapetsas ", - "Steve Zesch ", - "Susan Kare", - "Tomas Bzatek ", - "Victor Kareh ", - "Vlad Orlov ", - "Wolfgang Ulbrich ", - "Wu Xiaotian ", - "Yaakov Selkowitz ", - "Zhang Xianwei ", - "张雯 ", - "高群凯 ", - NULL - }; - const gchar *documenters[] = - { - "MATE Documentation Team", - "GNOME Documentation Team", - "Sun Microsystems", - NULL - }; const gchar *license[] = { N_("Caja is free software; you can redistribute it and/or modify " @@ -628,9 +528,30 @@ action_about_caja_callback (GtkAction *action, "51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA") }; gchar *license_trans; + GKeyFile *key_file; + GError *error = NULL; + char **authors, **documenters; + gsize n_authors = 0, n_documenters = 0 , i; + + key_file = g_key_file_new (); + if (!g_key_file_load_from_file (key_file, CAJA_DATADIR G_DIR_SEPARATOR_S "caja.about", 0, &error)) + { + g_warning ("Couldn't load about data: %s\n", error->message); + g_error_free (error); + g_key_file_free (key_file); + return; + } + + 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); + + 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_strjoin ("\n\n", _(license[0]), _(license[1]), - _(license[2]), NULL); + license_trans = g_strjoin ("\n\n", _(license[0]), _(license[1]), _(license[2]), NULL); gtk_show_about_dialog (GTK_WINDOW (user_data), "program-name", _("Caja"), @@ -645,16 +566,14 @@ action_about_caja_callback (GtkAction *action, "wrap-license", TRUE, "authors", authors, "documenters", documenters, - /* Translators should localize the following string - * which will be displayed at the bottom of the about - * box to give credit to the translator(s). - */ "translator-credits", _("translator-credits"), "logo-icon-name", "system-file-manager", "website", "http://www.mate-desktop.org", "website-label", _("MATE Web Site"), NULL); + g_strfreev (authors); + g_strfreev (documenters); g_free (license_trans); } diff --git a/src/caja.about b/src/caja.about new file mode 100644 index 00000000..b47515a8 --- /dev/null +++ b/src/caja.about @@ -0,0 +1,3 @@ +[About] +Authors=Adam Erdman ;Alexander Larsson;Alexander van der Meij ;Alexandru Pandelea ;Alexei Sorokin ;Ali Abdin;Anders Carlsson;Andrea Azzarone ;Andy Hertzfeld;Arlo Rose;Balló György ;Benjamin Valentin ;Boris Egorov ;Brent Hull ;Chen Donghai ;Clement Lefebvre ;Clément Masci;Colomban Wendling ;Cosimo Cecchi ;Dan Bravender ;Darin Adler;David Camp;E.S. Quinn ;Elan Ruusamäe ;Eli Goldberg;Elias Aebi ;Elliot Lee;Eskil Heyn Olsen;Ettore Perazzoli;Felipe Barriga Richards ;Franco Tortoriello ;Galik ;Gene Z. Ragan;George Lebl;Ian McKellar;Ikey Doherty ;J Shane Culpepper;James Willcox;Jan Arne Petersen;Jan Niklas Hasse ;Jasmine Hassan ;Joanmarie Diggs ;John Harper;John Sullivan;Josh Barrow;Jury Verrigni ;Lars R. Damerow ;Laszlo Boros ;Lionel Landwerlin ;Luke Yelavich ;Maciej Stachowiak;Marcel Dijkstra ;Mark McLoughlin;Martin Matuska ;Martin Pieuchot ;Martin Wimpress ;Mathieu Lacage;Max Eliaser ;Michael Catanzaro ;Mike Engber;Mike Fleming;Mike Gabriel ;Moritz Bruder ;Nelson Marques ;Obata Akio ;Pablo Barciela ;Pavel Cisler;Perberos ;Phillip Susi ;Piotr Drąg ;Ramiro Estrugo;Raph Levien;Rebecca Schulman;Robey Pointer;Robin * Slomkowski;Samuel Thibault ;Sander Sweers ;Sargastic ;Scott Balneaves ;Seth Nickell;Stefano Karapetsas ;Steve Zesch ;Susan Kare;Tomas Bzatek ;Victor Kareh ;Vlad Orlov ;Wolfgang Ulbrich ;Wu Xiaotian ;Yaakov Selkowitz ;Zhang Xianwei ;张雯 ;高群凯 ; +Documenters=MATE Documentation Team;GNOME Documentation Team;Sun Microsystems; -- cgit v1.2.1