Beispiel #1
0
 def stop_game(self):
     if self.gsd.grid and self.gsd.grid.is_changed() and (not self.won):
         try:
             if dialog_extras.show_boolean_dialog(label=_("Save game before closing?")):
                 self.save_game(self)
         except dialog_extras.UserCancelledError:
             return
         self.do_stop()
Beispiel #2
0
 def new_cb (self, *args):
     if (self.gsd.grid and self.gsd.grid.is_changed() and not self.won):
         try:
             if dialog_extras.show_boolean_dialog(
                 label = _("Save this game before starting new one?"),
                 custom_yes = _("_Save game for later"),
                 custom_no = _("_Abandon game"),
                 ):
                 self.save_game()
             else:
                 self.sudoku_tracker.abandon_game(self)
         except dialog_extras.UserCancelledError:
             # User cancelled new game
             return
     self.do_stop()
     self.select_game()