/** * ile GAbout.C * Copyright 2001 The LyX Team. * See the file COPYING. * * \author Michael Koziarski */ #ifdef __GNUG__ #pragma implementation #endif #include #include "support/lstrings.h" #include "Lsstream.h" #include "gnomeBC.h" #include "GAbout.h" #include #include GAbout::GAbout(ControlAboutlyx & c) : FormCB(c, "GAbout") {} GAbout::~GAbout() {} void GAbout::build() { // Connect the buttons. close_btn()->signal_clicked().connect(SigC::slot(*this, &GAbout::CancelClicked)); // Manage the buttons state bc().setCancel(close_btn()); bc().refresh(); } void GAbout::apply() {} void GAbout::update() { using namespace std; string cr; cr += controller().getCopyright(); cr += "\n"; cr += controller().getLicense(); cr += "\n"; cr += controller().getDisclaimer(); copyright()->get_buffer()->set_text(cr); version()->set_text(controller().getVersion()); stringstream in; controller().getCredits(in); istringstream ss(in.str().c_str()); string s; string out; Gtk::TextIter e; while (getline(ss, s)) { if (prefixIs(s, "@b")) out += s.substr(2); else if (prefixIs(s, "@i")) out += s.substr(2); else out += s.substr(2); out += "\n"; } credits()->get_buffer()->set_text(out); } Gtk::Button * GAbout::close_btn() const { return getWidget("r_close_btn"); } Gtk::Label * GAbout::version() const { return getWidget("r_version"); } Gtk::TextView * GAbout::credits() const { return getWidget("r_credits"); } Gtk::TextView * GAbout::copyright() const { return getWidget("r_copyright"); }