eliot-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Eliot-dev] eliot/qt main_window.cpp


From: Olivier Teulière
Subject: [Eliot-dev] eliot/qt main_window.cpp
Date: Sun, 30 Nov 2008 21:09:09 +0000

CVSROOT:        /cvsroot/eliot
Module name:    eliot
Changes by:     Olivier Teulière <ipkiss>      08/11/30 21:09:09

Modified files:
        qt             : main_window.cpp 

Log message:
        Improved confirmation dialogs

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/eliot/qt/main_window.cpp?cvsroot=eliot&r1=1.21&r2=1.22

Patches:
Index: main_window.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/qt/main_window.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- main_window.cpp     30 Nov 2008 20:53:45 -0000      1.21
+++ main_window.cpp     30 Nov 2008 21:09:09 -0000      1.22
@@ -649,10 +649,13 @@
 {
     if (m_game)
     {
-        int res = QMessageBox::question(this, _q("Stop current game?"),
-                                        _q("Loading a dictionary will stop the 
current game. Do you want to continue?"),
-                                        QMessageBox::Yes | 
QMessageBox::Default,
-                                        QMessageBox::No | QMessageBox::Escape);
+        QString msg = _q("Loading a dictionary will stop the current game.");
+        QMessageBox confirmationBox(QMessageBox::Question, _q("Eliot"), msg,
+                                    QMessageBox::Yes | QMessageBox::No, this);
+        confirmationBox.setInformativeText(_q("Do you want to continue?"));
+        confirmationBox.setDefaultButton(QMessageBox::Yes);
+        confirmationBox.setEscapeButton(QMessageBox::No);
+        int res = confirmationBox.exec();
         if (res == QMessageBox::No)
             return;
     }
@@ -842,16 +845,20 @@
 
     // Ask for a confirmation, because this may lead to data loss
     QString msg = _q("Replaying this turn will modify the game history "
-                     "by deleting the turns \"in the future\".");
+                     "by deleting the turns after the displayed one (i.e. "
+                     "turns \"in the future\").");
     QMessageBox confirmationBox(QMessageBox::Question, _q("Eliot"), msg,
-                                QMessageBox::Ok | QMessageBox::Cancel, this);
+                                QMessageBox::Yes | QMessageBox::No, this);
     confirmationBox.setInformativeText(_q("Do you want to continue?"));
+    confirmationBox.setDefaultButton(QMessageBox::Yes);
+    confirmationBox.setEscapeButton(QMessageBox::No);
     int ret = confirmationBox.exec();
-    if (ret != QMessageBox::Ok)
+    if (ret != QMessageBox::Yes)
         return;
 
+    unsigned int currTurn = m_game->getCurrTurn();
     m_game->clearFuture();
     emit gameUpdated();
-    displayInfoMsg(_q("Future turns deleted"));
+    displayInfoMsg(_q("Replaying from turn %1").arg(currTurn));
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]