]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlAboutlyx.C
* Constify Buffer::getLabelList.
[lyx.git] / src / frontends / controllers / ControlAboutlyx.C
1 /**
2  * \file ControlAboutlyx.C
3  * Copyright 2001 The LyX Team.
4  * See the file COPYING.
5  *
6  * \author Edwin Leuven, leuven@fee.uva.nl
7  * \author Angus Leeming, a.leeming@.ac.uk
8  */
9
10 #include <config.h>
11 #include <fstream>
12
13 #ifdef __GNUG__
14 #pragma implementation
15 #endif
16
17 #include "ControlAboutlyx.h"
18 #include "Lsstream.h"
19 #include "gettext.h"
20 #include "support/filetools.h" // FileSearch
21 #include "version.h"
22
23 // needed for the browser
24 extern string system_lyxdir;
25 extern string user_lyxdir;
26
27
28 ControlAboutlyx::ControlAboutlyx(LyXView & lv, Dialogs & d)
29         : ControlDialogBI(lv, d)
30 {}
31
32
33 stringstream & ControlAboutlyx::getCredits(stringstream & ss) const
34 {
35         string const name = FileSearch(system_lyxdir, "CREDITS");
36
37         bool found(!name.empty());
38
39         if (found) {
40                 std::ifstream in(name.c_str());
41                 found = (in.get());
42
43                 if (found) {
44                         in.seekg(0, std::ios::beg); // rewind to the beginning
45
46                         ss << in.rdbuf();
47                         found = (ss.good());
48                 }
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         return ss;
58 }
59
60
61 string const ControlAboutlyx::getCopyright() const
62 {
63         return _("LyX is Copyright (C) 1995 by Matthias Ettrich,\n1995-2001 LyX Team");
64 }
65
66
67 string const ControlAboutlyx::getLicense() const
68 {
69         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.");
70 }
71
72
73 string const ControlAboutlyx::getDisclaimer() const
74 {
75         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.");
76 }
77
78
79 string const ControlAboutlyx::getVersion() const
80 {
81         stringstream ss;
82
83         ss << _("LyX Version ")
84            << lyx_version
85            << _(" of ")
86            << lyx_release_date
87            << "\n"
88            << _("Library directory: ")
89            << MakeDisplayPath(system_lyxdir)
90            << "\n"
91            << _("User directory: ")
92            << MakeDisplayPath(user_lyxdir);
93
94         return ss.str().c_str();
95 }