]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlAboutlyx.C
Small clean-up.
[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 #include "ControlAboutlyx.h"
15 #include "gettext.h"
16 #include "version.h"
17 #include "support/std_sstream.h"
18
19 #include "support/filetools.h" // FileSearch
20 #include "support/path_defines.h"
21
22 #include <fstream>
23
24 using lyx::support::FileSearch;
25 using lyx::support::MakeDisplayPath;
26 using lyx::support::system_lyxdir;
27 using lyx::support::user_lyxdir;
28
29 using std::ostream;
30 using std::ostringstream;
31
32
33 ControlAboutlyx::ControlAboutlyx(Dialog & parent)
34         : Dialog::Controller(parent)
35 {}
36
37
38 void ControlAboutlyx::getCredits(ostream & ss) const
39 {
40         string const name = FileSearch(system_lyxdir(), "CREDITS");
41
42         bool found(!name.empty());
43
44         if (found) {
45                 std::ifstream in(name.c_str());
46
47                 ss << in.rdbuf();
48                 found = ss.good();
49         }
50
51         if (!found) {
52                 ss << _("ERROR: LyX wasn't able to read CREDITS file\n")
53                    << _("Please install correctly to estimate the great\n")
54                    << _("amount of work other people have done for the LyX project.");
55         }
56 }
57
58
59 string const ControlAboutlyx::getCopyright() const
60 {
61         return _("LyX is Copyright (C) 1995 by Matthias Ettrich,\n1995-2001 LyX Team");
62 }
63
64
65 string const ControlAboutlyx::getLicense() const
66 {
67         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.");
68 }
69
70
71 string const ControlAboutlyx::getDisclaimer() const
72 {
73         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.");
74 }
75
76
77 string const ControlAboutlyx::getVersion() const
78 {
79         ostringstream ss;
80
81         ss << _("LyX Version ")
82            << lyx_version
83            << _(" of ")
84            << lyx_release_date
85            << "\n"
86            << _("Library directory: ")
87            << MakeDisplayPath(system_lyxdir())
88            << "\n"
89            << _("User directory: ")
90            << MakeDisplayPath(user_lyxdir());
91
92         return ss.str();
93 }