Ejemplo n.º 1
0
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() ) );
}
bool ActionEditor::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: currentActionChanged((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 1: deleteAction(); break;
    case 2: newAction(); break;
    case 3: newActionGroup(); break;
    case 4: newDropDownActionGroup(); break;
    case 5: connectionsClicked(); break;
    case 6: removeConnections((QObject*)static_QUType_ptr.get(_o+1)); break;
    default:
	return ActionEditorBase::qt_invoke( _id, _o );
    }
    return TRUE;
}