[gnome-games] Remove fill options (Bug #616580)



commit 06b8d80ddb685929ae224cc98fda5d9dca7c386d
Author: Robert Ancell <robert ancell gmail com>
Date:   Fri Apr 23 14:36:17 2010 +1000

    Remove fill options (Bug #616580)

 gnome-sudoku/src/lib/gsudoku.py |    4 ----
 gnome-sudoku/src/lib/main.py    |   35 -----------------------------------
 gnome-sudoku/src/lib/saver.py   |    1 -
 3 files changed, 0 insertions(+), 40 deletions(-)
---
diff --git a/gnome-sudoku/src/lib/gsudoku.py b/gnome-sudoku/src/lib/gsudoku.py
index 0eac469..d9a5bb0 100644
--- a/gnome-sudoku/src/lib/gsudoku.py
+++ b/gnome-sudoku/src/lib/gsudoku.py
@@ -96,7 +96,6 @@ class SudokuGameDisplay (SudokuNumberGrid, gobject.GObject):
         group_size = int(group_size)
         self.hints = 0
         self.always_show_hints = False
-        self.auto_fills = 0
         self.show_impossible_implications = show_impossible_implications
         self.impossible_hints = 0
         self.impossibilities = []
@@ -296,7 +295,6 @@ class SudokuGameDisplay (SudokuNumberGrid, gobject.GObject):
 
     @simple_debug
     def change_grid (self, grid, group_size):
-        self.auto_fills = 0
         self.hints = 0
         self.impossible_hints = 0
         self.trackers = {}
@@ -474,8 +472,6 @@ class SudokuGameDisplay (SudokuNumberGrid, gobject.GObject):
         for coords, val in changed:
             self.add_value(coords[0], coords[1], val)
             retval.append((coords[0], coords[1], val))
-        if retval:
-            self.auto_fills += 1
         if self.grid.check_for_completeness():
             self.emit('puzzle-finished')
         return retval
diff --git a/gnome-sudoku/src/lib/main.py b/gnome-sudoku/src/lib/main.py
index 119cb2d..0cc33fb 100644
--- a/gnome-sudoku/src/lib/main.py
+++ b/gnome-sudoku/src/lib/main.py
@@ -55,8 +55,6 @@ def inactivate_new_game_etc (fun):
             '/MenuBar/Settings/AlwaysShowPossible',
             '/MenuBar/Settings/ShowImpossibleImplications',
             '/MenuBar/Tools/ShowPossible',
-            '/MenuBar/Tools/AutofillCurrentSquare',
-            '/MenuBar/Tools/Autofill',
             '/MenuBar/Tools/ClearTopNotes',
             '/MenuBar/Tools/ClearBottomNotes',
             '/MenuBar/Tools/Tracker',
@@ -108,8 +106,6 @@ class UI (gconf_wrapper.GConfWrapper):
       </menu>
       <menu action="Tools">
         <menuitem action="ShowPossible"/>
-        <menuitem action="AutofillCurrentSquare"/>
-        <menuitem action="Autofill"/>
         <separator/>
         <menuitem action="ClearTopNotes"/>
         <menuitem action="ClearBottomNotes"/>
@@ -249,10 +245,6 @@ class UI (gconf_wrapper.GConfWrapper):
             ('Tools', None, _('_Tools')),
             ('ShowPossible', gtk.STOCK_DIALOG_INFO, _('_Hint'), '<Control>h',
              _('Show which numbers could go in the current square.'), self.show_hint_cb),
-            ('AutofillCurrentSquare', gtk.STOCK_APPLY, _('_Fill'), '<Control>f',
-             _('Automatically fill in the current square if possible.'), self.auto_fill_current_square_cb),
-            ('Autofill', gtk.STOCK_REFRESH, _('Fill _All Squares'), '<Control>a',
-             _('Automatically fill in all squares for which there is only one valid value.'), self.auto_fill_cb),
             ('ClearTopNotes', None, _('Clear _Top Notes'), '<Control>j',
              _("Clear all of the top notes"), self.clear_top_notes_cb),
             ('ClearBottomNotes', None, _('Clear _Bottom Notes'), '<Control>k',
@@ -411,10 +403,6 @@ class UI (gconf_wrapper.GConfWrapper):
                                  "You had %(n)s impossibilities pointed out.",
                                  self.gsd.impossible_hints) % {'n':self.gsd.impossible_hints}
             sublabel += "\n"
-        if self.gsd.auto_fills:
-            sublabel += ngettext("You used the auto-fill %(n)s time.",
-                                 "You used the auto-fill %(n)s times.",
-                                 self.gsd.auto_fills) % {'n':self.gsd.auto_fills}
         self.start_dancer()
         dialog_extras.show_message(_("You win!"), label = _("You win!"),
                                    sublabel = sublabel
@@ -613,29 +601,6 @@ class UI (gconf_wrapper.GConfWrapper):
             self.gsd.hide_impossible_implications()
 
     @simple_debug
-    def auto_fill_cb (self, *args):
-        if not hasattr(self, 'autofilled'):
-            self.autofilled = []
-        if not hasattr(self, 'autofiller'):
-            self.autofiller = Undo.UndoableObject(
-                self.do_auto_fill,
-                self.undo_auto_fill,
-                self.history
-                )
-        self.autofiller.perform()
-
-    def do_auto_fill (self, *args):
-        self.autofilled.append(self.gsd.auto_fill())
-
-    def undo_auto_fill (self, *args):
-        for entry in self.autofilled.pop():
-            self.gsd.remove(entry[0], entry[1], do_removal = True)
-
-    @simple_debug
-    def auto_fill_current_square_cb (self, *args):
-        self.gsd.auto_fill_current_entry()
-
-    @simple_debug
     def setup_tracker_interface (self):
         self.trackers = {}
         self.tracker_ui = TrackerBox(self)
diff --git a/gnome-sudoku/src/lib/saver.py b/gnome-sudoku/src/lib/saver.py
index 8e15f04..06bd441 100644
--- a/gnome-sudoku/src/lib/saver.py
+++ b/gnome-sudoku/src/lib/saver.py
@@ -6,7 +6,6 @@ from gettext import gettext as _
 
 SAVE_ATTRIBUTES = [('gsd.hints'),
                    ('gsd.impossible_hints'),
-                   ('gsd.auto_fills'),
                    ('timer.__absolute_start_time__'),
                    ('timer.active_time'),
                    ('timer.total_time'),



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