convert property_foo().set_value(bar) to property_foo() = bar
[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 "about.h"
36 #include "rgb_macros.h"
37 #include "ardour_ui.h"
38
39 #include "i18n.h"
40
41 using namespace Gtk;
42 using namespace Gdk;
43 using namespace std;
44 using namespace sigc;
45 using namespace ARDOUR;
46
47 #ifdef WITH_PAYMENT_OPTIONS
48
49 /* XPM */
50 static const gchar * paypal_xpm[] = {
51 "62 31 33 1",
52 "       c None",
53 ".      c #325781",
54 "+      c #154170",
55 "@      c #C1CDDA",
56 "#      c #4E6E92",
57 "$      c #D1D5DA",
58 "%      c #88A0B8",
59 "&      c #B4C4D3",
60 "*      c #C8D3DE",
61 "=      c #D7E1E9",
62 "-      c #002158",
63 ";      c #F6F8FA",
64 ">      c #44658B",
65 ",      c #E7ECF0",
66 "'      c #A4B7CA",
67 ")      c #9DB0C4",
68 "!      c #E3F1F7",
69 "~      c #708CA9",
70 "{      c #E1E7ED",
71 "]      c #567698",
72 "^      c #7C96B1",
73 "/      c #E7F5FA",
74 "(      c #EEF1F4",
75 "_      c #6883A2",
76 ":      c #244873",
77 "<      c #BBBBBB",
78 "[      c #E9E9E9",
79 "}      c #063466",
80 "|      c #22364D",
81 "1      c #94A7BD",
82 "2      c #000000",
83 "3      c #EAF7FC",
84 "4      c #FFFFFF",
85 "1'111111111111111111111111111111111111111111111111111111111%_#",
86 "%333333333333333333333333333333333333333333333333333333333333.",
87 "%444444444444444444444444444444444444444444444444444444444444:",
88 "_4333333!!!!!!33333333333333333333!!!!!!33333333333!%%%%1334[:",
89 "_444444@+}}}}+>)44444444444444444,:}}}}}.^(44444444@}..+.44($:",
90 "_433333^:&&&&)_}_33///33333333333&+)&&&'~+./3///333^.(;#]33($:",
91 "_444444>_444444'}_>...#%####~,]##..444444=+#]...>1;#_4;.144($:",
92 "_43333!+'4,>#=4(:+_%%%]}}#~#}_+~~:]44_>&44#}_%%%_+>:14=}@33($:",
93 "_44444*+$4&--)4(+%44444%-)4=--'4{+14,}-~44##44444&}}*4)+444($:",
94 "_433331:;4):_;4*}_]:.$4*-~4{}>44#-=4@.#{4;+>_:.&4,++;4_#333($:",
95 "_44444_#444444=.-.%&*,41-#4(:@4'-:(44444(_-:^&*,4*}#44.%444($:",
96 "_43333:%4;@@'~+-%44*&44]-.;;'4,:-#44*@&%:-];4{'(4)-%4{+&333($:",
97 "_4444{}@4*}}+>#:;4^-#4;.>+,444_+:^4(:}+.]}=4'-+(4_-&4&+{444($:",
98 "_4333'+(41:*=3'.44*)(4=+)+*44@}%+@4=}&=/@}{4{1{44:+,4^.3333($:",
99 "_4444~>,,]#444*})(;**,':*}'4;._@}=,%:444(+~(;{&,*}.,,>~4444($:",
100 "_4333>}}}}^3333~}::}}}}>].;4^+=~}}}}]3333'}+:}}}}}}}}}'3333($:",
101 "_4444$@@@@(44444$))@*@*^}$4=}14=@@@@{44444=))&*@@@@@@@;4444($:",
102 "_433333333333333333333=+:%%.>/33333333333333333333333333333($:",
103 "_4444444444444444444441....>=444444444444444444444444444444($:",
104 "_4333333333333333333333333333333333333333333333333333333333($:",
105 "_4444444444444444444444444444444444444444444444444444444444($:",
106 "_4333333333333333333333333333333333333333333333333333333333($:",
107 "_4444442222444222442444242444244222242444242222244222244444($:",
108 "_4333332333232333233232332232233233332233233323332333333333($:",
109 "_4444442222442222244424442424244222442424244424444222444444($:",
110 "_4333332333332333233323332333233233332332233323333333233333($:",
111 "_4444442444442444244424442444244222242444244424442222444444($:",
112 "_433333333333333333333333333333333333333333333333333333333344:",
113 "#4([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[=&:",
114 ".=&<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<1|",
115 "::||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||"};
116 #endif
117
118 static const char* authors[] = {
119         N_("Paul Davis"),
120         N_("Jesse Chappell"),
121         N_("Taybin Rutkin"),
122         N_("Marcus Andersson"),
123         N_("Jeremy Hall"),
124         N_("Steve Harris"),
125         N_("Tim Mayberry"),
126         N_("Mark Stewart"),
127         N_("Sam Chessman"),
128         N_("Jack O'Quin"),
129         N_("Matt Krai"),
130         N_("Ben Bell"),
131         N_("Gerard van Dongen"),
132         N_("Thomas Charbonnel"),
133         N_("Nick Mainsbridge"),
134         N_("Colin Law"),
135         N_("Sampo Savolainen"),
136         N_("Joshua Leach"),
137         N_("Rob Holland"),
138         N_("Per Sigmond"),
139         N_("Doug Mclain"),
140         N_("Petter Sundlöf"),
141         0
142 };
143
144 static const char* translators[] = {
145         N_("French:\n\tAlain Fréhel <alain.frehel@free.fr>"),
146         N_("German:\n\tKarsten Petersen <kapet@kapet.de>"),
147         N_("Italian:\n\tFilippo Pappalardo <filippo@email.it>"),
148         N_("Portuguese:\n\tRui Nuno Capela <rncbc@rncbc.org>"),
149         N_("Brazilian Portuguese:\n\tAlexander da Franca Fernandes <alexander@nautae.eti.br>\
150 \n\tChris Ross <chris@tebibyte.org>"),
151         N_("Spanish:\n\t Alex Krohn <alexkrohn@fastmail.fm>"),
152         N_("Russian:\n\t Igor Blinov <pitstop@nm.ru>"),
153         0
154 };
155
156
157 About::About ()
158 #ifdef WITH_PAYMENT_OPTIONS
159         : paypal_pixmap (paypal_xpm)
160 #endif
161 {
162         string path;
163         string t;
164
165         path = find_data_file ("splash.ppm");
166
167         Glib::RefPtr<Pixbuf> pixbuf = Gdk::Pixbuf::create_from_file (path);
168
169         set_logo (Gdk::Pixbuf::create_from_file (path));
170         set_authors (authors);
171
172         for (int n = 0; translators[n]; ++n) {
173                 t += translators[n];
174                 t += ' ';
175         }
176
177         set_translator_credits (t);
178         set_copyright (_("Copyright (C) 1999-2005 Paul Davis\n"));
179         set_license (_("Ardour comes with ABSOLUTELY NO WARRANTY\n"
180                        "This is free software, and you are welcome to redistribute it\n"
181                        "under certain conditions; see the file COPYING for details.\n"));
182         set_name (X_("ardour"));
183         set_website (X_("http://ardour.org/"));
184         set_website_label (X_("ardour.org"));
185         set_version ((string_compose(_("%1\n(built with ardour/gtk %2.%3.%4 libardour: %5.%6.%7)"), 
186                               VERSIONSTRING, 
187                               gtk_ardour_major_version, 
188                               gtk_ardour_minor_version, 
189                               gtk_ardour_micro_version, 
190                               libardour_major_version, 
191                               libardour_minor_version, 
192                               libardour_micro_version))); 
193
194
195 #ifdef WITH_PAYMENT_OPTIONS
196         paypal_button.add (paypal_pixmap);
197         
198         HBox *payment_box = manage (new HBox);
199         payment_box->pack_start (paypal_button, true, false);
200
201         subvbox.pack_start (*payment_box, false, false);
202 #endif
203
204 }
205
206 About::~About ()
207 {
208 }
209
210 #ifdef WITH_PAYMENT_OPTIONS
211 void
212 About::goto_paypal ()
213 {
214         char buf[PATH_MAX+16];
215         char *argv[4];
216         char *docfile = "foo";
217         int grandchild;
218         
219         if (fork() == 0) {
220
221                 /* child */
222
223                 if ((grandchild = fork()) == 0) {
224                         
225                         /* grandchild */
226                         
227                         argv[0] = "mozilla";
228                         argv[1] = "-remote";
229                         snprintf (buf, sizeof(buf), "openurl(%s)", docfile);
230                         argv[2] = buf;
231                         argv[3] = 0;
232
233                         execvp ("mozilla", argv);
234                         error << "could not start mozilla" << endmsg;
235
236                 } else {
237                         int status;
238                         waitpid (grandchild, &status, 0);
239                 }
240
241         } 
242 }
243 #endif