diff options
Diffstat (limited to 'tdeui/keditlistbox.cpp')
| -rw-r--r-- | tdeui/keditlistbox.cpp | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/tdeui/keditlistbox.cpp b/tdeui/keditlistbox.cpp index bd7bb76b5..92efce083 100644 --- a/tdeui/keditlistbox.cpp +++ b/tdeui/keditlistbox.cpp @@ -105,10 +105,10 @@ void KEditListBox::init( bool checkAtEntering, int buttons, d->buttons = 0; setButtons( buttons ); - connect(m_lineEdit,TQT_SIGNAL(textChanged(const TQString&)),this,TQT_SLOT(typedSomething(const TQString&))); + connect(m_lineEdit,TQ_SIGNAL(textChanged(const TQString&)),this,TQ_SLOT(typedSomething(const TQString&))); m_lineEdit->setTrapReturnKey(true); - connect(m_lineEdit,TQT_SIGNAL(returnPressed()),this,TQT_SLOT(addItem())); - connect(m_listBox, TQT_SIGNAL(highlighted(int)), TQT_SLOT(enableMoveButtons(int))); + connect(m_lineEdit,TQ_SIGNAL(returnPressed()),this,TQ_SLOT(addItem())); + connect(m_listBox, TQ_SIGNAL(highlighted(int)), TQ_SLOT(enableMoveButtons(int))); // maybe supplied lineedit has some text already typedSomething( m_lineEdit->text() ); @@ -124,7 +124,7 @@ void KEditListBox::setButtons( uint buttons ) servNewButton = new TQPushButton(i18n("&Add"), this); servNewButton->setEnabled(false); servNewButton->show(); - connect(servNewButton, TQT_SIGNAL(clicked()), TQT_SLOT(addItem())); + connect(servNewButton, TQ_SIGNAL(clicked()), TQ_SLOT(addItem())); grid->addWidget(servNewButton, 2, 1); } else if ( ( buttons & Add ) == 0 && servNewButton ) { @@ -136,7 +136,7 @@ void KEditListBox::setButtons( uint buttons ) servRemoveButton = new TQPushButton(i18n("&Remove"), this); servRemoveButton->setEnabled(false); servRemoveButton->show(); - connect(servRemoveButton, TQT_SIGNAL(clicked()), TQT_SLOT(removeItem())); + connect(servRemoveButton, TQ_SIGNAL(clicked()), TQ_SLOT(removeItem())); grid->addWidget(servRemoveButton, 3, 1); } else if ( ( buttons & Remove ) == 0 && servRemoveButton ) { @@ -148,12 +148,12 @@ void KEditListBox::setButtons( uint buttons ) servUpButton = new TQPushButton(i18n("Move &Up"), this); servUpButton->setEnabled(false); servUpButton->show(); - connect(servUpButton, TQT_SIGNAL(clicked()), TQT_SLOT(moveItemUp())); + connect(servUpButton, TQ_SIGNAL(clicked()), TQ_SLOT(moveItemUp())); servDownButton = new TQPushButton(i18n("Move &Down"), this); servDownButton->setEnabled(false); servDownButton->show(); - connect(servDownButton, TQT_SIGNAL(clicked()), TQT_SLOT(moveItemDown())); + connect(servDownButton, TQ_SIGNAL(clicked()), TQ_SLOT(moveItemDown())); grid->addWidget(servUpButton, 4, 1); grid->addWidget(servDownButton, 5, 1); @@ -174,10 +174,14 @@ void KEditListBox::typedSomething(const TQString& text) // of currentItem() ... like changing it or emitting signals ... // but TT disagree with me on this one (it's been that way since ages ... grrr) bool block = m_listBox->signalsBlocked(); + const TQString& oldText = currentText(); + int item = currentItem(); m_listBox->blockSignals( true ); - m_listBox->changeItem(text, currentItem()); + m_listBox->changeItem(text, item); m_listBox->blockSignals( block ); emit changed(); + emit renamed(oldText, text); + emit renamed(item, oldText, text); } } @@ -278,7 +282,8 @@ void KEditListBox::addItem() m_lineEdit->clear(); m_lineEdit->blockSignals(block); - m_listBox->setSelected(currentItem(), false); + int item = currentItem(); + m_listBox->setSelected(item, false); if (!alreadyInList) { @@ -287,7 +292,8 @@ void KEditListBox::addItem() m_listBox->insertItem(currentTextLE); m_listBox->blockSignals( block ); emit changed(); - emit added( currentTextLE ); + emit added( currentTextLE ); + emit added( item, currentTextLE ); } } @@ -300,18 +306,19 @@ int KEditListBox::currentItem() const void KEditListBox::removeItem() { - int selected = m_listBox->currentItem(); + int item = m_listBox->currentItem(); - if ( selected >= 0 ) + if ( item >= 0 ) { - TQString removedText = m_listBox->currentText(); + TQString removedText = m_listBox->currentText(); - m_listBox->removeItem( selected ); + m_listBox->removeItem( item ); if ( count() > 0 ) - m_listBox->setSelected( TQMIN( selected, count() - 1 ), true ); + m_listBox->setSelected( TQMIN( item, count() - 1 ), true ); emit changed(); - emit removed( removedText ); + emit removed( removedText ); + emit removed( item, removedText ); } if ( servRemoveButton && m_listBox->currentItem() == -1 ) @@ -411,7 +418,7 @@ void KEditListBox::virtual_hook( int, void* ) KEditListBox::CustomEditor::CustomEditor( KComboBox *combo ) { m_representationWidget = combo; - m_lineEdit = tqt_dynamic_cast<KLineEdit*>( combo->lineEdit() ); + m_lineEdit = dynamic_cast<KLineEdit*>( combo->lineEdit() ); assert( m_lineEdit ); } |
