]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlAboutlyx.C
Add a buffer_path arg to InsetGraphicsMailer's params2string, string2params.
[lyx.git] / src / frontends / controllers / ControlAboutlyx.C
1 /**
2  * \file ControlAboutlyx.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Edwin Leuven
7  * \author Angus Leeming
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #include <config.h>
13
14
15 #include "ControlAboutlyx.h"
16 #include "gettext.h"
17 #include "version.h"
18 #include "Lsstream.h"
19
20 #include "support/LOstream.h"
21 #include "support/filetools.h" // FileSearch
22
23 #include <fstream>
24
25 using namespace lyx::support;
26
27 using std::ostream;
28
29 // needed for the browser
30 extern string system_lyxdir;
31 extern string user_lyxdir;
32
33
34 ControlAboutlyx::ControlAboutlyx(Dialog & parent)
35         : Dialog::Controller(parent)
36 {}
37
38
39 void ControlAboutlyx::getCredits(ostream & ss) const
40 {
41         string const name = FileSearch(system_lyxdir, "CREDITS");
42
43         bool found(!name.empty());
44
45         if (found) {
46                 std::ifstream in(name.c_str());
47
48                 ss << in.rdbuf();
49                 found = ss.good();
50         }
51
52         if (!found) {
53                 ss << _("ERROR: LyX wasn't able to read CREDITS file\n")
54                    << _("Please install correctly to estimate the great\n")
55                    << _("amount of work other people have done for the LyX project.");
56         }
57 }
58
59
60 string const ControlAboutlyx::getCopyright() const
61 {
62         return _("LyX is Copyright (C) 1995 by Matthias Ettrich,\n1995-2001 LyX Team");
63 }
64
65
66 string const ControlAboutlyx::getLicense() const
67 {
68         return _("This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.");
69 }
70
71
72 string const ControlAboutlyx::getDisclaimer() const
73 {
74         return _("LyX is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\nSee the GNU General Public License for more details.\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.");
75 }
76
77
78 string const ControlAboutlyx::getVersion() const
79 {
80         ostringstream ss;
81
82         ss << _("LyX Version ")
83            << lyx_version
84            << _(" of ")
85            << lyx_release_date
86            << "\n"
87            << _("Library directory: ")
88            << MakeDisplayPath(system_lyxdir)
89            << "\n"
90            << _("User directory: ")
91            << MakeDisplayPath(user_lyxdir);
92
93         return STRCONV(ss.str());
94 }