Skip to content

Commit

Permalink
Merge pull request #382 from teclator/ssh_key_interface
Browse files Browse the repository at this point in the history
SSH import proposal summary interface improvements (Fate#319624)
  • Loading branch information
teclator committed May 26, 2016
2 parents 162de11 + 35dfed6 commit 0a3976a
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 13 deletions.
7 changes: 7 additions & 0 deletions package/yast2-installation.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed May 25 15:49:41 UTC 2016 - kanderssen@suse.com

- More visual improvements in the SSH keys importing proposal
summary based on blog entry feedback. (Fate#319624)
- 3.1.189

-------------------------------------------------------------------
Wed May 25 13:07:59 UTC 2016 - lslezak@suse.cz

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-installation.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-installation
Version: 3.1.188
Version: 3.1.189
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
6 changes: 6 additions & 0 deletions src/lib/installation/clients/inst_pre_install.rb
Expand Up @@ -94,6 +94,12 @@ def main
read_ssh_info(device, mount_point)
end

# The ssh_import proposal doesn't make sense if there is no
# configuration to import from.
if ::Installation::SshImporter.instance.configurations.empty?
ProductControl.DisableSubProposal("inst_initial", "ssh_import")
end

# free the memory
@useful_partitions = nil

Expand Down
4 changes: 1 addition & 3 deletions src/lib/installation/clients/ssh_import_proposal.rb
Expand Up @@ -38,7 +38,7 @@ def importer

def preformatted_proposal
if importer.configurations.empty?
return _("No previous Linux installation found - not importing any SSH Key")
return Yast::HTML.List([_("No previous Linux installation found")])
end
if importer.device.nil?
res = _("No existing SSH host keys will be copied")
Expand All @@ -55,8 +55,6 @@ def preformatted_proposal
res = _("SSH host keys will be copied from %s") % partition
end
end
# TRANSLATORS: link to change the proposal
res += " " + _("(<a href=%s>change</a>)") % '"ssh_import"'
Yast::HTML.List([res])
end

Expand Down
31 changes: 22 additions & 9 deletions src/lib/installation/dialogs/ssh_import.rb
Expand Up @@ -34,7 +34,7 @@ def initialize
# Event callback for the 'ok' button
def next_handler
partition = UI.QueryWidget(Id(:device), :Value)
partition = nil if partition == :none
partition = nil unless UI.QueryWidget(Id(:import_ssh_key), :Value)
copy_config = UI.QueryWidget(Id(:copy_config), :Value)
log.info "SshImportDialog partition => #{partition} copy_config => #{copy_config}"
importer.device = partition
Expand Down Expand Up @@ -63,10 +63,25 @@ def copy_config
def dialog_content
HSquash(
VBox(
Left(Label(_("System to Import SSH Host Keys from"))),
partitions_list_widget,
VSpacing(1),
Left(copy_config_widget)
CheckBoxFrame(
Id(:import_ssh_key),
_("I would like to import SSH keys from a previous installation"),
true,
VBox(
HStretch(),
VSpacing(1),
HBox(
HSpacing(2),
partitions_list_widget
),
VSpacing(3),
HBox(
HSpacing(2),
Left(copy_config_widget)
)
)
),
HStretch()
)
)
end
Expand All @@ -82,7 +97,7 @@ def help_text
"thus the identity- of its SSH server. The key files found in /etc/ssh " \
"(one pair of files per host key) will be copied to the new system " \
"being installed.</p>" \
"<p>Check <b>Copy Whole SSH Configuration</b> to also copy other files " \
"<p>Check <b>Import SSH Configuration</b> to also copy other files " \
"found in /etc/ssh, in addition to the keys.</p>"
)
end
Expand All @@ -96,8 +111,6 @@ def partitions_list_widget
RadioButtonGroup(
Id(:device),
VBox(
# TRANSLATORS: option to select no partition for SSH keys import
Left(RadioButton(Id(:none), _("None"), device.nil?)),
*part_widgets
)
)
Expand All @@ -112,7 +125,7 @@ def partition_widget(dev, partition)
end

def copy_config_widget
CheckBox(Id(:copy_config), _("Copy Whole SSH Configuration"), copy_config)
CheckBox(Id(:copy_config), _("Import SSH Configuration"), copy_config)
end
end
end

0 comments on commit 0a3976a

Please sign in to comment.