]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlAboutlyx.C
Port the tabular dialog to the new scheme based on class Dialog.
[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
15 #include "ControlAboutlyx.h"
16 #include "gettext.h"
17 #include "version.h"
18 #include "Lsstream.h"
19
20 #include "support/LOstream.h"
21 #include "support/filetools.h" // FileSearch
22
23 #include <fstream>
24
25 using std::ostream;
26
27 // needed for the browser
28 extern string system_lyxdir;
29 extern string user_lyxdir;
30
31
32 ControlAboutlyx::ControlAboutlyx(LyXView & lv, Dialogs & d)
33         : ControlDialogBI(lv, d)
34 {}
35
36
37 void ControlAboutlyx::getCredits(ostream & ss) const
38 {
39         string const name = FileSearch(system_lyxdir, "CREDITS");
40
41         bool found(!name.empty());
42
43         if (found) {
44                 std::ifstream in(name.c_str());
45
46                 ss << in.rdbuf();
47                 found = ss.good();
48         }
49
50         if (!found) {
51                 ss << _("ERROR: LyX wasn't able to read CREDITS file\n")
52                    << _("Please install correctly to estimate the great\n")
53                    << _("amount of work other people have done for the LyX project.");
54         }
55 }
56
57
58 string const ControlAboutlyx::getCopyright() const
59 {
60         return _("LyX is Copyright (C) 1995 by Matthias Ettrich,\n1995-2001 LyX Team");
61 }
62
63
64 string const ControlAboutlyx::getLicense() const
65 {
66         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.");
67 }
68
69
70 string const ControlAboutlyx::getDisclaimer() const
71 {
72         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.");
73 }
74
75
76 string const ControlAboutlyx::getVersion() const
77 {
78         ostringstream ss;
79
80         ss << _("LyX Version ")
81            << lyx_version
82            << _(" of ")
83            << lyx_release_date
84            << "\n"
85            << _("Library directory: ")
86            << MakeDisplayPath(system_lyxdir)
87            << "\n"
88            << _("User directory: ")
89            << MakeDisplayPath(user_lyxdir);
90
91         return STRCONV(ss.str());
92 }