]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormAboutlyx.C
remove defaults stuff, let Qt handle no toolbar
[lyx.git] / src / frontends / xforms / FormAboutlyx.C
1 /**
2  * \file FormAboutlyx.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  * \author Rob Lahaye
9  *
10  * Full author contact details are available in file CREDITS
11  */
12
13 #include <config.h>
14
15
16 #include "FormAboutlyx.h"
17 #include "xformsBC.h"
18 #include "ControlAboutlyx.h"
19 #include "forms/form_aboutlyx.h"
20 #include "xforms_helpers.h"
21 #include "Lsstream.h"
22 #include "version.h"
23
24 #include FORMS_H_LOCATION
25
26
27 typedef FormController<ControlAboutlyx, FormView<FD_aboutlyx> > base_class;
28
29 FormAboutlyx::FormAboutlyx(Dialog & parent)
30         : base_class(parent, _("About LyX"), false)
31 {}
32
33
34 void FormAboutlyx::build()
35 {
36         dialog_.reset(build_aboutlyx(this));
37
38         // create version tab
39         version_.reset(build_aboutlyx_version(this));
40
41         ostringstream vs;
42         vs << controller().getVersion()
43            << '\n' << lyx_version_info;
44
45         fl_add_browser_line(version_->browser_version, vs.str().c_str());
46
47         // create credits tab
48         credits_.reset(build_aboutlyx_credits(this));
49
50         ostringstream crs;
51         controller().getCredits(crs);
52
53         fl_add_browser_line(credits_->browser_credits, crs.str().c_str());
54
55         // create license tab
56         license_.reset(build_aboutlyx_license(this));
57         int const width = license_->browser_license->w - 10;
58
59         ostringstream cs;
60         cs << controller().getCopyright() << "\n\n"
61            << formatted(controller().getLicense(), width) << "\n\n"
62            << formatted(controller().getDisclaimer(), width);
63
64         fl_add_browser_line(license_->browser_license, cs.str().c_str());
65
66         // stack tabs
67         fl_addto_tabfolder(dialog_->tabfolder, _("Version"),
68                            version_->form);
69         fl_addto_tabfolder(dialog_->tabfolder, _("Credits"),
70                            credits_->form);
71         fl_addto_tabfolder(dialog_->tabfolder, _("License"),
72                            license_->form);
73
74         // work-around xforms bug re update of folder->x, folder->y coords.
75         setPrehandler(dialog_->tabfolder);
76
77         // Manage the cancel/close button
78         bcview().setCancel(dialog_->button_close);
79 }