[yast-commit] r47007 - in /trunk/qt/src: YQWizard.cc YQWizard.h
Author: kmachalkova
Date: Wed Apr 23 17:54:39 2008
New Revision: 47007
URL: http://svn.opensuse.org/viewcvs/yast?rev=47007&view=rev
Log:
Make wizard menu work again - using triggered()
signal instead of obsolete activated() (#367796)
Modified:
trunk/qt/src/YQWizard.cc
trunk/qt/src/YQWizard.h
Modified: trunk/qt/src/YQWizard.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQWizard.cc?rev=47007&r1=47006&r2=47007&view=diff
==============================================================================
--- trunk/qt/src/YQWizard.cc (original)
+++ trunk/qt/src/YQWizard.cc Wed Apr 23 17:54:39 2008
@@ -962,8 +962,8 @@
_menuBar->addMenu( menu );
menu->setTitle( fromUTF8( text ) );
- connect( menu, SIGNAL( activated ( int ) ),
- this, SLOT ( sendMenuEvent( int ) ) );
+ connect( menu, SIGNAL( triggered ( QAction * ) ),
+ this, SLOT ( sendMenuEvent( QAction * ) ) );
_menuBar->show();
}
@@ -984,8 +984,8 @@
_menuIDs.insert( fromUTF8( id ), menu );
//FIXME parentMenu->insertItem( fromUTF8( text ), menu );
- connect( menu, SIGNAL( activated ( int ) ),
- this, SLOT ( sendMenuEvent( int ) ) );
+ connect( menu, SIGNAL( triggered ( QAction * ) ),
+ this, SLOT ( sendMenuEvent( QAction * ) ) );
}
else
{
@@ -1005,8 +1005,10 @@
#if 0
int id = _menuEntryIDs.size();
#endif
- _menuEntryIDs.push_back( idString );
- parentMenu->addAction( fromUTF8( text ) );
+ QAction *action;
+ action = parentMenu->addAction( fromUTF8( text ) );
+ _menuEntryIDs[ action ] = idString ;
+
}
else
{
@@ -1042,15 +1044,15 @@
}
-void YQWizard::sendMenuEvent( int numID )
+void YQWizard::sendMenuEvent( QAction *action )
{
- if ( numID >= 0 && numID < (int) _menuEntryIDs.size() )
+ if ( _menuEntryIDs.contains( action ) )
{
- sendEvent( _menuEntryIDs[ numID ] );
+ sendEvent( _menuEntryIDs[ action ] );
}
else
{
- yuiError() << "Invalid menu ID: " << numID << endl;
+ yuiError() << "Invalid menu ID " << endl;
}
}
Modified: trunk/qt/src/YQWizard.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQWizard.h?rev=47007&r1=47006&r2=47007&view=diff
==============================================================================
--- trunk/qt/src/YQWizard.h (original)
+++ trunk/qt/src/YQWizard.h Wed Apr 23 17:54:39 2008
@@ -432,7 +432,7 @@
* Internal notification that a menu item with numeric ID 'numID' has been
* activated.
**/
- void sendMenuEvent( int numID );
+ void sendMenuEvent( QAction *action );
protected:
@@ -548,7 +548,7 @@
QHash
participants (1)
-
kmachalkova@svn.opensuse.org