Skip to content

Commit

Permalink
Merge pull request #474 from yast/file_conflict_fix
Browse files Browse the repository at this point in the history
Fixed displaying the file conflicts callbacks (bsc#983464)
  • Loading branch information
lslezak committed Jun 8, 2016
2 parents 647633a + 166cb53 commit 0679991
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
7 changes: 5 additions & 2 deletions library/packages/src/lib/packages/file_conflict_callbacks.rb
Expand Up @@ -37,6 +37,7 @@ def register
Yast.import "Report"
Yast.import "Label"
Yast.import "PackageCallbacks"
Yast.import "Wizard"

textdomain "base"

Expand Down Expand Up @@ -83,6 +84,7 @@ def start
Yast::UI.ChangeWidget(Id(PKG_INSTALL_WIDGET), :Value, 0)
Yast::UI.ChangeWidget(Id(PKG_INSTALL_WIDGET), :Label, label)
else
Yast::Wizard.CreateDialog
# TRANSLATORS: help text for the file conflict detection progress
help = _("<p>Detecting the file conflicts is in progress.</p>")
# Use the same label for the window title and the progressbar label
Expand Down Expand Up @@ -148,10 +150,11 @@ def report(excluded_packages, conflicts)
# Handle the file conflict detection finish callback.
def finish
log.info "File conflict check finished"
return if Yast::Mode.commandline
return if Yast::Mode.commandline || pkg_installation?

# finish the opened progress dialog
Yast::Progress.Finish unless pkg_installation?
Yast::Progress.Finish
Yast::Wizard.CloseDialog
end

# Construct the file conflicts dialog.
Expand Down
4 changes: 3 additions & 1 deletion library/packages/test/file_conflict_callbacks_test.rb
Expand Up @@ -80,6 +80,7 @@ def CallbackFileConflictFinish(func)

it "opens a new progress if installation progress was not displayed" do
expect(Yast::UI).to receive(:WidgetExists).and_return(false)
expect(Yast::Wizard).to receive(:CreateDialog)
expect(Yast::Progress).to receive(:Simple)

start_cb.call
Expand Down Expand Up @@ -287,7 +288,8 @@ def CallbackFileConflictFinish(func)
end

it "closes progress if installation progress was not displayed" do
expect(Yast::UI).to receive(:WidgetExists).and_return(false)
allow(Yast::UI).to receive(:WidgetExists).and_return(false)
expect(Yast::Wizard).to receive(:CloseDialog)
expect(Yast::Progress).to receive(:Finish)

finish_cb.call
Expand Down
7 changes: 7 additions & 0 deletions package/yast2.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Jun 8 12:13:16 UTC 2016 - lslezak@suse.cz

- Fixed displaying the file conflicts callbacks when the Progress
dialog is not displayed (bsc#983464)
- 3.1.193

-------------------------------------------------------------------
Thu Jun 2 10:29:34 UTC 2016 - igonzalezsosa@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2
Version: 3.1.192
Version: 3.1.193
Release: 0
Summary: YaST2 - Main Package
License: GPL-2.0
Expand Down

0 comments on commit 0679991

Please sign in to comment.