Hello community, here is the log from the commit of package libyui for openSUSE:Factory checked in at 2019-04-21 09:01:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libyui (Old) and /work/SRC/openSUSE:Factory/.libyui.new.5536 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libyui" Sun Apr 21 09:01:36 2019 rev:37 rq:695296 version:3.5.0 Changes: -------- --- /work/SRC/openSUSE:Factory/libyui/libyui.changes 2018-11-08 09:40:32.393656710 +0100 +++ /work/SRC/openSUSE:Factory/.libyui.new.5536/libyui.changes 2019-04-21 09:01:40.298429364 +0200 @@ -1,0 +2,6 @@ +Thu Dec 20 09:53:15 UTC 2018 - Rodion Iafarov <[email protected]> + +- Add changes required for the libyui-rest-api (bsc#1132247) +- 3.5.0 + +------------------------------------------------------------------- Old: ---- libyui-3.4.2.tar.bz2 New: ---- libyui-3.5.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libyui-doc.spec ++++++ --- /var/tmp/diff_new_pack.CWf3Sb/_old 2019-04-21 09:01:41.026430229 +0200 +++ /var/tmp/diff_new_pack.CWf3Sb/_new 2019-04-21 09:01:41.046430253 +0200 @@ -1,7 +1,7 @@ # # spec file for package libyui-doc # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,10 +17,10 @@ %define parent libyui -%define so_version 9 +%define so_version 10 Name: %{parent}-doc -Version: 3.4.2 +Version: 3.5.0 Release: 0 Source: %{parent}-%{version}.tar.bz2 ++++++ libyui.spec ++++++ --- /var/tmp/diff_new_pack.CWf3Sb/_old 2019-04-21 09:01:41.106430324 +0200 +++ /var/tmp/diff_new_pack.CWf3Sb/_new 2019-04-21 09:01:41.122430343 +0200 @@ -1,7 +1,7 @@ # # spec file for package libyui # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,11 +17,11 @@ Name: libyui -Version: 3.4.2 +Version: 3.5.0 Release: 0 Source: %{name}-%{version}.tar.bz2 -%define so_version 9 +%define so_version 10 %define bin_name %{name}%{so_version} # optionally build with code coverage reporting, ++++++ libyui-3.4.2.tar.bz2 -> libyui-3.5.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.2/VERSION.cmake new/libyui-3.5.0/VERSION.cmake --- old/libyui-3.4.2/VERSION.cmake 2018-09-06 08:53:38.000000000 +0200 +++ new/libyui-3.5.0/VERSION.cmake 2019-04-17 18:15:06.000000000 +0200 @@ -1,6 +1,6 @@ SET( VERSION_MAJOR "3") -SET( VERSION_MINOR "4" ) -SET( VERSION_PATCH "2" ) +SET( VERSION_MINOR "5" ) +SET( VERSION_PATCH "0" ) SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${GIT_SHA1_VERSION}" ) ##### This is need for the libyui core, ONLY. @@ -8,7 +8,7 @@ # Currently you must also change so_version in libyui.spec # *and also in **all** other* libyui-*.spec files in the other repositories. # Yes, such a design is suboptimal. -SET( SONAME_MAJOR "9" ) +SET( SONAME_MAJOR "10" ) SET( SONAME_MINOR "0" ) SET( SONAME_PATCH "0" ) SET( SONAME "${SONAME_MAJOR}.${SONAME_MINOR}.${SONAME_PATCH}" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.2/package/libyui-doc.spec new/libyui-3.5.0/package/libyui-doc.spec --- old/libyui-3.4.2/package/libyui-doc.spec 2018-09-06 08:53:38.000000000 +0200 +++ new/libyui-3.5.0/package/libyui-doc.spec 2019-04-17 18:15:06.000000000 +0200 @@ -17,10 +17,10 @@ %define parent libyui -%define so_version 9 +%define so_version 10 Name: %{parent}-doc -Version: 3.4.2 +Version: 3.5.0 Release: 0 Source: %{parent}-%{version}.tar.bz2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.2/package/libyui.changes new/libyui-3.5.0/package/libyui.changes --- old/libyui-3.4.2/package/libyui.changes 2018-09-06 08:53:38.000000000 +0200 +++ new/libyui-3.5.0/package/libyui.changes 2019-04-17 18:15:06.000000000 +0200 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Thu Dec 20 09:53:15 UTC 2018 - Rodion Iafarov <[email protected]> + +- Add changes required for the libyui-rest-api (bsc#1132247) +- 3.5.0 + +------------------------------------------------------------------- Tue Aug 21 10:38:54 CEST 2018 - [email protected] - Changed dir of COPYING file. @@ -67,7 +73,7 @@ ------------------------------------------------------------------- Fri Oct 14 11:16:30 CEST 2016 - [email protected] -- Fix pre-selecting a tree item when adding it, in ncurses +- Fix pre-selecting a tree item when adding it, in ncurses (gh#libyui/libyui#86, boo#1005889). The very first item would be selected, ignoring YTreeItem::setSelected. - Added ui test before loading extended widget plugin, to avoid diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.2/package/libyui.spec new/libyui-3.5.0/package/libyui.spec --- old/libyui-3.4.2/package/libyui.spec 2018-09-06 08:53:38.000000000 +0200 +++ new/libyui-3.5.0/package/libyui.spec 2019-04-17 18:15:06.000000000 +0200 @@ -16,11 +16,11 @@ # Name: libyui -Version: 3.4.2 +Version: 3.5.0 Release: 0 Source: %{name}-%{version}.tar.bz2 -%define so_version 9 +%define so_version 10 %define bin_name %{name}%{so_version} # optionally build with code coverage reporting, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.2/src/YPushButton.h new/libyui-3.5.0/src/YPushButton.h --- old/libyui-3.4.2/src/YPushButton.h 2018-09-06 08:53:38.000000000 +0200 +++ new/libyui-3.5.0/src/YPushButton.h 2019-04-17 18:15:06.000000000 +0200 @@ -216,6 +216,13 @@ { setLabel( str ); } + /** + * Activate the button. Can be used in tests to simulate user input. + * + * Derived classes are required to implement this. + **/ + virtual void activate() = 0; + private: ImplPtr<YPushButtonPrivate> priv; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.2/src/YTable.cc new/libyui-3.5.0/src/YTable.cc --- old/libyui-3.4.2/src/YTable.cc 2018-09-06 08:53:38.000000000 +0200 +++ new/libyui-3.5.0/src/YTable.cc 2019-04-17 18:15:06.000000000 +0200 @@ -146,6 +146,32 @@ return ! YSelectionWidget::enforceSingleSelection(); } +YItem * +YTable::findItem( const std::string & wantedItemLabel, int column ) const +{ + return YTable::findItem( wantedItemLabel, column, itemsBegin(), itemsEnd() ); +} + + +YItem * +YTable::findItem( const std::string & wantedItemLabel, + int column, + YItemConstIterator begin, + YItemConstIterator end ) const +{ + if ( ! hasColumn( column ) ) + return nullptr; + + for ( YItemConstIterator it = begin; it != end; ++it ) + { + auto * item = dynamic_cast<YTableItem *>(*it); + + if ( item && item->label( column ) == wantedItemLabel ) + return item; + } + + return nullptr; +} const YPropertySet & YTable::propertySet() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.2/src/YTable.h new/libyui-3.5.0/src/YTable.h --- old/libyui-3.4.2/src/YTable.h 2018-09-06 08:53:38.000000000 +0200 +++ new/libyui-3.5.0/src/YTable.h 2019-04-17 18:15:06.000000000 +0200 @@ -144,6 +144,19 @@ bool hasMultiSelection() const; /** + * Try to find an item with label 'wantedItemLabel' in column 'column' + * between iterators 'begin' and 'end'. Return that item or 0 if there is + * none. + **/ + + YItem * findItem( const std::string & wantedItemLabel, int column ) const; + + YItem * findItem( const std::string & wantedItemLabel, + int column, + YItemConstIterator begin, + YItemConstIterator end ) const; + + /** * Notification that a cell (its text and/or its icon) was changed from the * outside. Applications are required to call this whenever a table cell is * changed after adding the corresponding table item (the row) to the table diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.2/src/YUI.cc new/libyui-3.5.0/src/YUI.cc --- old/libyui-3.4.2/src/YUI.cc 2018-09-06 08:53:38.000000000 +0200 +++ new/libyui-3.5.0/src/YUI.cc 2019-04-17 18:15:06.000000000 +0200 @@ -48,6 +48,7 @@ #include "YEnvVar.h" #include "YBuiltinCaller.h" #include "YWidgetID.h" +#include "YUIPlugin.h" using std::endl; @@ -76,6 +77,7 @@ { yuiMilestone() << "This is libyui " << VERSION << std::endl; yuiMilestone() << "Creating UI " << ( withThreads ? "with" : "without" ) << " threads" << endl; + _ui = this; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.2/src/YUILoader.cc new/libyui-3.5.0/src/YUILoader.cc --- old/libyui-3.4.2/src/YUILoader.cc 2018-09-06 08:53:38.000000000 +0200 +++ new/libyui-3.5.0/src/YUILoader.cc 2019-04-17 18:15:06.000000000 +0200 @@ -42,9 +42,11 @@ void YUILoader::loadUI( bool withThreads ) { bool isGtk = false; - const char * envDesktop = getenv( "XDG_CURRENT_DESKTOP" ) ?: ""; - const char * envDisplay = getenv( "DISPLAY" ) ?: ""; - const char * envPreset = getenv( "YUI_PREFERED_BACKEND" ) ?: ""; + const char * envDesktop = getenv( "XDG_CURRENT_DESKTOP" ) ?: ""; + const char * envDisplay = getenv( "DISPLAY" ) ?: ""; + const char * envPreset = getenv( "YUI_PREFERED_BACKEND" ) ?: ""; + const char * envTestEnable = getenv( "Y2TEST" ) ? : ""; + std::string wantedGUI; yuiMilestone () << "DISPLAY: \"" << envDisplay << "\"" << std::endl; @@ -120,7 +122,18 @@ try { - loadPlugin( wantedGUI, withThreads ); + // Load integration testing framework plugin, which load required UI + // There is no support for GTK planned, so not loading rest api + // plugin in case gtk was requested + if ( strcmp( envTestEnable, "1" ) == 0 && wantedGUI != YUIPlugin_Gtk ) + { + loadRestAPIPlugin( wantedGUI, withThreads ); + } + else + { + loadPlugin( wantedGUI, withThreads ); + } + return; } @@ -156,6 +169,49 @@ } } +void YUILoader::loadRestAPIPlugin( const std::string & wantedGUI, bool withThreads ) +{ + // Do not try to load if variable is not set + yuiMilestone () << "Requested to start http server to control UI." << std::endl; + if( pluginExists( YUIPlugin_RestAPI ) ) + { + // TODO: Do not load unused libraries + // Load underlying UI plugin, as test method inherits from it + // YUIPlugin_Test uses both libraries to be single point of entry + YUIPlugin uiPluginNC( YUIPlugin_NCurses ); + YUIPlugin uiPluginQT( YUIPlugin_Qt ); + YUIPlugin uiTestPlugin( YUIPlugin_RestAPI ); + + yuiMilestone () << "User-selected underlying UI-plugin: \"" << wantedGUI << "\"" << std::endl; + if ( uiPluginNC.success() && uiPluginQT.success() && uiTestPlugin.success() ) + { + yuiMilestone () << "Loading http server to control UI." << std::endl; + + createUIFunction_t createUI = 0; + // Only QT an Ncurses are supported + if( wantedGUI == YUIPlugin_Qt ) + { + createUI = (createUIFunction_t) uiTestPlugin.locateSymbol( "createYQHttpUI" ); + } + else if( wantedGUI == YUIPlugin_NCurses ) { + createUI = (createUIFunction_t) uiTestPlugin.locateSymbol( "createYNCHttpUI" ); + } + + if ( createUI ) + { + YUI * ui = createUI( withThreads ); // no threads + // Same as in loadPlugin + atexit(deleteUI); + + if ( ui ) + return; + } + } + } + // Throw an exception if loading of the plugin failed + YUI_THROW ( YUIPluginException ( YUIPlugin_RestAPI ) ); +} + void YUILoader::deleteUI() { if ( YUI::_ui ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.2/src/YUILoader.h new/libyui-3.5.0/src/YUILoader.h --- old/libyui-3.4.2/src/YUILoader.h 2018-09-06 08:53:38.000000000 +0200 +++ new/libyui-3.5.0/src/YUILoader.h 2019-04-17 18:15:06.000000000 +0200 @@ -37,7 +37,7 @@ #define YUIPlugin_Qt "qt" #define YUIPlugin_NCurses "ncurses" #define YUIPlugin_Gtk "gtk" - +#define YUIPlugin_RestAPI "rest-api" /** * Class to load one of the concrete UI plug-ins: Qt, NCurses, Gtk. @@ -98,6 +98,12 @@ static void deleteUI(); /** + * Method handles loading integration test framework and load underlying GUI + * using hints from loadUI. + **/ + static void loadRestAPIPlugin( const std::string & wantedGUI, bool withThreads = false ); + + /** * Load a UI plug-in. 'name' is one of the YUIPlugin_ -defines above. * * This might throw exceptions. @@ -161,4 +167,13 @@ **/ typedef YExternalWidgets * (*createEWFunction_t)( const char * ); +/** + * For the integration testing YUI has separate framework which allows to have + * control over UI using REST API. Server has to be started after testing framework + * plugin is loaded, which is done by the method which creates server instance. + * Not to have additional definition imports, we define it as void here. + * In the framework calls it can be used to +**/ +typedef void (*getServerFunction_t)(); + #endif // YUILoader_h diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.4.2/src/YWizard.h new/libyui-3.5.0/src/YWizard.h --- old/libyui-3.4.2/src/YWizard.h 2018-09-06 08:53:38.000000000 +0200 +++ new/libyui-3.5.0/src/YWizard.h 2019-04-17 18:15:06.000000000 +0200 @@ -183,10 +183,19 @@ virtual void setDialogTitle( const std::string & titleText ) = 0; /** + * Get the current dialog title shown in the window manager's title bar. + **/ + virtual std::string getDialogTitle() = 0; + + /** * Set the dialog heading. **/ virtual void setDialogHeading( const std::string & headingText ) = 0; + /** + * Get the dialog heading. + **/ + virtual std::string getDialogHeading() = 0; // // Steps handling
