compile fix

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14975 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2006-09-11 11:02:36 +00:00
parent 3253193b63
commit 68eab2b645
4 changed files with 24 additions and 22 deletions

View File

@ -23,18 +23,20 @@
#include <gtkmm.h>
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())

View File

@ -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));
}
}

View File

@ -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;
}
}

View File

@ -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()));
}