Skip to content

Commit

Permalink
Added OpenUI, CloseUI (boo#937026).
Browse files Browse the repository at this point in the history
  • Loading branch information
mvidner committed Jul 8, 2015
1 parent 608a2e0 commit 5f68c18
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 7 deletions.
6 changes: 6 additions & 0 deletions package/yast2-ycp-ui-bindings.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jul 8 12:40:33 UTC 2015 - mvidner@suse.com

- Added OpenUI, CloseUI (boo#937026).
- 3.1.9

-------------------------------------------------------------------
Wed Jul 1 11:28:01 UTC 2015 - jreidinger@suse.com

Expand Down
10 changes: 3 additions & 7 deletions package/yast2-ycp-ui-bindings.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-ycp-ui-bindings
Version: 3.1.8
Version: 3.1.9
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand All @@ -37,13 +37,9 @@ BuildRequires: sgml-skel

Requires: yast2-core
BuildRequires: yast2-core-devel
Conflicts: yast2-core < 2.16.38

# dependecies for new libyui
Conflicts: yast2 < 2.23.0
Conflicts: yast2-libyui < 2.42.0

BuildRequires: libyui-devel >= 3.1.2
# YApplication::openUI/closeUI
BuildRequires: libyui-devel >= 3.2.0

# libyui ImplPtr
BuildRequires: boost-devel
Expand Down
29 changes: 29 additions & 0 deletions src/YCP_UI.cc
Expand Up @@ -619,6 +619,35 @@ YCPValue YCP_UI::CloseDialog()
}


/**
* @builtin OpenUI()
* @short Opens NCurses and disables stdout
* @description
* To mix TUI (NCurses) with stdio, enclose the UI parts
* within an OpenUI/CloseUI pair.
*
* @return void
*/

void YCP_UI::OpenUI()
{
YUI::app()->openUI();
}


/**
* @builtin CloseUI()
* @short Closes NCurses and enables stdout
*
* @return void
*/

void YCP_UI::CloseUI()
{
YUI::app()->closeUI();
}



/**
* @builtin ChangeWidget
Expand Down
2 changes: 2 additions & 0 deletions src/YCP_UI.h
Expand Up @@ -58,6 +58,7 @@ class YCP_UI
static YCPValue ChangeWidget ( const YCPValue & widgetId, const YCPValue & property, const YCPValue & new_value );
static void CheckShortcuts ();
static YCPValue CloseDialog ();
static void CloseUI ();
static void DumpWidgetTree ();
static void FakeUserInput ( const YCPValue & nextInput );
static YCPMap GetDisplayInfo ();
Expand All @@ -69,6 +70,7 @@ class YCP_UI
static void NormalCursor ();
static YCPBoolean OpenContextMenu ( const YCPTerm & term );
static YCPBoolean OpenDialog ( const YCPTerm & opts, const YCPTerm & dialogTerm );
static void OpenUI ();
static void PlayMacro ( const YCPString & filename );
static void PostponeShortcutCheck ();
static YCPValue QueryWidget ( const YCPValue & widgetId, const YCPValue& property );
Expand Down
19 changes: 19 additions & 0 deletions src/YUINamespace.cc
Expand Up @@ -217,6 +217,25 @@ YUINamespace::CloseDialog()
}


YCPValue
YUINamespace::OpenUI()
{
if ( YUIComponent::ui() )
YCP_UI::OpenUI();

return YCPVoid();
}

YCPValue
YUINamespace::CloseUI()
{
if ( YUIComponent::ui() )
YCP_UI::CloseUI();

return YCPVoid();
}


YCPValue
YUINamespace::ChangeWidget( const YCPSymbol & widget_id, const YCPSymbol & property, const YCPValue & new_value )
{
Expand Down
6 changes: 6 additions & 0 deletions src/YUINamespace.h
Expand Up @@ -189,6 +189,12 @@ class YUINamespace: public Y2Namespace
/* TYPEINFO: boolean() */
YCPValue CloseDialog();

/* TYPEINFO: void() */
YCPValue OpenUI();

/* TYPEINFO: void() */
YCPValue CloseUI();

/* TYPEINFO: boolean (symbol, symbol, any) */
YCPValue ChangeWidget( const YCPSymbol & widget_id, const YCPSymbol & property, const YCPValue & /*nil*/ new_value );

Expand Down

0 comments on commit 5f68c18

Please sign in to comment.