]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlAboutlyx.C
remove preamble dialog from the qt frontend
[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 #ifdef __GNUG__
15 #pragma implementation
16 #endif
17
18 #include "ControlAboutlyx.h"
19 #include "gettext.h"
20 #include "version.h"
21 #include "Lsstream.h"
22
23 #include "support/LOstream.h"
24 #include "support/filetools.h" // FileSearch
25
26 #include <fstream>
27
28 using std::ostream;
29
30 // needed for the browser
31 extern string system_lyxdir;
32 extern string user_lyxdir;
33
34
35 ControlAboutlyx::ControlAboutlyx(LyXView & lv, Dialogs & d)
36         : ControlDialogBI(lv, d)
37 {}
38
39
40 void ControlAboutlyx::getCredits(ostream & ss) const
41 {
42         string const name = FileSearch(system_lyxdir, "CREDITS");
43
44         bool found(!name.empty());
45
46         if (found) {
47                 std::ifstream in(name.c_str());
48
49                 ss << in.rdbuf();
50                 found = ss.good();
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
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         ostringstream 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 STRCONV(ss.str());
95 }