]> git.lyx.org Git - lyx.git/blob - src/frontends/gnome/GAbout.C
doxygen fixes.
[lyx.git] / src / frontends / gnome / GAbout.C
1 /**
2  * \file GAbout.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Michael Koziarski 
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11 #ifdef __GNUG__
12 #pragma implementation
13 #endif
14
15 #include <config.h>
16
17 #include "support/lstrings.h"
18 #include "Lsstream.h"
19
20
21 #include "gnomeBC.h"
22 #include "GAbout.h"
23
24 #include <gtkmm/button.h>
25 #include <gtkmm/textview.h>
26
27 GAbout::GAbout(ControlAboutlyx & c)
28         : GnomeCB<ControlAboutlyx>(c, "GAbout")
29 {}
30
31
32 GAbout::~GAbout()
33 {}
34
35
36 void GAbout::build()
37 {
38         // Connect the buttons.
39         close_btn()->signal_clicked().connect(SigC::slot(*this, &GAbout::CancelClicked));
40
41         // Manage the buttons state
42         bc().setCancel(close_btn());
43         bc().refresh();
44 }
45
46 void GAbout::apply()
47 {}
48
49
50 void GAbout::update()
51 {
52         using namespace std;
53
54         string cr;
55         cr += controller().getCopyright();
56         cr += "\n";
57         cr += controller().getLicense();
58         cr += "\n";
59         cr += controller().getDisclaimer();
60         copyright()->get_buffer()->set_text(cr);
61
62         
63
64         version()->set_text(controller().getVersion());
65
66         stringstream in;
67         controller().getCredits(in);
68
69         istringstream ss(in.str().c_str());
70
71         string s;
72         string out;
73         Gtk::TextIter  e;
74
75         while (getline(ss, s)) {
76         
77                 if (prefixIs(s, "@b"))
78                         out += s.substr(2);
79                 else if (prefixIs(s, "@i"))
80                         out += s.substr(2);
81                 else
82                         out += s.substr(2);
83
84                 out += "\n";
85         }
86         credits()->get_buffer()->set_text(out);
87 }
88
89
90
91 Gtk::Button * GAbout::close_btn() const 
92 {
93         return getWidget<Gtk::Button>("r_close_btn");
94 }
95 Gtk::Label * GAbout::version() const 
96 {
97         return getWidget<Gtk::Label>("r_version");
98 }
99 Gtk::TextView * GAbout::credits() const 
100 {
101         return getWidget<Gtk::TextView>("r_credits");
102 }
103 Gtk::TextView * GAbout::copyright() const 
104 {
105         return getWidget<Gtk::TextView>("r_copyright");
106 }