Skip to content

Commit

Permalink
Better popup message
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Dec 15, 2022
1 parent 852c61c commit 2af88f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/lib/add-on/clients/add-on_auto.rb
Expand Up @@ -300,9 +300,11 @@ def expand_url_for(add_on, media_url)
#
# @return [Boolean]
def retry_again?(product, media_url)
Popup.ContinueCancel(
# TRANSLATORS: The placeholders are for the product name and the URL.
format(_("Make the add-on \"%{name}\" available via \"%{url}\"."), name: product, url: media_url)
Popup.YesNo(
# TRANSLATORS: Popup with Yes/No buttons, adding the repository failed.
# The placeholders are for the product name and the URL.
format(_("Failed to add product \"%{name}\" from \n%{url}\nTry again?"),
name: product, url: media_url)
)
end

Expand Down
6 changes: 3 additions & 3 deletions test/y2add_on/clients/add-on_auto_test.rb
Expand Up @@ -402,14 +402,14 @@
before do
allow(Yast::Report).to receive(:Error)
allow(Yast::Pkg).to receive(:SourceCreate).and_return(-1)
allow(Yast::Popup).to receive(:ContinueCancel).and_return(retry_on_error, false)
allow(Yast::Popup).to receive(:YesNo).and_return(retry_on_error, false)
end

let(:retry_on_error) { true }

context "ask_on_error=true" do
it "ask the user to make it available" do
expect(Yast::Popup).to receive(:ContinueCancel)
expect(Yast::Popup).to receive(:YesNo)

client.write
end
Expand Down Expand Up @@ -451,7 +451,7 @@
let(:ask_on_error) { false }

it "does not ask to make it available" do
expect(Yast::Popup).to_not receive(:ContinueCancel)
expect(Yast::Popup).to_not receive(:YesNo)

client.write
end
Expand Down

0 comments on commit 2af88f0

Please sign in to comment.