source: synfigstudio/trunk/fuentes/src/gui/dialogs/about.cpp @ 481

Last change on this file since 481 was 481, checked in by jrpelegrina, 4 years ago

First release to xenial

File size: 8.0 KB
Line 
1/* === S Y N F I G ========================================================= */
2/*!     \file about.cpp
3**      \brief About dialog implementation
4**
5**      $Id$
6**
7**      \legal
8**      Copyright (c) 2008 Paul Wise
9**
10**      This package is free software; you can redistribute it and/or
11**      modify it under the terms of the GNU General Public License as
12**      published by the Free Software Foundation; either version 2 of
13**      the License, or (at your option) any later version.
14**
15**      This package is distributed in the hope that it will be useful,
16**      but WITHOUT ANY WARRANTY; without even the implied warranty of
17**      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18**      General Public License for more details.
19**      \endlegal
20*/
21/* ========================================================================= */
22
23/* === H E A D E R S ======================================================= */
24
25#ifdef USING_PCH
26#       include "pch.h"
27#else
28#ifdef HAVE_CONFIG_H
29#       include <config.h>
30#endif
31
32#include <vector>
33
34#include <gtk/gtk.h>
35
36#include <gtkmm/aboutdialog.h>
37
38#include <ETL/stringf>
39
40#include <synfig/general.h>
41
42// This is generated at make time from .svn or .git/svn or autorevision.conf
43#include <autorevision.h>
44
45#include "about.h"
46#include "app.h"
47
48#include "general.h"
49
50#endif
51
52/* === U S I N G =========================================================== */
53
54using namespace std;
55using namespace etl;
56using namespace studio;
57
58/* === M A C R O S ========================================================= */
59
60#ifndef VERSION
61#define VERSION "unknown"
62#define PACKAGE "synfigstudio"
63#endif
64
65#ifdef WIN32
66#       ifdef IMAGE_DIR
67#               undef IMAGE_DIR
68#               define IMAGE_DIR "share\\pixmaps"
69#       endif
70#endif
71
72#ifndef IMAGE_DIR
73#       define IMAGE_DIR "/usr/local/share/pixmaps"
74#endif
75
76#ifndef IMAGE_EXT
77#       define IMAGE_EXT        "png"
78#endif
79
80#define stringify_(x) #x
81#define stringify(x) stringify_(x)
82
83/* === G L O B A L S ======================================================= */
84
85/* === P R O C E D U R E S ================================================= */
86
87/* === M E T H O D S ======================================================= */
88
89About::About()
90{
91        set_transient_for((Gtk::Window&)(*App::main_window));
92#ifdef HAVE_GTK_ABOUTDIALOG_SET_PROGRAM_NAME
93        set_program_name(PACKAGE_NAME);
94#else
95        set_name(PACKAGE_NAME);
96#endif
97        set_version(VERSION);
98        set_comments(_("2D vector animation studio"));
99
100        // TODO: set_url_hook bot works in GTK3
101        //set_url_hook(sigc::mem_fun(*this, &About::on_link_clicked));
102        set_website("http://synfig.org/");
103        set_website_label(_("Visit the Synfig website"));
104
105        set_copyright(_("Copyright 2001-2013\nRobert B. Quattlebaum Jr.,\nAdrian Bentley and Synfig contributors"));
106        Glib::ustring license =
107                "This program is free software; you can redistribute it and/or modify "
108                "it under the terms of the GNU General Public License as published by "
109                "the Free Software Foundation; either version 2 of the License, or "
110                "(at your option) any later version.\n\n"
111
112                "This program is distributed in the hope that it will be useful, "
113                "but WITHOUT ANY WARRANTY; without even the implied warranty of "
114                "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the "
115                "GNU General Public License for more details.\n\n"
116
117                "You should have received a copy of the GNU General Public License along "
118                "with this program; if not, write to the Free Software Foundation, Inc., "
119                "51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or visit: http://www.gnu.org/";
120        set_license(license);
121#ifdef HAVE_GTK_ABOUTDIALOG_SET_WRAP_LICENSE
122        set_wrap_license(true);
123#endif
124
125        std::vector<Glib::ustring> authors;
126        authors.push_back(_("Original developers:"));
127        authors.push_back("");
128        authors.push_back("Robert B. Quattlebaum Jr (darco)");
129        authors.push_back("Adrian Bentley");
130        authors.push_back("");
131        authors.push_back(_("Contributors:"));
132        authors.push_back("");
133        authors.push_back("Adrian Winchell (SnapSilverlight)");
134        authors.push_back("Andreas Jochens");
135        authors.push_back("Brendon Higgins");
136        authors.push_back("Carlos López González (genete)");
137        authors.push_back("Carlos A. Sosa Navarro");
138        authors.push_back("Chris Moore (dooglus)");
139        authors.push_back("Chris Norman (pixelgeek)");
140        authors.push_back("Cyril Brulebois (KiBi)");
141        authors.push_back("Daniel Fort");
142        authors.push_back("Daniel Hornung (rubikcube)");
143        authors.push_back("David Roden (Bombe)");
144        authors.push_back("Denis Zdorovtsov (trizer)");
145        authors.push_back("Dmitriy Pomerantsev (Atrus)");
146        authors.push_back("Douglas Lau");
147        authors.push_back("Evgenij Katunov");
148        authors.push_back("Gerald Young (Yoyobuae)");
149        authors.push_back("Gerco Ballintijn");
150        authors.push_back("IL'dar AKHmetgaleev (AkhIL)");
151        authors.push_back("Ivan Mahonin");
152        authors.push_back("Jerome Blanchi (d.j.a.y.)");
153        authors.push_back("Konstantin Dmitriev (zelgadis)");
154        authors.push_back("Luka Pravica");
155        authors.push_back("Nikita Kitaev (nikitakit)");
156        authors.push_back("Martin Michlmayr (tbm)");
157        authors.push_back("Max May (Permutatrix)");
158        authors.push_back("Miguel Gea Milvaques (xerakko)");
159        authors.push_back("Paul Wise (pabs)");
160        authors.push_back("Ralf Corsepius");
161        authors.push_back("Ramon Miranda");
162        authors.push_back("Ray Frederikson");
163        authors.push_back("Timo Paulssen (timonator)");
164        authors.push_back("Yu Chen (jcome)");
165        authors.push_back("Yue Shi Lai");
166        set_authors(authors);
167
168        std::vector<Glib::ustring> artists;
169        artists.push_back("Aurore D (rore)");
170        artists.push_back("Bertrand Grégoire (berteh)");
171        artists.push_back("Carl-Christian Gehl (Razputin)");
172        artists.push_back("Carlos López González (genete)");
173        artists.push_back("Chris Norman (pixelgeek)");
174        artists.push_back("Daniel Hornung (rubikcube)");
175        artists.push_back("David Rylander (rylleman)");
176        artists.push_back("Franco Iacomella (Yaco)");
177        artists.push_back("Gerald Young (Yoyobuae)");
178        artists.push_back("Henrique Lopes Barone");
179        artists.push_back("Konstantin Dmitriev (zelgadis)");
180        artists.push_back("Madeleine Crubellier (mad0)");
181        artists.push_back("Nikolai Mamashev (solkap)");
182        artists.push_back("Robert B. Quattlebaum Jr. (darco)");
183        artists.push_back("Thimotee Guiet (satrip)");
184        artists.push_back("Yu Chen (jcome)");
185        set_artists(artists);
186
187        // TRANSLATORS: change this to your name, separate multiple names with \n
188        set_translator_credits(_("translator-credits"));
189
190        std::string imagepath;
191#ifdef WIN32
192        imagepath=App::get_base_path()+ETL_DIRECTORY_SEPARATOR+IMAGE_DIR;
193#else
194        imagepath=IMAGE_DIR;
195#endif
196        char* synfig_root=getenv("SYNFIG_ROOT");
197        if(synfig_root) {
198                imagepath=synfig_root;
199                imagepath+=ETL_DIRECTORY_SEPARATOR;
200                imagepath+="share";
201                imagepath+=ETL_DIRECTORY_SEPARATOR;
202                imagepath+="pixmaps";
203        }
204        imagepath+=ETL_DIRECTORY_SEPARATOR;
205
206        Gtk::Image *Logo = manage(new class Gtk::Image());
207        Logo->set(imagepath+"synfig_icon." IMAGE_EXT);
208        set_logo(Logo->get_pixbuf());
209
210#ifdef SHOW_EXTRA_INFO
211
212        string extra_info = get_comments() + "\n";
213
214        #ifdef DEVEL_VERSION
215                extra_info += strprintf(_("\nDevelopment version:\n%s\n"),DEVEL_VERSION);
216        #endif
217
218        extra_info += "\n";
219
220        extra_info += strprintf(_("Built on %s" /* at %s */ "\n"), __DATE__ /* , __TIME__ */ );
221
222        extra_info += "\n";
223
224        extra_info += strprintf(_("Built with:\n"), ETL_VERSION);
225        extra_info += strprintf(_("ETL %s\n"), ETL_VERSION);
226        extra_info += strprintf(_("Synfig API %s\n"), stringify(SYNFIG_VERSION));
227        extra_info += strprintf(_("Synfig library %d\n"), SYNFIG_LIBRARY_VERSION);
228        extra_info += strprintf(_("GTK+ %d.%d.%d\n"), GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
229        #ifdef __GNUC__
230                extra_info += strprintf(_("GNU G++ %d.%d.%d\n"),__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__);
231        #endif
232
233        extra_info += "\n";
234
235        extra_info += strprintf(_("Using:\n"), synfig::get_version());
236        extra_info += strprintf(_("Synfig %s\n"), synfig::get_version());
237        extra_info += strprintf(_("GTK+ %d.%d.%d"),gtk_major_version,gtk_minor_version,gtk_micro_version);
238
239        #ifdef _DEBUG
240                extra_info += "\n\nDEBUG BUILD";
241        #endif
242
243        set_comments(extra_info);
244
245#endif
246
247        // Hide the dialog when you click close
248        signal_response().connect(sigc::mem_fun(*this, &About::close));
249}
250
251void About::close(int){
252        hide();
253}
254
255void About::on_link_clicked(Gtk::AboutDialog&, const Glib::ustring &url)
256{
257        App::open_url(url);
258}
Note: See TracBrowser for help on using the repository browser.