diff options
Diffstat (limited to 'kdevdesigner/designer/actioneditorimpl.cpp')
-rw-r--r-- | kdevdesigner/designer/actioneditorimpl.cpp | 122 |
1 files changed, 61 insertions, 61 deletions
diff --git a/kdevdesigner/designer/actioneditorimpl.cpp b/kdevdesigner/designer/actioneditorimpl.cpp index 294507a9..45b70994 100644 --- a/kdevdesigner/designer/actioneditorimpl.cpp +++ b/kdevdesigner/designer/actioneditorimpl.cpp @@ -50,21 +50,21 @@ ActionEditor::ActionEditor( TQWidget* parent, const char* name, WFlags fl ) explicitlyClosed(false) { listActions->addColumn( i18n( "Actions" ) ); - setEnabled( FALSE ); - buttonConnect->setEnabled( FALSE ); + setEnabled( false ); + buttonConnect->setEnabled( false ); TQPopupMenu *popup = new TQPopupMenu( this ); - popup->insertItem( i18n( "New &Action" ), this, TQT_SLOT( newAction() ) ); - popup->insertItem( i18n( "New Action &Group" ), this, TQT_SLOT( newActionGroup() ) ); - popup->insertItem( i18n( "New &Dropdown Action Group" ), this, TQT_SLOT( newDropDownActionGroup() ) ); + popup->insertItem( i18n( "New &Action" ), this, TQ_SLOT( newAction() ) ); + popup->insertItem( i18n( "New Action &Group" ), this, TQ_SLOT( newActionGroup() ) ); + popup->insertItem( i18n( "New &Dropdown Action Group" ), this, TQ_SLOT( newDropDownActionGroup() ) ); buttonNewAction->setPopup( popup ); buttonNewAction->setPopupDelay( 0 ); - connect( listActions, TQT_SIGNAL( insertAction() ), this, TQT_SLOT( newAction() ) ); - connect( listActions, TQT_SIGNAL( insertActionGroup() ), this, TQT_SLOT( newActionGroup() ) ); - connect( listActions, TQT_SIGNAL( insertDropDownActionGroup() ), this, TQT_SLOT( newDropDownActionGroup() ) ); - connect( listActions, TQT_SIGNAL( deleteAction() ), this, TQT_SLOT( deleteAction() ) ); - connect( listActions, TQT_SIGNAL( connectAction() ), this, TQT_SLOT( connectionsClicked() ) ); + connect( listActions, TQ_SIGNAL( insertAction() ), this, TQ_SLOT( newAction() ) ); + connect( listActions, TQ_SIGNAL( insertActionGroup() ), this, TQ_SLOT( newActionGroup() ) ); + connect( listActions, TQ_SIGNAL( insertDropDownActionGroup() ), this, TQ_SLOT( newDropDownActionGroup() ) ); + connect( listActions, TQ_SIGNAL( deleteAction() ), this, TQ_SLOT( deleteAction() ) ); + connect( listActions, TQ_SIGNAL( connectAction() ), this, TQ_SLOT( connectionsClicked() ) ); } void ActionEditor::closeEvent( TQCloseEvent *e ) @@ -101,21 +101,21 @@ void ActionEditor::setCurrentAction( TQAction *a ) TQAction *ActionEditor::newActionEx() { - ActionItem *i = new ActionItem( listActions, (bool)FALSE ); + ActionItem *i = new ActionItem( listActions, (bool)false ); TQAction *a = i->action(); - TQObject::connect( a, TQT_SIGNAL( destroyed( TQObject * ) ), - this, TQT_SLOT( removeConnections( TQObject* ) ) ); + TQObject::connect( a, TQ_SIGNAL( destroyed( TQObject * ) ), + this, TQ_SLOT( removeConnections( TQObject* ) ) ); MetaDataBase::addEntry( i->action() ); TQString n = "Action"; - formWindow->unify( i->action(), n, TRUE ); + formWindow->unify( i->action(), n, true ); i->setText( 0, n ); i->action()->setName( n ); i->action()->setText( i->action()->name() ); - MetaDataBase::setPropertyChanged( i->action(), "text", TRUE ); - MetaDataBase::setPropertyChanged( i->action(), "name", TRUE ); + MetaDataBase::setPropertyChanged( i->action(), "text", true ); + MetaDataBase::setPropertyChanged( i->action(), "name", true ); formWindow->actionList().append( i->action() ); if ( formWindow->formFile() ) - formWindow->formFile()->setModified( TRUE ); + formWindow->formFile()->setModified( true ); return i->action(); } @@ -139,9 +139,9 @@ void ActionEditor::deleteAction() ++it; } if ( formWindow ) { - formWindow->setActiveObject( TQT_TQOBJECT(formWindow->mainContainer()) ); + formWindow->setActiveObject( formWindow->mainContainer() ); if ( formWindow->formFile() ) - formWindow->formFile()->setModified( TRUE ); + formWindow->formFile()->setModified( true ); } } @@ -149,7 +149,7 @@ void ActionEditor::newAction() { ActionItem *actionParent = (ActionItem*)listActions->selectedItem(); if ( actionParent ) { - if ( !::tqqt_cast<TQActionGroup*>(actionParent->actionGroup()) ) + if ( !::tqt_cast<TQActionGroup*>(actionParent->actionGroup()) ) actionParent = (ActionItem*)actionParent->parent(); } @@ -157,67 +157,67 @@ void ActionEditor::newAction() if ( actionParent ) i = new ActionItem( actionParent ); else - i = new ActionItem( listActions, (bool)FALSE ); + i = new ActionItem( listActions, (bool)false ); TQAction *a = i->action(); - TQObject::connect( a, TQT_SIGNAL( destroyed( TQObject * ) ), - this, TQT_SLOT( removeConnections( TQObject* ) ) ); + TQObject::connect( a, TQ_SIGNAL( destroyed( TQObject * ) ), + this, TQ_SLOT( removeConnections( TQObject* ) ) ); MetaDataBase::addEntry( i->action() ); TQString n = "Action"; - formWindow->unify( i->action(), n, TRUE ); + formWindow->unify( i->action(), n, true ); i->setText( 0, n ); i->action()->setName( n ); i->action()->setText( i->action()->name() ); if ( actionParent && actionParent->actionGroup() && actionParent->actionGroup()->usesDropDown() ) { - i->action()->setToggleAction( TRUE ); - MetaDataBase::setPropertyChanged( i->action(), "toggleAction", TRUE ); + i->action()->setToggleAction( true ); + MetaDataBase::setPropertyChanged( i->action(), "toggleAction", true ); } - MetaDataBase::setPropertyChanged( i->action(), "text", TRUE ); - MetaDataBase::setPropertyChanged( i->action(), "name", TRUE ); + MetaDataBase::setPropertyChanged( i->action(), "text", true ); + MetaDataBase::setPropertyChanged( i->action(), "name", true ); listActions->setCurrentItem( i ); if ( !actionParent ) formWindow->actionList().append( i->action() ); if ( formWindow->formFile() ) - formWindow->formFile()->setModified( TRUE ); + formWindow->formFile()->setModified( true ); } void ActionEditor::newActionGroup() { ActionItem *actionParent = (ActionItem*)listActions->selectedItem(); if ( actionParent ) { - if ( !::tqqt_cast<TQActionGroup*>(actionParent->actionGroup()) ) + if ( !::tqt_cast<TQActionGroup*>(actionParent->actionGroup()) ) actionParent = (ActionItem*)actionParent->parent(); } ActionItem *i = 0; if ( actionParent ) - i = new ActionItem( actionParent, TRUE ); + i = new ActionItem( actionParent, true ); else - i = new ActionItem( listActions, TRUE ); + i = new ActionItem( listActions, true ); TQAction *ag = i->actionGroup(); - TQObject::connect( ag, TQT_SIGNAL( destroyed( TQObject * ) ), - this, TQT_SLOT( removeConnections( TQObject* ) ) ); + TQObject::connect( ag, TQ_SIGNAL( destroyed( TQObject * ) ), + this, TQ_SLOT( removeConnections( TQObject* ) ) ); MetaDataBase::addEntry( i->actionGroup() ); - MetaDataBase::setPropertyChanged( i->actionGroup(), "usesDropDown", TRUE ); + MetaDataBase::setPropertyChanged( i->actionGroup(), "usesDropDown", true ); TQString n = "ActionGroup"; - formWindow->unify( i->action(), n, TRUE ); + formWindow->unify( i->action(), n, true ); i->setText( 0, n ); i->actionGroup()->setName( n ); i->actionGroup()->setText( i->actionGroup()->name() ); - MetaDataBase::setPropertyChanged( i->actionGroup(), "text", TRUE ); - MetaDataBase::setPropertyChanged( i->actionGroup(), "name", TRUE ); + MetaDataBase::setPropertyChanged( i->actionGroup(), "text", true ); + MetaDataBase::setPropertyChanged( i->actionGroup(), "name", true ); listActions->setCurrentItem( i ); - i->setOpen( TRUE ); + i->setOpen( true ); if ( !actionParent ) formWindow->actionList().append( i->actionGroup() ); if ( formWindow->formFile() ) - formWindow->formFile()->setModified( TRUE ); + formWindow->formFile()->setModified( true ); } void ActionEditor::newDropDownActionGroup() { newActionGroup(); - ( (ActionItem*)listActions->currentItem() )->actionGroup()->setUsesDropDown( TRUE ); + ( (ActionItem*)listActions->currentItem() )->actionGroup()->setUsesDropDown( true ); } void ActionEditor::setFormWindow( FormWindow *fw ) @@ -225,29 +225,29 @@ void ActionEditor::setFormWindow( FormWindow *fw ) listActions->clear(); formWindow = fw; if ( !formWindow || - !::tqqt_cast<TQMainWindow*>(formWindow->mainContainer()) ) { - setEnabled( FALSE ); + !::tqt_cast<TQMainWindow*>(formWindow->mainContainer()) ) { + setEnabled( false ); } else { - setEnabled( TRUE ); + setEnabled( true ); for ( TQAction *a = formWindow->actionList().first(); a; a = formWindow->actionList().next() ) { ActionItem *i = 0; - if ( ::tqqt_cast<TQAction*>(a->parent()) ) + if ( ::tqt_cast<TQAction*>(a->parent()) ) continue; i = new ActionItem( listActions, a ); i->setText( 0, a->name() ); i->setPixmap( 0, a->iconSet().pixmap() ); // make sure we don't duplicate the connection - TQObject::disconnect( a, TQT_SIGNAL( destroyed( TQObject * ) ), - this, TQT_SLOT( removeConnections( TQObject * ) ) ); - TQObject::connect( a, TQT_SIGNAL( destroyed( TQObject * ) ), - this, TQT_SLOT( removeConnections( TQObject* ) ) ); - if ( ::tqqt_cast<TQActionGroup*>(a) ) { + TQObject::disconnect( a, TQ_SIGNAL( destroyed( TQObject * ) ), + this, TQ_SLOT( removeConnections( TQObject * ) ) ); + TQObject::connect( a, TQ_SIGNAL( destroyed( TQObject * ) ), + this, TQ_SLOT( removeConnections( TQObject* ) ) ); + if ( ::tqt_cast<TQActionGroup*>(a) ) { insertChildActions( i ); } } if ( listActions->firstChild() ) { listActions->setCurrentItem( listActions->firstChild() ); - listActions->setSelected( listActions->firstChild(), TRUE ); + listActions->setSelected( listActions->firstChild(), true ); } } } @@ -261,19 +261,19 @@ void ActionEditor::insertChildActions( ActionItem *i ) while ( it.current() ) { TQObject *o = it.current(); ++it; - if ( !::tqqt_cast<TQAction*>(o) ) + if ( !::tqt_cast<TQAction*>(o) ) continue; TQAction *a = (TQAction*)o; ActionItem *i2 = new ActionItem( (TQListViewItem*)i, a ); - i->setOpen( TRUE ); + i->setOpen( true ); i2->setText( 0, a->name() ); i2->setPixmap( 0, a->iconSet().pixmap() ); // make sure we don't duplicate the connection - TQObject::disconnect( o, TQT_SIGNAL( destroyed( TQObject * ) ), - this, TQT_SLOT( removeConnections( TQObject * ) ) ); - TQObject::connect( o, TQT_SIGNAL( destroyed( TQObject * ) ), - this, TQT_SLOT( removeConnections( TQObject * ) ) ); - if ( ::tqqt_cast<TQActionGroup*>(a) ) + TQObject::disconnect( o, TQ_SIGNAL( destroyed( TQObject * ) ), + this, TQ_SLOT( removeConnections( TQObject * ) ) ); + TQObject::connect( o, TQ_SIGNAL( destroyed( TQObject * ) ), + this, TQ_SLOT( removeConnections( TQObject * ) ) ); + if ( ::tqt_cast<TQActionGroup*>(a) ) insertChildActions( i2 ); } } @@ -305,7 +305,7 @@ void ActionEditor::updateActionIcon( TQAction *a ) void ActionEditor::connectionsClicked() { ConnectionDialog dlg( formWindow->mainWindow() ); - dlg.setDefault( TQT_TQOBJECT(currentAction), TQT_TQOBJECT(formWindow) ); + dlg.setDefault( currentAction, formWindow ); dlg.addConnection(); dlg.exec(); } @@ -313,9 +313,9 @@ void ActionEditor::connectionsClicked() void ActionEditor::removeConnections( TQObject *o ) { TQValueList<MetaDataBase::Connection> conns = - MetaDataBase::connections( TQT_TQOBJECT(formWindow), o ); + MetaDataBase::connections( formWindow, o ); for ( TQValueList<MetaDataBase::Connection>::Iterator it2 = conns.begin(); it2 != conns.end(); ++it2 ) - MetaDataBase::removeConnection( TQT_TQOBJECT(formWindow), (*it2).sender, (*it2).signal, + MetaDataBase::removeConnection( formWindow, (*it2).sender, (*it2).signal, (*it2).receiver, (*it2).slot ); } |