[Xfce4-commits] [apps/xfce4-screensaver] 01/01: Move the root warning to a GtkInfoBar

noreply at xfce.org noreply at xfce.org
Mon Oct 29 01:56:55 CET 2018


This is an automated email from the git hooks/post-receive script.

b   l   u   e   s   a   b   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-screensaver.

commit cd5a6610c1306586321d2f3e72f02131096e951d
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Sun Oct 28 20:56:50 2018 -0400

    Move the root warning to a GtkInfoBar
---
 NEWS                                 |   1 +
 src/xfce4-screensaver-preferences.c  |  12 ++--
 src/xfce4-screensaver-preferences.ui | 116 +++++++++++++++++++++++++++++------
 3 files changed, 105 insertions(+), 24 deletions(-)

diff --git a/NEWS b/NEWS
index 4a3ce7d..860d512 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@
   - Support color settings for Xfdesktop 4.12
   - Fallback to the Xfdesktop default color background (dark blue)
   - UI files are now compiled and included in the binaries
+  - Root warning is now an InfoBar to make it more visible
 - Bug Fixes:
   - Fix crash with no background placement, fix color settings (Xfce #14769)
   - Redraw the screensaver on monitor configuration events (Xfce #14796)
diff --git a/src/xfce4-screensaver-preferences.c b/src/xfce4-screensaver-preferences.c
index e2bca5c..95557ce 100644
--- a/src/xfce4-screensaver-preferences.c
+++ b/src/xfce4-screensaver-preferences.c
@@ -1279,15 +1279,15 @@ static void
 setup_for_root_user (void)
 {
     GtkWidget *lock_checkbox;
-    GtkWidget *label;
+    GtkWidget *infobar;
 
     lock_checkbox = GTK_WIDGET (gtk_builder_get_object (builder, "lock_checkbox"));
-    label = GTK_WIDGET (gtk_builder_get_object (builder, "root_warning_label"));
+    infobar = GTK_WIDGET (gtk_builder_get_object (builder, "root_warning_infobar"));
 
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lock_checkbox), FALSE);
     gtk_widget_set_sensitive (lock_checkbox, FALSE);
 
-    gtk_widget_show (label);
+    gtk_widget_show (infobar);
 }
 
 static void
@@ -1526,7 +1526,7 @@ init_capplet (void)
     GtkWidget *label;
     GtkWidget *enabled_checkbox;
     GtkWidget *lock_checkbox;
-    GtkWidget *root_warning_label;
+    GtkWidget *root_warning_infobar;
     GtkWidget *preview_button;
     GtkWidget *gpm_button;
     GtkWidget *fullscreen_preview_window;
@@ -1573,7 +1573,7 @@ init_capplet (void)
     activate_delay_hbox         = GTK_WIDGET (gtk_builder_get_object (builder, "activate_delay_hbox"));
     enabled_checkbox            = GTK_WIDGET (gtk_builder_get_object (builder, "enable_checkbox"));
     lock_checkbox               = GTK_WIDGET (gtk_builder_get_object (builder, "lock_checkbox"));
-    root_warning_label          = GTK_WIDGET (gtk_builder_get_object (builder, "root_warning_label"));
+    root_warning_infobar        = GTK_WIDGET (gtk_builder_get_object (builder, "root_warning_infobar"));
     preview_button              = GTK_WIDGET (gtk_builder_get_object (builder, "preview_button"));
     gpm_button                  = GTK_WIDGET (gtk_builder_get_object (builder, "gpm_button"));
     fullscreen_preview_window   = GTK_WIDGET (gtk_builder_get_object (builder, "fullscreen_preview_window"));
@@ -1587,7 +1587,7 @@ init_capplet (void)
     label = GTK_WIDGET (gtk_builder_get_object (builder, "savers_label"));
     gtk_label_set_mnemonic_widget (GTK_LABEL (label), treeview);
 
-    gtk_widget_set_no_show_all (root_warning_label, TRUE);
+    gtk_widget_set_no_show_all (root_warning_infobar, TRUE);
     widget_set_best_visual (preview);
 
     if (! is_program_in_path (GPM_COMMAND))
diff --git a/src/xfce4-screensaver-preferences.ui b/src/xfce4-screensaver-preferences.ui
index 41619d8..4a0b157 100644
--- a/src/xfce4-screensaver-preferences.ui
+++ b/src/xfce4-screensaver-preferences.ui
@@ -305,6 +305,99 @@ Simon Steinbeiß
             <property name="orientation">vertical</property>
             <property name="spacing">12</property>
             <child>
+              <object class="GtkInfoBar" id="root_warning_infobar">
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="message_type">warning</property>
+                <child internal-child="action_area">
+                  <object class="GtkButtonBox">
+                    <property name="can_focus">False</property>
+                    <property name="spacing">6</property>
+                    <property name="layout_style">end</property>
+                    <child>
+                      <placeholder/>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child internal-child="content_area">
+                  <object class="GtkBox">
+                    <property name="can_focus">False</property>
+                    <property name="spacing">16</property>
+                    <child>
+                      <object class="GtkImage">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="pixel_size">24</property>
+                        <property name="icon_name">dialog-warning</property>
+                        <property name="icon_size">3</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkBox">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="orientation">vertical</property>
+                        <child>
+                          <object class="GtkLabel">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">Running as root</property>
+                            <property name="xalign">0</property>
+                            <attributes>
+                              <attribute name="weight" value="bold"/>
+                            </attributes>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">The screen will not be locked for the root user.</property>
+                            <property name="xalign">0</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">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
               <object class="GtkInfoBar" id="logind_lid_infobar">
                 <property name="can_focus">False</property>
                 <property name="no_show_all">True</property>
@@ -341,6 +434,7 @@ Simon Steinbeiß
                       <object class="GtkImage">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="pixel_size">24</property>
                         <property name="icon_name">dialog-information</property>
                         <property name="icon_size">3</property>
                       </object>
@@ -360,7 +454,7 @@ Simon Steinbeiß
                           <object class="GtkLabel">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="label" translatable="yes">Xfce Power Manager is not configured to handle laptop lid events.</property>
+                            <property name="label" translatable="yes">Xfce Power Manager is not configured to handle laptop lid events</property>
                             <property name="xalign">0</property>
                             <attributes>
                               <attribute name="weight" value="bold"/>
@@ -403,7 +497,7 @@ Simon Steinbeiß
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">True</property>
-                <property name="position">0</property>
+                <property name="position">1</property>
               </packing>
             </child>
             <child>
@@ -504,7 +598,7 @@ Simon Steinbeiß
               <packing>
                 <property name="expand">True</property>
                 <property name="fill">True</property>
-                <property name="position">1</property>
+                <property name="position">2</property>
               </packing>
             </child>
             <child>
@@ -612,20 +706,6 @@ Simon Steinbeiß
                                     <property name="position">2</property>
                                   </packing>
                                 </child>
-                                <child>
-                                  <object class="GtkLabel" id="root_warning_label">
-                                    <property name="can_focus">False</property>
-                                    <property name="halign">start</property>
-                                    <property name="label" translatable="yes"><b>Warning: the screen will not be locked for the root user.</b></property>
-                                    <property name="use_markup">True</property>
-                                    <property name="wrap">True</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">False</property>
-                                    <property name="position">3</property>
-                                  </packing>
-                                </child>
                               </object>
                               <packing>
                                 <property name="expand">True</property>
@@ -658,7 +738,7 @@ Simon Steinbeiß
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">True</property>
-                <property name="position">2</property>
+                <property name="position">3</property>
               </packing>
             </child>
           </object>

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list