2001-08-19 13:25:15 +00:00
|
|
|
/**
|
|
|
|
* \file QAbout.C
|
|
|
|
* Copyright 2001 the LyX Team
|
|
|
|
* Read the file COPYING
|
|
|
|
*
|
|
|
|
* \author Kalle Dalheimer <kalle@klaralvdalens-datakonsult.se>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
2001-08-21 01:14:54 +00:00
|
|
|
#include "support/lstrings.h"
|
|
|
|
#include "Lsstream.h"
|
|
|
|
#include "debug.h"
|
2001-08-19 13:25:15 +00:00
|
|
|
#include "gettext.h"
|
2002-06-19 03:38:44 +00:00
|
|
|
#include "LyXView.h"
|
|
|
|
#include "ButtonControllerBase.h"
|
|
|
|
#include "ControlAboutlyx.h"
|
|
|
|
|
2001-08-19 13:25:15 +00:00
|
|
|
#include <qlabel.h>
|
|
|
|
#include <qpushbutton.h>
|
2001-08-21 01:14:54 +00:00
|
|
|
#include <qtextview.h>
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-06-19 03:38:44 +00:00
|
|
|
#include "QAboutDialog.h"
|
2001-08-23 21:21:50 +00:00
|
|
|
#include "Qt2BC.h"
|
2001-08-19 13:25:15 +00:00
|
|
|
#include "QAbout.h"
|
|
|
|
|
2001-08-29 15:37:39 +00:00
|
|
|
using std::getline;
|
|
|
|
|
2001-08-19 13:25:15 +00:00
|
|
|
typedef Qt2CB<ControlAboutlyx, Qt2DB<QAboutDialog> > base_class;
|
|
|
|
|
2002-08-12 14:28:43 +00:00
|
|
|
QAbout::QAbout()
|
|
|
|
: base_class(_("About LyX"))
|
2001-08-19 13:25:15 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-08-26 00:29:39 +00:00
|
|
|
void QAbout::build_dialog()
|
2001-08-19 13:25:15 +00:00
|
|
|
{
|
|
|
|
dialog_.reset(new QAboutDialog());
|
|
|
|
connect(dialog_.get()->closePB, SIGNAL(clicked()),
|
2001-08-25 03:00:19 +00:00
|
|
|
this, SLOT(slotClose()));
|
2001-08-19 13:25:15 +00:00
|
|
|
|
2002-01-31 13:15:33 +00:00
|
|
|
dialog_->copyright->setText(controller().getCopyright().c_str());
|
|
|
|
dialog_->copyright->append("\n");
|
|
|
|
dialog_->copyright->append(controller().getLicense().c_str());
|
|
|
|
dialog_->copyright->append("\n");
|
|
|
|
dialog_->copyright->append(controller().getDisclaimer().c_str());
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
dialog_->versionLA->setText(controller().getVersion().c_str());
|
|
|
|
|
2001-08-21 01:14:54 +00:00
|
|
|
stringstream in;
|
|
|
|
controller().getCredits(in);
|
2001-08-19 13:25:15 +00:00
|
|
|
|
2001-08-21 01:14:54 +00:00
|
|
|
istringstream ss(in.str().c_str());
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-08-21 01:14:54 +00:00
|
|
|
string s;
|
|
|
|
string out;
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-08-21 01:14:54 +00:00
|
|
|
while (getline(ss, s)) {
|
|
|
|
if (prefixIs(s, "@b"))
|
|
|
|
out += "<b>" + s.substr(2) + "</b>";
|
|
|
|
else if (prefixIs(s, "@i"))
|
|
|
|
out += "<i>" + s.substr(2) + "</i>";
|
|
|
|
else
|
|
|
|
out += s;
|
|
|
|
out += "<br>";
|
|
|
|
}
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-08-21 01:14:54 +00:00
|
|
|
dialog_->creditsTV->setText(out.c_str());
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-08-29 02:04:31 +00:00
|
|
|
// try to resize to a good size
|
|
|
|
dialog_->copyright->hide();
|
|
|
|
dialog_->setMinimumSize(dialog_->copyright->sizeHint());
|
|
|
|
dialog_->copyright->show();
|
|
|
|
dialog_->setMinimumSize(dialog_->sizeHint());
|
|
|
|
|
2001-08-19 13:25:15 +00:00
|
|
|
// Manage the cancel/close button
|
|
|
|
bc().setCancel(dialog_->closePB);
|
|
|
|
bc().refresh();
|
|
|
|
}
|