/**
- * \file GAbout.C
- * Copyright 2001 The LyX Team.
- * See the file COPYING.
+ * \file GAbout.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
*
- * \author Michael Koziarski <michael@koziarski.org>
+ * \author Michael Koziarski
+ *
+ * Full author contact details are available in file CREDITS.
*/
-#ifdef __GNUG__
-#pragma implementation
-#endif
#include <config.h>
#include "support/lstrings.h"
-#include "Lsstream.h"
-
+#include "gnome_helpers.h"
#include "gnomeBC.h"
#include "GAbout.h"
#include <gtkmm/button.h>
#include <gtkmm/textview.h>
-GAbout::GAbout(ControlAboutlyx & c)
- : FormCB<ControlAboutlyx>(c, "GAbout")
+#include <sstream>
+
+using std::istringstream;
+
+
+GAbout::GAbout()
+ : GnomeCB<ControlAboutlyx>("GAbout")
{}
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());
+ istringstream ss(in.str());
string s;
- string out;
- Gtk::TextIter e;
+ Glib::RefPtr<Gtk::TextBuffer> buf = credits()->get_buffer();
+ addDefaultTags(buf);
while (getline(ss, s)) {
-
+
if (prefixIs(s, "@b"))
- out += s.substr(2);
+ buf->insert_with_tag(buf->end(),
+ Glib::locale_to_utf8(s.substr(2)),
+ "bold");
else if (prefixIs(s, "@i"))
- out += s.substr(2);
+ buf->insert_with_tag(buf->end(),
+ Glib::locale_to_utf8(s.substr(2)),
+ "italic");
else
- out += s.substr(2);
+ buf->insert(buf->end(),
+ Glib::locale_to_utf8(s.substr(2)));
+ buf->insert(buf->end(),"\n");
- out += "\n";
}
- credits()->get_buffer()->set_text(out);
+
}
-Gtk::Button * GAbout::close_btn() const
+Gtk::Button * GAbout::close_btn() const
{
- return getWidget<Gtk::Button>("r_close_btn");
+ return getWidget<Gtk::Button>("r_close_btn");
}
-Gtk::Label * GAbout::version() const
+Gtk::Label * GAbout::version() const
{
- return getWidget<Gtk::Label>("r_version");
+ return getWidget<Gtk::Label>("r_version");
}
-Gtk::TextView * GAbout::credits() const
+Gtk::TextView * GAbout::credits() const
{
- return getWidget<Gtk::TextView>("r_credits");
+ return getWidget<Gtk::TextView>("r_credits");
}
-Gtk::TextView * GAbout::copyright() const
+Gtk::TextView * GAbout::copyright() const
{
- return getWidget<Gtk::TextView>("r_copyright");
+ return getWidget<Gtk::TextView>("r_copyright");
}