]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormAboutlyx.C
Really dull and boring header shit
[lyx.git] / src / frontends / xforms / FormAboutlyx.C
1 /**
2  * \file FormAboutlyx.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
13 #ifdef __GNUG__
14 #pragma implementation
15 #endif
16
17 #include "FormAboutlyx.h"
18 #include "xformsBC.h"
19 #include "ControlAboutlyx.h"
20 #include "forms/form_aboutlyx.h"
21 #include "xforms_helpers.h"
22 #include FORMS_H_LOCATION
23 #include "Lsstream.h"
24
25 using std::getline;
26
27 typedef FormCB<ControlAboutlyx, FormDB<FD_aboutlyx> > base_class;
28
29 FormAboutlyx::FormAboutlyx()
30         : base_class(_("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         fl_set_object_label(version_->text_version,
41                             controller().getVersion().c_str());
42         fl_set_object_label(version_->text_copyright,
43                             controller().getCopyright().c_str());
44
45         // create license and warranty tab
46         license_.reset(build_aboutlyx_license(this));
47
48         string str = formatted(controller().getLicense(),
49                                license_->text_license->w - 10);
50         fl_set_object_label(license_->text_license, str.c_str());
51
52         str = formatted(controller().getDisclaimer(),
53                         license_->text_warranty->w - 10);
54         fl_set_object_label(license_->text_warranty, str.c_str());
55
56         // create credits
57         credits_.reset(build_aboutlyx_credits(this));
58         stringstream ss;
59         fl_add_browser_line(credits_->browser_credits,
60                             controller().getCredits(ss).str().c_str());
61
62         // stack tabs
63         fl_addto_tabfolder(dialog_->tabfolder,_("Copyright and Version"),
64                            version_->form);
65         fl_addto_tabfolder(dialog_->tabfolder,_("License and Warranty"),
66                            license_->form);
67         fl_addto_tabfolder(dialog_->tabfolder,_("Credits"),
68                            credits_->form);
69
70         // Manage the cancel/close button
71         bc().setCancel(dialog_->button_close);
72 }