]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlAboutlyx.C
Compilation fix.
[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 "frontends/LyXView.h"
19 #include "Lsstream.h"
20 #include "BufferView.h"
21 #include "gettext.h"
22 #include "support/filetools.h" // FileSearch
23 #include "version.h"
24
25 // needed for the browser
26 extern string system_lyxdir;
27 extern string user_lyxdir;
28
29
30 ControlAboutlyx::ControlAboutlyx(LyXView & lv, Dialogs & d)
31         : ControlDialogBI(lv, d)
32 {}
33
34
35 stringstream & ControlAboutlyx::getCredits(stringstream & 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                 found = (in.get());
44
45                 if (found) {
46                         in.seekg(0, std::ios::beg); // rewind to the beginning
47
48                         ss << in.rdbuf();
49                         found = (ss.good());
50                 }
51         }
52
53         if (!found) {
54                 ss << _("ERROR: LyX wasn't able to read CREDITS file\n")
55                    << _("Please install correctly to estimate the great\n")
56                    << _("amount of work other people have done for the LyX project.");
57         }
58
59         return ss;
60 }
61
62
63 string const ControlAboutlyx::getCopyright() const
64 {
65         return _("LyX is Copyright (C) 1995 by Matthias Ettrich,\n1995-2001 LyX Team");
66 }
67
68
69 string const ControlAboutlyx::getLicense() const
70 {
71         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.");
72 }
73
74
75 string const ControlAboutlyx::getDisclaimer() const
76 {
77         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.");
78 }
79
80
81 string const ControlAboutlyx::getVersion() const
82 {
83         stringstream ss;
84
85         ss << _("LyX Version ")
86            << lyx_version
87            << _(" of ")
88            << lyx_release_date
89            << "\n"
90            << _("Library directory: ")
91            << MakeDisplayPath(system_lyxdir)
92            << "\n"
93            << _("User directory: ")
94            << MakeDisplayPath(user_lyxdir);
95
96         return ss.str().c_str();
97 }