3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 // Too hard to make concept checks work with this file
14 #ifdef _GLIBCXX_CONCEPT_CHECKS
15 #undef _GLIBCXX_CONCEPT_CHECKS
17 #ifdef _GLIBCPP_CONCEPT_CHECKS
18 #undef _GLIBCPP_CONCEPT_CHECKS
21 #include "ControlAboutlyx.h"
22 #include "GAboutlyx.h"
26 #include <libglademm.h>
30 using std::ostringstream;
38 enum TranslateState {NORMAL, BEGIN, IN_AT, IN_BOLD, IN_ITALIC};
41 Glib::ustring translateMarkup(Glib::ustring const & lyxMarkup)
43 Glib::ustring::const_iterator it = lyxMarkup.begin();
44 Glib::ustring pangoMarkup;
45 TranslateState state = BEGIN;
46 for (; it != lyxMarkup.end(); it++) {
55 pangoMarkup.push_back('\n');
59 pangoMarkup.push_back(*it);
75 pangoMarkup.push_back('@');
76 pangoMarkup.push_back('\n');
80 pangoMarkup.push_back('@');
81 pangoMarkup.push_back(*it);
88 pangoMarkup += "</b>\n";
91 pangoMarkup.push_back(*it);
98 pangoMarkup += "</i>\n";
101 pangoMarkup.push_back(*it);
108 pangoMarkup.push_back('\n');
111 pangoMarkup.push_back(*it);
116 pangoMarkup += "amp;";
119 pangoMarkup.erase(--(pangoMarkup.end()));
120 pangoMarkup += "<";
123 pangoMarkup.erase(--(pangoMarkup.end()));
124 pangoMarkup += ">";
132 pangoMarkup.push_back('@');
135 pangoMarkup += "</i>";
138 pangoMarkup += "</b>";
150 GAboutlyx::GAboutlyx(Dialog & parent)
151 : GViewCB<ControlAboutlyx, GViewGladeB>(parent, "About LyX")
156 void GAboutlyx::doBuild()
158 string const gladeName = findGladeFile("aboutlyx");
159 xml_ = Gnome::Glade::Xml::create(gladeName);
160 Gtk::Label * version;
161 Gtk::Label * credits;
162 Gtk::Label * license;
163 xml_->get_widget("version", version);
164 xml_->get_widget("credits", credits);
165 xml_->get_widget("license", license);
166 std::ostringstream vs;
167 vs << controller().getVersion()
168 << std::endl << lyx_version_info;
169 version->set_text(Glib::locale_to_utf8(vs.str()));
170 std::ostringstream crs;
171 controller().getCredits(crs);
173 translateMarkup(Glib::convert(crs.str(),
176 std::ostringstream ls;
177 ls << controller().getCopyright() << "\n\n"
178 << controller().getLicense() << "\n\n"
179 << controller().getDisclaimer();
180 license->set_text(Glib::locale_to_utf8(ls.str()));
182 xml_->get_widget("close_button", btn);
184 //btn->signal_clicked().connect(sigc::mem_fun(*this, &GViewBase::onCancel));
187 } // namespace frontend