From 04f39fab067f28e2651fc7b68c642002e2de15ef Mon Sep 17 00:00:00 2001 From: Alexander Valavanis Date: Sun, 13 Aug 2017 14:39:38 +0100 Subject: Install AUTHORS & TRANSLATORS files and auto-generate credits in AboutBox --- src/path-prefix.h | 4 + src/ui/dialog/aboutbox.cpp | 386 +++------------------------------------------ 2 files changed, 29 insertions(+), 361 deletions(-) (limited to 'src') diff --git a/src/path-prefix.h b/src/path-prefix.h index 1c17ce2d8..96999b3cb 100644 --- a/src/path-prefix.h +++ b/src/path-prefix.h @@ -31,6 +31,7 @@ # define INKSCAPE_APPICONDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/pixmaps" ) # define INKSCAPE_ATTRRELDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/inkscape/attributes" ) # define INKSCAPE_BINDDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/inkscape/bind" ) +# define INKSCAPE_DOCDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/inkscape/doc" ) # define INKSCAPE_EXAMPLESDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/inkscape/examples" ) # define INKSCAPE_EXTENSIONDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/inkscape/extensions" ) # define INKSCAPE_FILTERDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/inkscape/filters" ) @@ -55,6 +56,7 @@ # define INKSCAPE_APPICONDIR WIN32_DATADIR("pixmaps") # define INKSCAPE_ATTRRELDIR WIN32_DATADIR("attributes") # define INKSCAPE_BINDDIR WIN32_DATADIR("bind") +# define INKSCAPE_DOCDIR WIN32_DATADIR("doc") # define INKSCAPE_EXAMPLESDIR WIN32_DATADIR("examples") # define INKSCAPE_EXTENSIONDIR WIN32_DATADIR("extensions") # define INKSCAPE_FILTERDIR WIN32_DATADIR("filters") @@ -78,6 +80,7 @@ # define INKSCAPE_APPICONDIR "Contents/Resources/share/pixmaps" # define INKSCAPE_ATTRRELDIR "Contents/Resources/share/inkscape/attributes" # define INKSCAPE_BINDDIR "Contents/Resources/share/inkscape/bind" +# define INKSCAPE_DOCDIR "Contents/Resources/share/inkscape/doc" # define INKSCAPE_EXAMPLESDIR "Contents/Resources/share/inkscape/examples" # define INKSCAPE_EXTENSIONDIR "Contents/Resources/share/inkscape/extensions" # define INKSCAPE_FILTERDIR "Contents/Resources/share/inkscape/filters" @@ -101,6 +104,7 @@ # define INKSCAPE_APPICONDIR INKSCAPE_DATADIR "/pixmaps" # define INKSCAPE_ATTRRELDIR INKSCAPE_DATADIR "/inkscape/attributes" # define INKSCAPE_BINDDIR INKSCAPE_DATADIR "/inkscape/bind" +# define INKSCAPE_DOCDIR INKSCAPE_DATADIR "/inkscape/doc" # define INKSCAPE_EXAMPLESDIR INKSCAPE_DATADIR "/inkscape/examples" # define INKSCAPE_EXTENSIONDIR INKSCAPE_DATADIR "/inkscape/extensions" # define INKSCAPE_FILTERDIR INKSCAPE_DATADIR "/inkscape/filters" diff --git a/src/ui/dialog/aboutbox.cpp b/src/ui/dialog/aboutbox.cpp index c95f84f8e..652ebd411 100644 --- a/src/ui/dialog/aboutbox.cpp +++ b/src/ui/dialog/aboutbox.cpp @@ -23,6 +23,8 @@ #include "ui/dialog/aboutbox.h" +#include + #include #include #include @@ -146,201 +148,26 @@ Gtk::Widget *build_splash_widget() { * used for making widgets */ void AboutBox::initStrings() { - //############################## //# A U T H O R S //############################## - - /* This text is copied from the AUTHORS file. - * To update it, execute this snippet of sed magic in the toplevel - * source directory: - * - * sed -e 's/^\(.*\) \([^ ]*\)*$/\2_ \1/' AUTHORS - | sort - | sed -e 's/^\([^_]*\)_ \(.*\)$/\2 \1/;s/^.*$/"\0\\n"/;$s/\\n//' - | zenity --text-info - * - * and paste the result from the combo box here. - */ - std::vector authors = { - "Maximilian Albert", - "Joshua A. Andler", - "Tavmjong Bah", - "Pierre Barbry-Blot", - "Jean-François Barraud", - "Campbell Barton", - "Bill Baxter", - "John Beard", - "John Bintz", - "Arpad Biro", - "Nicholas Bishop", - "Joshua L. Blocher", - "Hanno Böck", - "Tomasz Boczkowski", - "Adrian Boguszewski", - "Henrik Bohre", - "Boldewyn", - "Daniel Borgmann", - "Bastien Bouclet", - "Hans Breuer", - "Gustav Broberg", - "Christopher Brown", - "Marcus Brubaker", - "Luca Bruno", - "Brynn (brynn@inkscapecommunity.com)", - "Nicu Buculei", - "Bulia Byak", - "Pierre Caclin", - "Ian Caldwell", - "Gail Carmichael", - "Ed Catmur", - "Chema Celorio", - "Jabiertxo Arraiza Cenoz", - "Johan Ceuppens", - "Zbigniew Chyla", - "Alexander Clausen", - "John Cliff", - "Kees Cook", - "Ben Cromwell", - "Robert Crosbie", - "Jon Cruz", - "Aurélie De-Cooman", - "Milosz Derezynski", - "Daniel Díaz", - "Bruno Dilly", - "Larry Doolittle", - "Nicolas Dufour", - "Tim Dwyer", - "Maxim V. Dziumanenko", - "Moritz Eberl", - "Johan Engelen", - "Miklos Erdelyi", - "Ulf Erikson", - "Noé Falzon", - "Sebastian Faubel", - "Frank Felfe", - "Andrew Fitzsimon", - "Edward Flick", - "Marcin Floryan", - "Ben Fowler", - "Fred", - "Cedric Gemy", - "Steren Giannini", - "Olivier Gondouin", - "Ted Gould", - "Toine de Greef", - "Michael Grosberg", - "Kris De Gussem", - "Bryce Harrington", - "Dale Harvey", - "Aurélio Adnauer Heckert", - "Carl Hetherington", - "Jos Hirth", - "Hannes Hochreiner", - "Thomas Holder", - "Joel Holdsworth", - "Christoffer Holmstedt", - "Alan Horkan", - "Karl Ove Hufthammer", - "Richard Hughes", - "Nathan Hurst", - "inductiveload", - "Thomas Ingham", - "Jean-Olivier Irisson", - "Bob Jamison", - "Ted Janeczko", - "Marc Jeanmougin", - "jEsuSdA", - "Fernando Lucchesi Bastos Jurema", - "Lauris Kaplinski", - "Lynn Kerby", - "Niko Kiirala", - "James Kilfiger", - "Nikita Kitaev", - "Jason Kivlighn", - "Adrian Knoth", - "Krzysztof Kosiński", - "Petr Kovar", - "Benoît Lavorata", - "Alex Leone", - "Julien Leray", - "Raph Levien", - "Diederik van Lierop", - "Nicklas Lindgren", - "Vitaly Lipatov", - "Ivan Louette", - "Pierre-Antoine Marc", - "Aurel-Aimé Marmion", - "Colin Marquardt", - "Craig Marshall", - "Ivan Masár", - "Dmitry G. Mastrukov", - "David Mathog", - "Matiphas", - "Michael Meeks", - "Federico Mena", - "MenTaLguY", - "Aubanel Monnier", - "Vincent Montagne", - "Tim Mooney", - "Derek P. Moore", - "Chris Morgan", - "Peter Moulder", - "Jörg Müller", - "Yukihiro Nakai", - "Victor Navez", - "Christian Neumair", - "Nick", - "Andreas Nilsson", - "Mitsuru Oka", - "Vinícius dos Santos Oliveira", - "Martin Owens", - "Alvin Penner", - "Matthew Petroff", - "Jon Phillips", - "Zdenko Podobny", - "Alexandre Prokoudine", - "Jean-René Reinhard", - "Alexey Remizov", - "Frederic Rodrigo", - "Hugo Rodrigues", - "Juarez Rudsatz", - "Xavier Conde Rueda", - "Felipe Corrêa da Silva Sanches", - "Christian Schaller", - "Marco Scholten", - "Tom von Schwerdtner", - "Danilo Šegan", - "Abhishek Sharma", - "Shivaken", - "Michael Sloan", - "John Smith", - "Sandra Snan", - "Boštjan Špetič", - "Aaron Spike", - "Kaushik Sridharan", - "Ralf Stephan", - "Dariusz Stojek", - "Martin Sucha", - "~suv", - "Pat Suwalski", - "Adib Taraben", - "Hugh Tebby", - "Jonas Termeau", - "David Turner", - "Andre Twupack", - "Aleksandar Urošević", - "Alex Valavanis", - "Joakim Verona", - "Lucas Vieites", - "Daniel Wagenaar", - "Liam P. White", - "Sebastian Wüst", - "Michael Wybrow", - "Gellule Xg", - "Daniel Yacob", - "Masatake Yamato", - "David Yip"}; + + // Create an empty vector to store the list of authors + std::vector authors; + + // Try to copy the list of authors from the "AUTHORS" file, which + // should have been installed into the share/doc directory + auto authors_filename = Glib::build_filename(INKSCAPE_DOCDIR, "AUTHORS"); + std::ifstream authors_filestream(authors_filename); + if(authors_filestream) { + std::string author_line; + + while (std::getline(authors_filestream, author_line)) { + authors.push_back(author_line); + } + } + + // Set the author credits in this dialog, using the author list set_authors(authors); //############################## @@ -368,175 +195,12 @@ void AboutBox::initStrings() { translators_text.append("\n\n\n"); } - /* This text is copied from the TRANSLATORS file. - * To update it, execute this snippet of sed magic in the toplevel - * source directory: - * - * sed -e 's/^\(.*\) \([^ ]*\)*$/\2_ \1/' TRANSLATORS - | sed -e 's/^\([^_]*\)_ \(.*\)$/\2 \1/;s/^.*$/"\0\\n"/;$s/\\n//' - | zenity --text-info - * - * and paste the result from the combo box here. - */ - gchar const *allTranslators = -"3ARRANO.com <3arrano@3arrano.com>, 2005.\n" -"Adib Taraben , 2004-2014.\n" -"Alan Monfort , 2009-2010.\n" -"Alastair McKinstry , 2000.\n" -"Aleksandar Marković , 2015.\n" -"Aleksandar Urošević , 2004-2009.\n" -"Alessio Frusciante , 2002, 2003.\n" -"Alexander Shopov , 2006.\n" -"Alexandre Prokoudine , 2005, 2010-2014.\n" -"Alexey Remizov , 2004.\n" -"Ali Ghanavatian , 2010.\n" -"Álvaro Lopes , 2001, 2002.\n" -"Andreas Hyden , 2000.\n" -"Andrius Ramanauskas , 2006.\n" -"Antonio Codazzi , 2006, 2007.\n" -"Antônio Cláudio (LedStyle) , 2006.\n" -"Amanpreet Singh Brar Alamwalia , 2005.\n" -"Arman Aksoy , 2003.\n" -"Arpad Biro , 2004, 2005.\n" -"Benedikt Roth , 2000.\n" -"Benjamin Weis , 2014.\n" -"Benno Schulenberg , 2008.\n" -"Boštjan Špetič , 2004, 2005.\n" -"Brisa Francesco , 2000.\n" -"Bruce Cowan , 2010.\n" -"bulia byak , 2004.\n" -"Chris jia , 2006.\n" -"Christian Meyer , 2000-2002.\n" -"Christian Neumair , 2002, 2003.\n" -"Christian Rose , 2000-2003.\n" -"Cristian Secară , 2010-2013.\n" -"Christophe Merlet (RedFox) , 2000-2002.\n" -"Clytie Siddall , 2004-2008.\n" -"Colin Marquardt , 2004-2006.\n" -"Cédric Gemy , 2006.\n" -"Daniel Díaz , 2004.\n" -"Didier Conchaudron , 2003.\n" -"Dimitris Spingos (Δημήτρης Σπίγγος) , 2011-2015.\n" -"Dorji Tashi , 2006.\n" -"Duarte Loreto 2002, 2003 (Maintainer).\n" -"Elias Norberg , 2009.\n" -"Equipe de Tradução Inkscape Brasil , 2007.\n" -"Fatih Demir , 2000.\n" -"Firas Hanife , 2014-2016.\n" -"Foppe Benedictus , 2007-2009.\n" -"Francesc Dorca , 2003. Traducció sodipodi.\n" -"Francisco Javier F. Serrador , 2003.\n" -"Francisco Xosé Vázquez Grandal , 2001.\n" -"Frederic Rodrigo , 2004-2005.\n" -"Ganesh Murmu , 2014.\n" -"Ge'ez Frontier Foundation , 2002.\n" -"George Boukeas , 2011.\n" -"Heiko Wöhrle , 2014.\n" -"Hleb Valoshka <375gnu@gmail.com>, 2008-2009.\n" -"Hizkuntza Politikarako Sailburuordetza , 2005.\n" -"Ilia Penev , 2006.\n" -"Ivan Masár , 2006-2014. \n" -"Ivan Řihošek , 2014.\n" -"Iñaki Larrañaga , 2006.\n" -"Jānis Eisaks , 2012-2014.\n" -"Jeffrey Steve Borbón Sanabria , 2005.\n" -"Jesper Öqvist , 2010, 2011.\n" -"Joaquim Perez i Noguer , 2008-2009.\n" -"Jörg Müller , 2005.\n" -"Jeroen van der Vegt , 2003, 2005, 2008.\n" -"Jin-Hwan Jeong , 2009.\n" -"Jonathan Ernst , 2006.\n" -"Jordi Mas i Hernàndez , 2015.\n" -"Jose Antonio Salgueiro Aquino , 2003.\n" -"Josef Vybiral , 2005-2006.\n" -"Juarez Rudsatz , 2004.\n" -"Junichi Uekawa , 2002.\n" -"Jurmey Rabgay , 2006.\n" -"Kai Lahmann , 2000.\n" -"Karl Ove Hufthammer , 2004, 2005.\n" -"KATSURAGAWA Naoki , 2006.\n" -"Keld Simonsen , 2000, 2001.\n" -"Kenji Inoue , 2006-2007.\n" -"Khandakar Mujahidul Islam , 2006.\n" -"Kingsley Turner , 2006.\n" -"Kitae , 2006.\n" -"Kjartan Maraas , 2000-2002.\n" -"Kris De Gussem , 2008-2015.\n" -"Lauris Kaplinski , 2000.\n" -"Leandro Regueiro , 2006-2008, 2010.\n" -"Liu Xiaoqin , 2008.\n" -"Louni Kandulna , 2014.\n" -"Luca Bruno , 2005.\n" -"Lucas Vieites Fariña, 2003-2013.\n" -"Mahesh subedi , 2006.\n" -"Marcin Floryan , 2016.\n" -"Maren Hachmann , 2015-2016.\n" -"Martin Srebotnjak, , 2005, 2010.\n" -"Masatake YAMATO , 2002.\n" -"Masato Hashimoto , 2009-2014.\n" -"Matiphas , 2004-2006.\n" -"Mattias Hultgren , 2005, 2006.\n" -"Maxim Dziumanenko , 2004.\n" -"Mətin Əmirov , 2003.\n" -"Mitsuru Oka , 2002.\n" -"Morphix User , 2006.\n" -"Mufit Eribol , 2000.\n" -"Muhammad Bashir Al-Noimi , 2008.\n" -"Myckel Habets , 2008.\n" -"Nasreen , 2013.\n" -"Nguyen Dinh Trung , 2007, 2008.\n" -"Nicolas Dufour , 2008-2016.\n" -"Paresh prabhu , 2013.\n" -"Pawan Chitrakar , 2006.\n" -"Przemysław Loesch , 2005.\n" -"Quico Llach , 2000. Traducció sodipodi.\n" -"Raymond Ostertag , 2002, 2003.\n" -"Riku Leino , 2006-2011.\n" -"Rune Rønde Laursen , 2006.\n" -"Ruud Steltenpool , 2006.\n" -"Sangeeta , 2011.\n" -"Savitha , 2013.\n" -"Serdar Soytetir , 2005.\n" -"shivaken , 2004.\n" -"Shyam Krishna Bal , 2006.\n" -"Simos Xenitellis , 2001, 2011.\n" -"Spyros Blanas , 2006, 2011.\n" -"Stefan Graubner , 2005.\n" -"Supranee Thirawatthanasuk , 2006.\n" -"Sushma Joshi , 2011.\n" -"Sveinn í Felli , 2014-2015.\n" -"Sylvain Chiron , 2016.\n" -"Takeshi Aihana , 2000, 2001.\n" -"Tim Sheridan , 2007-2016.\n" -"Theppitak Karoonboonyanan , 2006.\n" -"Thiago Pimentel , 2006.\n" -"Toshifumi Sato , 2005.\n" -"Jon South , 2006. \n" -"Uwe Schöler , 2006-2014.\n" -"Valek Filippov , 2000, 2003.\n" -"Victor Dachev , 2006.\n" -"Victor Westmann , 2011, 2014.\n" -"Ville Pätsi, 2013.\n" -"Vincent van Adrighem , 2003.\n" -"Vital Khilko , 2003.\n" -"Vitaly Lipatov , 2002, 2004.\n" -"vonHalenbach , 2005.\n" -"vrundeshw , 2012.\n" -"Waluyo Adi Siswanto , 2011.\n" -"Wang Li , 2002.\n" -"Wei-Lun Chao , 2006.\n" -"Wolfram Strempfer , 2006.\n" -"Xavier Conde Rueda , 2004-2008.\n" -"Yaron Shahrabani , 2009.\n" -"Yukihiro Nakai , 2000, 2003.\n" -"Yuri Beznos , 2006.\n" -"Yuri Chornoivan , 2007-2014.\n" -"Yuri Syrota , 2000.\n" -"Yves Guillou , 2004.\n" -"Zdenko Podobný , 2003, 2004." - ; - - translators_text.append(allTranslators); + auto translators_filename = Glib::build_filename(INKSCAPE_DOCDIR, "TRANSLATORS"); + + if (Glib::file_test (translators_filename, Glib::FILE_TEST_EXISTS)) { + auto all_translators = Glib::file_get_contents(translators_filename); + translators_text.append(all_translators); + } set_translator_credits(translators_text); set_license("GPL 3.0 or later"); // Overriden in next line -- cgit v1.2.3