Hello community, here is the log from the commit of package yast2 for openSUSE:Factory checked in at 2018-05-10 15:45:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2 (Old) and /work/SRC/openSUSE:Factory/.yast2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2" Thu May 10 15:45:08 2018 rev:427 rq:605384 version:4.0.73 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2/yast2.changes 2018-05-01 22:40:06.299510864 +0200 +++ /work/SRC/openSUSE:Factory/.yast2.new/yast2.changes 2018-05-10 15:45:10.678547966 +0200 @@ -1,0 +2,8 @@ +Tue May 8 10:21:07 UTC 2018 - jlopez@suse.com + +- CWM: allow to define back handler for CWM#show. +- CWM: define default handlers for back and abort in CWM::Dialog. +- Needed for Expert Partitioner fate#318196. +- 4.0.73 + +------------------------------------------------------------------- Old: ---- yast2-4.0.72.tar.bz2 New: ---- yast2-4.0.73.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2.spec ++++++ --- /var/tmp/diff_new_pack.M1EpIl/_old 2018-05-10 15:45:11.454519527 +0200 +++ /var/tmp/diff_new_pack.M1EpIl/_new 2018-05-10 15:45:11.454519527 +0200 @@ -17,10 +17,10 @@ Name: yast2 -Version: 4.0.72 +Version: 4.0.73 Release: 0 Summary: YaST2 - Main Package -License: GPL-2.0-only +License: GPL-2.0 Group: System/YaST Url: https://github.com/yast/yast-yast2 Source0: %{name}-%{version}.tar.bz2 ++++++ yast2-4.0.72.tar.bz2 -> yast2-4.0.73.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.0.72/library/cwm/examples/object_api.rb new/yast2-4.0.73/library/cwm/examples/object_api.rb --- old/yast2-4.0.72/library/cwm/examples/object_api.rb 2018-04-27 16:57:00.000000000 +0200 +++ new/yast2-4.0.73/library/cwm/examples/object_api.rb 2018-05-08 16:52:01.000000000 +0200 @@ -58,8 +58,12 @@ ) Yast::Wizard.CreateDialog + back_handler = proc { Yast::Popup.YesNo("Really go back?") } abort_handler = proc { Yast::Popup.YesNo("Really abort?") } - CWM.show(contents, caption: _("Lucky number"), abort_handler: abort_handler) + CWM.show(contents, + caption: _("Lucky number"), + back_handler: back_handler, + abort_handler: abort_handler) Yast::Wizard.CloseDialog lucky_number_widget.result diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.0.72/library/cwm/src/lib/cwm/dialog.rb new/yast2-4.0.73/library/cwm/src/lib/cwm/dialog.rb --- old/yast2-4.0.72/library/cwm/src/lib/cwm/dialog.rb 2018-04-27 16:57:00.000000000 +0200 +++ new/yast2-4.0.73/library/cwm/src/lib/cwm/dialog.rb 2018-05-08 16:52:01.000000000 +0200 @@ -76,6 +76,24 @@ [] end + # Handler when the back button is used + # + # If returns false, then it does not go back. + # + # @return [Boolean] + def back_handler + true + end + + # Handler when the abort button is used + # + # If returns false, then it does not abort. + # + # @return [Boolean] + def abort_handler + true + end + private # Create a wizard dialog, run the *block*, ensure the dialog is closed. @@ -97,7 +115,9 @@ abort_button: abort_button, next_button: next_button, skip_store_for: skip_store_for, - disable_buttons: disable_buttons + disable_buttons: disable_buttons, + back_handler: proc { back_handler }, + abort_handler: proc { abort_handler } ) end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.0.72/library/cwm/src/modules/CWM.rb new/yast2-4.0.73/library/cwm/src/modules/CWM.rb --- old/yast2-4.0.72/library/cwm/src/modules/CWM.rb 2018-04-27 16:57:00.000000000 +0200 +++ new/yast2-4.0.73/library/cwm/src/modules/CWM.rb 2018-05-08 16:52:01.000000000 +0200 @@ -942,12 +942,15 @@ # Useful mainly when some widget returns an event that should not trigger the storing, # like a reset button or a redrawing. It will skip also validation, because it is not needed # as nothing is stored. - # @param [Proc] abort_handler handler that is called after click on abort. If it returns false, - # then it stops abort. If it return true, then it returns :abort symbol. If handler is not - # defined, then it acts like if it return true. + # @param [Proc] back_handler handler that is called after clicking on back. If it returns false, + # then it does not go back. If it returns true, then :back symbol is returned. If handler is not + # defined, then it acts like if it returns true. + # @param [Proc] abort_handler handler that is called after clicking on abort. If it returns false, + # then it stops abort. If it returns true, then :abort symbol is returned. If handler is not + # defined, then it acts like if it returns true. # @return [Symbol] wizard sequencer symbol def show(contents, caption: nil, back_button: nil, next_button: nil, abort_button: nil, skip_store_for: [], - disable_buttons: [], abort_handler: nil) + disable_buttons: [], back_handler: nil, abort_handler: nil) widgets = widgets_in_contents(contents) options = { "contents" => widgets_contents(contents), @@ -960,7 +963,9 @@ options["abort_button"] = abort_button if abort_button options["skip_store_for"] = skip_store_for options["disable_buttons"] = disable_buttons - options["fallback_functions"] = { abort: Yast.fun_ref(abort_handler, "boolean ()") } if abort_handler + options["fallback_functions"] = {} + options["fallback_functions"][:back] = Yast.fun_ref(back_handler, "boolean ()") if back_handler + options["fallback_functions"][:abort] = Yast.fun_ref(abort_handler, "boolean ()") if abort_handler ShowAndRun(options) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.0.72/library/cwm/test/dialog_test.rb new/yast2-4.0.73/library/cwm/test/dialog_test.rb --- old/yast2-4.0.72/library/cwm/test/dialog_test.rb 2018-04-27 16:57:00.000000000 +0200 +++ new/yast2-4.0.73/library/cwm/test/dialog_test.rb 2018-05-08 16:52:01.000000000 +0200 @@ -15,6 +15,12 @@ include_examples "CWM::Dialog" describe ".run" do + before do + allow(Yast::Wizard).to receive(:IsWizardDialog).and_return(false) + allow(Yast::Wizard).to receive(:CreateDialog) + allow(Yast::Wizard).to receive(:CloseDialog) + end + it "opens a dialog when needed, and calls CWM#show" do expect(Yast::Wizard).to receive(:IsWizardDialog).and_return(false) expect(Yast::Wizard).to receive(:CreateDialog) @@ -32,5 +38,25 @@ expect(subject.class.run).to eq(:launch) end + + it "passes the back handler to CWM#show" do + expect(Yast::CWM).to receive(:show) do |_content, options| + expect(options).to include(:back_handler) + # Checking the default handler is passed (simply returns true) + expect(options[:back_handler].call).to eq(true) + end + + subject.class.run + end + + it "passes the abort handler to CWM#show" do + expect(Yast::CWM).to receive(:show) do |_content, options| + expect(options).to include(:abort_handler) + # Checking the default handler is passed (simply returns true) + expect(options[:abort_handler].call).to eq(true) + end + + subject.class.run + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.0.72/package/yast2.changes new/yast2-4.0.73/package/yast2.changes --- old/yast2-4.0.72/package/yast2.changes 2018-04-27 16:57:00.000000000 +0200 +++ new/yast2-4.0.73/package/yast2.changes 2018-05-08 16:52:01.000000000 +0200 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Tue May 8 10:21:07 UTC 2018 - jlopez@suse.com + +- CWM: allow to define back handler for CWM#show. +- CWM: define default handlers for back and abort in CWM::Dialog. +- Needed for Expert Partitioner fate#318196. +- 4.0.73 + +------------------------------------------------------------------- Mon Apr 23 19:03:40 UTC 2018 - igonzalezsosa@suse.com - Add a text helper to wrap richtext in directional markers diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.0.72/package/yast2.spec new/yast2-4.0.73/package/yast2.spec --- old/yast2-4.0.72/package/yast2.spec 2018-04-27 16:57:00.000000000 +0200 +++ new/yast2-4.0.73/package/yast2.spec 2018-05-08 16:52:01.000000000 +0200 @@ -16,7 +16,7 @@ # Name: yast2 -Version: 4.0.72 +Version: 4.0.73 Release: 0 Summary: YaST2 - Main Package License: GPL-2.0