[pybliographer/wip/gtk3] Remove old-confirmation-dialog option



commit b9aa70b2d6bcb912714b483bdddaa59651eb127f
Author: Germán Poo-Caamaño <gpoo gnome org>
Date:   Tue Oct 10 17:26:25 2017 -0300

    Remove old-confirmation-dialog option

 Pyblio/ConfDir/Gnome.py    |    5 -----
 Pyblio/GnomeUI/Document.py |   28 ++++++++++++----------------
 2 files changed, 12 insertions(+), 21 deletions(-)
---
diff --git a/Pyblio/ConfDir/Gnome.py b/Pyblio/ConfDir/Gnome.py
index edb0162..3cd56c9 100644
--- a/Pyblio/ConfDir/Gnome.py
+++ b/Pyblio/ConfDir/Gnome.py
@@ -14,9 +14,6 @@ on the main screen of the interface """,
 Config.define ('gnome/native-as-default', """ Should we edit the
 entries in their native format by default ? """, Config.Boolean ())
 
-Config.define ('gnome/old-confirmation-dialog',
-              """ Should we use the old dialog when closing, and ask for permission to skip saving? """, 
Config.Boolean ())
-
 Config.define ('gnome/searched', """ List of searchable fields """,
                Config.List (Config.String ()))
 
@@ -32,8 +29,6 @@ Config.set ('gnome/searched', ['Author', 'Title', 'Abstract', 'Date'])
 
 Config.set ('gnome/native-as-default', 0)
 
-Config.set ('gnome/old-confirmation-dialog', 0)
-
 Config.set ('gnome/columns', ('Author', 'Date', 'Title'))
 
 Config.set ('gnome/history', 10)
diff --git a/Pyblio/GnomeUI/Document.py b/Pyblio/GnomeUI/Document.py
index 8a1e399..7c9e615 100644
--- a/Pyblio/GnomeUI/Document.py
+++ b/Pyblio/GnomeUI/Document.py
@@ -459,22 +459,18 @@ class Document (Connector.Publisher):
     def confirm (self):
         ''' eventually ask for modification cancellation '''
         
-        if self.changed:
-           if Config.get('gnome/old-confirmation-dialog').data:
-               return Utils.Callback (_("The database has been modified.\nDiscard changes?"),
-                                      self.w).answer ()
-      
-           else:
-               answer = Utils.Callback (_("The database has been modified.\nSave changes?"),
-                                        self.w, cancel_add = True).answer ()
-                if answer == 2:
-                    return False
-                elif answer and self.modification_check ():
-                    self.save_document ()
-                    return True
-               else:
-                   return True
-       return 1
+        if not self.changed:
+            return True
+
+        result = Utils.Callback (_("The database has been modified.\nSave changes?"),
+                                 self.w, cancel_add=True).answer()
+        if result == 2:
+            return False
+        elif result and self.modification_check ():
+            self.save_document ()
+            return True
+        else:
+            return True
 
     def modification_check (self):
        """Check for external modification, if necessary,


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