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 prefs_dialog.cpp prefs...


From: Olivier Teulière
Subject: [Eliot-dev] eliot/qt main_window.cpp prefs_dialog.cpp prefs...
Date: Mon, 08 Dec 2008 21:37:02 +0000

CVSROOT:        /cvsroot/eliot
Module name:    eliot
Changes by:     Olivier Teulière <ipkiss>      08/12/08 21:37:02

Modified files:
        qt             : main_window.cpp prefs_dialog.cpp prefs_dialog.h 
        qt/ui          : prefs_dialog.ui 

Log message:
        Allow deactivating the warning before replaying a turn

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/eliot/qt/main_window.cpp?cvsroot=eliot&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/eliot/qt/prefs_dialog.cpp?cvsroot=eliot&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/eliot/qt/prefs_dialog.h?cvsroot=eliot&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/eliot/qt/ui/prefs_dialog.ui?cvsroot=eliot&r1=1.6&r2=1.7

Patches:
Index: main_window.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/qt/main_window.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- main_window.cpp     30 Nov 2008 21:09:09 -0000      1.22
+++ main_window.cpp     8 Dec 2008 21:37:02 -0000       1.23
@@ -843,6 +843,9 @@
     if (m_game == NULL)
         return;
 
+    QSettings settings(ORGANIZATION, PACKAGE_NAME);
+    QVariant warn = settings.value(PrefsDialog::kINTF_WARN_REPLAY_TURN);
+    if (warn.isNull() || warn.toBool()) {
     // 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 after the displayed one (i.e. "
@@ -855,6 +858,7 @@
     int ret = confirmationBox.exec();
     if (ret != QMessageBox::Yes)
         return;
+    }
 
     unsigned int currTurn = m_game->getCurrTurn();
     m_game->clearFuture();

Index: prefs_dialog.cpp
===================================================================
RCS file: /cvsroot/eliot/eliot/qt/prefs_dialog.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- prefs_dialog.cpp    22 Sep 2008 21:21:44 -0000      1.5
+++ prefs_dialog.cpp    8 Dec 2008 21:37:02 -0000       1.6
@@ -31,6 +31,7 @@
 
 const QString PrefsDialog::kINTF_ALIGN_HISTORY = "Interface/AlignHistory";
 const QString PrefsDialog::kINTF_DIC_PATH = "Interface/DicPath";
+const QString PrefsDialog::kINTF_WARN_REPLAY_TURN = "Interface/WarnReplayTurn";
 
 
 PrefsDialog::PrefsDialog(QWidget *iParent)
@@ -42,8 +43,10 @@
     {
         // Interface settings
         QSettings qs(ORGANIZATION, PACKAGE_NAME);
-        
checkBoxIntfAlignHistory->setChecked(qs.value(kINTF_ALIGN_HISTORY).toBool());
         lineEditIntfDicPath->setText(qs.value(kINTF_DIC_PATH, "").toString());
+        
checkBoxIntfAlignHistory->setChecked(qs.value(kINTF_ALIGN_HISTORY).toBool());
+        QVariant warnReplayTurn = qs.value(kINTF_WARN_REPLAY_TURN);
+        checkBoxIntfWarnReplayTurn->setChecked(warnReplayTurn.isNull() || 
warnReplayTurn.toBool());
 
         // Duplicate settings
         
checkBoxDuplRefuseInvalid->setChecked(Settings::Instance().getBool("duplicate.reject-invalid"));
@@ -92,13 +95,14 @@
     {
         // Interface settings
         QSettings qs(ORGANIZATION, PACKAGE_NAME);
+        qs.setValue(kINTF_DIC_PATH, lineEditIntfDicPath->text());
         if (qs.value(kINTF_ALIGN_HISTORY).toBool() != 
checkBoxIntfAlignHistory->isChecked())
         {
             // We need to redraw the history widget
             shouldEmitUpdate = true;
             qs.setValue(kINTF_ALIGN_HISTORY, 
checkBoxIntfAlignHistory->isChecked());
         }
-        qs.setValue(kINTF_DIC_PATH, lineEditIntfDicPath->text());
+        qs.setValue(kINTF_WARN_REPLAY_TURN, 
checkBoxIntfWarnReplayTurn->isChecked());
 
         // Duplicate settings
         Settings::Instance().setBool("duplicate.reject-invalid",

Index: prefs_dialog.h
===================================================================
RCS file: /cvsroot/eliot/eliot/qt/prefs_dialog.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- prefs_dialog.h      26 Jan 2008 16:58:47 -0000      1.2
+++ prefs_dialog.h      8 Dec 2008 21:37:02 -0000       1.3
@@ -36,6 +36,7 @@
 
     static const QString kINTF_ALIGN_HISTORY;
     static const QString kINTF_DIC_PATH;
+    static const QString kINTF_WARN_REPLAY_TURN;
 
 public slots:
     /// Update the settings when the user selects "OK"

Index: ui/prefs_dialog.ui
===================================================================
RCS file: /cvsroot/eliot/eliot/qt/ui/prefs_dialog.ui,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- ui/prefs_dialog.ui  7 Sep 2008 13:17:42 -0000       1.6
+++ ui/prefs_dialog.ui  8 Dec 2008 21:37:02 -0000       1.7
@@ -5,8 +5,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>401</width>
-    <height>432</height>
+    <width>404</width>
+    <height>437</height>
    </rect>
   </property>
   <property name="windowTitle" >
@@ -66,6 +66,16 @@
         </property>
        </widget>
       </item>
+      <item>
+       <widget class="QCheckBox" name="checkBoxIntfWarnReplayTurn" >
+        <property name="text" >
+         <string>_("Warn before replaying a turn")</string>
+        </property>
+        <property name="checked" >
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>




reply via email to

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