]> git.lyx.org Git - features.git/blobdiff - src/frontends/gnome/GAbout.C
Replace LString.h with support/std_string.h,
[features.git] / src / frontends / gnome / GAbout.C
index 8cacbba7e1c35bfeb0964f99012ea98da7d85d7b..9c69961fc43f0572b7b9e1eb45f91f46befbb28b 100644 (file)
@@ -3,29 +3,26 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Michael Koziarski 
+ * \author Michael Koziarski
  *
- * Full author contact details are available in file CREDITS
+ * 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 "support/std_sstream.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")
+GAbout::GAbout()
+       : GnomeCB<ControlAboutlyx>("GAbout")
 {}
 
 
@@ -59,48 +56,53 @@ void GAbout::update()
        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");
 }