[gnome-sudoku] Add <ctrl>N and <ctrl>R shortcuts.
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-sudoku] Add <ctrl>N and <ctrl>R shortcuts.
- Date: Thu, 4 Sep 2014 21:39:01 +0000 (UTC)
commit 44e487ee738ebe3c844b674283f8baa70d2fb44d
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Sat Aug 30 19:56:08 2014 +0200
Add <ctrl>N and <ctrl>R shortcuts.
https://bugzilla.gnome.org/show_bug.cgi?id=735710
src/gnome-sudoku.vala | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/gnome-sudoku.vala b/src/gnome-sudoku.vala
index c24d532..b86f957 100644
--- a/src/gnome-sudoku.vala
+++ b/src/gnome-sudoku.vala
@@ -106,6 +106,8 @@ public class Sudoku : Gtk.Application
add_accelerator ("<Primary>z", "app.undo", null);
add_accelerator ("<Primary><Shift>z", "app.redo", null);
+ add_accelerator ("<Primary>r", "app.reset", null);
+ add_accelerator ("<Primary>n", "app.new-game", null);
add_accelerator ("<Primary>p", "app.print", null);
add_accelerator ("<Primary>q", "app.quit", null);
add_accelerator ("F1", "app.help", null);
@@ -211,15 +213,14 @@ public class Sudoku : Gtk.Application
{
undo_action.set_enabled (false);
redo_action.set_enabled (false);
- clear_action.set_enabled (!board.is_empty ());
if (view != null)
game_box.remove (view);
header_bar_subtitle = board.difficulty_category.to_string ();
- back_cb ();
game = new SudokuGame (board);
+ back_cb ();
game.timer.start ();
@@ -280,6 +281,7 @@ public class Sudoku : Gtk.Application
private void show_new_game_screen ()
{
main_stack.set_visible_child_name ("start_box");
+ clear_action.set_enabled (false);
back_button.visible = game != null;
undo_redo_box.visible = false;
header_bar_subtitle = header_bar.get_subtitle ();
@@ -333,6 +335,7 @@ public class Sudoku : Gtk.Application
private void back_cb ()
{
main_stack.set_visible_child_name ("frame");
+ clear_action.set_enabled (!game.board.is_empty ());
back_button.visible = false;
undo_redo_box.visible = true;
header_bar.set_subtitle (header_bar_subtitle);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]