]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiAlert.cpp
header cleanup
[lyx.git] / src / frontends / qt4 / GuiAlert.cpp
index a9cb6d82aea929b2a3dad5e7ec2bc52db85195f7..b53f20f738524fdf452db0b8a7ae58c0918e4788 100644 (file)
@@ -30,6 +30,7 @@
 #include <QInputDialog>
 
 #include <iomanip>
+#include <iostream>
 
 using namespace std;
 using namespace lyx::support;
@@ -52,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 ?
@@ -104,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;
@@ -127,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)),
@@ -144,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;
@@ -170,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;
@@ -196,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;
@@ -215,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;