Author: aschnell
Date: Thu Apr 3 21:12:30 2008
New Revision: 46066
URL: http://svn.opensuse.org/viewcvs/yast?rev=46066&view=rev
Log:
- extended toterm builtin
Modified:
trunk/core/VERSION
trunk/core/libycp/src/YCPBuiltinTerm.cc
trunk/core/libycp/testsuite/tests/builtin/Builtin-Term.err
trunk/core/libycp/testsuite/tests/builtin/Builtin-Term.out
trunk/core/libycp/testsuite/tests/builtin/Builtin-Term.ycp
trunk/core/package/yast2-core.changes
Modified: trunk/core/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/VERSION?rev=46066&r1=46065&r2=46066&view=diff
==============================================================================
--- trunk/core/VERSION (original)
+++ trunk/core/VERSION Thu Apr 3 21:12:30 2008
@@ -1 +1 @@
-2.16.41
+2.16.42
Modified: trunk/core/libycp/src/YCPBuiltinTerm.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libycp/src/YCPBuiltinTerm.cc?rev=46066&r1=46065&r2=46066&view=diff
==============================================================================
--- trunk/core/libycp/src/YCPBuiltinTerm.cc (original)
+++ trunk/core/libycp/src/YCPBuiltinTerm.cc Thu Apr 3 21:12:30 2008
@@ -143,7 +143,7 @@
static YCPValue
-t_toterm (const YCPValue &v)
+t_toterm1 (const YCPValue &v)
{
/**
* @builtin toterm
@@ -154,7 +154,9 @@
*
* @param any VALUE
* @return term
+ *
* @usage toterm ("VBox") -> `VBox ()
+ * @usage toterm (`VBox) -> `VBox ()
*/
if (v.isNull())
@@ -169,11 +171,49 @@
{
return YCPTerm (v->asString()->value());
}
+ else if (v->valuetype() == YT_SYMBOL)
+ {
+ return YCPTerm (v->asSymbol()->symbol());
+ }
return YCPNull();
}
static YCPValue
+t_toterm2 (const YCPSymbol &s, const YCPList &l)
+{
+ /**
+ * @builtin toterm
+ * @short Constructs a term from a symbol and a list.
+ *
+ * @description
+ * Constructs a term from a symbol and a list. Thus complement to symbolof
+ * and argsof.
+ *
+ * @param symbol s
+ * @param list l
+ * @return term
+ *
+ * @usage toterm (`RadioButton, [ `id (`test), "Test" ]) -> `RadioButton (`id (`test), "Test")
+ */
+
+ if (s.isNull () || l.isNull ())
+ {
+ return YCPNull ();
+ }
+
+ YCPTerm ret = YCPTerm (s->symbol());
+
+ for (int i = 0; i < l->size (); i++)
+ {
+ ret->add(l->value (i));
+ }
+
+ return ret;
+}
+
+
+static YCPValue
t_remove (const YCPTerm &term, const YCPInteger &i)
{
/**
@@ -242,7 +282,8 @@
{ "size", "integer (term)", (void *)t_size },
{ "symbolof", "symbol (term)", (void *)t_symbolof },
{ "select", "flex (term, integer, const flex)", (void *)t_select, DECL_NIL|DECL_FLEX },
- { "toterm", "term (any)", (void *)t_toterm },
+ { "toterm", "term (any)", (void *)t_toterm1 },
+ { "toterm", "term (symbol, const list <any>)", (void *)t_toterm2 },
{ "remove", "term (term, integer)", (void *)t_remove },
{ "argsof", "list <any> (term)", (void *)t_argsof },
{ 0 }
Modified: trunk/core/libycp/testsuite/tests/builtin/Builtin-Term.err
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libycp/testsuite/tests/builtin/Builtin-Term.err?rev=46066&r1=46065&r2=46066&view=diff
==============================================================================
--- trunk/core/libycp/testsuite/tests/builtin/Builtin-Term.err (original)
+++ trunk/core/libycp/testsuite/tests/builtin/Builtin-Term.err Thu Apr 3 21:12:30 2008
@@ -28,6 +28,22 @@
----------------------------------------------------------------------
Parsed:
----------------------------------------------------------------------
+"** toterm **"
+----------------------------------------------------------------------
+Parsed:
+----------------------------------------------------------------------
+toterm ("sym")
+----------------------------------------------------------------------
+Parsed:
+----------------------------------------------------------------------
+toterm (`sym)
+----------------------------------------------------------------------
+Parsed:
+----------------------------------------------------------------------
+toterm (`sym, [1, 2])
+----------------------------------------------------------------------
+Parsed:
+----------------------------------------------------------------------
"** remove **"
----------------------------------------------------------------------
Parsed:
@@ -38,29 +54,29 @@
----------------------------------------------------------------------
"** select **"
----------------------------------------------------------------------
-[Parser] tests/builtin/Builtin-Term.ycp:34 Warning: 'select ()' is deprecated
+[Parser] tests/builtin/Builtin-Term.ycp:41 Warning: 'select ()' is deprecated
Parsed:
----------------------------------------------------------------------
/* any -> const integer */`hirn (1, 2)[-1]:42
----------------------------------------------------------------------
-[Parser] tests/builtin/Builtin-Term.ycp:35 Warning: 'select ()' is deprecated
+[Parser] tests/builtin/Builtin-Term.ycp:42 Warning: 'select ()' is deprecated
Parsed:
----------------------------------------------------------------------
/* any -> const integer */`hirn (1, 2)[0]:42
----------------------------------------------------------------------
-[Parser] tests/builtin/Builtin-Term.ycp:36 Warning: 'select ()' is deprecated
+[Parser] tests/builtin/Builtin-Term.ycp:43 Warning: 'select ()' is deprecated
Parsed:
----------------------------------------------------------------------
/* any -> const integer */`hirn (1, 2)[1]:42
----------------------------------------------------------------------
-[Parser] tests/builtin/Builtin-Term.ycp:37 Warning: 'select ()' is deprecated
+[Parser] tests/builtin/Builtin-Term.ycp:44 Warning: 'select ()' is deprecated
Parsed:
----------------------------------------------------------------------
/* any -> const integer */`hirn (1, 2)[2]:42
----------------------------------------------------------------------
-[Parser] tests/builtin/Builtin-Term.ycp:39 Warning: 'select ()' is deprecated
+[Parser] tests/builtin/Builtin-Term.ycp:46 Warning: 'select ()' is deprecated
Parsed:
----------------------------------------------------------------------
/* any -> string */`hirn (1, 2)[0]:"wrong type"
----------------------------------------------------------------------
-[Interpreter] tests/builtin/Builtin-Term.ycp:39 Can't convert value '1' to type 'string'
+[Interpreter] tests/builtin/Builtin-Term.ycp:46 Can't convert value '1' to type 'string'
Modified: trunk/core/libycp/testsuite/tests/builtin/Builtin-Term.out
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libycp/testsuite/tests/builtin/Builtin-Term.out?rev=46066&r1=46065&r2=46066&view=diff
==============================================================================
--- trunk/core/libycp/testsuite/tests/builtin/Builtin-Term.out (original)
+++ trunk/core/libycp/testsuite/tests/builtin/Builtin-Term.out Thu Apr 3 21:12:30 2008
@@ -5,6 +5,10 @@
("** symbolof and argsof **")
(`hrombuch)
([18, false])
+("** toterm **")
+(`sym ())
+(`sym ())
+(`sym (1, 2))
("** remove **")
(`hrombuch ("b", "c"))
("** select **")
Modified: trunk/core/libycp/testsuite/tests/builtin/Builtin-Term.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libycp/testsuite/tests/builtin/Builtin-Term.ycp?rev=46066&r1=46065&r2=46066&view=diff
==============================================================================
--- trunk/core/libycp/testsuite/tests/builtin/Builtin-Term.ycp (original)
+++ trunk/core/libycp/testsuite/tests/builtin/Builtin-Term.ycp Thu Apr 3 21:12:30 2008
@@ -24,6 +24,13 @@
(argsof (`hrombuch (18, false)))
+("** toterm **")
+
+(toterm("sym"))
+(toterm(`sym))
+(toterm(`sym, [ 1, 2 ]))
+
+
("** remove **")
(remove (`hrombuch ("a", "b", "c"), 1))
Modified: trunk/core/package/yast2-core.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/package/yast2-core.changes?rev=46066&r1=46065&r2=46066&view=diff
==============================================================================
--- trunk/core/package/yast2-core.changes (original)
+++ trunk/core/package/yast2-core.changes Thu Apr 3 21:12:30 2008
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Thu Apr 03 20:54:56 CEST 2008 - aschnell@suse.de
+
+- extended toterm builtin
+- 2.16.42
+
+-------------------------------------------------------------------
Fri Mar 28 17:22:19 CET 2008 - mvidner@suse.cz
- Lazy SCR: to better suit the current naming scheme, to get .foo.bar
@@ -24,7 +30,7 @@
Mon Feb 25 18:08:53 CET 2008 - sh@suse.de
- Package split: libyui and ycp-ui-bindings are now separate pkgs
-- V 2.16.38
+- V 2.16.38
-------------------------------------------------------------------
Thu Feb 21 07:26:08 CET 2008 - coolo@suse.de
@@ -48,7 +54,7 @@
Wed Feb 20 11:42:34 CET 2008 - sh@suse.de
- Accept `opt(`immediate) for tree widget
-- V 2.16.36
+- V 2.16.36
-------------------------------------------------------------------
Wed Feb 20 11:38:25 CET 2008 - mvidner@suse.cz
@@ -65,7 +71,7 @@
- Load plug-ins for "UI", "qt", "ncurses" from one single plug-in
- Made core UI independent of YCP and liby2 (Y2Component...)
-- V 2.16.35
+- V 2.16.35
-------------------------------------------------------------------
Fri Feb 15 10:01:29 CET 2008 - lslezak@suse.cz
@@ -77,26 +83,26 @@
-------------------------------------------------------------------
Wed Feb 13 19:24:07 CET 2008 - sh@suse.de
-- Made new UI logging thread-safe
+- Made new UI logging thread-safe
-------------------------------------------------------------------
Tue Feb 12 19:24:16 CET 2008 - sh@suse.de
- New utility class YCommandLine in libyui to retrieve
argc and argv from /proc/<pid>/cmdline
-- V 2.16.34
+- V 2.16.34
-------------------------------------------------------------------
Mon Feb 11 19:23:29 CET 2008 - sh@suse.de
- Preliminary UI split: moved ycp-ui out of libyui
-- V 2.16.33
+- V 2.16.33
-------------------------------------------------------------------
Fri Feb 8 16:56:48 CET 2008 - sh@suse.de
- Moved last YCPValue out of YUI
-- V 2.16.32
+- V 2.16.32
-------------------------------------------------------------------
Fri Feb 8 11:28:32 CET 2008 - mvidner@suse.cz
@@ -109,7 +115,7 @@
Thu Feb 7 15:50:14 CET 2008 - sh@suse.de
- Moved UI built-ins out to separate class YCP_UI
-- V 2.16.30
+- V 2.16.30
-------------------------------------------------------------------
Thu Feb 7 11:09:39 CET 2008 - mvidner@suse.cz
@@ -123,35 +129,35 @@
- Moved macro recording and playing out of YUI class into new
YMacro class with static functions
-- V 2.16.29
+- V 2.16.29
-------------------------------------------------------------------
Fri Feb 1 14:48:52 CET 2008 - sh@suse.de
- Moved UI event handling from YUI to YDialog
-- V 2.16.26
+- V 2.16.26
-------------------------------------------------------------------
Thu Jan 31 15:25:52 CET 2008 - sh@suse.de
-- Simplified and unified internal UI dialog handling
+- Simplified and unified internal UI dialog handling
- V 2.16.25
-------------------------------------------------------------------
Tue Jan 29 20:02:26 CET 2008 - sh@suse.de
- YCP-less event handling in libyui core
-- V 2.16.24
+- V 2.16.24
-------------------------------------------------------------------
Fri Jan 25 19:56:35 CET 2008 - sh@suse.de
-- Improved UI syntax error handling: Open dialogs to inform the user
+- Improved UI syntax error handling: Open dialogs to inform the user
-------------------------------------------------------------------
Wed Jan 23 18:28:52 CET 2008 - sh@suse.de
-- V 2.16.23
+- V 2.16.23
-------------------------------------------------------------------
Tue Jan 22 15:42:25 CET 2008 - lslezak@suse.cz
@@ -162,7 +168,7 @@
-------------------------------------------------------------------
Tue Jan 22 15:02:51 CET 2008 - sh@suse.de
-- Improved back trace legibility: Demangling C++ symbols
+- Improved back trace legibility: Demangling C++ symbols
-------------------------------------------------------------------
Mon Jan 16 17:06:00 CET 2008 - tgoettlicher@suse.de
@@ -177,7 +183,7 @@
-------------------------------------------------------------------
Wed Jan 16 14:14:24 CET 2008 - sh@suse.de
-- Infrastructure for new stream-based UI logging
+- Infrastructure for new stream-based UI logging
-------------------------------------------------------------------
Tue Jan 15 14:22:31 CET 2008 - mvidner@suse.cz
@@ -189,7 +195,7 @@
-------------------------------------------------------------------
Mon Jan 14 12:30:00 CET 2008 - tgoettlicher@suse.de
-- minor changes in BusyIndicator widget
+- minor changes in BusyIndicator widget
- V 2.16.21
-------------------------------------------------------------------
@@ -209,7 +215,7 @@
Wed Jan 9 14:52:29 CET 2008 - sh@suse.de
- Fixed segfault upon shutting down UI
- (observed mostly on single-CPU non-hyperthreading machines)
+ (observed mostly on single-CPU non-hyperthreading machines)
- V 2.16.18
-------------------------------------------------------------------
@@ -227,7 +233,7 @@
-------------------------------------------------------------------
Tue Dec 11 18:39:03 CET 2007 - sh@suse.de
-- Fixed bug #347634: Cannot pass empty string to editable ComboBox
+- Fixed bug #347634: Cannot pass empty string to editable ComboBox
-------------------------------------------------------------------
Tue Dec 11 18:22:22 CET 2007 - sh@suse.de
@@ -240,11 +246,11 @@
Mon Dec 10 18:35:12 CET 2007 - sh@suse.de
- Moved file and directory dialogs from YUI to YApplication:
- - askForExistingDirectory(),
+ - askForExistingDirectory(),
- askForExistingFile()
- askForSaveFile()
- V 2.16.15
-
+
-------------------------------------------------------------------
Thu Dec 6 16:28:04 CET 2007 - sh@suse.de
@@ -255,7 +261,7 @@
is automatically assumed; with the new name `InputField() it
behaves like specified.
-- V 2.16.14
+- V 2.16.14
-------------------------------------------------------------------
Wed Dec 5 14:42:32 CET 2007 - sh@suse.de
@@ -269,7 +275,7 @@
-------------------------------------------------------------------
Wed Dec 5 11:53:14 CET 2007 - sh@suse.de
-- Fixed bug #346139: CheckBoxFrame is inverted
+- Fixed bug #346139: CheckBoxFrame is inverted
-------------------------------------------------------------------
Mon Dec 3 11:42:01 CET 2007 - coolo@suse.de
@@ -282,10 +288,10 @@
- Removed YContainerWidget for good
- Removed legacy YWidget::queryWidget() and YWidget::changeWidget()
methods
-- Dropped support for outdated property handling with old
+- Dropped support for outdated property handling with old
YWidget::queryWidget() and YWidget::changeWidget() methods
- Dropped support for outdated YWidget( YWidgetOpt ) constructors
-- Unified Y*WidgetFactory::create*Dialog() methods:
+- Unified Y*WidgetFactory::create*Dialog() methods:
- Added pure virtual YWidgetFactory::createDialog( type, colorMode)
- Made YWidgetFactory::createMainDialog() and
YWidgetFactory::createPopupDialog() non-virtual
@@ -295,7 +301,7 @@
- Catch exceptions in evaluateReplaceWidget
(more graceful error handling)
- Added basic default button handling to YDialog, YPushButton
-- V 2.16.11
+- V 2.16.11
-------------------------------------------------------------------
Thu Nov 29 17:41:50 CET 2007 - locilka@suse.cz
@@ -328,7 +334,7 @@
Fri Nov 23 12:32:55 CET 2007 - sh@suse.de
- Fixed bug #52673 : Deselect all items in SelectionBox
-- Fixed bug #230496: Exchange MenuButton items
+- Fixed bug #230496: Exchange MenuButton items
-------------------------------------------------------------------
Fri Nov 23 11:38:55 CET 2007 - sh@suse.de
@@ -351,7 +357,7 @@
-------------------------------------------------------------------
Thu Nov 22 21:13:34 CET 2007 - sh@suse.de
-- Moved UI setLanguage from YUI to YApplication
+- Moved UI setLanguage from YUI to YApplication
-------------------------------------------------------------------
Thu Nov 22 11:05:16 CET 2007 - locilka@suse.cz
@@ -364,14 +370,14 @@
- V 2.16.7
- More graceful error handling in
- UI::ChangeWidget()
- - UI::QueryWidget()
+ - UI::QueryWidget()
- InputField widgets now use reasonable default width,
no longer grow to eat up as much width as available
-------------------------------------------------------------------
Fri Nov 16 16:37:12 CET 2007 - sh@suse.de
-- V 2.16.6
+- V 2.16.6
- Merged mod-ui branch to trunk:
- Moved YCP code out of widget code
(still to be done for some non-widget classes)
@@ -384,7 +390,7 @@
- Item parsers (YSelectionBox, YComboBox, YTree, YTable, ...)
now more forgiving
- Individual table cells can now queried and set in YTable
- - More informative error messages
+ - More informative error messages
- Error messages in log now report the YCP code location
- Renamed YTextEdit to YInputField (old name still valid)
@@ -396,7 +402,7 @@
- Dropped YImage from YCPByteBlock (nowhere in use any more)
- All YSelectionWidgets (YSelectionBox, YComboBox, YTree, YTable,
- YMultiSelectionBox, YMenu) now support
+ YMultiSelectionBox, YMenu) now support
UI::QueryWidget(`myWidget, `Items ) (returning an item list)
- Consistent icon support for YSelectionWidgets
@@ -473,7 +479,7 @@
Mon Sep 3 13:41:33 CEST 2007 - juhliarik@suse.cz
- Added new function getenv(), #305163
-- 2.15.10
+- 2.15.10
-------------------------------------------------------------------
Tue Aug 21 15:57:24 CEST 2007 - mvidner@suse.cz
@@ -563,7 +569,7 @@
Fri Apr 13 17:38:58 CEST 2007 - sh@suse.de
- Merged mod-ui branch changes (r37142:37462) back to trunk:
- - Added infrastructure for UI plugins
+ - Added infrastructure for UI plugins
- V 2.15.6
@@ -577,7 +583,7 @@
-------------------------------------------------------------------
Wed Mar 21 16:34:46 CET 2007 - kmachalkova@suse.cz
-- YWidget: warning instead of error in setKeyboardFocus (#255785)
+- YWidget: warning instead of error in setKeyboardFocus (#255785)
-------------------------------------------------------------------
Fri Mar 16 16:21:00 CET 2007 - mvidner@suse.cz
@@ -612,7 +618,7 @@
Tue Feb 13 16:22:05 CET 2007 - kmachalkova@suse.cz
- Replaced '[x]' placeholder glyph (CheckMark) with 'x' to make it
- distinct from ncurses checkbox (#244061)
+ distinct from ncurses checkbox (#244061)
-------------------------------------------------------------------
Thu Feb 8 10:17:13 CET 2007 - mvidner@suse.cz
@@ -659,7 +665,7 @@
- Added RunInTerminal UI builtin for running external programs from
ncurses UI (#148683, #221254, #222547)
-- 2.15.1
+- 2.15.1
-------------------------------------------------------------------
Tue Dec 5 08:45:30 CET 2006 - mvidner@suse.cz
@@ -717,7 +723,7 @@
Wed Sep 13 16:41:06 CEST 2006 - sh@suse.de
- Applied patch from Ricardo Cruz