[gnome-control-center] Brightness & Lock: add Show Notifications setting



commit 11ad5954c62d3ac083d0a2cde3fd7d3db07c059e
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Tue Jul 10 16:17:15 2012 +0200

    Brightness & Lock: add Show Notifications setting
    
    Add a switch to control the visibility of notifications when
    the screen is locked.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=658660

 panels/screen/cc-screen-panel.c |   12 +++++++++++
 panels/screen/screen.ui         |   42 ++++++++++++++++++++++++++++++++++++--
 2 files changed, 51 insertions(+), 3 deletions(-)
---
diff --git a/panels/screen/cc-screen-panel.c b/panels/screen/cc-screen-panel.c
index ce8d360..b2f0647 100644
--- a/panels/screen/cc-screen-panel.c
+++ b/panels/screen/cc-screen-panel.c
@@ -539,6 +539,18 @@ cc_screen_panel_init (CcScreenPanel *self)
                    widget, "sensitive",
                    G_SETTINGS_BIND_GET);
 
+  widget = WID ("show_notifications_switch");
+  g_settings_bind (self->priv->lock_settings,
+                   "show-notifications",
+                   widget, "active",
+                   G_SETTINGS_BIND_DEFAULT);
+
+  widget = WID ("show_notifications_box");
+  g_settings_bind (self->priv->lock_settings,
+                   "lock-enabled",
+                   widget, "sensitive",
+                   G_SETTINGS_BIND_GET);
+
   update_lock_screen_sensitivity (self);
 
   widget = WID ("screen_vbox");
diff --git a/panels/screen/screen.ui b/panels/screen/screen.ui
index 86c645e..dcb5539 100644
--- a/panels/screen/screen.ui
+++ b/panels/screen/screen.ui
@@ -1,7 +1,6 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <requires lib="gtk+" version="2.16"/>
-  <!-- interface-naming-policy project-wide -->
+  <!-- interface-requires gtk+ 3.0 -->
   <object class="GtkListStore" id="lock_liststore">
     <columns>
       <!-- column-name name -->
@@ -339,6 +338,43 @@
                             <property name="position">2</property>
                           </packing>
                         </child>
+                        <child>
+                          <object class="GtkBox" id="show_notifications_box">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <child>
+                              <object class="GtkLabel" id="show_notifications_label">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="xalign">0</property>
+                                <property name="label" translatable="yes">Notifications when locked</property>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkSwitch" id="show_notifications_switch">
+                                <property name="use_action_appearance">False</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="valign">center</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="expand">True</property>
+                            <property name="fill">True</property>
+                            <property name="position">3</property>
+                          </packing>
+                        </child>
                       </object>
                     </child>
                   </object>



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