Author: tgoettlicher
Date: Fri Mar 6 15:23:54 2009
New Revision: 55975
URL: http://svn.opensuse.org/viewcvs/yast?rev=55975&view=rev
Log:
added context menus to yast2-qt
Modified:
trunk/libyui/VERSION
trunk/libyui/package/yast2-libyui.changes
trunk/libyui/src/Makefile.am
trunk/libyui/src/YApplication.cc
trunk/libyui/src/YApplication.h
trunk/libyui/src/YEvent.cc
trunk/libyui/src/YEvent.h
trunk/libyui/src/YOptionalWidgetFactory.cc
trunk/libyui/src/YOptionalWidgetFactory.h
trunk/libyui/src/YTypes.h
trunk/libyui/src/YUISymbols.h
trunk/libyui/src/YWidget.cc
trunk/libyui/src/YWidget.h
trunk/qt/VERSION.cmake
trunk/qt/package/yast2-qt.changes
trunk/qt/src/CMakeLists.txt
trunk/qt/src/YQApplication.cc
trunk/qt/src/YQApplication.h
trunk/qt/src/YQOptionalWidgetFactory.cc
trunk/qt/src/YQOptionalWidgetFactory.h
trunk/qt/src/YQSelectionBox.cc
trunk/qt/src/YQTree.cc
trunk/qt/src/YQTree.h
trunk/qt/yast2-qt.spec.in
trunk/ycp-ui-bindings/VERSION
trunk/ycp-ui-bindings/package/yast2-ycp-ui-bindings.changes
trunk/ycp-ui-bindings/src/YCPDialogParser.cc
trunk/ycp-ui-bindings/src/YCP_UI.cc
trunk/ycp-ui-bindings/src/YCP_UI.h
trunk/ycp-ui-bindings/src/YUINamespace.cc
trunk/ycp-ui-bindings/src/YUINamespace.h
trunk/ycp-ui-bindings/src/YWidgetOpt.h
trunk/ycp-ui-bindings/yast2-ycp-ui-bindings.spec.in
Modified: trunk/libyui/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/VERSION?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/libyui/VERSION (original)
+++ trunk/libyui/VERSION Fri Mar 6 15:23:54 2009
@@ -1 +1 @@
-2.18.6
+2.18.7
Modified: trunk/libyui/package/yast2-libyui.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/package/yast2-libyui.changes?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/libyui/package/yast2-libyui.changes (original)
+++ trunk/libyui/package/yast2-libyui.changes Fri Mar 6 15:23:54 2009
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Fri Mar 6 10:34:28 CET 2009 - tgoettlicher@suse.de
+
+- Added context menus
+- V 2.18.7
+
+-------------------------------------------------------------------
Sun Mar 1 17:26:31 CET 2009 - coolo@suse.de
- hopefully last fix ;(
Modified: trunk/libyui/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/src/Makefile.am?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/libyui/src/Makefile.am (original)
+++ trunk/libyui/src/Makefile.am Fri Mar 6 15:23:54 2009
@@ -54,6 +54,7 @@
YCheckBox.cc \
YCheckBoxFrame.cc \
YComboBox.cc \
+ YContextMenu.cc \
YDateField.cc \
YDialog.cc \
YDownloadProgress.cc \
@@ -147,6 +148,7 @@
YCheckBoxFrame.h \
YCheckBox.h \
YComboBox.h \
+ YContextMenu.h \
YDateField.h \
YDialog.h \
YDownloadProgress.h \
Modified: trunk/libyui/src/YApplication.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/src/YApplication.cc?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/libyui/src/YApplication.cc (original)
+++ trunk/libyui/src/YApplication.cc Fri Mar 6 15:23:54 2009
@@ -204,6 +204,14 @@
}
}
+bool
+YApplication::openContextMenu( const YItemCollection & itemCollection )
+{
+ YUI_THROW( YUIUnsupportedWidgetException( "ContextMenu" ) );
+ return false;
+}
+
+
int
YApplication::deviceUnits( YUIDimension dim, float layoutUnits )
Modified: trunk/libyui/src/YApplication.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/src/YApplication.h?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/libyui/src/YApplication.h (original)
+++ trunk/libyui/src/YApplication.h Fri Mar 6 15:23:54 2009
@@ -22,6 +22,8 @@
#include <string>
#include "YUI.h"
#include "ImplPtr.h"
+#include "YMenuItem.h"
+
using std::string;
@@ -215,6 +217,18 @@
const string & headline ) = 0;
/**
+ * Open a context menu for a widget
+ *
+ * 'itemCollection' describes the menu structure
+ *
+ * Returns true on success (otherwise false).
+ *
+ * Derived classes are free to overwrite this.
+ **/
+ virtual bool openContextMenu( const YItemCollection & itemCollection );
+
+
+ /**
* Set the current product name ("openSUSE", "SLES", ...).
* This name will be expanded in help texts when the &product; entity is
* used.
@@ -362,6 +376,7 @@
private:
ImplPtr<YApplicationPrivate> priv;
+
};
#define YApplication_h
Modified: trunk/libyui/src/YEvent.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/src/YEvent.cc?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/libyui/src/YEvent.cc (original)
+++ trunk/libyui/src/YEvent.cc Fri Mar 6 15:23:54 2009
@@ -90,6 +90,7 @@
case Activated: return "Activated";
case SelectionChanged: return "SelectionChanged";
case ValueChanged: return "ValueChanged";
+ case ContextMenuActivated: return "ContextMenuActivated";
// Intentionally omitting "default" branch so the compiler can
// detect unhandled enums
Modified: trunk/libyui/src/YEvent.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/src/YEvent.h?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/libyui/src/YEvent.h (original)
+++ trunk/libyui/src/YEvent.h Fri Mar 6 15:23:54 2009
@@ -58,7 +58,8 @@
UnknownReason = 0,
Activated,
SelectionChanged,
- ValueChanged
+ ValueChanged,
+ ContextMenuActivated
};
Modified: trunk/libyui/src/YOptionalWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/src/YOptionalWidgetFactory.cc?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/libyui/src/YOptionalWidgetFactory.cc (original)
+++ trunk/libyui/src/YOptionalWidgetFactory.cc Fri Mar 6 15:23:54 2009
@@ -262,3 +262,12 @@
{
THROW_UNSUPPORTED( "YGraph" );
}
+
+
+bool
+YOptionalWidgetFactory::hasContextMenu()
+{
+ return false;
+}
+
+
Modified: trunk/libyui/src/YOptionalWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/src/YOptionalWidgetFactory.h?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/libyui/src/YOptionalWidgetFactory.h (original)
+++ trunk/libyui/src/YOptionalWidgetFactory.h Fri Mar 6 15:23:54 2009
@@ -128,6 +128,8 @@
const string & layoutAlgorithm );
virtual YGraph * createGraph( YWidget * parent, graph_t * graph );
+ virtual bool hasContextMenu();
+
protected:
friend class YUI;
Modified: trunk/libyui/src/YTypes.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/src/YTypes.h?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/libyui/src/YTypes.h (original)
+++ trunk/libyui/src/YTypes.h Fri Mar 6 15:23:54 2009
@@ -59,7 +59,7 @@
{
YMainDialog,
YPopupDialog,
- YWizardDialog
+ YWizardDialog,
};
Modified: trunk/libyui/src/YUISymbols.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/src/YUISymbols.h?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/libyui/src/YUISymbols.h (original)
+++ trunk/libyui/src/YUISymbols.h Fri Mar 6 15:23:54 2009
@@ -27,6 +27,7 @@
#define YUIBuiltin_AskForSaveFileName "AskForSaveFileName"
#define YUIBuiltin_Beep "Beep"
#define YUIBuiltin_BusyCursor "BusyCursor"
+#define YUIBuiltin_OpenContextMenu "OpenContextMenu"
#define YUIBuiltin_ChangeWidget "ChangeWidget"
#define YUIBuiltin_CloseDialog "CloseDialog"
#define YUIBuiltin_DumpWidgetTree "DumpWidgetTree"
@@ -145,12 +146,14 @@
#define YUISpecialWidget_Wizard "Wizard"
#define YUISpecialWidget_TimezoneSelector "TimezoneSelector"
#define YUISpecialWidget_Graph "Graph"
+#define YUISpecialWidget_ContextMenu "ContextMenu"
// Widget properties
#define YUIProperty_Alive "Alive"
#define YUIProperty_Cell "Cell"
+#define YUIProperty_ContextMenu "ContextMenu"
#define YUIProperty_CurrentBranch "CurrentBranch"
#define YUIProperty_CurrentButton "CurrentButton"
#define YUIProperty_CurrentItem "CurrentItem"
@@ -199,6 +202,7 @@
#define YUIOpt_cancelButton "cancelButton"
#define YUIOpt_centered "centered"
#define YUIOpt_confirmUnsupported "confirmUnsupported"
+#define YUIOpt_contextMenu "contextMenu"
#define YUIOpt_customButton "customButton"
#define YUIOpt_debugLayout "debugLayout"
#define YUIOpt_decorated "decorated"
Modified: trunk/libyui/src/YWidget.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/src/YWidget.cc?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/libyui/src/YWidget.cc (original)
+++ trunk/libyui/src/YWidget.cc Fri Mar 6 15:23:54 2009
@@ -57,6 +57,7 @@
, beingDestroyed( false )
, enabled( true )
, notify( false )
+ , contextMenu( false )
, sendKeyEvents( false )
, autoShortcut( false )
, toolkitWidgetRep( 0 )
@@ -78,6 +79,7 @@
bool beingDestroyed;
bool enabled;
bool notify;
+ bool contextMenu;
bool sendKeyEvents;
bool autoShortcut;
void * toolkitWidgetRep;
@@ -392,6 +394,7 @@
/**
* @property boolean Enabled enabled/disabled state of this widget
* @property boolean Notify the current notify state (see also `opt( `notify ))
+ * @property boolean ContextMenu the current contextmenu state (see also `opt( `contextMenu ))
* @property string WidgetClass the widget class of this widget (YLabel, YPushButton, ...)
* @property string DebugLabel (possibly translated) text describing this widget for debugging
* @property string HelpText help text
@@ -456,6 +459,7 @@
if ( propertyName == YUIProperty_Enabled ) return YPropertyValue( isEnabled() );
if ( propertyName == YUIProperty_Notify ) return YPropertyValue( notify() );
+ if ( propertyName == YUIProperty_ContextMenu ) return YPropertyValue( contextMenu() );
if ( propertyName == YUIProperty_WidgetClass ) return YPropertyValue( widgetClass() );
if ( propertyName == YUIProperty_HelpText ) return YPropertyValue( helpText() );
if ( propertyName == YUIProperty_DebugLabel ) return YPropertyValue( debugLabel() );
@@ -511,12 +515,24 @@
}
+void YWidget::setContextMenu( bool contextMenu )
+{
+ priv->contextMenu = contextMenu;
+}
+
+
bool YWidget::notify() const
{
return priv->notify;
}
+bool YWidget::contextMenu() const
+{
+ return priv->contextMenu;
+}
+
+
int YWidget::preferredSize( YUIDimension dim )
{
switch ( dim )
Modified: trunk/libyui/src/YWidget.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/src/YWidget.h?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/libyui/src/YWidget.h (original)
+++ trunk/libyui/src/YWidget.h Fri Mar 6 15:23:54 2009
@@ -455,6 +455,18 @@
bool notify() const;
/**
+ * Sets the ContextMenu property
+ **/
+ void setContextMenu( bool contextMenu = true );
+
+ /**
+ * Returns whether the widget will send an event when the user
+ * clicks selects the context menu e.g. via right click.
+ **/
+ bool contextMenu() const;
+
+
+ /**
* Returns 'true' if this widget should send key events, i.e. if it has
* `opt(`keyEvent) set.
**/
Modified: trunk/qt/VERSION.cmake
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/VERSION.cmake?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/qt/VERSION.cmake (original)
+++ trunk/qt/VERSION.cmake Fri Mar 6 15:23:54 2009
@@ -1,3 +1,3 @@
SET(VERSION_MAJOR "2")
SET(VERSION_MINOR "18")
-SET(VERSION_PATCH "5")
+SET(VERSION_PATCH "6")
Modified: trunk/qt/package/yast2-qt.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/package/yast2-qt.changes?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/qt/package/yast2-qt.changes (original)
+++ trunk/qt/package/yast2-qt.changes Fri Mar 6 15:23:54 2009
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Fri Mar 6 10:35:25 CET 2009 - tgoettlicher@suse.de
+
+- Added context menus
+- V 2.18.6
+
+-------------------------------------------------------------------
Fri Feb 20 16:18:37 CET 2009 - tgoettlicher@suse.de
- Fixed menubar spacing in wizard (bnc #464088)
Modified: trunk/qt/src/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/CMakeLists.txt?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/qt/src/CMakeLists.txt (original)
+++ trunk/qt/src/CMakeLists.txt Fri Mar 6 15:23:54 2009
@@ -32,6 +32,7 @@
YQCheckBox.cc
YQCheckBoxFrame.cc
YQComboBox.cc
+ YQContextMenu.cc
YQDateField.cc
YQDialog.cc
YQDownloadProgress.cc
@@ -96,6 +97,7 @@
YQCheckBox.h
YQCheckBoxFrame.h
YQComboBox.h
+ YQContextMenu.h
YQDateField.h
YQDialog.h
YQDownloadProgress.h
Modified: trunk/qt/src/YQApplication.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQApplication.cc?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/qt/src/YQApplication.cc (original)
+++ trunk/qt/src/YQApplication.cc Fri Mar 6 15:23:54 2009
@@ -28,6 +28,7 @@
#include <QMessageBox>
#include <QSettings>
#include <QFontDatabase>
+#include <QMenu>
#include
@@ -42,6 +43,7 @@
#include "YQApplication.h"
#include "YQPackageSelectorPluginStub.h"
#include "YQGraphPluginStub.h"
+#include "YQContextMenu.h"
YQApplication::YQApplication()
@@ -54,8 +56,10 @@
, _autoFonts( false )
, _autoNormalFontSize( -1 )
, _autoHeadingFontSize( -1 )
- , _leftHandedMouse( false )
+ , _leftHandedMouse( false )
, _askedForLeftHandedMouse( false )
+ , _contextMenuPos ( QPoint (0, 0) )
+ , _contextMenu ( 0 )
{
yuiDebug() << "YQApplication constructor start" << endl;
@@ -509,6 +513,15 @@
}
+bool
+YQApplication::openContextMenu( const YItemCollection & itemCollection )
+{
+ YQContextMenu* menu = new YQContextMenu( _contextMenuPos );
+ menu->addItems(itemCollection);
+
+ return true;
+}
+
QString
YQApplication::askForSaveFileName( const QString & startWith,
@@ -713,5 +726,11 @@
return plugin;
}
+void
+YQApplication::setContextMenuPos( QPoint contextMenuPos )
+{
+ _contextMenuPos = contextMenuPos;
+}
+
#include "YQApplication.moc"
Modified: trunk/qt/src/YQApplication.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQApplication.h?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/qt/src/YQApplication.h (original)
+++ trunk/qt/src/YQApplication.h Fri Mar 6 15:23:54 2009
@@ -31,6 +31,7 @@
class QSettings;
class YQPackageSelectorPlugin;
class YQGraphPlugin;
+class QMenu;
class YQApplication: public QObject, public YApplication
@@ -211,6 +212,18 @@
const QString & headline );
/**
+ * Open a context menu for a widget
+ *
+ * 'itemCollection' describes the menu structure
+ *
+ * Returns true on success (otherwise false).
+ *
+ * Implemented from YApplication.
+ **/
+ virtual bool openContextMenu ( const YItemCollection & itemCollection );
+
+
+ /**
* Return the package selector plugin singleton or creates it
* (including loading the plugin lib) if it does not exist yet.
**/
@@ -276,7 +289,16 @@
* Reimplemented from YApplication.
**/
virtual void beep();
+
+ /**
+ * Return position of the context menu (in gloabl coordinates)
+ **/
+ virtual QPoint contextMenuPos() { return _contextMenuPos; }
+ /**
+ * Sets the position of the context menu (in gloabl coordinates)
+ **/
+ virtual void setContextMenuPos( QPoint contextMenuPos );
// Display information and UI capabilities.
//
@@ -304,7 +326,6 @@
virtual bool hasWizardDialogSupport() { return true; }
virtual bool leftHandedMouse();
-
protected:
/**
@@ -355,6 +376,9 @@
bool _leftHandedMouse;
bool _askedForLeftHandedMouse;
+ QPoint _contextMenuPos;
+ QMenu* _contextMenu;
+
};
Modified: trunk/qt/src/YQOptionalWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQOptionalWidgetFactory.cc?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/qt/src/YQOptionalWidgetFactory.cc (original)
+++ trunk/qt/src/YQOptionalWidgetFactory.cc Fri Mar 6 15:23:54 2009
@@ -306,3 +306,10 @@
else
return 0;
}
+
+bool YQOptionalWidgetFactory::hasContextMenu()
+{
+ return true;
+}
+
+
Modified: trunk/qt/src/YQOptionalWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQOptionalWidgetFactory.h?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/qt/src/YQOptionalWidgetFactory.h (original)
+++ trunk/qt/src/YQOptionalWidgetFactory.h Fri Mar 6 15:23:54 2009
@@ -118,6 +118,8 @@
const string & layoutAlgorithm );
virtual YGraph * createGraph( YWidget * parent, graph_t * graph );
+ virtual bool hasContextMenu();
+
protected:
friend class YQUI;
Modified: trunk/qt/src/YQSelectionBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQSelectionBox.cc?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/qt/src/YQSelectionBox.cc (original)
+++ trunk/qt/src/YQSelectionBox.cc Fri Mar 6 15:23:54 2009
@@ -289,6 +289,14 @@
YQUI::yqApp()->maybeLeftHandedUser();
}
}
+ else if ( ev->type() == QEvent::ContextMenu )
+ {
+ QContextMenuEvent * contextMenuEvent = dynamic_cast (ev);
+
+ YQUI::yqApp()->setContextMenuPos( contextMenuEvent->globalPos() );
+ if ( contextMenu() )
+ YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ContextMenuActivated ) );
+ }
return QWidget::eventFilter( obj, ev );
}
Modified: trunk/qt/src/YQTree.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQTree.cc?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/qt/src/YQTree.cc (original)
+++ trunk/qt/src/YQTree.cc Fri Mar 6 15:23:54 2009
@@ -36,6 +36,8 @@
#include "YTreeItem.h"
#include "YQSignalBlocker.h"
#include "YQWidgetCaption.h"
+#include "YQApplication.h"
+
#define VERBOSE_TREE_ITEMS 0
@@ -67,6 +69,7 @@
_qt_treeWidget->header()->hide();
// _qt_treeWidget->setHeader(0L);
_qt_treeWidget->setRootIsDecorated ( true );
+ _qt_treeWidget->setContextMenuPolicy(Qt::CustomContextMenu);
_caption->setBuddy ( _qt_treeWidget );
@@ -81,6 +84,10 @@
connect( _qt_treeWidget, SIGNAL( itemCollapsed ( QTreeWidgetItem * ) ),
this, SLOT ( slotItemCollapsed( QTreeWidgetItem * ) ) );
+
+ connect( _qt_treeWidget, SIGNAL( customContextMenuRequested ( const QPoint & ) ),
+ this, SLOT ( slotContextMenu ( const QPoint & ) ) );
+
}
@@ -283,6 +290,14 @@
}
+void YQTree::slotContextMenu ( const QPoint & pos )
+{
+ exit(0);
+ YQUI::yqApp()->setContextMenuPos( pos );
+// if ( contextMenu() )
+ YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ContextMenuActivated ) );
+}
+
/*============================================================================*/
Modified: trunk/qt/src/YQTree.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQTree.h?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/qt/src/YQTree.h (original)
+++ trunk/qt/src/YQTree.h Fri Mar 6 15:23:54 2009
@@ -120,6 +120,9 @@
protected slots:
+ void slotContextMenu ( const QPoint & pos );
+
+
/**
* Propagate a tree item selection.
*
Modified: trunk/qt/yast2-qt.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/yast2-qt.spec.in?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/qt/yast2-qt.spec.in (original)
+++ trunk/qt/yast2-qt.spec.in Fri Mar 6 15:23:54 2009
@@ -16,8 +16,8 @@
Summary: -
BuildRequires: yast2-devtools >= 2.16.3
-BuildRequires: yast2-libyui-devel >= 2.18.4
-Requires: yast2-libyui >= 2.18.4
+BuildRequires: yast2-libyui-devel >= 2.18.7
+Requires: yast2-libyui >= 2.18.7
Requires: yast2_theme >= 2.16.1
Provides: yast2_ui
Provides: y2base:/usr/lib/YaST2/servers/qt
Modified: trunk/ycp-ui-bindings/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ycp-ui-bindings/VERSION?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/ycp-ui-bindings/VERSION (original)
+++ trunk/ycp-ui-bindings/VERSION Fri Mar 6 15:23:54 2009
@@ -1 +1 @@
-2.18.3
+2.18.4
Modified: trunk/ycp-ui-bindings/package/yast2-ycp-ui-bindings.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ycp-ui-bindings/package/yast2-ycp-ui-bindings.changes?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/ycp-ui-bindings/package/yast2-ycp-ui-bindings.changes (original)
+++ trunk/ycp-ui-bindings/package/yast2-ycp-ui-bindings.changes Fri Mar 6 15:23:54 2009
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+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)
Modified: trunk/ycp-ui-bindings/src/YCPDialogParser.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ycp-ui-bindings/src/YCPDialogParser.cc?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/ycp-ui-bindings/src/YCPDialogParser.cc (original)
+++ trunk/ycp-ui-bindings/src/YCPDialogParser.cc Fri Mar 6 15:23:54 2009
@@ -144,6 +144,11 @@
* ( if `opt( `notify ) is set for that SelectionBox ).
* Only widgets with this option set are affected.
*
+ * @option contextMenu Make this widget to send an event when the context menu is requested
+ * e.g. when the user clicks right mouse button
+ * ( if `opt( `contextMenu ) 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).
@@ -191,6 +196,7 @@
{
string sym = rawopt->value(o)->asSymbol()->symbol();
if ( sym == YUIOpt_notify ) opt.notifyMode.setValue( true );
+ else if ( sym == YUIOpt_contextMenu ) opt.contextMenu.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 );
@@ -345,6 +351,7 @@
if ( opt.isDisabled.value() ) w->setDisabled();
if ( opt.notifyMode.value() ) w->setNotify( true );
+ if ( opt.contextMenu.value() ) w->setContextMenu( true );
if ( opt.keyEvents.value() ) w->setSendKeyEvents( true );
if ( opt.autoShortcut.value() ) w->setAutoShortcut( true );
if ( opt.isHStretchable.value() ) w->setStretchable( YD_HORIZ, true );
Modified: trunk/ycp-ui-bindings/src/YCP_UI.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ycp-ui-bindings/src/YCP_UI.cc?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/ycp-ui-bindings/src/YCP_UI.cc (original)
+++ trunk/ycp-ui-bindings/src/YCP_UI.cc Fri Mar 6 15:23:54 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"
@@ -100,6 +101,7 @@
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;
@@ -543,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;
}
@@ -1585,5 +1588,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: trunk/ycp-ui-bindings/src/YCP_UI.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ycp-ui-bindings/src/YCP_UI.h?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/ycp-ui-bindings/src/YCP_UI.h (original)
+++ trunk/ycp-ui-bindings/src/YCP_UI.h Fri Mar 6 15:23:54 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: trunk/ycp-ui-bindings/src/YUINamespace.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ycp-ui-bindings/src/YUINamespace.cc?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/ycp-ui-bindings/src/YUINamespace.cc (original)
+++ trunk/ycp-ui-bindings/src/YUINamespace.cc Fri Mar 6 15:23:54 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: trunk/ycp-ui-bindings/src/YUINamespace.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ycp-ui-bindings/src/YUINamespace.h?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/ycp-ui-bindings/src/YUINamespace.h (original)
+++ trunk/ycp-ui-bindings/src/YUINamespace.h Fri Mar 6 15:23:54 2009
@@ -300,6 +300,9 @@
/* TYPEINFO: boolean () */
YCPBoolean TextMode();
+ /* TYPEINFO: boolean (term) */
+ YCPBoolean OpenContextMenu( const YCPTerm & term );
+
YCPValue
Modified: trunk/ycp-ui-bindings/src/YWidgetOpt.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ycp-ui-bindings/src/YWidgetOpt.h?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/ycp-ui-bindings/src/YWidgetOpt.h (original)
+++ trunk/ycp-ui-bindings/src/YWidgetOpt.h Fri Mar 6 15:23:54 2009
@@ -120,6 +120,7 @@
YBoolOpt isDisabled;
YBoolOpt notifyMode;
+ YBoolOpt contextMenu;
YBoolOpt isHStretchable;
YBoolOpt isVStretchable;
YBoolOpt autoShortcut;
Modified: trunk/ycp-ui-bindings/yast2-ycp-ui-bindings.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ycp-ui-bindings/yast2-ycp-ui-bindings.spec.in?rev=55975&r1=55974&r2=55975&view=diff
==============================================================================
--- trunk/ycp-ui-bindings/yast2-ycp-ui-bindings.spec.in (original)
+++ trunk/ycp-ui-bindings/yast2-ycp-ui-bindings.spec.in Fri Mar 6 15:23:54 2009
@@ -19,8 +19,8 @@
# libycp includes crypto built-ins
BuildRequires: libxcrypt-devel
-Requires: yast2-libyui >= 2.18.4
-BuildRequires: yast2-libyui-devel >= 2.18.4
+Requires: yast2-libyui >= 2.18.7
+BuildRequires: yast2-libyui-devel >= 2.18.7
# libyui ImplPtr
BuildRequires: boost-devel
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org