]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlAboutlyx.C
Really dull and boring header shit
[lyx.git] / src / frontends / controllers / ControlAboutlyx.C
1 /**
2  * \file ControlAboutlyx.C
3  * See the file COPYING.
4  *
5  * \author Edwin Leuven
6  * \author Angus Leeming
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11 #include <config.h>
12 #include <fstream>
13
14 #ifdef __GNUG__
15 #pragma implementation
16 #endif
17
18 #include "ControlAboutlyx.h"
19 #include "Lsstream.h"
20 #include "gettext.h"
21 #include "support/filetools.h" // FileSearch
22 #include "version.h"
23
24 // needed for the browser
25 extern string system_lyxdir;
26 extern string user_lyxdir;
27
28
29 ControlAboutlyx::ControlAboutlyx(LyXView & lv, Dialogs & d)
30         : ControlDialogBI(lv, d)
31 {}
32
33
34 stringstream & ControlAboutlyx::getCredits(stringstream & ss) const
35 {
36         string const name = FileSearch(system_lyxdir, "CREDITS");
37
38         bool found(!name.empty());
39
40         if (found) {
41                 std::ifstream in(name.c_str());
42                 found = (in.get());
43
44                 if (found) {
45                         in.seekg(0, std::ios::beg); // rewind to the beginning
46
47                         ss << in.rdbuf();
48                         found = (ss.good());
49                 }
50         }
51
52         if (!found) {
53                 ss << _("ERROR: LyX wasn't able to read CREDITS file\n")
54                    << _("Please install correctly to estimate the great\n")
55                    << _("amount of work other people have done for the LyX project.");
56         }
57
58         return ss;
59 }
60
61
62 string const ControlAboutlyx::getCopyright() const
63 {
64         return _("LyX is Copyright (C) 1995 by Matthias Ettrich,\n1995-2001 LyX Team");
65 }
66
67
68 string const ControlAboutlyx::getLicense() const
69 {
70         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.");
71 }
72
73
74 string const ControlAboutlyx::getDisclaimer() const
75 {
76         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.");
77 }
78
79
80 string const ControlAboutlyx::getVersion() const
81 {
82         stringstream ss;
83
84         ss << _("LyX Version ")
85            << lyx_version
86            << _(" of ")
87            << lyx_release_date
88            << "\n"
89            << _("Library directory: ")
90            << MakeDisplayPath(system_lyxdir)
91            << "\n"
92            << _("User directory: ")
93            << MakeDisplayPath(user_lyxdir);
94
95         return ss.str().c_str();
96 }