]> Pileus Git - ~andy/gtk/commitdiff
Add event sound settings. Patch by Lennart Pöttering.
authorMatthias Clasen <matthiasc@src.gnome.org>
Tue, 1 Jul 2008 06:22:04 +0000 (06:22 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 1 Jul 2008 06:22:04 +0000 (06:22 +0000)
        * gdk/x11/gdksettings.c:
        * gtk/gtksettings.c: Add event sound settings.
        Patch by Lennart Pöttering.

svn path=/trunk/; revision=20717

ChangeLog
gdk/x11/gdksettings.c
gtk/gtksettings.c

index e57c8afbcb358224f29f047ad94528f0ea8bae34..dbf85e48a104164a502806d239c8791fa7b7f762 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-07-01  Matthias Clasen  <mclasen@redhat.com>
+
+       539790 – [PATCH] Please add three new settings to GtkSettings
+
+       * gdk/x11/gdksettings.c: 
+       * gtk/gtksettings.c: Add event sound settings.
+       Patch by Lennart Pöttering.
+
 2008-07-01  Matthias Clasen  <mclasen@redhat.com>
 
        Bug 434535 – printoperation's create_surface doesn't check temp file
index 22878ab253e4374e80028510780230d8267c7715..0e98816bf01a6548381ada4e48873e8e988bbe8e 100644 (file)
@@ -70,7 +70,10 @@ static const char gdk_settings_names[] =
   "Gtk/EnableMnemonics\0"     "gtk-enable-mnemonics\0"
   "Gtk/ScrolledWindowPlacement\0" "gtk-scrolled-window-placement\0"
   "Gtk/IMModule\0"            "gtk-im-module\0"
-  "Fontconfig/Timestamp\0"    "gtk-fontconfig-timestamp\0";
+  "Fontconfig/Timestamp\0"    "gtk-fontconfig-timestamp\0"
+  "Net/SoundThemeName\0"      "gtk-sound-theme-name\0"
+  "Net/EnableInputFeedbackSounds\0" "gtk-enable-input-feedback-sounds\0"
+  "Net/EnableEventSounds\0"  "gtk-enable-event-sounds\0";
 
 
 static const struct
@@ -118,5 +121,8 @@ static const struct
   { 1361, 1381 },
   { 1402, 1430 },
   { 1460, 1473 },
-  { 1487, 1508 }
+  { 1487, 1508 },
+  { 1533, 1552 },
+  { 1573, 1603 },
+  { 1636, 1658 }
 };
index fad288d8b7990cc54d623807a2e4dfc718d7cb1c..40d8ebaafacb770dd780ec48a92c4d086764786e 100644 (file)
@@ -112,7 +112,10 @@ enum {
   PROP_RECENT_FILES_LIMIT,
   PROP_IM_MODULE,
   PROP_RECENT_FILES_MAX_AGE,
-  PROP_FONTCONFIG_TIMESTAMP
+  PROP_FONTCONFIG_TIMESTAMP,
+  PROP_SOUND_THEME_NAME,
+  PROP_ENABLE_INPUT_FEEDBACK_SOUNDS,
+  PROP_ENABLE_EVENT_SOUNDS
 };
 
 
@@ -857,6 +860,71 @@ gtk_settings_class_init (GtkSettingsClass *class)
   
   g_assert (result == PROP_FONTCONFIG_TIMESTAMP);
   
+  /**
+   * GtkSettings:gtk-sound-theme-name:
+   *
+   * The XDG sound theme to use for event sounds.
+   *
+   * See the <ulink url="http://www.freedesktop.org/wiki/Specifications/sound-theme-spec">Sound Theme spec</ulink> 
+   * for more information on event sounds and sound themes.
+   *
+   * GTK+ itself does not support event sounds, you have to use a loadable 
+   * module like the one that comes with libcanberra.
+   *
+   * Since: 2.14
+   */
+  result = settings_install_property_parser (class,
+                                             g_param_spec_string ("gtk-sound-theme-name",
+                                                                  P_("Sound Theme Name"),
+                                                                  P_("XDG sound theme name"),
+                                                                  "freedesktop",
+                                                                  GTK_PARAM_READWRITE),
+                                             NULL);
+  g_assert (result == PROP_SOUND_THEME_NAME);
+
+  /**
+   * GtkSettings:gtk-enable-input-feedback-sounds:
+   *
+   * Whether to play event sounds as feedback to user input.
+   *
+   * See the <ulink url="http://www.freedesktop.org/wiki/Specifications/sound-theme-spec">Sound Theme spec</ulink> 
+   * for more information on event sounds and sound themes.
+   *
+   * GTK+ itself does not support event sounds, you have to use a loadable 
+   * module like the one that comes with libcanberra.
+   *
+   * Since: 2.14
+   */
+  result = settings_install_property_parser (class,
+                                             g_param_spec_boolean ("gtk-enable-input-feedback-sounds",
+                                                                  P_("Aureal Input Feedback"),
+                                                                  P_("Whether to play event sounds as feedback to user input"),
+                                                                  TRUE,
+                                                                  GTK_PARAM_READWRITE),
+                                             NULL);
+  g_assert (result == PROP_ENABLE_INPUT_FEEDBACK_SOUNDS);
+
+  /**
+   * GtkSettings:gtk-enable-event-sounds:
+   *
+   * Whether to play any event sounds at all.
+   *
+   * See the <ulink url="http://www.freedesktop.org/wiki/Specifications/sound-theme-spec">Sound Theme spec</ulink> 
+   * for more information on event sounds and sound themes.
+   *
+   * GTK+ itself does not support event sounds, you have to use a loadable 
+   * module like the one that comes with libcanberra.
+   *
+   * Since: 2.14
+   */
+  result = settings_install_property_parser (class,
+                                             g_param_spec_boolean ("gtk-enable-event-sounds",
+                                                                  P_("Enable Event Sounds"),
+                                                                  P_("Whether to play any event sounds at all"),
+                                                                  TRUE,
+                                                                  GTK_PARAM_READWRITE),
+                                             NULL);
+  g_assert (result == PROP_ENABLE_EVENT_SOUNDS);
 }
 
 static void