Hello community, here is the log from the commit of package yast2-country for openSUSE:Factory checked in at 2020-10-18 16:23:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-country (Old) and /work/SRC/openSUSE:Factory/.yast2-country.new.3486 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-country" Sun Oct 18 16:23:45 2020 rev:217 rq:841876 version:4.3.10 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-country/yast2-country.changes 2020-09-15 16:15:15.617855049 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-country.new.3486/yast2-country.changes 2020-10-18 16:24:03.020561033 +0200 @@ -1,0 +2,8 @@ +Thu Oct 15 07:49:20 UTC 2020 - Steffen Winterfeldt <snw...@suse.de> + +- adjust keyboard client layout to also fit the firstboot workflow + (bsc#1174856) +- restructure keyboard client code to allow easier reuse (bsc#1174856) +- 4.3.10 + +------------------------------------------------------------------- Old: ---- yast2-country-4.3.9.tar.bz2 New: ---- yast2-country-4.3.10.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-country.spec ++++++ --- /var/tmp/diff_new_pack.NIWxYA/_old 2020-10-18 16:24:04.412561652 +0200 +++ /var/tmp/diff_new_pack.NIWxYA/_new 2020-10-18 16:24:04.412561652 +0200 @@ -17,7 +17,7 @@ Name: yast2-country -Version: 4.3.9 +Version: 4.3.10 Release: 0 Summary: YaST2 - Country Settings (Language, Keyboard, and Timezone) License: GPL-2.0-only ++++++ yast2-country-4.3.9.tar.bz2 -> yast2-country-4.3.10.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.9/keyboard/src/clients/keyboard.rb new/yast2-country-4.3.10/keyboard/src/clients/keyboard.rb --- old/yast2-country-4.3.9/keyboard/src/clients/keyboard.rb 2020-09-08 12:41:52.000000000 +0200 +++ new/yast2-country-4.3.10/keyboard/src/clients/keyboard.rb 2020-10-15 10:15:50.000000000 +0200 @@ -1,110 +1,3 @@ -require "yast" -require_relative "../lib/y2keyboard/clients/keyboard" - -module Yast - class KeyboardClient < Client - def main - textdomain "country" - - Yast.import "Arch" - Yast.import "CommandLine" - Yast.import "Keyboard" - - # The command line description map - @cmdline = { - "id" => "keyboard", - # TRANSLATORS: command line help text for Securoty module - "help" => _("Keyboard configuration."), - "guihandler" => fun_ref(method(:KeyboardSequence), "any ()"), - "initialize" => fun_ref(method(:KeyboardRead), "boolean ()"), - "finish" => fun_ref(method(:KeyboardWrite), "boolean ()"), - "actions" => { - "summary" => { - "handler" => fun_ref( - method(:KeyboardSummaryHandler), - "boolean (map)" - ), - # command line help text for 'summary' action - "help" => _("Keyboard configuration summary."), - "readonly" => true - }, - "set" => { - "handler" => fun_ref(method(:KeyboardSetHandler), "boolean (map)"), - # command line help text for 'set' action - "help" => _("Set new values for keyboard configuration.") - }, - "list" => { - "handler" => fun_ref(method(:KeyboardListHandler), "boolean (map)"), - # command line help text for 'list' action - "help" => _("List all available keyboard layouts."), - "readonly" => true - } - }, - "options" => { - "layout" => { - # command line help text for 'set layout' option - "help" => _("New keyboard layout"), - "type" => "string" - } - }, - "mappings" => { "summary" => [], "set" => ["layout"], "list" => [] } - } - - CommandLine.Run(@cmdline) - end - - # read keyboard settings - def KeyboardRead - Keyboard.Read - true - end - - # write keyboard settings - def KeyboardWrite - Keyboard.Save - true - end - - # the keyboard configuration sequence - def KeyboardSequence - # dont ask for keyboard on S/390 - return :next if Arch.s390 - - Y2Keyboard::Clients::Keyboard.run - end - - # Handler for keyboard summary - def KeyboardSummaryHandler(options) - # summary label - CommandLine.Print(_("Current Keyboard Layout: %s" % Keyboard.current_kbd)) - true - end - - # Handler for listing keyboard layouts - def KeyboardListHandler(options) - Keyboard.Selection.each do |code, name| - CommandLine.Print(Builtins.sformat("%1 (%2)", code, name)) - end - true - end - - # Handler for changing keyboard settings - def KeyboardSetHandler(options) - keyboard = options["layout"] || "" - - if keyboard == "" || !Keyboard.Selection.key?(keyboard) - # TRANSLATORS: error message (%1 is given layout); do not translate 'list' - CommandLine.Print( - _("Keyboard layout '%s' is invalid. Use a 'list' command to see possible values." % keyboard) - ) - false - else - Keyboard.Set(keyboard) - Keyboard.Modified - true - end - end - end -end +require "y2keyboard/clients/keyboard" Yast::KeyboardClient.new.main diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.9/keyboard/src/lib/y2keyboard/clients/keyboard.rb new/yast2-country-4.3.10/keyboard/src/lib/y2keyboard/clients/keyboard.rb --- old/yast2-country-4.3.9/keyboard/src/lib/y2keyboard/clients/keyboard.rb 2020-09-08 12:41:52.000000000 +0200 +++ new/yast2-country-4.3.10/keyboard/src/lib/y2keyboard/clients/keyboard.rb 2020-10-15 10:15:50.000000000 +0200 @@ -1,21 +1,4 @@ -# Copyright (c) [2018] SUSE LLC -# -# All Rights Reserved. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of version 2 of the GNU General Public License as published -# by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, contact SUSE LLC. -# -# To contact SUSE LLC about this file by physical or electronic mail, you may -# find current contact information at www.suse.com. +require "yast" require_relative "../dialogs/layout_selector" require_relative "../strategies/systemd_strategy" @@ -23,25 +6,123 @@ require_relative "../keyboard_layout" require_relative "../../../data/keyboards" +module Yast + class KeyboardClient < Client + def main + textdomain "country" -module Y2Keyboard - module Clients - # Client with systemd implementation. - class Keyboard - def self.run - Yast.import "Stage" - Yast.import "Mode" - - if Yast::Stage.initial || Yast::Mode.config - # In installation mode or AY configuration mode - strategy = Y2Keyboard::Strategies::YastProposalStrategy.new - else - # running system --> using systemd - strategy = Y2Keyboard::Strategies::SystemdStrategy.new - end - Y2Keyboard::KeyboardLayout.use(strategy, Keyboards.all_keyboards) - Y2Keyboard::Dialogs::LayoutSelector.new.run + Yast.import "Arch" + Yast.import "CommandLine" + Yast.import "Keyboard" + + # The command line description map + @cmdline = { + "id" => "keyboard", + # TRANSLATORS: command line help text for Securoty module + "help" => _("Keyboard configuration."), + "guihandler" => fun_ref(method(:KeyboardSequence), "any ()"), + "initialize" => fun_ref(method(:KeyboardRead), "boolean ()"), + "finish" => fun_ref(method(:KeyboardWrite), "boolean ()"), + "actions" => { + "summary" => { + "handler" => fun_ref( + method(:KeyboardSummaryHandler), + "boolean (map)" + ), + # command line help text for 'summary' action + "help" => _("Keyboard configuration summary."), + "readonly" => true + }, + "set" => { + "handler" => fun_ref(method(:KeyboardSetHandler), "boolean (map)"), + # command line help text for 'set' action + "help" => _("Set new values for keyboard configuration.") + }, + "list" => { + "handler" => fun_ref(method(:KeyboardListHandler), "boolean (map)"), + # command line help text for 'list' action + "help" => _("List all available keyboard layouts."), + "readonly" => true + } + }, + "options" => { + "layout" => { + # command line help text for 'set layout' option + "help" => _("New keyboard layout"), + "type" => "string" + } + }, + "mappings" => { "summary" => [], "set" => ["layout"], "list" => [] } + } + + CommandLine.Run(@cmdline) + end + + # read keyboard settings + def KeyboardRead + Keyboard.Read + true + end + + # write keyboard settings + def KeyboardWrite + Keyboard.Save + true + end + + # the keyboard configuration sequence + def KeyboardSequence + # dont ask for keyboard on S/390 + return :next if Arch.s390 + + Yast::KeyboardClient.setup + end + + # Handler for keyboard summary + def KeyboardSummaryHandler(options) + # summary label + CommandLine.Print(_("Current Keyboard Layout: %s" % Keyboard.current_kbd)) + true + end + + # Handler for listing keyboard layouts + def KeyboardListHandler(options) + Keyboard.Selection.each do |code, name| + CommandLine.Print(Builtins.sformat("%1 (%2)", code, name)) + end + true + end + + # Handler for changing keyboard settings + def KeyboardSetHandler(options) + keyboard = options["layout"] || "" + + if keyboard == "" || !Keyboard.Selection.key?(keyboard) + # TRANSLATORS: error message (%1 is given layout); do not translate 'list' + CommandLine.Print( + _("Keyboard layout '%s' is invalid. Use a 'list' command to see possible values." % keyboard) + ) + false + else + Keyboard.Set(keyboard) + Keyboard.Modified + true + end + end + + def self.setup + Yast.import "Stage" + Yast.import "Mode" + + if Yast::Stage.initial || Yast::Mode.config + # In installation mode or AY configuration mode + strategy = Y2Keyboard::Strategies::YastProposalStrategy.new + else + # running system --> using systemd + strategy = Y2Keyboard::Strategies::SystemdStrategy.new end + Y2Keyboard::KeyboardLayout.use(strategy, Keyboards.all_keyboards) + Y2Keyboard::Dialogs::LayoutSelector.new.run end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.9/keyboard/src/lib/y2keyboard/dialogs/layout_selector.rb new/yast2-country-4.3.10/keyboard/src/lib/y2keyboard/dialogs/layout_selector.rb --- old/yast2-country-4.3.9/keyboard/src/lib/y2keyboard/dialogs/layout_selector.rb 2020-09-08 12:41:52.000000000 +0200 +++ new/yast2-country-4.3.10/keyboard/src/lib/y2keyboard/dialogs/layout_selector.rb 2020-10-15 10:15:50.000000000 +0200 @@ -25,6 +25,7 @@ Yast.import "UI" Yast.import "Popup" Yast.import "Mode" +Yast.import "Stage" module Y2Keyboard module Dialogs @@ -47,7 +48,7 @@ HWeight(50, layout_selection_box), HWeight(20, HStretch()) ), - footer + Yast::Stage.firstboot ? footer_firstboot : footer ) end @@ -79,6 +80,15 @@ finish_dialog(:accept) end + def next_handler + selected_layout.apply_layout + finish_dialog(:next) + end + + def back_handler + finish_dialog(:back) + end + def cancel_handler if !Yast::Mode.config # not in AY configuration module KeyboardLayoutLoader.load_layout(@previous_selected_layout) @@ -86,6 +96,10 @@ finish_dialog(:abort) end + def abort_handler + cancel_handler if Yast::Popup.ConfirmAbort(:painless) + end + def layout_list_handler if !Yast::Mode.config # not in AY configuration module KeyboardLayoutLoader.load_layout(selected_layout) @@ -126,6 +140,17 @@ HSpacing() ) end + + def footer_firstboot + HBox( + HSpacing(), + Left(PushButton(Id(:help), Opt(:key_F1, :help), Yast::Label.HelpButton)), + PushButton(Id(:abort), Yast::Label.AbortButton), + PushButton(Id(:back), Yast::Label.BackButton), + PushButton(Id(:next), Yast::Label.NextButton), + HSpacing() + ) + end end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.9/keyboard/test/clients/keyboard_spec.rb new/yast2-country-4.3.10/keyboard/test/clients/keyboard_spec.rb --- old/yast2-country-4.3.9/keyboard/test/clients/keyboard_spec.rb 2020-09-08 12:41:52.000000000 +0200 +++ new/yast2-country-4.3.10/keyboard/test/clients/keyboard_spec.rb 2020-10-15 10:15:50.000000000 +0200 @@ -24,12 +24,12 @@ Yast.import "Directory" -describe Y2Keyboard::Clients::Keyboard do - describe ".run" do +describe Yast::KeyboardClient do + describe ".setup" do let(:dialog) { spy(Y2Keyboard::Dialogs::LayoutSelector) } let(:systemd_strategy) { spy(Y2Keyboard::Strategies::SystemdStrategy) } let(:yast_proposal_strategy) { spy(Y2Keyboard::Strategies::YastProposalStrategy) } - subject(:client) { Y2Keyboard::Clients::Keyboard } + subject(:client) { Yast::KeyboardClient } before do allow(Y2Keyboard::Strategies::SystemdStrategy).to receive(:new).and_return(systemd_strategy) @@ -40,21 +40,21 @@ it "load keyboard layouts definitions from data directory" do expect(Y2Keyboard::KeyboardLayout).to receive(:use).with(anything, Keyboards.all_keyboards) - client.run + client.setup end it "use systemd strategy in a running system" do allow(Yast::Stage).to receive(:initial).and_return false expect(Y2Keyboard::KeyboardLayout).to receive(:use).with(systemd_strategy, anything) - client.run + client.setup end it "use yast_proposal_strategy strategy while installation" do allow(Yast::Stage).to receive(:initial).and_return true expect(Y2Keyboard::KeyboardLayout).to receive(:use).with(yast_proposal_strategy, anything) - client.run + client.setup end it "use yast_proposal_strategy strategy in the AY configuration module" do @@ -62,13 +62,13 @@ allow(Yast::Mode).to receive(:config).and_return true expect(Y2Keyboard::KeyboardLayout).to receive(:use).with(yast_proposal_strategy, anything) - client.run + client.setup end it "starts a dialog" do expect(Y2Keyboard::Dialogs::LayoutSelector).to receive(:new).and_return(dialog) - client.run + client.setup end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.9/package/yast2-country.changes new/yast2-country-4.3.10/package/yast2-country.changes --- old/yast2-country-4.3.9/package/yast2-country.changes 2020-09-08 12:41:52.000000000 +0200 +++ new/yast2-country-4.3.10/package/yast2-country.changes 2020-10-15 10:15:50.000000000 +0200 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Thu Oct 15 07:49:20 UTC 2020 - Steffen Winterfeldt <snw...@suse.de> + +- adjust keyboard client layout to also fit the firstboot workflow + (bsc#1174856) +- restructure keyboard client code to allow easier reuse (bsc#1174856) +- 4.3.10 + +------------------------------------------------------------------- Tue Sep 8 09:18:33 CEST 2020 - sch...@suse.de - Using ":" in the autoyast(...) supplements (bsc#1146494). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-country-4.3.9/package/yast2-country.spec new/yast2-country-4.3.10/package/yast2-country.spec --- old/yast2-country-4.3.9/package/yast2-country.spec 2020-09-08 12:41:52.000000000 +0200 +++ new/yast2-country-4.3.10/package/yast2-country.spec 2020-10-15 10:15:50.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-country -Version: 4.3.9 +Version: 4.3.10 Release: 0 Summary: YaST2 - Country Settings (Language, Keyboard, and Timezone) License: GPL-2.0-only