Hello community, here is the log from the commit of package libyui-ncurses for openSUSE:Factory checked in at 2019-07-08 14:59:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libyui-ncurses (Old) and /work/SRC/openSUSE:Factory/.libyui-ncurses.new.4615 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libyui-ncurses" Mon Jul 8 14:59:45 2019 rev:46 rq:713066 version:2.52.0 Changes: -------- --- /work/SRC/openSUSE:Factory/libyui-ncurses/libyui-ncurses.changes 2019-06-28 16:34:24.598647079 +0200 +++ /work/SRC/openSUSE:Factory/.libyui-ncurses.new.4615/libyui-ncurses.changes 2019-07-08 14:59:46.634421363 +0200 @@ -1,0 +2,7 @@ +Fri Jun 28 13:52:07 UTC 2019 - Ladislav Slezák <[email protected]> + +- Send the notify events also when some widgets are changed via the + REST API (CheckBox, RadioButton, InputField) (bsc#1139747) +- 2.52.0 + +------------------------------------------------------------------- Old: ---- libyui-ncurses-2.51.0.tar.bz2 New: ---- libyui-ncurses-2.52.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libyui-ncurses-doc.spec ++++++ --- /var/tmp/diff_new_pack.SHuKOg/_old 2019-07-08 14:59:47.326422409 +0200 +++ /var/tmp/diff_new_pack.SHuKOg/_new 2019-07-08 14:59:47.326422409 +0200 @@ -20,7 +20,7 @@ %define so_version 10 Name: %{parent}-doc -Version: 2.51.0 +Version: 2.52.0 Release: 0 Source: %{parent}-%{version}.tar.bz2 ++++++ libyui-ncurses.spec ++++++ --- /var/tmp/diff_new_pack.SHuKOg/_old 2019-07-08 14:59:47.366422469 +0200 +++ /var/tmp/diff_new_pack.SHuKOg/_new 2019-07-08 14:59:47.370422475 +0200 @@ -17,7 +17,7 @@ Name: libyui-ncurses -Version: 2.51.0 +Version: 2.52.0 Release: 0 Source: %{name}-%{version}.tar.bz2 ++++++ libyui-ncurses-2.51.0.tar.bz2 -> libyui-ncurses-2.52.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-2.51.0/.travis.yml new/libyui-ncurses-2.52.0/.travis.yml --- old/libyui-ncurses-2.51.0/.travis.yml 2019-04-17 17:53:37.000000000 +0200 +++ new/libyui-ncurses-2.52.0/.travis.yml 2019-07-02 15:44:07.000000000 +0200 @@ -5,6 +5,8 @@ before_install: - docker build -t libyui-ncurses-image . + # list the installed packages (just for easier debugging) + - docker run --rm -it libyui-ncurses-image rpm -qa | sort script: # the "libyui-travis" script is included in the base libyui/devel image # see https://github.com/libyui/docker-devel/blob/master/libyui-travis diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-2.51.0/Dockerfile new/libyui-ncurses-2.52.0/Dockerfile --- old/libyui-ncurses-2.51.0/Dockerfile 2019-04-17 17:53:37.000000000 +0200 +++ new/libyui-ncurses-2.52.0/Dockerfile 2019-07-02 15:44:07.000000000 +0200 @@ -1,4 +1,4 @@ -# Use the libyui/devel image as the base -FROM libyui/devel +# Use the libyui-devel image as the base +FROM registry.opensuse.org/devel/libraries/libyui/containers/libyui-devel:latest COPY . /usr/src/app diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-2.51.0/VERSION.cmake new/libyui-ncurses-2.52.0/VERSION.cmake --- old/libyui-ncurses-2.51.0/VERSION.cmake 2019-04-17 17:53:37.000000000 +0200 +++ new/libyui-ncurses-2.52.0/VERSION.cmake 2019-07-02 15:44:07.000000000 +0200 @@ -1,5 +1,5 @@ SET( VERSION_MAJOR "2" ) -SET( VERSION_MINOR "51" ) +SET( VERSION_MINOR "52" ) SET( VERSION_PATCH "0" ) SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${GIT_SHA1_VERSION}" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-2.51.0/package/libyui-ncurses-doc.spec new/libyui-ncurses-2.52.0/package/libyui-ncurses-doc.spec --- old/libyui-ncurses-2.51.0/package/libyui-ncurses-doc.spec 2019-04-17 17:53:37.000000000 +0200 +++ new/libyui-ncurses-2.52.0/package/libyui-ncurses-doc.spec 2019-07-02 15:44:07.000000000 +0200 @@ -19,7 +19,7 @@ %define so_version 10 Name: %{parent}-doc -Version: 2.51.0 +Version: 2.52.0 Release: 0 Source: %{parent}-%{version}.tar.bz2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-2.51.0/package/libyui-ncurses.changes new/libyui-ncurses-2.52.0/package/libyui-ncurses.changes --- old/libyui-ncurses-2.51.0/package/libyui-ncurses.changes 2019-04-17 17:53:37.000000000 +0200 +++ new/libyui-ncurses-2.52.0/package/libyui-ncurses.changes 2019-07-02 15:44:07.000000000 +0200 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Fri Jun 28 13:52:07 UTC 2019 - Ladislav Slezák <[email protected]> + +- Send the notify events also when some widgets are changed via the + REST API (CheckBox, RadioButton, InputField) (bsc#1139747) +- 2.52.0 + +------------------------------------------------------------------- Wed Apr 17 13:51:42 UTC 2019 - Ladislav Slezak <[email protected]> - Adapt to the latest libyui base library (REST API extension) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-2.51.0/package/libyui-ncurses.spec new/libyui-ncurses-2.52.0/package/libyui-ncurses.spec --- old/libyui-ncurses-2.51.0/package/libyui-ncurses.spec 2019-04-17 17:53:37.000000000 +0200 +++ new/libyui-ncurses-2.52.0/package/libyui-ncurses.spec 2019-07-02 15:44:07.000000000 +0200 @@ -17,7 +17,7 @@ Name: libyui-ncurses -Version: 2.51.0 +Version: 2.52.0 Release: 0 Source: %{name}-%{version}.tar.bz2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-2.51.0/src/NCCheckBox.cc new/libyui-ncurses-2.52.0/src/NCCheckBox.cc --- old/libyui-ncurses-2.51.0/src/NCCheckBox.cc 2019-04-17 17:53:37.000000000 +0200 +++ new/libyui-ncurses-2.52.0/src/NCCheckBox.cc 2019-07-02 15:44:07.000000000 +0200 @@ -26,6 +26,7 @@ #include <yui/YUILog.h> #include "NCurses.h" #include "NCCheckBox.h" +#include "YNCursesUI.h" unsigned char NCCheckBox::statetag[3] = { '?', ' ', 'x' }; @@ -88,6 +89,8 @@ void NCCheckBox::setValue( YCheckBoxState state ) { + YCheckBoxState old = value(); + switch ( state ) { case YCheckBox_on: @@ -107,6 +110,14 @@ } Redraw(); + + // trigger the notify event if enabled + if (old != state && notify()) + { + NCursesEvent event = NCursesEvent::ValueChanged; + event.widget = this; + YNCursesUI::ui()->sendEvent(event); + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-2.51.0/src/NCDialog.cc new/libyui-ncurses-2.52.0/src/NCDialog.cc --- old/libyui-ncurses-2.51.0/src/NCDialog.cc 2019-04-17 17:53:37.000000000 +0200 +++ new/libyui-ncurses-2.52.0/src/NCDialog.cc 2019-07-02 15:44:07.000000000 +0200 @@ -1081,10 +1081,19 @@ case WEOF: + if (pendingEvent) + { +#if VERBOSE_EVENTS + yuiDebug() << "Keeping the pending event" << std::endl; +#endif + } + else + { if ( timeout_millisec == -1 ) pendingEvent = NCursesEvent::cancel; else if ( timeout_millisec > 0 ) pendingEvent = NCursesEvent::timeout; + } break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-2.51.0/src/NCDialog.h new/libyui-ncurses-2.52.0/src/NCDialog.h --- old/libyui-ncurses-2.51.0/src/NCDialog.h 2019-04-17 17:53:37.000000000 +0200 +++ new/libyui-ncurses-2.52.0/src/NCDialog.h 2019-07-02 15:44:07.000000000 +0200 @@ -178,6 +178,11 @@ **/ virtual void activate(); + // Get the pending event, only for special cases (REST API) + NCursesEvent getPendingEvent() { return pendingEvent;} + // Set the pending event, makes sense only when simulating the user actions (REST API) + void setPendingEvent(NCursesEvent event) { pendingEvent = event;} + protected: enum NCDopts diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-2.51.0/src/NCInputField.cc new/libyui-ncurses-2.52.0/src/NCInputField.cc --- old/libyui-ncurses-2.51.0/src/NCInputField.cc 2019-04-17 17:53:37.000000000 +0200 +++ new/libyui-ncurses-2.52.0/src/NCInputField.cc 2019-07-02 15:44:07.000000000 +0200 @@ -28,6 +28,7 @@ #include <yui/YUILog.h> #include "NCurses.h" #include "NCInputField.h" +#include "YNCursesUI.h" #include <wctype.h> // iswalnum() @@ -177,6 +178,7 @@ void NCInputField::setValue( const std::string & ntext ) { + std::string old_value = value(); buffer = NCstring( ntext ).str(); if ( maxInputLength && buffer.length() > maxInputLength ) @@ -188,6 +190,13 @@ curpos = buffer.length(); tUpdate(); + + if (notify() && old_value != ntext) + { + NCursesEvent event = NCursesEvent::ValueChanged; + event.widget = this; + YNCursesUI::ui()->sendEvent(event); + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-2.51.0/src/NCPushButton.cc new/libyui-ncurses-2.52.0/src/NCPushButton.cc --- old/libyui-ncurses-2.51.0/src/NCPushButton.cc 2019-04-17 17:53:37.000000000 +0200 +++ new/libyui-ncurses-2.52.0/src/NCPushButton.cc 2019-07-02 15:44:07.000000000 +0200 @@ -28,6 +28,7 @@ #include "NCDialog.h" #include "NCurses.h" #include "NCPushButton.h" +#include "YNCursesUI.h" NCPushButton::NCPushButton( YWidget * parent, const std::string & nlabel ) @@ -123,10 +124,11 @@ NC::CENTER ); } +// pressing the button void NCPushButton::activate() { - // focus the button - setKeyboardFocus(); - // and fake pressing the RETURN key - ::ungetch(KEY_RETURN); + // send an activation event for this widget + NCursesEvent event = NCursesEvent::Activated; + event.widget = this; + YNCursesUI::ui()->sendEvent(event); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-2.51.0/src/NCRadioButton.cc new/libyui-ncurses-2.52.0/src/NCRadioButton.cc --- old/libyui-ncurses-2.51.0/src/NCRadioButton.cc 2019-04-17 17:53:37.000000000 +0200 +++ new/libyui-ncurses-2.52.0/src/NCRadioButton.cc 2019-07-02 15:44:07.000000000 +0200 @@ -27,6 +27,7 @@ #include "NCurses.h" #include "NCRadioButton.h" #include "NCRadioButtonGroup.h" +#include "YNCursesUI.h" NCRadioButton::NCRadioButton( YWidget * parent, @@ -96,6 +97,13 @@ } Redraw(); + + if (notify()) + { + NCursesEvent event = NCursesEvent::ValueChanged; + event.widget = this; + YNCursesUI::ui()->sendEvent(event); + } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-2.51.0/src/NCWidget.h new/libyui-ncurses-2.52.0/src/NCWidget.h --- old/libyui-ncurses-2.51.0/src/NCWidget.h 2019-04-17 17:53:37.000000000 +0200 +++ new/libyui-ncurses-2.52.0/src/NCWidget.h 2019-07-02 15:44:07.000000000 +0200 @@ -39,6 +39,8 @@ #define YWIDGET_MAGIC 42 +// debug option: enable verbose event logging +#define VERBOSE_EVENTS 0 class NCWidget : public tnode<NCWidget*>, protected NCursesError { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-2.51.0/src/YNCursesUI.cc new/libyui-ncurses-2.52.0/src/YNCursesUI.cc --- old/libyui-ncurses-2.51.0/src/YNCursesUI.cc 2019-04-17 17:53:37.000000000 +0200 +++ new/libyui-ncurses-2.52.0/src/YNCursesUI.cc 2019-07-02 15:44:07.000000000 +0200 @@ -451,3 +451,28 @@ return 0; } + +void YNCursesUI::sendEvent( NCursesEvent event ) +{ + // do not send anything if the events are globally blocked + // i.e. allow masking the events caused by changes from the code + if (eventsBlocked()) + { +#if VERBOSE_EVENTS + yuiDebug() << "Events blocked, ignoring event " << event << std::endl; +#endif + return; + } + + NCDialog *dialog = dynamic_cast<NCDialog *>(NCDialog::currentDialog(false)); // don't throw + + if (dialog) + { + yuiDebug() << "Sending event: " << event << std::endl; + dialog->setPendingEvent(event); + } + else + { + yuiError() << "No dialog" << std::endl; + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-ncurses-2.51.0/src/YNCursesUI.h new/libyui-ncurses-2.52.0/src/YNCursesUI.h --- old/libyui-ncurses-2.51.0/src/YNCursesUI.h 2019-04-17 17:53:37.000000000 +0200 +++ new/libyui-ncurses-2.52.0/src/YNCursesUI.h 2019-07-02 15:44:07.000000000 +0200 @@ -126,6 +126,12 @@ * with sendWidgetID(). This returns the widget or 0 if not found. **/ YWidget * askSendWidgetID(); + + /** + * Send an event to the UI. It's used in special cases (REST API) to simulate + * the user actions. + **/ + void sendEvent( NCursesEvent event ); };
