display timecode from BWF etc in SF browser; accels for windows now work (misspelling...
[ardour.git] / gtk2_ardour / about.cc
1 /*
2     Copyright (C) 2003 Paul Davis 
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18     $Id$
19 */
20
21 #include <algorithm>
22 #include <unistd.h>
23 #include <sys/types.h>
24 #include <sys/wait.h>
25 #include <cstdio>
26 #include <ctime>
27 #include <cstdlib>
28
29 #include <ardour/ardour.h>
30 #include <ardour/version.h>
31
32 #include "utils.h"
33 #include "version.h"
34
35 #include "svn_revision.h"
36 #include "about.h"
37 #include "rgb_macros.h"
38 #include "ardour_ui.h"
39
40 #include "i18n.h"
41
42 using namespace Gtk;
43 using namespace Gdk;
44 using namespace std;
45 using namespace sigc;
46 using namespace ARDOUR;
47 using namespace PBD;
48
49 #ifdef WITH_PAYMENT_OPTIONS
50
51 /* XPM */
52 static const gchar * paypal_xpm[] = {
53 "62 31 33 1",
54 "       c None",
55 ".      c #325781",
56 "+      c #154170",
57 "@      c #C1CDDA",
58 "#      c #4E6E92",
59 "$      c #D1D5DA",
60 "%      c #88A0B8",
61 "&      c #B4C4D3",
62 "*      c #C8D3DE",
63 "=      c #D7E1E9",
64 "-      c #002158",
65 ";      c #F6F8FA",
66 ">      c #44658B",
67 ",      c #E7ECF0",
68 "'      c #A4B7CA",
69 ")      c #9DB0C4",
70 "!      c #E3F1F7",
71 "~      c #708CA9",
72 "{      c #E1E7ED",
73 "]      c #567698",
74 "^      c #7C96B1",
75 "/      c #E7F5FA",
76 "(      c #EEF1F4",
77 "_      c #6883A2",
78 ":      c #244873",
79 "<      c #BBBBBB",
80 "[      c #E9E9E9",
81 "}      c #063466",
82 "|      c #22364D",
83 "1      c #94A7BD",
84 "2      c #000000",
85 "3      c #EAF7FC",
86 "4      c #FFFFFF",
87 "1'111111111111111111111111111111111111111111111111111111111%_#",
88 "%333333333333333333333333333333333333333333333333333333333333.",
89 "%444444444444444444444444444444444444444444444444444444444444:",
90 "_4333333!!!!!!33333333333333333333!!!!!!33333333333!%%%%1334[:",
91 "_444444@+}}}}+>)44444444444444444,:}}}}}.^(44444444@}..+.44($:",
92 "_433333^:&&&&)_}_33///33333333333&+)&&&'~+./3///333^.(;#]33($:",
93 "_444444>_444444'}_>...#%####~,]##..444444=+#]...>1;#_4;.144($:",
94 "_43333!+'4,>#=4(:+_%%%]}}#~#}_+~~:]44_>&44#}_%%%_+>:14=}@33($:",
95 "_44444*+$4&--)4(+%44444%-)4=--'4{+14,}-~44##44444&}}*4)+444($:",
96 "_433331:;4):_;4*}_]:.$4*-~4{}>44#-=4@.#{4;+>_:.&4,++;4_#333($:",
97 "_44444_#444444=.-.%&*,41-#4(:@4'-:(44444(_-:^&*,4*}#44.%444($:",
98 "_43333:%4;@@'~+-%44*&44]-.;;'4,:-#44*@&%:-];4{'(4)-%4{+&333($:",
99 "_4444{}@4*}}+>#:;4^-#4;.>+,444_+:^4(:}+.]}=4'-+(4_-&4&+{444($:",
100 "_4333'+(41:*=3'.44*)(4=+)+*44@}%+@4=}&=/@}{4{1{44:+,4^.3333($:",
101 "_4444~>,,]#444*})(;**,':*}'4;._@}=,%:444(+~(;{&,*}.,,>~4444($:",
102 "_4333>}}}}^3333~}::}}}}>].;4^+=~}}}}]3333'}+:}}}}}}}}}'3333($:",
103 "_4444$@@@@(44444$))@*@*^}$4=}14=@@@@{44444=))&*@@@@@@@;4444($:",
104 "_433333333333333333333=+:%%.>/33333333333333333333333333333($:",
105 "_4444444444444444444441....>=444444444444444444444444444444($:",
106 "_4333333333333333333333333333333333333333333333333333333333($:",
107 "_4444444444444444444444444444444444444444444444444444444444($:",
108 "_4333333333333333333333333333333333333333333333333333333333($:",
109 "_4444442222444222442444242444244222242444242222244222244444($:",
110 "_4333332333232333233232332232233233332233233323332333333333($:",
111 "_4444442222442222244424442424244222442424244424444222444444($:",
112 "_4333332333332333233323332333233233332332233323333333233333($:",
113 "_4444442444442444244424442444244222242444244424442222444444($:",
114 "_433333333333333333333333333333333333333333333333333333333344:",
115 "#4([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[=&:",
116 ".=&<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<1|",
117 "::||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||"};
118 #endif
119
120 static const char* authors[] = {
121         N_("Paul Davis"),
122         N_("Jesse Chappell"),
123         N_("Taybin Rutkin"),
124         N_("Marcus Andersson"),
125         N_("Jeremy Hall"),
126         N_("Steve Harris"),
127         N_("Tim Mayberry"),
128         N_("Mark Stewart"),
129         N_("Sam Chessman"),
130         N_("Jack O'Quin"),
131         N_("Matt Krai"),
132         N_("Ben Bell"),
133         N_("Gerard van Dongen"),
134         N_("Thomas Charbonnel"),
135         N_("Nick Mainsbridge"),
136         N_("Colin Law"),
137         N_("Sampo Savolainen"),
138         N_("Joshua Leach"),
139         N_("Rob Holland"),
140         N_("Per Sigmond"),
141         N_("Doug Mclain"),
142         N_("Petter Sundlöf"),
143         N_("Thorsten Wilms"),
144         N_("Ben Loftis"),
145         N_("Stefan Kersten"),
146         N_("Christopher George"),
147         N_("Robert Jordens"),
148         0
149 };
150
151 static const char* translators[] = {
152         N_("French:\n\tAlain Fréhel <alain.frehel@free.fr>\n\tChristophe Combelles <ccomb@free.fr>\n"),
153         N_("German:\n\tKarsten Petersen <kapet@kapet.de>\n"),
154         N_("Italian:\n\tFilippo Pappalardo <filippo@email.it>\n"),
155         N_("Portuguese:\n\tRui Nuno Capela <rncbc@rncbc.org>\n"),
156         N_("Brazilian Portuguese:\n\tAlexander da Franca Fernandes <alexander@nautae.eti.br>\
157 \n\tChris Ross <chris@tebibyte.org>\n"),
158         N_("Spanish:\n\t Alex Krohn <alexkrohn@fastmail.fm>\n"),
159         N_("Russian:\n\t Igor Blinov <pitstop@nm.ru>\n"),
160         0
161 };
162
163
164 About::About ()
165 #ifdef WITH_PAYMENT_OPTIONS
166         : paypal_pixmap (paypal_xpm)
167 #endif
168 {
169         set_type_hint(Gdk::WINDOW_TYPE_HINT_SPLASHSCREEN);
170
171         string path;
172         string t;
173
174         path = find_data_file ("splash.png");
175
176         Glib::RefPtr<Pixbuf> pixbuf = Gdk::Pixbuf::create_from_file (path);
177
178         set_logo (Gdk::Pixbuf::create_from_file (path));
179         set_authors (authors);
180
181         for (int n = 0; translators[n]; ++n) {
182                 t += translators[n];
183                 t += ' ';
184         }
185
186         set_translator_credits (t);
187         set_copyright (_("Copyright (C) 1999-2006 Paul Davis\n"));
188         set_license (_("Ardour comes with ABSOLUTELY NO WARRANTY\n"
189                        "This is free software, and you are welcome to redistribute it\n"
190                        "under certain conditions; see the file COPYING for details.\n"));
191         set_name (X_("ardour"));
192         set_website (X_("http://ardour.org/"));
193         set_website_label (_("visit http://www.ardour.org/"));
194         set_version ((string_compose(_("%1\n(built from revision %2)"),
195                                      VERSIONSTRING, 
196                                      ardour_svn_revision)));
197         
198
199 #ifdef WITH_PAYMENT_OPTIONS
200         paypal_button.add (paypal_pixmap);
201         
202         HBox *payment_box = manage (new HBox);
203         payment_box->pack_start (paypal_button, true, false);
204
205         subvbox.pack_start (*payment_box, false, false);
206 #endif
207
208 }
209
210 About::~About ()
211 {
212 }
213
214 #ifdef WITH_PAYMENT_OPTIONS
215 void
216 About::goto_paypal ()
217 {
218         char buf[PATH_MAX+16];
219         char *argv[4];
220         char *docfile = "foo";
221         int grandchild;
222         
223         if (fork() == 0) {
224
225                 /* child */
226
227                 if ((grandchild = fork()) == 0) {
228                         
229                         /* grandchild */
230                         
231                         argv[0] = "mozilla";
232                         argv[1] = "-remote";
233                         snprintf (buf, sizeof(buf), "openurl(%s)", docfile);
234                         argv[2] = buf;
235                         argv[3] = 0;
236
237                         execvp ("mozilla", argv);
238                         error << "could not start mozilla" << endmsg;
239
240                 } else {
241                         int status;
242                         waitpid (grandchild, &status, 0);
243                 }
244
245         } 
246 }
247 #endif