From 68eab2b645a6090def8c6bada4d4fc449d045e3b Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Mon, 11 Sep 2006 11:02:36 +0000 Subject: [PATCH] compile fix git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14975 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/gtk/Alert_pimpl.C | 32 +++++++++++++++++--------------- src/frontends/gtk/GDocument.C | 2 +- src/frontends/gtk/GErrorList.C | 4 ++-- src/frontends/gtk/GView.C | 8 ++++---- 4 files changed, 24 insertions(+), 22 deletions(-) diff --git a/src/frontends/gtk/Alert_pimpl.C b/src/frontends/gtk/Alert_pimpl.C index 0abc9bb3e3..5fd23bc8db 100644 --- a/src/frontends/gtk/Alert_pimpl.C +++ b/src/frontends/gtk/Alert_pimpl.C @@ -23,18 +23,20 @@ #include +using lyx::docstring; + using std::string; namespace { -string translateShortcut(string const & str) +docstring translateShortcut(docstring const & str) { - string::size_type i = str.find_first_of("&"); - if (i == string::npos || i == str.length() - 1) + docstring::size_type i = str.find_first_of(lyx::from_ascii("&")); + if (i == docstring::npos || i == str.length() - 1) return str; - string tstr = str; + docstring tstr = str; tstr[i] = '_'; return tstr; } @@ -45,30 +47,30 @@ string translateShortcut(string const & str) void warning_pimpl(docstring const & title, docstring const & message) { - Gtk::MessageDialog dlg(Glib::Markup::escape_text(Glib::locale_to_utf8(message)), + Gtk::MessageDialog dlg(Glib::Markup::escape_text(lyx::to_utf8(message)), true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_CLOSE, true); - dlg.set_title(title); + dlg.set_title(lyx::to_utf8(title)); dlg.run(); } void error_pimpl(docstring const & title, docstring const & message) { - Gtk::MessageDialog dlg(Glib::Markup::escape_text(Glib::locale_to_utf8(message)), + Gtk::MessageDialog dlg(Glib::Markup::escape_text(lyx::to_utf8(message)), true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE, true); - dlg.set_title(title); + dlg.set_title(lyx::to_utf8(title)); dlg.run(); } void information_pimpl(docstring const & title, docstring const & message) { - Gtk::MessageDialog dlg(Glib::Markup::escape_text(Glib::locale_to_utf8(message)), + Gtk::MessageDialog dlg(Glib::Markup::escape_text(lyx::to_utf8(message)), true, Gtk::MESSAGE_INFO, Gtk::BUTTONS_CLOSE, true); - dlg.set_title(title); + dlg.set_title(lyx::to_utf8(title)); dlg.run(); } @@ -77,15 +79,15 @@ int prompt_pimpl(docstring const & title, docstring const & question, int defaultButton, int /*escapeButton*/, docstring const & b1, docstring const & b2, docstring const & b3) { - Glib::ustring gb1 = Glib::locale_to_utf8(translateShortcut(b1)); - Glib::ustring gb2 = Glib::locale_to_utf8(translateShortcut(b2)); + Glib::ustring gb1 = lyx::to_utf8(translateShortcut(b1)); + Glib::ustring gb2 = lyx::to_utf8(translateShortcut(b2)); Glib::ustring gb3; if (!b3.empty()) - gb3 = Glib::locale_to_utf8(translateShortcut(b3)); - Gtk::MessageDialog dlg(Glib::Markup::escape_text(Glib::locale_to_utf8(question)), + gb3 = lyx::to_utf8(translateShortcut(b3)); + Gtk::MessageDialog dlg(Glib::Markup::escape_text(lyx::to_utf8(question)), true, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_NONE, true); - dlg.set_title(title); + dlg.set_title(lyx::to_utf8(title)); dlg.add_button(gb1, 0); dlg.add_button(gb2, 1); if (!b3.empty()) diff --git a/src/frontends/gtk/GDocument.C b/src/frontends/gtk/GDocument.C index d683a6f800..3c586b6e03 100644 --- a/src/frontends/gtk/GDocument.C +++ b/src/frontends/gtk/GDocument.C @@ -105,7 +105,7 @@ void GDocument::doBuild() // FIXME UNICODE docstring item = bformat(_("Unavailable: %1$s"), lyx::from_utf8(cit->description())); - classcombo_.append_text(item); + classcombo_.append_text(lyx::to_utf8(item)); } } diff --git a/src/frontends/gtk/GErrorList.C b/src/frontends/gtk/GErrorList.C index 8a0970b26b..773beac868 100644 --- a/src/frontends/gtk/GErrorList.C +++ b/src/frontends/gtk/GErrorList.C @@ -70,7 +70,7 @@ void GErrorList::onErrListSelection() (*errlistsel_->get_selected())[listColIndex_]; ErrorList const & errors = controller().errorList(); - errdescview_->get_buffer()->set_text(errors[choice].description); + errdescview_->get_buffer()->set_text(lyx::to_utf8(errors[choice].description)); } @@ -93,7 +93,7 @@ void GErrorList::updateContents() if (rowindex == 0) errlistsel_->select(*row); - (*row)[listCol_] = cit->error; + (*row)[listCol_] = lyx::to_utf8(cit->error); (*row)[listColIndex_] = rowindex; } } diff --git a/src/frontends/gtk/GView.C b/src/frontends/gtk/GView.C index ebd53ad78e..d38a91ac46 100644 --- a/src/frontends/gtk/GView.C +++ b/src/frontends/gtk/GView.C @@ -175,19 +175,19 @@ void GView::allowInput() const void GView::message(docstring const & msg) { - minibuffer_->message(msg); + minibuffer_->message(lyx::to_utf8(msg)); } void GView::updateStatusBar() { - message(getLyXFunc().viewStatusMessage()); + message(lyx::from_utf8(getLyXFunc().viewStatusMessage())); } void GView::setWindowTitle(docstring const & t, docstring const & /*it*/) { - set_title(Glib::locale_to_utf8(t)); + set_title(lyx::to_utf8(t)); } @@ -209,7 +209,7 @@ void GView::busy(bool yes) const void GView::clearMessage() { - message(getLyXFunc().viewStatusMessage()); + message(lyx::from_utf8(getLyXFunc().viewStatusMessage())); } -- 2.39.2