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