[four-in-a-row] Remove Enable Animations preference
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [four-in-a-row] Remove Enable Animations preference
- Date: Fri, 31 Jan 2014 03:52:58 +0000 (UTC)
commit 6fb63a3b4a7b1d0139f71e367d4b28ccb1bb1a54
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Thu Jan 30 21:33:32 2014 -0600
Remove Enable Animations preference
data/org.gnome.four-in-a-row.gschema.xml | 5 ---
src/main.c | 44 +++++++++--------------------
src/prefs.c | 30 +-------------------
src/prefs.h | 1 -
4 files changed, 16 insertions(+), 64 deletions(-)
---
diff --git a/data/org.gnome.four-in-a-row.gschema.xml b/data/org.gnome.four-in-a-row.gschema.xml
index 6caea86..d41d499 100644
--- a/data/org.gnome.four-in-a-row.gschema.xml
+++ b/data/org.gnome.four-in-a-row.gschema.xml
@@ -15,11 +15,6 @@
<summary>Theme ID</summary>
<description>A number specifying the preferred theme.</description>
</key>
- <key name="animate" type="b">
- <default>true</default>
- <summary>Animate</summary>
- <description>Whether or not to use animation.</description>
- </key>
<key name="sound" type="b">
<default>true</default>
<summary>Sound</summary>
diff --git a/src/main.c b/src/main.c
index a37cf9a..7f95a38 100644
--- a/src/main.c
+++ b/src/main.c
@@ -635,14 +635,10 @@ on_game_hint (GSimpleAction *action, GVariant *parameter, gpointer data)
c = playgame (vstr, vboard) - 1;
column_moveto = c;
- if (p.do_animate) {
- while (timeout)
- gtk_main_iteration ();
- anim = ANIM_HINT;
- timeout = g_timeout_add (SPEED_MOVE, (GSourceFunc) on_animate, NULL);
- } else {
- move_cursor (column_moveto);
- }
+ while (timeout)
+ gtk_main_iteration ();
+ anim = ANIM_HINT;
+ timeout = g_timeout_add (SPEED_MOVE, (GSourceFunc) on_animate, NULL);
blink_tile (0, c, gboard[0][c], 6);
@@ -1032,16 +1028,10 @@ process_move (gint c)
}
- if (!p.do_animate) {
- move_cursor (c);
- column_moveto = c;
- process_move2 (c);
- } else {
- column_moveto = c;
- anim = ANIM_MOVE;
- timeout = g_timeout_add (SPEED_MOVE,
- (GSourceFunc) on_animate, GINT_TO_POINTER (c));
- }
+ column_moveto = c;
+ anim = ANIM_MOVE;
+ timeout = g_timeout_add (SPEED_MOVE,
+ (GSourceFunc) on_animate, GINT_TO_POINTER (c));
}
static void
@@ -1051,18 +1041,12 @@ process_move2 (gint c)
r = first_empty_row (c);
if (r > 0) {
-
- if (!p.do_animate) {
- drop_marble (r, c);
- process_move3 (c);
- } else {
- row = 0;
- row_dropto = r;
- anim = ANIM_DROP;
- timeout = g_timeout_add (SPEED_DROP,
- (GSourceFunc) on_animate,
- GINT_TO_POINTER (c));
- }
+ row = 0;
+ row_dropto = r;
+ anim = ANIM_DROP;
+ timeout = g_timeout_add (SPEED_DROP,
+ (GSourceFunc) on_animate,
+ GINT_TO_POINTER (c));
} else {
play_sound (SOUND_COLUMN_FULL);
}
diff --git a/src/prefs.c b/src/prefs.c
index 1556e47..2cc444a 100644
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -51,7 +51,6 @@ static GtkWidget *prefsbox = NULL;
static GtkWidget *combobox1;
static GtkWidget *combobox2;
static GtkWidget *combobox_theme;
-static GtkWidget *checkbutton_animate;
static GtkWidget *checkbutton_sound;
static gint
@@ -77,13 +76,7 @@ settings_changed_cb (GSettings *settings,
const char *key,
gpointer user_data)
{
- if (strcmp (key, "animate") == 0) {
- p.do_animate = g_settings_get_boolean (settings, "animate");
- if (prefsbox == NULL)
- return;
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton_animate),
- p.do_animate);
- } else if (strcmp (key, "sound") == 0) {
+ if (strcmp (key, "sound") == 0) {
p.do_sound = g_settings_get_boolean (settings, "sound");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton_sound),
p.do_sound);
@@ -117,15 +110,6 @@ on_select_theme (GtkComboBox * combo, gpointer data)
g_settings_set_int (settings, "theme-id", id);
}
-
-
-static void
-on_toggle_animate (GtkToggleButton * t, gpointer data)
-{
- p.do_animate = gtk_toggle_button_get_active (t);
- g_settings_set_boolean (settings, "animate", gtk_toggle_button_get_active (t));
-}
-
static void
on_toggle_sound (GtkToggleButton * t, gpointer data)
{
@@ -171,7 +155,6 @@ void
prefs_init (void)
{
p.do_sound = g_settings_get_boolean (settings, "sound");
- p.do_animate = g_settings_get_boolean (settings, "animate");
p.level[PLAYER1] = g_settings_get_int (settings, "player1");
p.level[PLAYER2] = g_settings_get_int (settings, "player2");
p.keypress[MOVE_LEFT] = g_settings_get_int (settings, "key-left");
@@ -298,13 +281,9 @@ prefsbox_open (void)
gtk_label_set_mnemonic_widget (GTK_LABEL (label), combobox_theme);
gtk_grid_attach (GTK_GRID (grid), combobox_theme, 1, 2, 1, 1);
- checkbutton_animate =
- gtk_check_button_new_with_mnemonic (_("Enable _animation"));
- gtk_grid_attach (GTK_GRID (grid), checkbutton_animate, 0, 3, 2, 1);
-
checkbutton_sound =
gtk_check_button_new_with_mnemonic (_("E_nable sounds"));
- gtk_grid_attach (GTK_GRID (grid), checkbutton_sound, 0, 4, 2, 1);
+ gtk_grid_attach (GTK_GRID (grid), checkbutton_sound, 0, 3, 2, 1);
/* keyboard tab */
@@ -322,8 +301,6 @@ prefsbox_open (void)
/* fill in initial values */
gtk_combo_box_set_active (GTK_COMBO_BOX (combobox_theme), p.theme_id);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton_animate),
- p.do_animate);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton_sound),
p.do_sound);
@@ -335,9 +312,6 @@ prefsbox_open (void)
g_signal_connect (G_OBJECT (combobox_theme), "changed",
G_CALLBACK (on_select_theme), NULL);
- g_signal_connect (G_OBJECT (checkbutton_animate), "toggled",
- G_CALLBACK (on_toggle_animate), NULL);
-
g_signal_connect (G_OBJECT (checkbutton_sound), "toggled",
G_CALLBACK (on_toggle_sound), NULL);
diff --git a/src/prefs.h b/src/prefs.h
index e7ad40e..29d2ad9 100644
--- a/src/prefs.h
+++ b/src/prefs.h
@@ -3,7 +3,6 @@
typedef struct _Prefs Prefs;
struct _Prefs {
gboolean do_sound;
- gboolean do_animate;
gint theme_id;
LevelID level[2];
gint keypress[3];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]