diff --git a/package/yast2-packager.changes b/package/yast2-packager.changes index c586287e9..51b411fd3 100644 --- a/package/yast2-packager.changes +++ b/package/yast2-packager.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Oct 26 21:01:37 UTC 2020 - Josef Reidinger + +- Confirm abort in product license dialog (bsc#1178005) +- 4.3.10 + ------------------------------------------------------------------- Mon Oct 12 11:39:08 CEST 2020 - schubi@suse.de diff --git a/package/yast2-packager.spec b/package/yast2-packager.spec index 0200abb8f..f6cac2370 100644 --- a/package/yast2-packager.spec +++ b/package/yast2-packager.spec @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 4.3.9 +Version: 4.3.10 Release: 0 Summary: YaST2 - Package Library License: GPL-2.0-or-later diff --git a/src/lib/y2packager/dialogs/inst_product_license.rb b/src/lib/y2packager/dialogs/inst_product_license.rb index 482a047a7..a0d3dd56a 100644 --- a/src/lib/y2packager/dialogs/inst_product_license.rb +++ b/src/lib/y2packager/dialogs/inst_product_license.rb @@ -17,6 +17,7 @@ require "y2packager/widgets/product_license_confirmation" Yast.import "Language" +Yast.import "Popup" module Y2Packager module Dialogs @@ -61,6 +62,11 @@ def contents ) end + # Overwrite abort handler to ask for confirmation + def abort_handler + Yast::Popup.ConfirmAbort(:painless) + end + private # Return the license confirmation widget if required diff --git a/test/lib/dialogs/inst_product_license_test.rb b/test/lib/dialogs/inst_product_license_test.rb index aaccfb281..201ba48c4 100755 --- a/test/lib/dialogs/inst_product_license_test.rb +++ b/test/lib/dialogs/inst_product_license_test.rb @@ -54,4 +54,18 @@ dialog.contents end end + + describe "#abort_handler" do + it "returns true if user confirm abort" do + allow(Yast::Popup).to receive(:ConfirmAbort).and_return(true) + + expect(subject.abort_handler).to eq true + end + + it "returns false if user cancel abort confirmation" do + allow(Yast::Popup).to receive(:ConfirmAbort).and_return(false) + + expect(subject.abort_handler).to eq false + end + end end