]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QAbout.C
some more random changes, added Timeout (make clean if LyX crashes !!)
[lyx.git] / src / frontends / qt2 / QAbout.C
1 /**
2  * \file QAbout.C
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author Kalle Dalheimer <kalle@klaralvdalens-datakonsult.se>
7  */
8
9 #include <config.h>
10
11 #include "support/lstrings.h"
12 #include "Lsstream.h"
13 #include "debug.h"
14 #include "gettext.h"
15 #include "QAboutDialog.h"
16  
17 #include <qlabel.h>
18 #include <qpushbutton.h>
19 #include <qtextview.h>
20 #include "QtLyXView.h"
21  
22 #include "ButtonControllerBase.h"
23 #include "Qt2BC.h"
24 #include "ControlAboutlyx.h"
25 #include "QAbout.h"
26
27 typedef Qt2CB<ControlAboutlyx, Qt2DB<QAboutDialog> > base_class;
28
29 QAbout::QAbout(ControlAboutlyx & c) 
30         : base_class(c, _("About LyX"))
31 {
32 }
33
34
35 void QAbout::build()
36 {
37         dialog_.reset(new QAboutDialog());
38         connect(dialog_.get()->closePB, SIGNAL(clicked()),
39                 this, SLOT(slotClose()));
40
41         dialog_->copyrightLA->setText(controller().getCopyright().c_str());
42         dialog_->licenseLA->setText(controller().getLicense().c_str());
43         dialog_->disclaimerLA->setText(controller().getDisclaimer().c_str());
44         dialog_->versionLA->setText(controller().getVersion().c_str()); 
45  
46         stringstream in;
47         controller().getCredits(in);
48
49         istringstream ss(in.str().c_str());
50  
51         string s;
52         string out;
53  
54         while (getline(ss, s)) {
55                 if (prefixIs(s, "@b"))
56                         out += "<b>" + s.substr(2) + "</b>";
57                 else if (prefixIs(s, "@i"))
58                         out += "<i>" + s.substr(2) + "</i>";
59                 else
60                         out += s;
61                 out += "<br>";
62         }
63  
64         dialog_->creditsTV->setText(out.c_str());
65  
66         // Manage the cancel/close button
67         bc().setCancel(dialog_->closePB);
68         bc().refresh();
69 }