[gnome-games/sudoku-tube] Make dancer work
- From: Zhang Sen <zhangsen src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-games/sudoku-tube] Make dancer work
- Date: Fri, 10 Jul 2009 23:32:38 +0000 (UTC)
commit 59fb09fc58cfb7392b51fc481de9ff68d21489d5
Author: Zhang Sen <zh jesse gmail com>
Date: Fri Jul 10 22:56:01 2009 +0800
Make dancer work
Disable self.sudoku_tracker.finish_game(self), temporarily
gnome-sudoku/src/lib/main.py | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/gnome-sudoku/src/lib/main.py b/gnome-sudoku/src/lib/main.py
index 8bdda16..e4680bd 100644
--- a/gnome-sudoku/src/lib/main.py
+++ b/gnome-sudoku/src/lib/main.py
@@ -120,7 +120,6 @@ class UI (gconf_wrapper.GConfWrapper):
if game_type == game_selector.NewOrSavedGameSelector.NEW_GAME:
self._main_model = gsudoku.SudokuModel(puzzle, 9)
self._main_grid_vew.connect_to_model(self._main_model)
-# self._main_grid_vew.connect('puzzle-finished', self.you_win_callback)
elif game_type == game_selector.NewOrSavedGameSelector.SAVED_GAME:
saver.open_game(self, puzzle)
self._post_open_setup()
@@ -194,6 +193,7 @@ class UI (gconf_wrapper.GConfWrapper):
tracker_ui_container = self.builder.get_object("tracker_ui_container")
self._main_grid_vew = gsudoku.SudokuView(group_size=9)
+ self._main_grid_vew.connect('puzzle-finished', self.you_win_callback)
main_grid_container.pack_start(self._main_grid_vew, padding=6)
self.tracker_ui = tracker_box.TrackerBox(self)
@@ -315,24 +315,27 @@ class UI (gconf_wrapper.GConfWrapper):
# increase difficulty for next time.
self.gconf['difficulty'] = self.gconf['difficulty'] + 0.1
self.timer.finish_timing()
- self.sudoku_tracker.finish_game(self)
+# self.sudoku_tracker.finish_game(self)
sublabel = _("You completed the puzzle in %(totalTime)s (%(activeTime)s active)") % {'totalTime': self.timer.total_time_string(),
'activeTime': self.timer.active_time_string()
}
sublabel += "\n"
- sublabel += ngettext("You got %(n)s hint", "You got %(n)s hints", self.gsd.hints) % {'n':self.gsd.hints}
+ sublabel += ngettext("You got %(n)s hint", "You got %(n)s hints",
+ self._main_model.hints) % {'n': self._main_model.hints}
sublabel += "\n"
- if self.gsd.impossible_hints:
+ if self._main_model.impossible_hints:
sublabel += ngettext("You had %(n)s impossibility pointed out.",
"You had %(n)s impossibilities pointed out.",
- self.gsd.impossible_hints) % {'n':self.gsd.impossible_hints}
+ self._main_model.impossible_hints) % {
+ 'n': self._main_model.impossible_hints}
sublabel += "\n"
- if self.gsd.auto_fills:
+ if self._main_model.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._main_model.auto_fills) % {
+ 'n':self._main_model.auto_fills}
import dancer
- self.dancer = dancer.GridDancer(self.gsd)
+ self.dancer = dancer.GridDancer(self._main_grid_vew)
self.dancer.start_dancing()
dialog_extras.show_message(_("You win!"), label = _("You win!"),
sublabel = sublabel
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]