AU: install latency listener
[ardour.git] / gtk2_ardour / about.cc
index e3734ec6ce50dde6eaa52946c2cb497cd8be01ff..72bccfd2d43008ff53b7c9a37b5fdda4fe7051f3 100644 (file)
 #include <algorithm>
 #include <unistd.h>
 #include <sys/types.h>
-#include <sys/wait.h>
 #include <cstdio>
 #include <ctime>
 #include <cstdlib>
 
+#include "pbd/error.h"
 #include "pbd/file_utils.h"
+#include "pbd/openuri.h"
 
-#include "ardour/svn_revision.h"
-#include "ardour/ardour.h"
-#include "ardour/version.h"
+#include "ardour/profile.h"
+#include "ardour/revision.h"
 #include "ardour/filesystem_paths.h"
 
-#include "utils.h"
-#include "version.h"
-
 #include "about.h"
 #include "configinfo.h"
 #include "rgb_macros.h"
-#include "ardour_ui.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
+
+#ifdef WAF_BUILD
+#include "gtk2ardour-version.h"
+#endif
 
 using namespace Gtk;
 using namespace Gdk;
@@ -48,6 +48,10 @@ using namespace std;
 using namespace ARDOUR;
 using namespace PBD;
 
+#ifndef CODENAME
+#define CODENAME ""
+#endif
+
 #ifdef WITH_PAYMENT_OPTIONS
 
 /* XPM */
@@ -120,6 +124,7 @@ static const gchar * paypal_xpm[] = {
 #endif
 
 static const char* authors[] = {
+       N_("Fons Adriaensen"),
        N_("Brian Ahr"),
        N_("John Anderson"),
        N_("Marcus Andersson"),
@@ -127,66 +132,99 @@ static const char* authors[] = {
        N_("Hans Baier"),
        N_("Ben Bell"),
        N_("Sakari Bergen"),
+       N_("Christian Borss"),
        N_("Chris Cannam"),
+       N_("Jeremy Carter"),
        N_("Jesse Chappell"),
        N_("Thomas Charbonnel"),
        N_("Sam Chessman"),
+       N_("André Colomb"),
        N_("Paul Davis"),
        N_("Gerard van Dongen"),
+       N_("John Emmas"),
        N_("Colin Fletcher"),
+       N_("Dave Flick"),
        N_("Hans Fugal"),
+       N_("Robin Gareus"),
+       N_("Nil Geisweiller"),
        N_("Christopher George"),
+       N_("Chris Goddard"),
        N_("J. Abelardo Gutierrez"),
        N_("Jeremy Hall"),
        N_("Audun Halland"),
+       N_("David Halter"),
        N_("Steve Harris"),
+       N_("Melvin Ray Herr"),
        N_("Carl Hetherington"),
        N_("Rob Holland"),
        N_("Robert Jordens"),
        N_("Stefan Kersten"),
        N_("Armand Klenk"),
+       N_("Julien de Kozak"),
        N_("Matt Krai"),
+       N_("Georg Krause"),
+       N_("Nick Lanham"),
        N_("Colin Law"),
        N_("Joshua Leach"),
        N_("Ben Loftis"),
        N_("Nick Mainsbridge"),
        N_("Tim Mayberry"),
        N_("Doug Mclain"),
+       N_("Todd Naugle"),
+       N_("André Nusser"),
+       N_("Bent Bisballe Nyeng"),
        N_("Jack O'Quin"),
+       N_("Pavel Potocek"),
        N_("Nimal Ratnayake"),
-       N_("Dave Robillard"),
+       N_("Julien Rivaud"),
+       N_("David Robillard"),
+       N_("Julien Roger"),
        N_("Taybin Rutkin"),
+       N_("Andreas Ruge"),
        N_("Sampo Savolainen"),
+       N_("Rodrigo Severo"),
        N_("Per Sigmond"),
        N_("Lincoln Spiteri"),
+       N_("Mike Start"),
        N_("Mark Stewart"),
        N_("Roland Stigge"),
        N_("Petter Sundlöf"),
        N_("Mike Täht"),
+       N_("Roy Vegard"),
        N_("Thorsten Wilms"),
+       N_("Damien Zammit"),
+       N_("Grygorii Zharun"),
        0
 };
 
 static const char* translators[] = {
-       N_("French:\n\tAlain Fréhel <alain.frehel@free.fr>\n\tChristophe Combelles <ccomb@free.fr>\n"),
+       N_("French:\n\tAlain Fréhel <alain.frehel@free.fr>\n\tChristophe Combelles <ccomb@free.fr>\n\tMartin Blanchard\n\tRomain Arnaud <roming22@gmail.com>\n"),
        N_("German:\n\tKarsten Petersen <kapet@kapet.de>\
 \n\tSebastian Arnold <mail@sebastian-arnold.net>\
-\n\tRobert Schwede<schwede@ironshark.com>\n"),
-       N_("Italian:\n\tFilippo Pappalardo <filippo@email.it>\n"),
+\n\tRobert Schwede <schwede@ironshark.com>\
+\n\tBenjamin Scherrer <realhangman@web.de>\
+\n\tEdgar Aichinger <edogawa@aon.at>\
+\n\tRichard Oax <richard@pagliacciempire.de>\
+\n\tRobin Gloster <robin@loc-com.de>\n"),
+       N_("Italian:\n\tFilippo Pappalardo <filippo@email.it>\n\tRaffaele Morelli <raffaele.morelli@gmail.com>\n"),
        N_("Portuguese:\n\tRui Nuno Capela <rncbc@rncbc.org>\n"),
        N_("Brazilian Portuguese:\n\tAlexander da Franca Fernandes <alexander@nautae.eti.br>\
 \n\tChris Ross <chris@tebibyte.org>\n"),
-       N_("Spanish:\n\t Alex Krohn <alexkrohn@fastmail.fm>\n"),
-       N_("Russian:\n\t Igor Blinov <pitstop@nm.ru>\n"),
+       N_("Spanish:\n\t Alex Krohn <alexkrohn@fastmail.fm>\n\tPablo Fernández <pablo.fbus@gmail.com>\n"),
+       N_("Russian:\n\t Igor Blinov <pitstop@nm.ru>\
+\n\tAlexandre Prokoudine <alexandre.prokoudine@gmail.com>\n"),
        N_("Greek:\n\t Klearchos Gourgourinis <muadib@in.gr>\n"),
        N_("Swedish:\n\t Petter Sundlöf <petter.sundlof@gmail.com>\n"),
        N_("Polish:\n\t Piotr Zaryk <pzaryk@gmail.com>\n"),
+       N_("Czech:\n\t Pavel Fric <pavelfric@seznam.cz>\n"),
+       N_("Norwegian:\n\t Eivind Ødegård\n"),
+       N_("Chinese:\n\t Rui-huai Zhang <zrhzrh@mail.ustc.edu.cn>\n"),
        0
 };
 
 static const char* gpl = X_("\n\
 Ardour comes with NO WARRANTY. It is free software, and you are welcome to redistribute it\n\
-under the terms of the GNU Public License, shown below.\n\
+under the terms of the GNU General Public License, shown below.\n\
 \n\
                    GNU GENERAL PUBLIC LICENSE\n\
                       Version 2, June 1991\n\
@@ -246,7 +284,7 @@ patent must be licensed for everyone's free use or not licensed at all.\n\
   The precise terms and conditions for copying, distribution and\n\
 modification follow.\n\
 \f\n\
-                   GNU GENERAL PUBLIC LICENSE\n\
+""                 GNU GENERAL PUBLIC LICENSE\n\
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\
 \n\
   0. This License applies to any program or other work which contains\n\
@@ -528,7 +566,9 @@ proprietary programs.  If your program is a subroutine library, you may\n\
 consider it more useful to permit linking proprietary applications with the\n\
 library.  If this is what you want to do, use the GNU Library General\n\
 Public License instead of this License.\n\
-");
+"); /* Note that at the start of (approximately) line 265, the above license
+       text has been split into two concatenated tokens (to satisfy compilation
+       under MSVC). Hopefully this won't affect gcc */
 
 About::About ()
        : config_info (0)
@@ -538,15 +578,14 @@ About::About ()
 {
        // set_type_hint(Gdk::WINDOW_TYPE_HINT_SPLASHSCREEN);
 
-       string path;
        string t;
 
-       sys::path splash_file;
+       std::string splash_file;
 
-       SearchPath spath(ardour_search_path() + system_data_search_path());
+       Searchpath spath(ardour_data_search_path());
 
-       if (find_file_in_search_path (spath, "splash.png", splash_file)) {
-               set_logo (Gdk::Pixbuf::create_from_file (splash_file.to_string()));
+       if (find_file (spath, "splash.png", splash_file)) {
+               set_logo (Gdk::Pixbuf::create_from_file (splash_file));
        } else {
                error << "Could not find splash file" << endmsg;
        }
@@ -558,21 +597,52 @@ About::About ()
                t += ' ';
        }
 
+#if defined __x86_64__ || defined _M_X64
+       const std::string cpu_arch = _("Intel 64-bit");
+#elif defined __i386__  || defined _M_IX86
+       const std::string cpu_arch = _("Intel 32-bit");
+#elif defined __ppc__ && defined  __LP64__
+       const std::string cpu_arch = _("PowerPC 64-bit");
+#elif defined __ppc__
+       const std::string cpu_arch = _("PowerPC 32-bit");
+#elif defined  __LP64__
+       const std::string cpu_arch = _("64-bit");
+#else
+       const std::string cpu_arch = _("32-bit"); // ARM, ALPHA,..
+#endif
+       std::string codename = CODENAME;
+       if (ARDOUR::Profile->get_mixbus() || ARDOUR::Profile->get_trx()) {
+               codename = "";
+       }
+
+#ifndef NDEBUG
+       const std::string suffix = _(" - debug");
+#else
+       const std::string suffix = "";
+#endif
+
        set_translator_credits (t);
-       set_copyright (_("Copyright (C) 1999-2009 Paul Davis\n"));
+       set_copyright (_("Copyright (C) 1999-2015 Paul Davis\n"));
        set_license (gpl);
-       set_name (X_("ardour"));
+       set_name (X_("Ardour"));
        set_website (X_("http://ardour.org/"));
-       set_website_label (_("visit http://ardour.org/"));
-       set_version ((string_compose(_("%1\n(built from revision %2)"),
+       set_website_label (_("http://ardour.org/"));
+       set_version ((string_compose(_("%1%2\n(rev %3)\n%4%5"),
                                     VERSIONSTRING,
-                                    svn_revision)));
+                                    codename,
+                                    revision, cpu_arch, suffix)));
 
        Gtk::Button* config_button = manage (new Button (_("Config")));
 
        get_action_area()->add (*config_button);
        get_action_area()->reorder_child (*config_button, 0);
        config_button->signal_clicked().connect (mem_fun (*this, &About::show_config_info));
+
+       Gtk::Button *btn = static_cast<Gtk::Button*>(get_widget_for_response(Gtk::RESPONSE_CANCEL));
+       if (btn) {
+               btn->signal_clicked().connect(sigc::mem_fun(static_cast<Gtk::Window*>(this), &Gtk::Window::hide));
+       }
+       set_url_hook (sigc::ptr_fun(&About::launch_homepage));
 }
 
 About::~About ()
@@ -587,6 +657,12 @@ About::show_config_info ()
                config_info = new ConfigInfoDialog;
        }
 
-       config_info->present ();
+       config_info->run ();
+       config_info->hide ();
 }
 
+void
+About::launch_homepage (AboutDialog& /* about */, const Glib::ustring& website_url)
+{
+       PBD::open_uri (website_url);
+}