bool ActionListView::qt_emit( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->signalOffset() ) { case 0: insertAction(); break; case 1: insertActionGroup(); break; case 2: insertDropDownActionGroup(); break; case 3: deleteAction(); break; case 4: connectAction(); break; default: return QListView::qt_emit(_id,_o); } return TRUE; }
ActionEditor::ActionEditor( QWidget* parent, const char* name, WFlags fl ) : ActionEditorBase( parent, name, fl ), currentAction( 0 ), formWindow( 0 ), explicitlyClosed(false) { listActions->addColumn( i18n( "Actions" ) ); setEnabled( FALSE ); buttonConnect->setEnabled( FALSE ); QPopupMenu *popup = new QPopupMenu( this ); popup->insertItem( i18n( "New &Action" ), this, SLOT( newAction() ) ); popup->insertItem( i18n( "New Action &Group" ), this, SLOT( newActionGroup() ) ); popup->insertItem( i18n( "New &Dropdown Action Group" ), this, SLOT( newDropDownActionGroup() ) ); buttonNewAction->setPopup( popup ); buttonNewAction->setPopupDelay( 0 ); connect( listActions, SIGNAL( insertAction() ), this, SLOT( newAction() ) ); connect( listActions, SIGNAL( insertActionGroup() ), this, SLOT( newActionGroup() ) ); connect( listActions, SIGNAL( insertDropDownActionGroup() ), this, SLOT( newDropDownActionGroup() ) ); connect( listActions, SIGNAL( deleteAction() ), this, SLOT( deleteAction() ) ); connect( listActions, SIGNAL( connectAction() ), this, SLOT( connectionsClicked() ) ); }
void ActionListView::rmbMenu( QListViewItem *i, const QPoint &p ) { QPopupMenu *popup = new QPopupMenu( this ); popup->insertItem( tr( "New &Action" ), 0 ); popup->insertItem( tr( "New Action &Group" ), 1 ); popup->insertItem( tr( "New &Dropdown Action Group" ), 2 ); if ( i ) { popup->insertSeparator(); popup->insertItem( tr( "&Connect Action..." ), 3 ); popup->insertSeparator(); popup->insertItem( tr( "Delete Action" ), 4 ); } int res = popup->exec( p ); if ( res == 0 ) emit insertAction(); else if ( res == 1 ) emit insertActionGroup(); else if ( res == 2 ) emit insertDropDownActionGroup(); else if ( res == 3 ) emit connectAction(); else if ( res == 4 ) emit deleteAction(); }