diff options
Diffstat (limited to 'khtml/rendering/render_form.cpp')
-rw-r--r-- | khtml/rendering/render_form.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/khtml/rendering/render_form.cpp b/khtml/rendering/render_form.cpp index 403295a8f..58a9a8d33 100644 --- a/khtml/rendering/render_form.cpp +++ b/khtml/rendering/render_form.cpp @@ -385,7 +385,9 @@ TQPopupMenu *LineEditWidget::createPopupMenu() if (m_input->autoComplete()) { popup->insertSeparator(); - int id = popup->insertItem( SmallIconSet("history_clear"), i18n("Clear &History"), ClearHistory ); + int id = popup->insertItem( SmallIconSet("edit"), i18n("&Edit History..."), EditHistory ); + popup->setItemEnabled( id, (compObj() && !compObj()->isEmpty()) ); + id = popup->insertItem( SmallIconSet("history_clear"), i18n("Clear &History"), ClearHistory ); popup->setItemEnabled( id, (compObj() && !compObj()->isEmpty()) ); } @@ -409,11 +411,25 @@ void LineEditWidget::extendedMenuActivated( int id) m_view->clearCompletionHistory(m_input->name().string()); if (compObj()) compObj()->clear(); + case EditHistory: + { + KHistoryComboEditor dlg( compObj() ? compObj()->items() : TQStringList(), this ); + connect( &dlg, TQT_SIGNAL( removeFromHistory(const TQString&) ), TQT_SLOT( slotRemoveFromHistory(const TQString&)) ); + dlg.exec(); + } default: break; } } +void LineEditWidget::slotRemoveFromHistory(const TQString &entry) +{ + m_view->removeFormCompletionItem(m_input->name().string(), entry); + if (compObj()) + compObj()->removeItem(entry); +} + + bool LineEditWidget::event( TQEvent *e ) { if (KLineEdit::event(e)) |