Skip to content

Commit

Permalink
Fix btrfs_subvolume checkbox initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
dgdavid committed Feb 6, 2019
1 parent b3ea029 commit 48d82f3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/include/users/dialogs.rb
Expand Up @@ -1782,13 +1782,22 @@ def EditUserDialog(what)
UI.ReplaceWidget(:tabContents, get_details_term.call)
Wizard.SetHelpText(EditUserDetailsDialogHelp(user_type, what))

UI.ChangeWidget(Id(:btrfs_subvolume), :Enabled, btrfs_available?)

if what == "edit_user"
UI.ChangeWidget(Id(:btrfs_subvolume), :Enabled, false)
# Show the value for the current home directory/subvolume
UI.ChangeWidget(Id(:btrfs_subvolume), :Value, btrfs_subvolume?(org_home))
end

if do_not_edit
UI.ChangeWidget(Id(:uid), :Enabled, false)
UI.ChangeWidget(Id(:home), :Enabled, false)
UI.ChangeWidget(Id(:move_home), :Enabled, false)
UI.ChangeWidget(Id(:shell), :Enabled, false)
UI.ChangeWidget(Id(:defaultgroup), :Enabled, false)
UI.ChangeWidget(Id(:browse), :Enabled, false)
UI.ChangeWidget(Id(:btrfs_subvolume), :Enabled, false)
end
if user_type == "ldap" && !Ldap.file_server
UI.ChangeWidget(Id(:browse), :Enabled, false)
Expand All @@ -1804,8 +1813,6 @@ def EditUserDialog(what)
UI.ChangeWidget(Id(:mode), :InputMaxLength, 3)
end
UI.ChangeWidget(Id(:shell), :Value, shell)
UI.ChangeWidget(Id(:btrfs_subvolume), :Enabled, what == "add_user" && btrfs_available?)
UI.ChangeWidget(Id(:btrfs_subvolume), :Value, what == "edit_user" && btrfs_subvolume?(home))

current = ret
end
Expand Down

0 comments on commit 48d82f3

Please sign in to comment.