Skip to content

Commit

Permalink
Merge pull request #219 from lnussel/master
Browse files Browse the repository at this point in the history
Disable block device selector in WSL (boo#1154238)
  • Loading branch information
jreidinger committed Jan 16, 2020
2 parents e0ed7a7 + ebc7bec commit a7b5f34
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
6 changes: 6 additions & 0 deletions package/yast2-users.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Jan 16 09:46:36 UTC 2020 - Ludwig Nussel <lnussel@suse.de>

- Disable block device selector in WSL (boo#1154238)
- 4.2.7

-------------------------------------------------------------------
Mon Nov 25 15:37:16 UTC 2019 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-users.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-users
Version: 4.2.6
Version: 4.2.7
Release: 0
Summary: YaST2 - User and Group Configuration
License: GPL-2.0-only
Expand Down
25 changes: 17 additions & 8 deletions src/lib/users/widgets/public_key_selector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
require "yast2/popup"
require "tmpdir"

Yast.import "Arch"
Yast.import "Label"
Yast.import "UI"
Yast.import "UsersSimple"
Expand Down Expand Up @@ -153,15 +154,20 @@ def inner_content
#
# @return [Yast::Term]
def blk_device_selector
VBox(
Left(
HBox(
blk_devices_combo_box,
PushButton(Id(:refresh), Opt(:notify), Yast::Label.RefreshButton)
)
),
# no block devices in WSL
if Yast::Arch.is_wsl
Left(PushButton(Id(:browse), Opt(:notify), Yast::Label.BrowseButton))
)
else
VBox(
Left(
HBox(
blk_devices_combo_box,
PushButton(Id(:refresh), Opt(:notify), Yast::Label.RefreshButton)
)
),
Left(PushButton(Id(:browse), Opt(:notify), Yast::Label.BrowseButton))
)
end
end

# UI which shows the public key content
Expand Down Expand Up @@ -234,6 +240,9 @@ def update
#
# @return [String] Key content
def read_key
# /mnt has windows drives mounted by default
return read_key_from("/mnt") if Yast::Arch.is_wsl

select_blk_device
dir = Dir.mktmpdir
begin
Expand Down

0 comments on commit a7b5f34

Please sign in to comment.