~kroq-gar78/ubuntu/precise/gnome-control-center/fix-885947

« back to all changes in this revision

Viewing changes to debian/patches/113_at_properties_add_visual_bell.patch

  • Committer: Bazaar Package Importer
  • Author(s): Rodrigo Moya
  • Date: 2011-05-17 10:47:27 UTC
  • mfrom: (0.1.11 experimental) (1.1.45 upstream)
  • Revision ID: james.westby@ubuntu.com-20110517104727-lqel6m8vhfw5jby1
Tags: 1:3.0.1.1-1ubuntu1
* Rebase on Debian, remaining Ubuntu changes:
* debian/control:
  - Build-Depend on hardening-wrapper, dpkg-dev and dh-autoreconf
  - Add dependency on ubuntu-system-service
  - Remove dependency on gnome-icon-theme-symbolic
  - Move dependency on apg, gnome-icon-theme-symbolic and accountsservice to
    be a Recommends: until we get them in main
* debian/rules:
  - Use autoreconf
  - Add binary-post-install rule for gnome-control-center-data
  - Run dh-autoreconf
* debian/gnome-control-center.dirs:
* debian/gnome-control-center.links:
  - Add a link to the control center shell for indicators
* debian/patches/00_disable-nm.patch:
  - Temporary patch to disable building with NetworkManager until we get
    the new one in the archive
* debian/patches/01_git_remove_gettext_calls.patch:
  - Remove calls to AM_GNU_GETTEXT, IT_PROG_INTLTOOL should be enough
* debian/patches/01_git_kill_warning.patch:
  - Kill warning
* debian/patches/50_ubuntu_systemwide_prefs.patch:
  - Ubuntu specific proxy preferences
* debian/patches/51_ubuntu_system_keyboard.patch:
  - Implement the global keyboard spec at https://wiki.ubuntu.com/DefaultKeyboardSettings

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Index: gnome-control-center-2.30.1/capplets/accessibility/at-properties/at-enable-dialog.ui
2
 
===================================================================
3
 
--- gnome-control-center-2.30.1.orig/capplets/accessibility/at-properties/at-enable-dialog.ui   2010-08-20 20:10:39.451730011 -0400
4
 
+++ gnome-control-center-2.30.1/capplets/accessibility/at-properties/at-enable-dialog.ui        2010-08-20 20:14:55.139510013 -0400
5
 
@@ -120,6 +120,28 @@
6
 
                                 <property name="position">2</property>
7
 
                               </packing>
8
 
                             </child>
9
 
+                            <child>
10
 
+                              <object class="GtkCheckButton" id="at_visual_bell_toggle">
11
 
+                                <property name="visible">True</property>
12
 
+                                <property name="can_focus">True</property>
13
 
+                                <property name="label" translatable="yes">Enable _visual system bell</property>
14
 
+                                <property name="use_underline">True</property>
15
 
+                                <property name="draw_indicator">True</property>
16
 
+                                <accessibility>
17
 
+                                  
18
 
+                                </accessibility>
19
 
+                                <child internal-child="accessible">
20
 
+                                  <object class="AtkObject" id="a11y-at_visual_bell_toggle1">
21
 
+                                    <property name="AtkObject::accessible_description" translatable="yes">Changes to visual system bell take effect immediately.</property>
22
 
+                                  </object>
23
 
+                                </child>
24
 
+                              </object>
25
 
+                              <packing>
26
 
+                                <property name="expand">False</property>
27
 
+                                <property name="fill">False</property>
28
 
+                                <property name="position">3</property>
29
 
+                              </packing>
30
 
+                            </child>
31
 
                           </object>
32
 
                           <packing>
33
 
                             <property name="position">1</property>
34
 
Index: gnome-control-center-2.30.1/capplets/accessibility/at-properties/main.c
35
 
===================================================================
36
 
--- gnome-control-center-2.30.1.orig/capplets/accessibility/at-properties/main.c        2010-08-20 20:15:08.126000011 -0400
37
 
+++ gnome-control-center-2.30.1/capplets/accessibility/at-properties/main.c     2010-08-20 20:28:08.716100014 -0400
38
 
@@ -23,6 +23,8 @@
39
 
 #define ACCESSIBILITY_KEY_DIR   "/desktop/gnome/interface"
40
 
 #define GKSU_NO_GRAB_KEY        "/apps/gksu/disable-grab"
41
 
 #define GKSU_NO_GRAB_KEY_DIR    "/apps/gksu"
42
 
+#define VISUAL_BELL_KEY         "/apps/metacity/general/visual_bell"
43
 
+#define VISUAL_BELL_KEY_DIR     "/apps/metacity/general"
44
 
 
45
 
 static gboolean initial_state;
46
 
 
47
 
@@ -248,6 +250,41 @@
48
 
        g_object_unref (client);
49
 
 }
50
 
 
51
 
+static void
52
 
+at_visual_bell_update  (GConfClient *client,
53
 
+                        GtkBuilder  *builder)
54
 
+{
55
 
+       gboolean is_enabled = gconf_client_get_bool (client, VISUAL_BELL_KEY, NULL);
56
 
+       GObject *button = gtk_builder_get_object (builder, "at_visual_bell_toggle");
57
 
+       
58
 
+       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
59
 
+                                     is_enabled);
60
 
+}
61
 
+
62
 
+
63
 
+static void
64
 
+at_visual_bell_changed (GConfClient *client,
65
 
+                        guint        cnxn_id,
66
 
+                        GConfEntry  *entry,
67
 
+                        gpointer     user_data)
68
 
+{
69
 
+       at_visual_bell_update (client, user_data); 
70
 
+}
71
 
+
72
 
+
73
 
+static void
74
 
+at_visual_bell_toggled (GtkToggleButton *toggle_button, 
75
 
+                        GtkBuilder      *builder)
76
 
+{
77
 
+       GConfClient *client = gconf_client_get_default ();
78
 
+       gboolean is_enabled = gtk_toggle_button_get_active (toggle_button);
79
 
+       
80
 
+       gconf_client_set_bool (client, VISUAL_BELL_KEY,
81
 
+                              is_enabled,
82
 
+                              NULL);
83
 
+       g_object_unref (client);
84
 
+}
85
 
+
86
 
 
87
 
 static void
88
 
 setup_dialog (GtkBuilder *builder)
89
 
@@ -279,6 +316,28 @@
90
 
         at_gksudo_changed,
91
 
         builder, NULL, NULL);
92
 
             
93
 
+
94
 
+    // Visual bell toggle
95
 
+    gconf_client_add_dir (client, VISUAL_BELL_KEY_DIR, 
96
 
+                          GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
97
 
+    
98
 
+    object = gtk_builder_get_object (builder, "at_visual_bell_toggle");
99
 
+        
100
 
+    g_signal_connect (object, "toggled",
101
 
+                      G_CALLBACK (at_visual_bell_toggled),   
102
 
+                      builder);
103
 
+
104
 
+    peditor = gconf_peditor_new_boolean (NULL, VISUAL_BELL_KEY,
105
 
+                                         GTK_WIDGET (object),
106
 
+                                         NULL);     
107
 
+        
108
 
+    at_visual_bell_update (client, builder);
109
 
+       
110
 
+    gconf_client_notify_add (client, VISUAL_BELL_KEY_DIR,
111
 
+        at_visual_bell_changed,
112
 
+        builder, NULL, NULL);
113
 
+
114
 
+
115
 
        gconf_client_add_dir (client, ACCESSIBILITY_KEY_DIR,
116
 
                              GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
117