Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/SLE-12-SP3' into sp3_merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Sep 7, 2017
2 parents c77a5aa + df6c0f2 commit 7b8b503
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM yastdevel/ruby
FROM yastdevel/ruby:sle12-sp3
RUN zypper --gpg-auto-import-keys --non-interactive in --no-recommends \
yast2-ntp-client yast2-tune yast2-registration
COPY . /usr/src/app
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "yast/rake"

Yast::Tasks.submit_to((ENV["YAST_SUBMIT"] || :factory).to_sym)
Yast::Tasks.submit_to :sle12sp3

Yast::Tasks.configuration do |conf|
# lets ignore license check for now
Expand Down
7 changes: 7 additions & 0 deletions package/yast2-caasp.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Sep 7 12:06:32 UTC 2017 - jreidinger@suse.com

- Add language selection (FATE#323837)
- Mark all user visible strings for translation (FATE#323837)
- 4.0.0

-------------------------------------------------------------------
Mon Sep 4 12:25:38 UTC 2017 - knut.anderssen@suse.com

Expand Down
8 changes: 4 additions & 4 deletions package/yast2-caasp.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-caasp
Version: 1.1.2
Version: 4.0.0
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand All @@ -41,9 +41,9 @@ BuildRequires: yast2-users >= 3.2.10
# Registration widget
Requires: yast2-registration >= 3.2.1
BuildRequires: yast2-registration >= 3.2.1
# new keyboard layout cwm widget
BuildRequires: yast2-country >= 3.3.2
Requires: yast2-country >= 3.3.2
# new language selection cwm widget
BuildRequires: yast2-country >= 4.0.0
Requires: yast2-country >= 4.0.0
# SlpServices.find
Requires: yast2-slp
BuildRequires: yast2-slp
Expand Down
21 changes: 14 additions & 7 deletions src/lib/y2caasp/clients/inst_casp_overview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
require "uri"
require "users/widgets"
require "y2country/widgets/keyboard_selection"
require "y2country/widgets/language_selection"
require "ui/widgets"
require "tune/widgets"
require "registration/widgets/registration_code"
Expand Down Expand Up @@ -54,7 +55,7 @@ def run # rubocop:disable MethodLength, AbcSize, CyclomaticComplexity, Perceived
Yast.import "InstShowInfo"
Yast.import "SlpService"

textdomain "installation"
textdomain "caasp"

# Simplified work-flow do not contain language proposal, but have software one.
# So avoid false positive detection of language change
Expand All @@ -72,14 +73,17 @@ def run # rubocop:disable MethodLength, AbcSize, CyclomaticComplexity, Perceived
ret = Yast::CWM.show(
content,
# Title for installation overview dialog
caption: _("Installation Overview"),
caption: _("Installation Overview"),
# Button label: start the installation
next_button: _("Install"),
next_button: _("Install"),
# do not show abort and back button
abort_button: "",
back_button: ""
abort_button: "",
back_button: "",
skip_store_for: [:redraw]
)

next if ret == :redraw

# Currently no other return value is expected, behavior can
# be unpredictable if something else is received - raise
# RuntimeError
Expand Down Expand Up @@ -150,6 +154,8 @@ def quadrant_layout(upper_left:, lower_left:, upper_right:, lower_right:)
# Returns a pair with UI widget-set for the dialog and widgets that can
# block installation
def content # rubocop:disable MethodLength
return @content if @content

controller_node = Installation::Widgets::HidingPlace.new(
Y2Caasp::Widgets::ControllerNode.new
)
Expand All @@ -163,10 +169,11 @@ def content # rubocop:disable MethodLength
redraw: [kdump_overview]
)

quadrant_layout(
@content = quadrant_layout(
upper_left: VBox(
::Y2Country::Widgets::LanguageSelection.new(emit_event: true),
# use english us as default keyboard layout
::Y2Country::Widgets::KeyboardSelectionCombo.new("english-us"),
::Y2Country::Widgets::KeyboardSelectionCombo.new,
::Users::PasswordWidget.new(little_space: true),
::Registration::Widgets::RegistrationCode.new
),
Expand Down
19 changes: 10 additions & 9 deletions src/lib/y2caasp/widgets/ntp_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ module Y2Caasp
module Widgets
# This widget is responsible of validating and storing the NTP server to use.
class NtpServer < CWM::InputField
extend Yast::I18n

# @return [Array<String>] List of default servers
attr_reader :default_servers

Expand All @@ -41,13 +43,12 @@ class NtpServer < CWM::InputField
# @params default_servers [Array<String>] List of servers
def initialize(default_servers = [])
@default_servers = default_servers
textdomain "caasp"
end

# intentional no translation for CaaSP
#
# @return [String] Widget's label
def label
"NTP Servers"
_("NTP Servers")
end

# Store the value of the input field if validates
Expand All @@ -61,8 +62,8 @@ def init
self.value = saved_servers.join(" ")
end

NOT_VALID_SERVERS_MESSAGE = "Not valid location for the NTP servers:\n%{servers}" \
"\n\nPlease, enter a valid IP or Hostname".freeze
NOT_VALID_SERVERS_MESSAGE = N_("Not valid location for the NTP servers:\n%{servers}" \
"\n\nPlease, enter a valid IP or Hostname").freeze
# Validate input
#
# * All specified IPs or hostnames should be valid
Expand All @@ -74,7 +75,7 @@ def validate
invalid_servers = servers.reject { |v| Yast::IP.Check(v) || Yast::Hostname.CheckFQ(v) }
return true if invalid_servers.empty?
Yast::Popup.Error(
format(NOT_VALID_SERVERS_MESSAGE, servers: invalid_servers.join(", "))
format(_(NOT_VALID_SERVERS_MESSAGE), servers: invalid_servers.join(", "))
)

false
Expand All @@ -94,12 +95,12 @@ def servers
# @return [Boolean] true if user wants to skip it; false otherwise.
def skip_ntp_server?
Yast::Popup.AnyQuestion(
"NTP Servers",
_("NTP Servers"),
# TRANSLATORS: error message for invalid ntp server name/address
"You have not configured an NTP server. This may lead to\n" \
_("You have not configured an NTP server. This may lead to\n" \
"your cluster not functioning properly or at all.\n" \
"Proceed with caution and at your own risk.\n\n" \
"Would you like to continue with the installation?",
"Would you like to continue with the installation?"),
Yast::Label.YesButton,
Yast::Label.NoButton,
:yes
Expand Down
2 changes: 1 addition & 1 deletion src/lib/y2caasp/widgets/overview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Overview < CWM::CustomWidget
# responsible for not creating circular dependencies.
# eg. "bootloader_proposal"
def initialize(client:, redraw: [])
textdomain "installation"
textdomain "caasp"
@proposal_client = client
@replace_point = "rp_" + client
# by default widget_id is the class name; must differentiate instances
Expand Down
9 changes: 6 additions & 3 deletions src/lib/y2caasp/widgets/system_role.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ module Widgets
# which must be a valid IP or FQDN.
# bsc#1032057: old name: Controller Node, new name: Administration Node.
class ControllerNode < CWM::InputField
def initialize
textdomain "caasp"
end

def label
# intentional no translation for CAASP
"Administration Node"
_("Administration Node")
end

# It stores the value of the input field if validates
Expand Down Expand Up @@ -85,7 +88,7 @@ class SystemRole < CWM::ComboBox
attr_reader :widgets_map

def initialize(controller_node_widget, ntp_server_widget)
textdomain "installation"
textdomain "caasp"
@widgets_map = {
controller_node: controller_node_widget,
ntp_server: ntp_server_widget
Expand Down
11 changes: 10 additions & 1 deletion test/inst_casp_overview_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,22 @@ def label
module Y2Country
module Widgets
class KeyboardSelectionCombo < CWM::ComboBox
def initialize(_language)
def initialize(_language = "def")
end

def label
"Keyboard"
end
end

class LanguageSelection < CWM::ComboBox
def initialize(emit_event: false)
end

def label
"language"
end
end
end
end

Expand Down

0 comments on commit 7b8b503

Please sign in to comment.