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