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