[gnome-nibbles] Makes Preferences menu not openable during game runtime Closes: bgo#531825



commit 91ddb6121c3028fda411bf7331e31146ad6585b4
Author: Bryan Quigley <bryanquigs src gnome org>
Date:   Fri Sep 13 00:20:03 2013 -0400

    Makes Preferences menu not openable during game runtime
    Closes: bgo#531825

 src/main.c        |    2 +-
 src/preferences.c |   20 --------------------
 2 files changed, 1 insertions(+), 21 deletions(-)
---
diff --git a/src/main.c b/src/main.c
index 6d200c5..d28ec89 100644
--- a/src/main.c
+++ b/src/main.c
@@ -255,7 +255,7 @@ new_game (void)
   gtk_action_set_sensitive (pause_action, TRUE);
   gtk_action_set_sensitive (end_game_action, TRUE);
   gtk_action_set_sensitive (new_game_action, FALSE);
-  gtk_action_set_sensitive (preferences_action, TRUE);
+  gtk_action_set_sensitive (preferences_action, FALSE);
 
   if (game_running ()) {
     main_id = 0;
diff --git a/src/preferences.c b/src/preferences.c
index 4d75cd2..519a439 100644
--- a/src/preferences.c
+++ b/src/preferences.c
@@ -220,7 +220,6 @@ gnibbles_preferences_cb (GtkWidget * widget, gpointer data)
   GtkWidget *controls;
   gchar *buffer;
   gint i;
-  gint running = 0;
 
   if (pref_dialog) {
     gtk_window_present (GTK_WINDOW (pref_dialog));
@@ -232,9 +231,6 @@ gnibbles_preferences_cb (GtkWidget * widget, gpointer data)
     gtk_action_activate (pause_action);
   }
 
-  if (game_running ())
-    running = 1;
-
   pref_dialog = gtk_dialog_new_with_buttons (_("Nibbles Preferences"),
                                              GTK_WINDOW (window), 0,
                                              GTK_STOCK_CLOSE,
@@ -323,8 +319,6 @@ gnibbles_preferences_cb (GtkWidget * widget, gpointer data)
     gtk_check_button_new_with_mnemonic (_("_Play levels in random order"));
   gtk_box_pack_start (GTK_BOX (vbox_options), button, FALSE, FALSE, 0);
 
-  if (running)
-    gtk_widget_set_sensitive (button, FALSE);
   if (properties->random)
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
   g_signal_connect (GTK_WIDGET (button), "toggled", G_CALLBACK
@@ -333,8 +327,6 @@ gnibbles_preferences_cb (GtkWidget * widget, gpointer data)
   button = gtk_check_button_new_with_mnemonic (_("_Enable fake bonuses"));
   gtk_box_pack_start (GTK_BOX (vbox_options), button, FALSE, FALSE, 0);
 
-  if (running)
-    gtk_widget_set_sensitive (button, FALSE);
   if (properties->fakes)
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
   g_signal_connect (GTK_WIDGET (button), "toggled", G_CALLBACK
@@ -360,8 +352,6 @@ gnibbles_preferences_cb (GtkWidget * widget, gpointer data)
 
   if (properties->random)
     gtk_widget_set_sensitive (GTK_WIDGET (label2), FALSE);
-  if (running)
-    gtk_widget_set_sensitive (GTK_WIDGET (label2), FALSE);
   gtk_widget_set_hexpand (label2, TRUE);
   gtk_grid_attach (GTK_GRID (grid2), label2, 0, 0, 1, 1);
 
@@ -376,8 +366,6 @@ gnibbles_preferences_cb (GtkWidget * widget, gpointer data)
 
   if (properties->random)
     gtk_widget_set_sensitive (GTK_WIDGET (levelspinner), FALSE);
-  if (running)
-    gtk_widget_set_sensitive (GTK_WIDGET (levelspinner), FALSE);
   gtk_grid_attach (GTK_GRID (grid2), levelspinner, 1, 0, 1, 1);
   g_signal_connect (GTK_ADJUSTMENT (adjustment), "value_changed",
                     G_CALLBACK (start_level_cb), levelspinner);
@@ -387,8 +375,6 @@ gnibbles_preferences_cb (GtkWidget * widget, gpointer data)
 
   gtk_widget_set_hexpand (label2, TRUE);
   gtk_grid_attach (GTK_GRID (grid2), label2, 0, 1, 1, 1);
-  if (running)
-    gtk_widget_set_sensitive (label2, FALSE);
 
   adjustment = gtk_adjustment_new ((gfloat) properties->human, 0.0,
                                    NUMWORMS, 1.0, 1.0, 0.0);
@@ -398,8 +384,6 @@ gnibbles_preferences_cb (GtkWidget * widget, gpointer data)
   gtk_label_set_mnemonic_widget (GTK_LABEL (label2), num_human);
 
   gtk_grid_attach (GTK_GRID (grid2), num_human, 1, 1, 1, 1);
-  if (running)
-    gtk_widget_set_sensitive (num_human, FALSE);
   g_signal_connect (GTK_ADJUSTMENT (adjustment), "value_changed",
                     G_CALLBACK (num_worms_cb), num_human);
 
@@ -408,8 +392,6 @@ gnibbles_preferences_cb (GtkWidget * widget, gpointer data)
 
   gtk_widget_set_hexpand (label2, TRUE);  
   gtk_grid_attach (GTK_GRID (grid2), label2, 0, 2, 1, 1);
-  if (running)
-    gtk_widget_set_sensitive (label2, FALSE);
 
   adjustment = gtk_adjustment_new ((gfloat) properties->ai, 0.0,
                                    NUMWORMS, 1.0, 1.0, 0.0);
@@ -419,8 +401,6 @@ gnibbles_preferences_cb (GtkWidget * widget, gpointer data)
   gtk_label_set_mnemonic_widget (GTK_LABEL (label2), num_ai);
 
   gtk_grid_attach (GTK_GRID (grid2), num_ai, 1, 2, 1, 1);
-  if (running)
-    gtk_widget_set_sensitive (num_ai, FALSE);
   g_signal_connect (GTK_ADJUSTMENT (adjustment), "value_changed",
                     G_CALLBACK (num_worms_cb), num_ai);
 


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