[PATCH 1/3] Remove the "Create a home directory" checkbox

David Shea dshea at redhat.com
Tue Jul 15 21:54:29 UTC 2014


No one complained about the checkbox not working, so let's see if anyone
complains about not having it.
---
 pyanaconda/ui/gui/spokes/advanced_user.glade | 90 ++++------------------------
 pyanaconda/ui/gui/spokes/user.py             | 10 +---
 2 files changed, 12 insertions(+), 88 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/advanced_user.glade b/pyanaconda/ui/gui/spokes/advanced_user.glade
index 05f99e7..6648d2e 100644
--- a/pyanaconda/ui/gui/spokes/advanced_user.glade
+++ b/pyanaconda/ui/gui/spokes/advanced_user.glade
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.16.1 -->
+<!-- Generated with glade 3.18.3 -->
 <interface>
   <requires lib="gtk+" version="3.0"/>
   <object class="GtkAdjustment" id="gid">
@@ -89,39 +89,17 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="label2">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="margin_top">8</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">Home Directory</property>
-                <attributes>
-                  <attribute name="weight" value="bold"/>
-                </attributes>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child>
               <object class="GtkBox" id="box2">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="margin_left">16</property>
-                <property name="orientation">vertical</property>
+                <property name="margin_top">3</property>
                 <child>
-                  <object class="GtkCheckButton" id="c_home">
-                    <property name="label" translatable="yes" context="GUI|Advanced User">Create a _home directory for this user.</property>
+                  <object class="GtkLabel" id="l_home">
                     <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="margin_top">4</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes" context="GUI|Advanced User">Home _directory:</property>
                     <property name="use_underline">True</property>
-                    <property name="xalign">0</property>
-                    <property name="draw_indicator">True</property>
-                    <signal name="toggled" handler="_apply_checkboxes" swapped="no"/>
+                    <property name="mnemonic_widget">t_home</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
@@ -130,40 +108,10 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkBox" id="box3">
+                  <object class="GtkEntry" id="t_home">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="margin_left">42</property>
-                    <property name="margin_top">3</property>
-                    <child>
-                      <object class="GtkLabel" id="l_home">
-                        <property name="visible">True</property>
-                        <property name="sensitive">False</property>
-                        <property name="can_focus">False</property>
-                        <property name="label" translatable="yes" context="GUI|Advanced User">Home _directory:</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">t_home</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkEntry" id="t_home">
-                        <property name="visible">True</property>
-                        <property name="sensitive">False</property>
-                        <property name="can_focus">True</property>
-                        <property name="margin_left">13</property>
-                        <property name="invisible_char">●</property>
-                      </object>
-                      <packing>
-                        <property name="expand">True</property>
-                        <property name="fill">True</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
+                    <property name="can_focus">True</property>
+                    <property name="margin_left">8</property>
                   </object>
                   <packing>
                     <property name="expand">True</property>
@@ -173,9 +121,9 @@
                 </child>
               </object>
               <packing>
-                <property name="expand">True</property>
+                <property name="expand">False</property>
                 <property name="fill">True</property>
-                <property name="position">2</property>
+                <property name="position">1</property>
               </packing>
             </child>
             <child>
@@ -215,8 +163,6 @@
                   <packing>
                     <property name="left_attach">0</property>
                     <property name="top_attach">0</property>
-                    <property name="width">1</property>
-                    <property name="height">1</property>
                   </packing>
                 </child>
                 <child>
@@ -233,8 +179,6 @@
                   <packing>
                     <property name="left_attach">0</property>
                     <property name="top_attach">1</property>
-                    <property name="width">1</property>
-                    <property name="height">1</property>
                   </packing>
                 </child>
                 <child>
@@ -251,8 +195,6 @@
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="top_attach">0</property>
-                    <property name="width">1</property>
-                    <property name="height">1</property>
                   </packing>
                 </child>
                 <child>
@@ -268,8 +210,6 @@
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="top_attach">1</property>
-                    <property name="width">1</property>
-                    <property name="height">1</property>
                   </packing>
                 </child>
               </object>
@@ -347,8 +287,6 @@
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="top_attach">0</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
@@ -366,8 +304,6 @@ Groups that do not already exist will be created; specify their GID in parenthes
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="top_attach">1</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
@@ -383,8 +319,6 @@ Groups that do not already exist will be created; specify their GID in parenthes
                       <packing>
                         <property name="left_attach">0</property>
                         <property name="top_attach">0</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
@@ -402,8 +336,6 @@ Groups that do not already exist will be created; specify their GID in parenthes
                       <packing>
                         <property name="left_attach">0</property>
                         <property name="top_attach">1</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                   </object>
diff --git a/pyanaconda/ui/gui/spokes/user.py b/pyanaconda/ui/gui/spokes/user.py
index 6fc8b1c..1444348 100644
--- a/pyanaconda/ui/gui/spokes/user.py
+++ b/pyanaconda/ui/gui/spokes/user.py
@@ -79,7 +79,6 @@ class AdvancedUserDialog(GUIObject, GUIDialogInputCheckHandler):
         self._groupDict = groupDict
 
     def _grabObjects(self):
-        self._cHome = self.builder.get_object("c_home")
         self._cUid = self.builder.get_object("c_uid")
         self._cGid = self.builder.get_object("c_gid")
         self._tHome = self.builder.get_object("t_home")
@@ -104,12 +103,9 @@ class AdvancedUserDialog(GUIObject, GUIDialogInputCheckHandler):
         checkbox states on the screen. It is called from
         the toggled Gtk event.
         """
-        c_home = self._cHome.get_active()
         c_uid = self._cUid.get_active()
         c_gid = self._cGid.get_active()
 
-        self._tHome.set_sensitive(c_home)
-        self._lHome.set_sensitive(c_home)
         self._spinUid.set_sensitive(c_uid)
         self._spinGid.set_sensitive(c_gid)
 
@@ -138,7 +134,6 @@ class AdvancedUserDialog(GUIObject, GUIDialogInputCheckHandler):
             self._tHome.set_text(homedir)
             self._user.homedir = homedir
 
-        self._cHome.set_active(bool(self._user.homedir))
         self._cUid.set_active(bool(self._user.uid))
         self._cGid.set_active(bool(self._user.gid))
         self._apply_checkboxes()
@@ -166,10 +161,7 @@ class AdvancedUserDialog(GUIObject, GUIDialogInputCheckHandler):
 
         #OK clicked
         if rc == 1:
-            if self._cHome.get_active():
-                self._user.homedir = self._tHome.get_text()
-            else:
-                self._user.homedir = None
+            self._user.homedir = self._tHome.get_text()
 
             if self._cUid.get_active():
                 self._user.uid = int(self._uid.get_value())
-- 
2.0.0



More information about the anaconda-patches mailing list