Skip to content

Commit

Permalink
Merge pull request #539 from yast/fix_abort
Browse files Browse the repository at this point in the history
Fix abort
  • Loading branch information
jreidinger committed Oct 27, 2020
2 parents 44b4c11 + 4469125 commit 95f55d3
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
6 changes: 6 additions & 0 deletions package/yast2-packager.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Oct 26 21:01:37 UTC 2020 - Josef Reidinger <jreidinger@suse.com>

- Confirm abort in product license dialog (bsc#1178005)
- 4.3.10

-------------------------------------------------------------------
Mon Oct 12 11:39:08 CEST 2020 - schubi@suse.de

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-packager.spec
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/lib/y2packager/dialogs/inst_product_license.rb
Expand Up @@ -17,6 +17,7 @@
require "y2packager/widgets/product_license_confirmation"

Yast.import "Language"
Yast.import "Popup"

module Y2Packager
module Dialogs
Expand Down Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions test/lib/dialogs/inst_product_license_test.rb
Expand Up @@ -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

0 comments on commit 95f55d3

Please sign in to comment.