]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/FormCredits.C
small fix with footnote, use stringstream some more
[lyx.git] / src / frontends / qt2 / FormCredits.C
1 /**
2  * \file FormCredits.C
3  * Copyright 2001 The LyX Team.
4  * See the file COPYING.
5  *
6  * \author Edwin Leuven, leuven@fee.uva.nl
7  * \author Angus Leeming, a.leeming@.ac.uk
8  * \author Kalle Dalheimer, kalle@klaralvdalens-datakonsult.se
9  */
10
11 #ifdef __GNUG__
12 #pragma implementation
13 #endif
14
15 #include <config.h>
16
17 #include "FormCreditsDialogImpl.h"
18 #include <qtextview.h>
19 #include <qpushbutton.h>
20 #undef emit
21
22 #include "qt2BC.h"
23 #include "ControlCredits.h"
24 #include "FormCredits.h"
25 #include "Lsstream.h"
26
27 using std::getline;
28
29 typedef Qt2CB<ControlCredits, Qt2DB<FormCreditsDialogImpl> > base_class;
30
31 FormCredits::FormCredits(ControlCredits & c)
32         : base_class(c, _("Credits"))
33 {}
34
35
36 void FormCredits::build()
37 {
38     // PENDING(kalle) Parent?
39     dialog_.reset(new FormCreditsDialogImpl( this ));
40
41     // Manage the cancel/close button
42     bc().setCancel(dialog_->okPB);
43     bc().refresh();
44     
45     std::stringstream ss;
46     QString xformscredits = controller().getCredits( ss ).str().c_str();
47     QStringList xformslist = QStringList::split( '\n', controller().getCredits( ss ).str().c_str(), true );
48     for( QStringList::Iterator it = xformslist.begin(); it != xformslist.end(); ++it ) {
49         QString line = *it;
50         if( line.left( 2 ) == "@b" )
51             dialog_->creditsTV->append( "<b>" + line.mid( 2 ) + "</b>" );
52         else if( line.left(  2 ) == "@i" )
53             dialog_->creditsTV->append( "<i>" + line.mid( 2 ) + "</i>" );
54         else
55             dialog_->creditsTV->append( line );
56     }
57 }