Author: tgoettlicher
Date: Wed Nov 25 17:39:28 2009
New Revision: 59763
URL: http://svn.opensuse.org/viewcvs/yast?rev=59763&view=rev
Log:
updated to latest version
Modified:
branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/MAINTAINER
branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/VERSION
branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/Events.ycp
branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/IconButton1.ycp
branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/RichText3.ycp
branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/Tree-icons.ycp
branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/Tree1.ycp
branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/package/yast2-ycp-ui-bindings.changes
branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCPDialogParser.cc
branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCPDialogParser.h
branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCPTreeItemParser.cc
branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCP_UI.cc
branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCP_UI.h
branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YUINamespace.cc
branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YUINamespace.h
branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YWidgetOpt.h
branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/yast2-ycp-ui-bindings.spec.in
Modified: branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/MAINTAINER
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/MAINTAINER?rev=59763&r1=59762&r2=59763&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/MAINTAINER (original)
+++ branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/MAINTAINER Wed Nov 25 17:39:28 2009
@@ -1 +1 @@
-Stefan Hundhammer
+Thomas Goettlicher
Modified: branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/VERSION?rev=59763&r1=59762&r2=59763&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/VERSION (original)
+++ branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/VERSION Wed Nov 25 17:39:28 2009
@@ -1 +1 @@
-2.17.11
+2.18.5
Modified: branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/Events.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/Events.ycp?rev=59763&r1=59762&r2=59763&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/Events.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/Events.ycp Wed Nov 25 17:39:28 2009
@@ -42,7 +42,7 @@
"chef de cuisine Giuseppe</a>.</p>";
- term delivery = `Tree(`id(`delivery_service ), `opt(`notify), "&Delivery Service",
+ term delivery = `Tree(`id(`delivery_service ), `opt(`notify, `notifyContextMenu), "&Delivery Service",
[
`item(`id(`europe), "Europe", true,
[
@@ -81,7 +81,7 @@
]
);
- term pizza = `SelectionBox(`id(`pizza), `opt(`notify,`immediate), "Pi&zza",
+ term pizza = `SelectionBox(`id(`pizza), `opt(`notify,`immediate, `notifyContextMenu), "Pi&zza",
[
`item(`id(`napoli ), "Napoli" ),
`item(`id(`funghi ), "Funghi" ),
@@ -92,7 +92,7 @@
]
);
- term toppings = `MultiSelectionBox(`id(`toppings), `opt(`notify), "To&ppings",
+ term toppings = `MultiSelectionBox(`id(`toppings), `opt(`notify, `notifyContextMenu), "To&ppings",
[
`item( `id(`cheese ), "Cheese" , true ),
`item( `id(`tomatoes ), "Tomatoes" , true ),
@@ -103,7 +103,7 @@
]
);
- term drink = `Table(`id(`drink), `opt(`notify, `immediate, `multiSelection), `header( "Drink", "Contents" ),
+ term drink = `Table(`id(`drink), `opt(`notify, `immediate, `multiSelection, `notifyContextMenu), `header( "Drink", "Contents" ),
[
`item(`id(`coke), "Coca Cola", "Caffeine" ),
`item(`id(`sprite), "Sprite", "" ),
Modified: branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/IconButton1.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/IconButton1.ycp?rev=59763&r1=59762&r2=59763&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/IconButton1.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/IconButton1.ycp Wed Nov 25 17:39:28 2009
@@ -1,12 +1,30 @@
+// PushButton with icons (relative path)
{
- // Build a dialog with one icon button.
- // Wait until that button is clicked,
- // then close the dialog and terminate.
+ UI::OpenDialog (
+ `VBox (
+ `Heading( "YaST2 Mini Control Center" ),
+ `IconButton (`id ("keyboard "), "yast-keyboard.png", "Keyboard"),
+ `IconButton (`id ("mouse" ), "yast-mouse.png", "Mouse"),
+ `IconButton (`id ("timezone" ), "yast-timezone.png", "Time zone"),
+ `IconButton (`id ("lan" ), "yast-lan.png", "Network"),
+ `IconButton (`id ("sw_single"), "yast-software.png", "Software")
+ )
+ );
- UI::OpenDialog(
- `IconButton( "icons/22x22/apps/yast-users.png", "&OK" )
- );
+ any ret = nil;
- UI::UserInput();
- UI::CloseDialog();
+ do
+ {
+ ret = UI::UserInput();
+
+ if (ret != `cancel)
+ {
+ UI::OpenDialog (`Label ("Running " + (string) ret + "..."));
+ sleep (4000);
+ UI::CloseDialog();
+ }
+
+ } while ( ret != `cancel);
+
+ UI::CloseDialog();
}
Modified: branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/RichText3.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/RichText3.ycp?rev=59763&r1=59762&r2=59763&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/RichText3.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/RichText3.ycp Wed Nov 25 17:39:28 2009
@@ -3,13 +3,16 @@
UI::OpenDialog( `opt(`defaultsize),
`VBox(
`RichText( "<h3>RichText example</h3>"
- + "<p>This is a <i>RichText</i> widget. The ncurses UI wraps lines automatically - Qt breaks lines and uses a vertical scroll bar.</p>"
+ + "<p>This is a <i>RichText</i> widget. Lines are wrapped automatically, this is a very very very very long long long long long long line .</p>"
+ "<p>It's very much like <i>HTML</i>, but not quite as powerful.</p>"
+ "<p>Text in <b>pre</b> tags preserves newlines and spaces.</p>"
+ "<pre>"
+ + "\n"
+ " host ip adress host ip adress\n"
- + " sturm 10.10.0.159 sturm 10.10.0.159\n"
- + "Lines are not wrapped; in text mode HTML tags are <b>not</b> removed if the pre tag is used.\n"
+ + " sturm 10.10.0.159 sturm 10.10.0.159\n\n"
+ + "Lines are not wrapped; in text mode HTML tags are <b>not</b> removed if the pre tag is used, "
+ + "but entities like product: &product; are filtered and shown correctly.\n"
+ + "\n"
+ "</pre>"
+ "<p>After <b>/pre</b> the text is <i>HTML</i> text like before.</p>"
+ "<p>Much much more text .............. continous"
@@ -17,9 +20,9 @@
+ " much much more text .................</p>"
+ "<p>"
+ "<pre>another pre t t </pre>"
- + "and much more text hopefully now displayed correctly"
+ + "and much more text after pre is closed, now <b>HTML</b> text "
+ "</p>"
- + "<pre>"
+ + "<pre>"
+ " host ip adress host ip adress\n"
+ " sturm 10.10.0.159 sturm 10.10.0.159\n"
+ "Lines are not wrapped; in text mode HTML tags are <b>not</b> removed if the pre tag is used.\n"
Modified: branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/Tree-icons.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/Tree-icons.ycp?rev=59763&r1=59762&r2=59763&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/Tree-icons.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/Tree-icons.ycp Wed Nov 25 17:39:28 2009
@@ -6,7 +6,7 @@
`Tree(`id(`mod),
"Modules",
[
- `item(`id( "country" ), `icon( "yast-yast-language.png" ), "Localization", true,
+ `item(`id( "country" ), `icon( "yast-language.png" ), "Localization", true,
[
`item(`id( "keyboard" ), `icon( "yast-keyboard.png" ), "Keyboard" ),
`item(`id( "timezone" ), `icon( "yast-timezone.png" ), "Time zone" )
Modified: branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/Tree1.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/Tree1.ycp?rev=59763&r1=59762&r2=59763&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/Tree1.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/examples/Tree1.ycp Wed Nov 25 17:39:28 2009
@@ -2,54 +2,55 @@
{
UI::OpenDialog(
`VBox(
- `Tree(`id(`dest_dir),
- "Select destination directory:",
- [
- `item(`id(`root), "/" , true,
- [
- `item(`id(`etc), "etc",
- [
- `item("opt"),
- `item("SuSEconfig"),
- `item("X11")
- ]
- ),
- `item("usr", false,
- [
- "bin",
- "lib",
- `item("share",
- [
- "man",
- "info",
- "emacs"
- ]
- ),
- `item(`id(`usr_local),"local"),
- `item("X11R6",
- [
- "bin",
- "lib",
- "share",
- "man",
- "etc"
- ]
- )
- ]
- ),
- `item(`id(`opt), "opt", true,
- [
- "kde",
- "netscape",
- "Office51"
- ]
- ),
- `item("home"),
- "work",
- `item(`id(`other), "<other>")
- ]
- )
- ] ),
+ `MinSize( 30, 10,
+ `Tree(`id(`dest_dir),
+ "Select destination directory:",
+ [
+ `item(`id(`root), "/" , false,
+ [
+ `item(`id(`etc), "etc",
+ [
+ `item("opt"),
+ `item("SuSEconfig"),
+ `item("X11")
+ ]
+ ),
+ `item("usr", false,
+ [
+ "bin",
+ "lib",
+ `item("share",
+ [
+ "man",
+ "info",
+ "emacs"
+ ]
+ ),
+ `item(`id(`usr_local),"local"),
+ `item("X11R6",
+ [
+ "bin",
+ "lib",
+ "share",
+ "man",
+ "etc"
+ ]
+ )
+ ]
+ ),
+ `item(`id(`opt), "opt", false,
+ [
+ "kde",
+ "netscape",
+ "Office51"
+ ]
+ ),
+ `item("home", false),
+ `item(`id(`other), "<other>")
+ ]
+ )
+ ] )
+ ),
`HBox(
`PushButton(`id(`sel_opt), `opt(`hstretch), "/&opt" ),
`PushButton(`id(`sel_usr), `opt(`hstretch), "/&usr" ),
Modified: branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/package/yast2-ycp-ui-bindings.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/package/yast2-ycp-ui-bindings.changes?rev=59763&r1=59762&r2=59763&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/package/yast2-ycp-ui-bindings.changes (original)
+++ branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/package/yast2-ycp-ui-bindings.changes Wed Nov 25 17:39:28 2009
@@ -1,4 +1,29 @@
-------------------------------------------------------------------
+Wed Mar 11 16:08:18 CET 2009 - kmachalkova@suse.cz
+
+- Do not abort in DumpWidgetTree function if there is no dialog
+ on the stack (log warning instead)
+- V 2.18.5
+
+-------------------------------------------------------------------
+Fri Mar 6 10:32:32 CET 2009 - tgoettlicher@suse.de
+
+- Added context menus
+- V 2.18.4
+
+-------------------------------------------------------------------
+Mon Feb 9 11:52:05 CET 2009 - sh@suse.de
+
+- Require latest libyui in spec file (API change)
+- V 2.18.3
+
+-------------------------------------------------------------------
+Wed Jan 14 16:25:57 CET 2009 - aschnell@suse.de
+
+- added graph widget
+- V 2.18.2
+
+-------------------------------------------------------------------
Wed Oct 15 15:12:38 CEST 2008 - sh@suse.de
- Added `opt(`confirmUnsupported) for PackageSelector widget
Modified: branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCPDialogParser.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCPDialogParser.cc?rev=59763&r1=59762&r2=59763&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCPDialogParser.cc (original)
+++ branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCPDialogParser.cc Wed Nov 25 17:39:28 2009
@@ -89,6 +89,7 @@
#include "YTree.h"
#include "YWizard.h"
#include "YTimezoneSelector.h"
+#include "YGraph.h"
#include "YBusyIndicator.h"
using std::string;
@@ -143,6 +144,11 @@
* ( if `opt( `notify ) is set for that SelectionBox ).
* Only widgets with this option set are affected.
*
+ * @option notifyContextMenu Make this widget to send an event when the context menu is requested
+ * e.g. when the user clicks right mouse button
+ * ( if `opt( `notifyContextMenu ) is set for that SelectionBox ).
+ * Only widgets with this option set are affected.
+ *
* @option disabled Set this widget insensitive, i.e. disable any user interaction.
* The widget will show this state by being greyed out
* (depending on the specific UI).
@@ -190,6 +196,7 @@
{
string sym = rawopt->value(o)->asSymbol()->symbol();
if ( sym == YUIOpt_notify ) opt.notifyMode.setValue( true );
+ else if ( sym == YUIOpt_notifyContextMenu) opt.notifyContextMenu.setValue( true );
else if ( sym == YUIOpt_disabled ) opt.isDisabled.setValue( true );
else if ( sym == YUIOpt_hstretch ) opt.isHStretchable.setValue( true );
else if ( sym == YUIOpt_vstretch ) opt.isVStretchable.setValue( true );
@@ -312,6 +319,7 @@
else if ( s == YUISpecialWidget_TimeField ) w = parseTimeField ( p, opt, term, ol, n );
else if ( s == YUISpecialWidget_Wizard ) w = parseWizard ( p, opt, term, ol, n );
else if ( s == YUISpecialWidget_TimezoneSelector ) w = parseTimezoneSelector ( p, opt, term, ol, n );
+ else if ( s == YUISpecialWidget_Graph ) w = parseGraph ( p, opt, term, ol, n );
else
{
YUI_THROW( YUIException( string( "Unknown widget type " ) + s.c_str() ) );
@@ -343,6 +351,7 @@
if ( opt.isDisabled.value() ) w->setDisabled();
if ( opt.notifyMode.value() ) w->setNotify( true );
+ if ( opt.notifyContextMenu.value()) w->setNotifyContextMenu( true );
if ( opt.keyEvents.value() ) w->setSendKeyEvents( true );
if ( opt.autoShortcut.value() ) w->setAutoShortcut( true );
if ( opt.isHStretchable.value() ) w->setStretchable( YD_HORIZ, true );
@@ -1419,7 +1428,7 @@
if ( sym == YUIOpt_default ) isDefaultButton = true;
else if ( sym == YUIOpt_okButton ) role = YOKButton;
else if ( sym == YUIOpt_cancelButton) role = YCancelButton;
- else if ( sym == YUIOpt_cancelButton) role = YApplyButton;
+ else if ( sym == YUIOpt_applyButton) role = YApplyButton;
else if ( sym == YUIOpt_helpButton ) role = YHelpButton;
else if ( sym == YUIOpt_customButton) opt.customButton.setValue( true );
else logUnknownOption( term, optList->value(o) );
@@ -3451,7 +3460,6 @@
YCPDialogParser::parseTimezoneSelector( YWidget * parent, YWidgetOpt & opt,
const YCPTerm & term, const YCPList & optList, int argnr )
{
-
if ( term->size() - argnr != 2
|| !term->value(argnr)->isString()
|| !term->value(argnr+1)->isMap() )
@@ -3472,6 +3480,43 @@
return selector;
}
+
+/**
+ * @widgets Graph
+ * @short graph
+ * @class YGraph
+ *
+ * @usage if ( HasSpecialWidget( `Graph ) {...
+ * `Graph( "graph.dot", "dot" )
+ *
+ * @description
+ * An graph
+ *
+ * @note This is a "special" widget, i.e. not all UIs necessarily support it. Check
+ * for availability with <tt>HasSpecialWidget(`Graph)</tt> before using it.
+ **/
+YWidget *
+YCPDialogParser::parseGraph( YWidget * parent, YWidgetOpt & opt,
+ const YCPTerm & term, const YCPList & optList, int argnr )
+{
+ if ( term->size() - argnr != 2
+ || !term->value(argnr)->isString()
+ || !term->value(argnr+1)->isString() )
+ {
+ THROW_BAD_ARGS( term );
+ }
+
+ rejectAllOptions( term, optList );
+
+ string filename = term->value( argnr )->asString()->value();
+ string layoutAlgorithm = term->value( argnr+1 )->asString()->value();
+
+ YGraph * graph = YUI::optionalWidgetFactory()->createGraph( parent, filename, layoutAlgorithm );
+
+ return graph;
+}
+
+
/**
* @widget BusyIndicator
* @short Graphical busy indicator
Modified: branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCPDialogParser.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCPDialogParser.h?rev=59763&r1=59762&r2=59763&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCPDialogParser.h (original)
+++ branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCPDialogParser.h Wed Nov 25 17:39:28 2009
@@ -272,6 +272,9 @@
static YWidget * parseTimezoneSelector ( YWidget *parent, YWidgetOpt & opt, const YCPTerm & term,
const YCPList & optList, int argnr );
+ static YWidget * parseGraph ( YWidget *parent, YWidgetOpt & opt, const YCPTerm & term,
+ const YCPList & optList, int argnr );
+
static YWidget * parseBusyIndicator( YWidget *parent, YWidgetOpt & opt,
const YCPTerm & term, const YCPList & optList, int argnr );
/**
Modified: branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCPTreeItemParser.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCPTreeItemParser.cc?rev=59763&r1=59762&r2=59763&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCPTreeItemParser.cc (original)
+++ branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCPTreeItemParser.cc Wed Nov 25 17:39:28 2009
@@ -85,7 +85,7 @@
item = new YCPTreeItem( parent,
label, // The real label
label, // Use the label as ID, too
- false ); // Not initially selected
+ false ); // Not initially open
}
else // `item(...)
{
Modified: branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCP_UI.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCP_UI.cc?rev=59763&r1=59762&r2=59763&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCP_UI.cc (original)
+++ branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCP_UI.cc Wed Nov 25 17:39:28 2009
@@ -43,6 +43,7 @@
#include "YCPItemParser.h"
#include "YCPMacroPlayer.h"
#include "YCPMacroRecorder.h"
+#include "YCPMenuItemParser.h"
#include "YCPPropertyHandler.h"
#include "YCPValueWidgetID.h"
#include "YCPWizardCommandParser.h"
@@ -99,6 +100,8 @@
else if ( symbol == YUISpecialWidget_Date ) hasWidget = fact->hasDateField();
else if ( symbol == YUISpecialWidget_Time ) hasWidget = fact->hasTimeField();
else if ( symbol == YUISpecialWidget_TimezoneSelector ) hasWidget = fact->hasTimezoneSelector();
+ else if ( symbol == YUISpecialWidget_Graph ) hasWidget = fact->hasGraph();
+ else if ( symbol == YUISpecialWidget_ContextMenu ) hasWidget = fact->hasContextMenu();
else
{
yuiError() << "HasSpecialWidget(): Unknown special widget: " << symbol << endl;
@@ -542,6 +545,7 @@
else if ( optList->value(o)->asSymbol()->symbol() == YUIOpt_warncolor ) colorMode = YDialogWarnColor;
else if ( optList->value(o)->asSymbol()->symbol() == YUIOpt_decorated ) {} // obsolete
else if ( optList->value(o)->asSymbol()->symbol() == YUIOpt_centered ) {} // obsolete
+
else
yuiWarning() << "Unknown option " << opts->value(o) << " for OpenDialog" << endl;
}
@@ -1059,7 +1063,15 @@
void YCP_UI::DumpWidgetTree()
{
- YDialog::currentDialog()->dumpDialogWidgetTree();
+ // Do not abort() the whole thing just because some sloppy
+ // YCP client does not know how to close dialogs (#483942)
+ // After all, this is a debugging function
+ YDialog *currentDialog = YDialog::currentDialog(false);
+
+ if (currentDialog)
+ currentDialog->dumpDialogWidgetTree();
+ else
+ yuiWarning() << "No dialog exists :( Nothing to dump." << endl;
}
/**
@@ -1584,5 +1596,35 @@
+/**
+* @description
+* Opens a context menu when the users right clickes a widget
+*
+*
+* Example: <tt>OpenContextMenu( `menu(
+* [ `item(`id(`folder), "&Entry1" ),
+* `menu( "&Submenu1",
+* [ `item(`id(`text),
+* "&Entry2" ),
+* `item(`id(`image),
+* "&Entry3" ) ]) ] )); </tt>
+*
+* @param itemList list of menu items
+* @return bool Returns true when the context menu was shown, on error
+ (e.g. not supported by ui) false is returned.
+
+*/
+YCPBoolean YCP_UI::OpenContextMenu ( const YCPTerm & term )
+{
+ YCPList itemList = term->value(0)->asList();
+
+ if ( YUI::app()->openContextMenu( YCPMenuItemParser::parseMenuItemList( itemList ) ) )
+ return YCPBoolean( true );
+ else
+ return YCPBoolean( false );
+}
+
+
+
// EOF
Modified: branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCP_UI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCP_UI.h?rev=59763&r1=59762&r2=59763&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCP_UI.h (original)
+++ branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YCP_UI.h Wed Nov 25 17:39:28 2009
@@ -56,6 +56,7 @@
static YCPValue HasSpecialWidget ( const YCPSymbol & widget );
static void MakeScreenShot ( const YCPString & filename );
static void NormalCursor ();
+ static YCPBoolean OpenContextMenu ( const YCPTerm & term );
static YCPBoolean OpenDialog ( const YCPTerm & opts, const YCPTerm & dialogTerm );
static void PlayMacro ( const YCPString & filename );
static void PostponeShortcutCheck ();
Modified: branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YUINamespace.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YUINamespace.cc?rev=59763&r1=59762&r2=59763&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YUINamespace.cc (original)
+++ branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YUINamespace.cc Wed Nov 25 17:39:28 2009
@@ -215,6 +215,16 @@
return YCPVoid();
}
+YCPBoolean
+YUINamespace::OpenContextMenu( const YCPTerm & term )
+{
+ if ( YUIComponent::ui() )
+ return YCP_UI::OpenContextMenu( term );
+ else
+ return YCPBoolean( false );
+}
+
+
YCPValue
YUINamespace::ChangeWidget( const YCPTerm & widget_id, const YCPSymbol & property, const YCPValue & new_value )
Modified: branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YUINamespace.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YUINamespace.h?rev=59763&r1=59762&r2=59763&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YUINamespace.h (original)
+++ branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YUINamespace.h Wed Nov 25 17:39:28 2009
@@ -300,6 +300,9 @@
/* TYPEINFO: boolean () */
YCPBoolean TextMode();
+ /* TYPEINFO: boolean (term) */
+ YCPBoolean OpenContextMenu( const YCPTerm & term );
+
YCPValue
Modified: branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YWidgetOpt.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YWidgetOpt.h?rev=59763&r1=59762&r2=59763&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YWidgetOpt.h (original)
+++ branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/src/YWidgetOpt.h Wed Nov 25 17:39:28 2009
@@ -120,6 +120,7 @@
YBoolOpt isDisabled;
YBoolOpt notifyMode;
+ YBoolOpt notifyContextMenu;
YBoolOpt isHStretchable;
YBoolOpt isVStretchable;
YBoolOpt autoShortcut;
Modified: branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/yast2-ycp-ui-bindings.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/yast2-ycp-ui-bindings.spec.in?rev=59763&r1=59762&r2=59763&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/yast2-ycp-ui-bindings.spec.in (original)
+++ branches/SuSE-Code-11-SP1-Branch/ycp-ui-bindings/yast2-ycp-ui-bindings.spec.in Wed Nov 25 17:39:28 2009
@@ -2,6 +2,8 @@
@HEADER@
+Group: System/YaST
+License: GPL v2 or later
BuildRequires: gcc-c++
@@ -19,21 +21,23 @@
# libycp includes crypto built-ins
BuildRequires: libxcrypt-devel
-Requires: yast2-libyui >= 2.17.14
-BuildRequires: yast2-libyui-devel >= 2.17.14
+Requires: yast2-libyui >= 2.18.7
+BuildRequires: yast2-libyui-devel >= 2.18.7
# libyui ImplPtr
BuildRequires: boost-devel
-Summary: -
+Summary: YaST2 - YCP Bindings for the YaST2 User Interface Engine
Provides: @plugindir@/libpy2UI.so.2.0.0
%description
--
+This package makes the generic YaST2 user interface engine available
+for YCP applications (YCP is the scripting language in which most YaST2
+modules are written).
@HEADER-DEVEL@
-Summary: -
+Summary: YaST2 - YCP Bindings for the YaST2 User Interface Engine
Requires: glibc-devel
Requires: libstdc++-devel
@@ -44,8 +48,9 @@
Requires: yast2-devtools
%description devel
--
-
+This is the development package that makes the generic YaST2 user
+interface engine available for YCP applications (YCP is the scripting
+language in which most YaST2 modules are written).
@PREP@
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org