Author: tgoettlicher Date: Fri Mar 6 16:58:46 2009 New Revision: 55988 URL: http://svn.opensuse.org/viewcvs/yast?rev=55988&view=rev Log: added ContextMenuClosed event Modified: trunk/qt/src/YQContextMenu.cc trunk/qt/src/YQContextMenu.h Modified: trunk/qt/src/YQContextMenu.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQContextMenu.cc?rev=55988&r1=55987&r2=55988&view=diff ============================================================================== --- trunk/qt/src/YQContextMenu.cc (original) +++ trunk/qt/src/YQContextMenu.cc Fri Mar 6 16:58:46 2009 @@ -62,6 +62,8 @@ connect( menu, SIGNAL( triggered ( QAction * ) ), this, SLOT ( menuEntryActivated( QAction * ) ) ); + connect( menu, SIGNAL( aboutToHide () ), + this, SLOT ( slotMenuHidden () ) ); // // Recursively add Qt menu items from the YMenuItems // @@ -120,6 +122,21 @@ } } +void +YQContextMenu::slotMenuHidden() +{ + // dirty hack + // see menuEntryActivated() for details + QTimer::singleShot( 100, this, SLOT( slotReturnMenuHidden() ) ); +} + +void +YQContextMenu::slotReturnMenuHidden() +{ + YQUI::ui()->sendEvent( new YMenuEvent( "ContextMenuClosed" ) ); +} + + void YQContextMenu::menuEntryActivated( QAction* action ) Modified: trunk/qt/src/YQContextMenu.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQContextMenu.h?rev=55988&r1=55987&r2=55988&view=diff ============================================================================== --- trunk/qt/src/YQContextMenu.h (original) +++ trunk/qt/src/YQContextMenu.h Fri Mar 6 16:58:46 2009 @@ -62,13 +62,6 @@ virtual void rebuildMenuTree(); /** - * Set enabled / disabled state. - * - * Reimplemented from YWidget. - **/ -// virtual void setEnabled( bool enabled ); - - /** * Preferred width of the widget. * * Reimplemented from YWidget. @@ -89,11 +82,6 @@ **/ virtual void setSize( int newWidth, int newHeight ); - /** - * Accept the keyboard focus. - **/ -// virtual bool setKeyboardFocus(); - protected slots: @@ -108,6 +96,19 @@ **/ void returnNow(); + /** + * Triggered when the context menu is hidden + **/ + void slotMenuHidden(); + + /** + * Triggered via slotMenuHidden() by zero timer to get back in sync + * with the Qt event loop. + **/ + void slotReturnMenuHidden(); + + + protected: -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org