]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/FormCredits.C
add iso8859-15 support
[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 "gettext.h"
18 #include "FormCreditsDialogImpl.h"
19 #include <qtextview.h>
20 #include <qpushbutton.h>
21 #undef emit
22
23 #include "qt2BC.h"
24 #include "ControlCredits.h"
25 #include "FormCredits.h"
26 #include "Lsstream.h"
27
28 using std::getline;
29
30 typedef Qt2CB<ControlCredits, Qt2DB<FormCreditsDialogImpl> > base_class;
31
32 FormCredits::FormCredits(ControlCredits & c)
33         : base_class(c, _("Credits"))
34 {}
35
36
37 void FormCredits::build()
38 {
39     // PENDING(kalle) Parent?
40     dialog_.reset(new FormCreditsDialogImpl( this ));
41
42     // Manage the cancel/close button
43     bc().setCancel(dialog_->okPB);
44     bc().refresh();
45     
46     std::stringstream ss;
47     QString xformscredits = controller().getCredits( ss ).str().c_str();
48     QStringList xformslist = QStringList::split( '\n', controller().getCredits( ss ).str().c_str(), true );
49     for( QStringList::Iterator it = xformslist.begin(); it != xformslist.end(); ++it ) {
50         QString line = *it;
51         if( line.left( 2 ) == "@b" )
52             dialog_->creditsTV->append( "<b>" + line.mid( 2 ) + "</b>" );
53         else if( line.left(  2 ) == "@i" )
54             dialog_->creditsTV->append( "<i>" + line.mid( 2 ) + "</i>" );
55         else
56             dialog_->creditsTV->append( line );
57     }
58 }