3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Kalle Dalheimer
8 * Full author contact details are available in file CREDITS
14 #pragma implementation
17 #include "support/lstrings.h"
22 #include "ButtonControllerBase.h"
23 #include "ControlAboutlyx.h"
26 #include <qpushbutton.h>
27 #include <qtextview.h>
29 #include "QAboutDialog.h"
35 typedef Qt2CB<ControlAboutlyx, Qt2DB<QAboutDialog> > base_class;
38 : base_class(_("About LyX"))
43 void QAbout::build_dialog()
45 dialog_.reset(new QAboutDialog());
46 connect(dialog_.get()->closePB, SIGNAL(clicked()),
47 this, SLOT(slotClose()));
49 dialog_->copyright->setText(controller().getCopyright().c_str());
50 dialog_->copyright->append("\n");
51 dialog_->copyright->append(controller().getLicense().c_str());
52 dialog_->copyright->append("\n");
53 dialog_->copyright->append(controller().getDisclaimer().c_str());
55 dialog_->versionLA->setText(controller().getVersion().c_str());
58 controller().getCredits(in);
60 istringstream ss(in.str().c_str());
65 while (getline(ss, s)) {
66 if (prefixIs(s, "@b"))
67 out += "<b>" + s.substr(2) + "</b>";
68 else if (prefixIs(s, "@i"))
69 out += "<i>" + s.substr(2) + "</i>";
75 dialog_->creditsTV->setText(out.c_str());
77 // try to resize to a good size
78 dialog_->copyright->hide();
79 dialog_->setMinimumSize(dialog_->copyright->sizeHint());
80 dialog_->copyright->show();
81 dialog_->setMinimumSize(dialog_->sizeHint());
83 // Manage the cancel/close button
84 bc().setCancel(dialog_->closePB);