2001-07-13 14:03:48 +00:00
|
|
|
/**
|
|
|
|
* \file FormAboutlyx.C
|
2002-09-05 15:14:23 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2001-07-13 14:03:48 +00:00
|
|
|
*
|
2002-09-05 14:10:50 +00:00
|
|
|
* \author Edwin Leuven
|
2002-10-21 17:38:09 +00:00
|
|
|
* \author Angus Leeming
|
2002-10-22 15:00:45 +00:00
|
|
|
* \author Rob Lahaye
|
2002-09-05 14:10:50 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2001-07-13 14:03:48 +00:00
|
|
|
*/
|
|
|
|
|
2002-03-11 17:00:41 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
2001-07-13 14:03:48 +00:00
|
|
|
|
2002-06-24 20:28:12 +00:00
|
|
|
#include "FormAboutlyx.h"
|
2001-07-13 14:03:48 +00:00
|
|
|
#include "xformsBC.h"
|
|
|
|
#include "ControlAboutlyx.h"
|
2002-06-13 13:43:51 +00:00
|
|
|
#include "forms/form_aboutlyx.h"
|
2001-07-13 14:03:48 +00:00
|
|
|
#include "xforms_helpers.h"
|
|
|
|
#include "Lsstream.h"
|
2002-10-22 15:00:45 +00:00
|
|
|
#include "version.h"
|
|
|
|
|
2003-05-14 09:17:22 +00:00
|
|
|
#include "lyx_forms.h"
|
2002-10-22 15:00:45 +00:00
|
|
|
|
2003-04-09 21:34:50 +00:00
|
|
|
namespace {
|
|
|
|
|
|
|
|
#if FL_VERSION == 0 || (FL_REVISION == 0 && FL_FIXLEVEL < 2)
|
|
|
|
bool const scalableTabfolders = false;
|
|
|
|
#else
|
|
|
|
bool const scalableTabfolders = true;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
} // namespace anon
|
|
|
|
|
2001-07-13 14:03:48 +00:00
|
|
|
|
2003-03-09 20:29:58 +00:00
|
|
|
typedef FormController<ControlAboutlyx, FormView<FD_aboutlyx> > base_class;
|
2001-07-13 14:03:48 +00:00
|
|
|
|
2003-03-09 20:29:58 +00:00
|
|
|
FormAboutlyx::FormAboutlyx(Dialog & parent)
|
2003-04-09 21:34:50 +00:00
|
|
|
: base_class(parent, _("About LyX"), scalableTabfolders)
|
2001-07-13 14:03:48 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
void FormAboutlyx::build()
|
|
|
|
{
|
2002-06-13 13:43:51 +00:00
|
|
|
dialog_.reset(build_aboutlyx(this));
|
2001-07-13 14:03:48 +00:00
|
|
|
|
|
|
|
// create version tab
|
2002-06-13 13:43:51 +00:00
|
|
|
version_.reset(build_aboutlyx_version(this));
|
2001-07-13 14:03:48 +00:00
|
|
|
|
2002-10-22 15:00:45 +00:00
|
|
|
ostringstream vs;
|
|
|
|
vs << controller().getVersion()
|
|
|
|
<< '\n' << lyx_version_info;
|
|
|
|
|
|
|
|
fl_add_browser_line(version_->browser_version, vs.str().c_str());
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-10-22 15:00:45 +00:00
|
|
|
// create credits tab
|
2002-11-04 02:12:42 +00:00
|
|
|
credits_.reset(build_aboutlyx_credits(this));
|
2001-07-13 14:03:48 +00:00
|
|
|
|
2002-10-22 15:00:45 +00:00
|
|
|
ostringstream crs;
|
|
|
|
controller().getCredits(crs);
|
2001-07-13 14:03:48 +00:00
|
|
|
|
2002-10-22 15:00:45 +00:00
|
|
|
fl_add_browser_line(credits_->browser_credits, crs.str().c_str());
|
|
|
|
|
|
|
|
// create license tab
|
|
|
|
license_.reset(build_aboutlyx_license(this));
|
|
|
|
int const width = license_->browser_license->w - 10;
|
|
|
|
|
|
|
|
ostringstream cs;
|
|
|
|
cs << controller().getCopyright() << "\n\n"
|
|
|
|
<< formatted(controller().getLicense(), width) << "\n\n"
|
|
|
|
<< formatted(controller().getDisclaimer(), width);
|
|
|
|
|
|
|
|
fl_add_browser_line(license_->browser_license, cs.str().c_str());
|
2001-07-13 14:03:48 +00:00
|
|
|
|
2003-04-09 21:34:50 +00:00
|
|
|
// Enable the tabfolder to be rescaled correctly.
|
|
|
|
if (scalableTabfolders)
|
|
|
|
fl_set_tabfolder_autofit(dialog_->tabfolder, FL_FIT);
|
|
|
|
|
|
|
|
// Stack tabs
|
2003-05-19 21:08:58 +00:00
|
|
|
fl_addto_tabfolder(dialog_->tabfolder, _("Version").c_str(),
|
2002-03-21 16:59:12 +00:00
|
|
|
version_->form);
|
2003-05-19 21:08:58 +00:00
|
|
|
fl_addto_tabfolder(dialog_->tabfolder, _("Credits").c_str(),
|
2002-03-21 16:59:12 +00:00
|
|
|
credits_->form);
|
2003-05-19 21:08:58 +00:00
|
|
|
fl_addto_tabfolder(dialog_->tabfolder, _("License").c_str(),
|
2002-10-22 15:00:45 +00:00
|
|
|
license_->form);
|
2001-07-13 14:03:48 +00:00
|
|
|
|
|
|
|
// Manage the cancel/close button
|
2003-03-10 03:13:28 +00:00
|
|
|
bcview().setCancel(dialog_->button_close);
|
2001-07-13 14:03:48 +00:00
|
|
|
}
|