-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
0030-Simplify-USER-configuration-spoke.patch
198 lines (187 loc) · 9.36 KB
/
0030-Simplify-USER-configuration-spoke.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
From 4d53234264bd06322fc35aabdeea9f540902f6b9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret=20=28fepitre=29?=
<frederic.pierret@qubes-os.org>
Date: Sun, 29 Jan 2023 17:46:18 +0100
Subject: [PATCH] Simplify USER configuration spoke
---
pyanaconda/ui/gui/spokes/user.glade | 57 ++++-------------------------
pyanaconda/ui/gui/spokes/user.py | 43 +---------------------
2 files changed, 9 insertions(+), 91 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/user.glade b/pyanaconda/ui/gui/spokes/user.glade
index 0dc9413355..893a888c43 100644
--- a/pyanaconda/ui/gui/spokes/user.glade
+++ b/pyanaconda/ui/gui/spokes/user.glade
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.38.1 -->
+<!-- Generated with glade 3.40.0 -->
<interface>
<requires lib="gtk+" version="3.6"/>
<requires lib="AnacondaWidgets" version="1.0"/>
@@ -202,23 +202,6 @@
<property name="top-attach">7</property>
</packing>
</child>
- <child>
- <object class="GtkCheckButton" id="password_required_checkbox">
- <property name="label" translatable="yes" context="GUI|User">_Require a password to use this account</property>
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="receives-default">False</property>
- <property name="use-underline">True</property>
- <property name="xalign">0</property>
- <property name="active">True</property>
- <property name="draw-indicator">True</property>
- <signal name="toggled" handler="on_password_required_toggled" swapped="no"/>
- </object>
- <packing>
- <property name="left-attach">1</property>
- <property name="top-attach">4</property>
- </packing>
- </child>
<child>
<object class="GtkBox" id="box2">
<property name="visible">True</property>
@@ -261,43 +244,13 @@
<property name="top-attach">6</property>
</packing>
</child>
- <child>
- <object class="GtkCheckButton" id="admin_checkbox">
- <property name="label" translatable="yes" context="GUI|User">Add ad_ministrative privileges to this user account (wheel group membership)</property>
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="receives-default">False</property>
- <property name="active">True</property>
- <property name="tooltip-text" translatable="yes" context="GUI|User">Allow this user to run the 'sudo' command.</property>
- <property name="use-underline">True</property>
- <property name="xalign">0</property>
- <property name="draw-indicator">True</property>
- <signal name="toggled" handler="on_admin_toggled" swapped="no"/>
- </object>
- <packing>
- <property name="left-attach">1</property>
- <property name="top-attach">3</property>
- </packing>
- </child>
<child>
<!-- n-columns=3 n-rows=3 -->
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
- <object class="GtkButton" id="advanced_button">
- <property name="label" translatable="yes" context="GUI|User">_Advanced...</property>
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can-focus">True</property>
- <property name="receives-default">True</property>
- <property name="use-underline">True</property>
- <signal name="clicked" handler="on_advanced_clicked" swapped="no"/>
- </object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">0</property>
- </packing>
+ <placeholder/>
</child>
<child>
<placeholder/>
@@ -374,6 +327,12 @@
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</object>
<packing>
<property name="expand">True</property>
diff --git a/pyanaconda/ui/gui/spokes/user.py b/pyanaconda/ui/gui/spokes/user.py
index 9752a4ed5f..36cc66cb22 100644
--- a/pyanaconda/ui/gui/spokes/user.py
+++ b/pyanaconda/ui/gui/spokes/user.py
@@ -290,8 +290,6 @@ class UserSpoke(NormalSpoke, GUISpokeInputCheckHandler):
# check boxes
self._admin_checkbox = self.builder.get_object("admin_checkbox")
self._password_required_checkbox = self.builder.get_object("password_required_checkbox")
- # advanced user configration dialog button
- self._advanced_button = self.builder.get_object("advanced_button")
# password checking status bar & label
self._password_bar = self.builder.get_object("password_bar")
self._password_label = self.builder.get_object("password_label")
@@ -365,19 +363,8 @@ class UserSpoke(NormalSpoke, GUISpokeInputCheckHandler):
# the Gtk signal handlers use the input check variables.
password_set_message = _("The password was set by kickstart.")
if self.password_kickstarted:
- self.password_required = True
self.password_entry.set_placeholder_text(password_set_message)
self.password_confirmation_entry.set_placeholder_text(password_set_message)
- elif not self.checker.policy.allow_empty:
- # Policy is that a non-empty password is required
- self.password_required = True
-
- if not self.checker.policy.allow_empty:
- # User isn't allowed to change whether password is required or not
- self.password_required_checkbox.set_sensitive(False)
-
- self._advanced_user_dialog = AdvancedUserDialog(self)
- self._advanced_user_dialog.initialize()
# report that we are done
self.initialize_done()
@@ -412,11 +399,7 @@ class UserSpoke(NormalSpoke, GUISpokeInputCheckHandler):
@property
def password_required(self):
- return self.password_required_checkbox.get_active()
-
- @password_required.setter
- def password_required(self, value):
- self.password_required_checkbox.set_active(value)
+ return True
@property
def user(self):
@@ -440,7 +423,6 @@ class UserSpoke(NormalSpoke, GUISpokeInputCheckHandler):
self.username = self.user.name
self.fullname = self.user.gecos
- self._admin_checkbox.set_active(self.user.has_admin_priviledges())
# rerun checks so that we have a correct status message, if any
self.checker.run_checks()
@@ -555,12 +537,6 @@ class UserSpoke(NormalSpoke, GUISpokeInputCheckHandler):
"""Called by Gtk on all username changes."""
new_username = editable.get_text()
- # Disable the advanced user dialog button when no username is set
- if editable.get_text():
- self._advanced_button.set_sensitive(True)
- else:
- self._advanced_button.set_sensitive(False)
-
# update the username in checker
self.checker.username = new_username
@@ -586,23 +562,6 @@ class UserSpoke(NormalSpoke, GUISpokeInputCheckHandler):
# rerun the checks
self.checker.run_checks()
- def on_admin_toggled(self, togglebutton, data=None):
- # Add or remove user admin status based on changes to the admin checkbox
- self.user.set_admin_priviledges(togglebutton.get_active())
-
- def on_advanced_clicked(self, _button, data=None):
- """Handler for the Advanced.. button. It starts the Advanced dialog
- for setting homedir, uid, gid and groups.
- """
-
- self.user.name = self.username
-
- self._advanced_user_dialog.refresh()
- with self.main_window.enlightbox(self._advanced_user_dialog.window):
- self._advanced_user_dialog.run()
-
- self._admin_checkbox.set_active(self.user.has_admin_priviledges())
-
def _checks_done(self, error_message):
"""Update the warning with the input validation error from the first
error message or clear warnings if all the checks were successful.
--
2.45.2