[five-or-more] Add a new game button to the scores dialog



commit 6381c1692fa04add436ac42042377c7466232772
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sun Feb 16 11:05:44 2014 -0600

    Add a new game button to the scores dialog

 src/glines.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/glines.c b/src/glines.c
index 2e5244c..ecd4120 100644
--- a/src/glines.c
+++ b/src/glines.c
@@ -470,9 +470,12 @@ static void
 show_scores (gint pos)
 {
   static GtkWidget *dialog;
+  gint result;
 
   if (dialog == NULL) {
     dialog = games_scores_dialog_new (GTK_WINDOW (app), highscores, _("Five or More Scores"));
+    games_scores_dialog_set_buttons (GAMES_SCORES_DIALOG (dialog),
+                                     GAMES_SCORES_NEW_GAME_BUTTON | GAMES_SCORES_CLOSE_BUTTON);
     games_scores_dialog_set_category_description (GAMES_SCORES_DIALOG
                                                   (dialog), _("_Board size:"));
   }
@@ -482,8 +485,13 @@ show_scores (gint pos)
   }
 
   gtk_window_present (GTK_WINDOW (dialog));
-  gtk_dialog_run (GTK_DIALOG (dialog));
+  result = gtk_dialog_run (GTK_DIALOG (dialog));
   gtk_widget_hide (dialog);
+
+  if (result == GTK_RESPONSE_ACCEPT) {
+    reset_game ();
+    start_game ();
+  }
 }
 
 static void


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