Commit 1b3ca448 authored by Arnaud B.'s avatar Arnaud B. Committed by Michael Catanzaro
Browse files

Move the sound switch to the app-menu.

https://bugzilla.gnome.org/show_bug.cgi?id=664976
parent 8e6a8cb7
......@@ -7,6 +7,10 @@
<attribute name="label" translatable="yes">_Preferences</attribute>
<attribute name="action">app.preferences</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Sound</attribute>
<attribute name="action">app.sound</attribute>
</item>
</section>
<section>
<item>
......
......@@ -41,20 +41,6 @@
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="sound-button">
<property name="visible">True</property>
<property name="label" translatable="yes">E_nable sounds</property>
<property name="use-underline">True</property>
<property name="sensitive">True</property>
</object>
<packing>
<property name="width">2</property>
<property name="height">1</property>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
</object>
<object class="GtkListStore" id="liststore-theme">
<columns>
......
......@@ -164,6 +164,7 @@ public class Iagno : Gtk.Application
add_action_entries (app_actions, this);
set_accels_for_action ("app.new-game", {"<Primary>n"});
set_accels_for_action ("app.undo-move", {"<Primary>z"});
add_action (settings.create_action ("sound"));
/* TODO bugs when changing manually the gsettings key (not for sound);
* solving this bug may remove the need of the hack in three parts */
add_action (settings.create_action ("play-as"));
......@@ -510,12 +511,6 @@ public class Iagno : Gtk.Application
}
}
private void sound_select (Gtk.ToggleButton widget)
{
var play_sounds = widget.get_active ();
settings.set_boolean ("sound", play_sounds);
}
private bool propbox_close_cb (Gtk.Widget widget, Gdk.EventAny event)
{
widget.hide ();
......@@ -590,12 +585,5 @@ public class Iagno : Gtk.Application
theme_combo.set_active_iter (iter);
}
theme_combo.changed.connect (theme_changed_cb);
var enable_sounds_button = builder.get_object ("sound-button") as Gtk.CheckButton;
settings.changed["sound"].connect (() => {
enable_sounds_button.set_active (settings.get_boolean ("sound"));
});
enable_sounds_button.set_active (settings.get_boolean ("sound"));
enable_sounds_button.toggled.connect (sound_select);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment