Hello community,

here is the log from the commit of package yast2 for openSUSE:Factory checked 
in at 2015-07-27 09:09:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2 (Old)
 and      /work/SRC/openSUSE:Factory/.yast2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2"

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2/yast2.changes      2015-07-22 
09:19:23.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.yast2.new/yast2.changes 2015-07-27 
09:09:13.000000000 +0200
@@ -1,0 +2,7 @@
+Tue Jul 21 14:44:04 UTC 2015 - jreidin...@suse.com
+
+- Allow Dialog class to support alternative ways how to get user
+  input (needed for yast2-vnc module) (bnc#938944)
+- 3.1.142
+
+-------------------------------------------------------------------

Old:
----
  yast2-3.1.141.tar.bz2

New:
----
  yast2-3.1.142.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2.spec ++++++
--- /var/tmp/diff_new_pack.RHvThy/_old  2015-07-27 09:09:14.000000000 +0200
+++ /var/tmp/diff_new_pack.RHvThy/_new  2015-07-27 09:09:14.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2
-Version:        3.1.141
+Version:        3.1.142
 Release:        0
 Url:            https://github.com/yast/yast-yast2
 

++++++ yast2-3.1.141.tar.bz2 -> yast2-3.1.142.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-3.1.141/library/general/src/lib/ui/event_dispatcher.rb 
new/yast2-3.1.142/library/general/src/lib/ui/event_dispatcher.rb
--- old/yast2-3.1.141/library/general/src/lib/ui/event_dispatcher.rb    
2015-07-20 10:41:38.000000000 +0200
+++ new/yast2-3.1.142/library/general/src/lib/ui/event_dispatcher.rb    
2015-07-22 11:51:37.000000000 +0200
@@ -36,7 +36,7 @@
       @_finish_dialog_flag = false
 
       loop do
-        input = Yast::UI.UserInput
+        input = user_input
         if respond_to?(:"#{input}_handler")
           send(:"#{input}_handler")
           return @_finish_dialog_value if @_finish_dialog_flag
@@ -46,6 +46,44 @@
       end
     end
 
+    # Reads input for next event dispath
+    # Can be redefined to modify the way of getting user input, like 
introducing a timeout.
+    # Default implementation uses Yast::UI.UserInput which waits indefinitely 
for user input.
+    # @example use user input with timeout
+    #    class OKDialog
+    #     include Yast::UIShortcuts
+    #     include Yast::Logger
+    #     include UI::EventDispatcher
+    #     Yast.import "UI"
+    #
+    #     def user_input
+    #       Yast::UI.TimeoutUserInput(1000)
+    #     end
+    #
+    #     def run
+    #       return nil unless Yast::UI.OpenDialog(
+    #         HBox(
+    #           PushButton(Id(:ok), "OK"),
+    #           PushButton(Id(:cancel), "Cancel")
+    #         )
+    #       )
+    #       begin
+    #         return event_loop
+    #       ensure
+    #          Yast::UI.CloseDialog
+    #       end
+    #     end
+    #
+    #     def ok_handler
+    #       finish_dialog(:ok)
+    #       log.info "OK button pressed"
+    #     end
+    #   end
+
+    def user_input
+      Yast::UI.UserInput
+    end
+
     # Set internal flag to not continue with processing other UI inputs
     # @param return_value[Object] value to return from event_loop
     def finish_dialog(return_value = nil)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-3.1.141/library/general/test/event_dispatcher_test.rb 
new/yast2-3.1.142/library/general/test/event_dispatcher_test.rb
--- old/yast2-3.1.141/library/general/test/event_dispatcher_test.rb     
2015-07-20 10:41:38.000000000 +0200
+++ new/yast2-3.1.142/library/general/test/event_dispatcher_test.rb     
2015-07-22 11:51:37.000000000 +0200
@@ -37,6 +37,29 @@
   end
 end
 
+class DispatcherUserInputTestDialog
+  include Yast::UIShortcuts
+  include UI::EventDispatcher
+  Yast.import "UI"
+
+  def run
+    return nil unless Yast::UI.OpenDialog(
+      HBox(
+        PushButton(Id(:cancel), "Cancel")
+      )
+    )
+    begin
+      return event_loop
+    ensure
+      Yast::UI.CloseDialog
+    end
+  end
+
+  def user_input
+    Yast::UI.TimeoutUserInput(1000)
+  end
+end
+
 describe UI::EventDispatcher do
   subject { DispatcherTestDialog.new }
 
@@ -63,7 +86,15 @@
     it "raise exception if handler is not defined" do
       mock_ui_events(:unknown)
 
-      expect { subject.event_loop }.to raise_error
+      expect { subject.event_loop }.to raise_error(RuntimeError)
+    end
+
+    it "uses user_input to get input" do
+      dialog = DispatcherUserInputTestDialog.new
+      expect(Yast::UI).to 
receive(:TimeoutUserInput).with(1000).and_return(:cancel)
+      expect(Yast::UI).to_not receive(:UserInput)
+
+      dialog.event_loop
     end
   end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-3.1.141/package/yast2.changes 
new/yast2-3.1.142/package/yast2.changes
--- old/yast2-3.1.141/package/yast2.changes     2015-07-20 10:41:38.000000000 
+0200
+++ new/yast2-3.1.142/package/yast2.changes     2015-07-22 11:51:37.000000000 
+0200
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Tue Jul 21 14:44:04 UTC 2015 - jreidin...@suse.com
+
+- Allow Dialog class to support alternative ways how to get user
+  input (needed for yast2-vnc module) (bnc#938944)
+- 3.1.142
+
+-------------------------------------------------------------------
 Fri Jul 17 08:28:41 UTC 2015 - igonzalezs...@suse.com
 
 - Do not try to load snapper extension as it does not exists anymore
@@ -16,7 +23,7 @@
 Mon Jul  6 18:02:27 CEST 2015 - shundham...@suse.de
 
 - Cleanup for snapshots made during installation (bnc#935923)
-- 3.1.139 
+- 3.1.139
 
 -------------------------------------------------------------------
 Wed Jul  1 13:46:26 UTC 2015 - jreidin...@suse.com
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-3.1.141/package/yast2.spec 
new/yast2-3.1.142/package/yast2.spec
--- old/yast2-3.1.141/package/yast2.spec        2015-07-20 10:41:38.000000000 
+0200
+++ new/yast2-3.1.142/package/yast2.spec        2015-07-22 11:51:37.000000000 
+0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2
-Version:        3.1.141
+Version:        3.1.142
 Release:        0
 Url:            https://github.com/yast/yast-yast2
 


Reply via email to