3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Michael Koziarski
8 * Full author contact details are available in file CREDITS.
14 #include "support/lstrings.h"
16 #include "gnome_helpers.h"
20 #include <gtkmm/button.h>
21 #include <gtkmm/textview.h>
25 using std::istringstream;
29 : GnomeCB<ControlAboutlyx>("GAbout")
39 // Connect the buttons.
40 close_btn()->signal_clicked().connect(SigC::slot(*this, &GAbout::CancelClicked));
42 // Manage the buttons state
43 bc().setCancel(close_btn());
56 cr += controller().getCopyright();
58 cr += controller().getLicense();
60 cr += controller().getDisclaimer();
61 copyright()->get_buffer()->set_text(cr);
65 version()->set_text(controller().getVersion());
68 controller().getCredits(in);
70 istringstream ss(in.str());
73 Glib::RefPtr<Gtk::TextBuffer> buf = credits()->get_buffer();
76 while (getline(ss, s)) {
78 if (prefixIs(s, "@b"))
79 buf->insert_with_tag(buf->end(),
80 Glib::locale_to_utf8(s.substr(2)),
82 else if (prefixIs(s, "@i"))
83 buf->insert_with_tag(buf->end(),
84 Glib::locale_to_utf8(s.substr(2)),
87 buf->insert(buf->end(),
88 Glib::locale_to_utf8(s.substr(2)));
89 buf->insert(buf->end(),"\n");
97 Gtk::Button * GAbout::close_btn() const
99 return getWidget<Gtk::Button>("r_close_btn");
101 Gtk::Label * GAbout::version() const
103 return getWidget<Gtk::Label>("r_version");
105 Gtk::TextView * GAbout::credits() const
107 return getWidget<Gtk::TextView>("r_credits");
109 Gtk::TextView * GAbout::copyright() const
111 return getWidget<Gtk::TextView>("r_copyright");