X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiAlert.cpp;h=b53f20f738524fdf452db0b8a7ae58c0918e4788;hb=ba76bf5eb85db5a10839fccee3430d906d3f7b70;hp=2835ec90d3aee9a5cbdefb2352cc46dbdf374b4e;hpb=9d0ea8aeff32833a90b3fe64df0c5518a9e241be;p=lyx.git diff --git a/src/frontends/qt4/GuiAlert.cpp b/src/frontends/qt4/GuiAlert.cpp index 2835ec90d3..b53f20f738 100644 --- a/src/frontends/qt4/GuiAlert.cpp +++ b/src/frontends/qt4/GuiAlert.cpp @@ -30,14 +30,14 @@ #include #include +#include -using std::endl; - +using namespace std; +using namespace lyx::support; namespace lyx { namespace frontend { -using support::bformat; static docstring const formatted(docstring const & text) { @@ -53,7 +53,7 @@ static docstring const formatted(docstring const & text) while (true) { size_t const nxtpos1 = text.find(' ', curpos); size_t const nxtpos2 = text.find('\n', curpos); - size_t const nxtpos = std::min(nxtpos1, nxtpos2); + size_t const nxtpos = min(nxtpos1, nxtpos2); docstring const word = nxtpos == docstring::npos ? @@ -105,16 +105,17 @@ int prompt(docstring const & title0, docstring const & question, int default_button, int cancel_button, docstring const & b1, docstring const & b2, docstring const & b3) { + lyxerr << "PROMPT" << title0 << "FOCUS: " << qApp->focusWidget() << endl; if (!use_gui || lyxerr.debugging()) { - lyxerr << to_utf8(title0) << '\n' + lyxerr << title0 << '\n' << "----------------------------------------\n" - << to_utf8(question) << endl; + << question << endl; lyxerr << "Assuming answer is "; switch (default_button) { - case 0: lyxerr << to_utf8(b1) << endl; - case 1: lyxerr << to_utf8(b2) << endl; - case 2: lyxerr << to_utf8(b3) << endl; + case 0: lyxerr << b1 << endl; + case 1: lyxerr << b2 << endl; + case 2: lyxerr << b3 << endl; } if (!use_gui) return default_button; @@ -128,6 +129,7 @@ int prompt(docstring const & title0, docstring const & question, qApp->changeOverrideCursor(Qt::ArrowCursor); // FIXME replace that with guiApp->currentView() + LYXERR0("FOCUS: " << qApp->focusWidget()); int res = QMessageBox::information(qApp->focusWidget(), toqstr(title), toqstr(formatted(question)), @@ -145,9 +147,9 @@ int prompt(docstring const & title0, docstring const & question, void warning(docstring const & title0, docstring const & message) { - lyxerr << "Warning: " << to_utf8(title0) << '\n' + lyxerr << "Warning: " << title0 << '\n' << "----------------------------------------\n" - << to_utf8(message) << endl; + << message << endl; if (!use_gui) return; @@ -171,9 +173,9 @@ void warning(docstring const & title0, docstring const & message) void error(docstring const & title0, docstring const & message) { - lyxerr << "Error: " << to_utf8(title0) << '\n' + lyxerr << "Error: " << title0 << '\n' << "----------------------------------------\n" - << to_utf8(message) << endl; + << message << endl; if (!use_gui) return; @@ -197,9 +199,9 @@ void error(docstring const & title0, docstring const & message) void information(docstring const & title0, docstring const & message) { if (!use_gui || lyxerr.debugging()) - lyxerr << to_utf8(title0) << '\n' + lyxerr << title0 << '\n' << "----------------------------------------\n" - << to_utf8(message) << endl; + << message << endl; if (!use_gui) return; @@ -216,8 +218,8 @@ bool askForText(docstring & response, docstring const & msg, { if (!use_gui || lyxerr.debugging()) { lyxerr << "----------------------------------------\n" - << to_utf8(msg) << '\n' - << "Assuming answer is " << to_utf8(dflt) << '\n' + << msg << '\n' + << "Assuming answer is " << dflt << '\n' << "----------------------------------------" << endl; if (!use_gui) { response = dflt;