Added new basic class for a QLineEdit with a clear button - LineEditClear.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5080 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-04-05 21:03:03 +00:00
parent 1df5582e1c
commit 7756b093bf
34 changed files with 413 additions and 962 deletions

View file

@ -112,10 +112,9 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags)
connect( ui.shareButton, SIGNAL(clicked()), SLOT(openShareManager()));
connect( ui.addIMAccountButton, SIGNAL(clicked( bool ) ), this , SLOT( addFriend() ) );
#endif // MINIMAL_RSGUI
connect(ui.clearButton, SIGNAL(clicked()), this, SLOT(clearFilter()));
connect(ui.messagelineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(savestatusmessage()));
connect(ui.filterPatternLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(filterRegExpChanged()));
connect(ui.filterLineEdit, SIGNAL(textChanged(QString)), ui.friendList, SLOT(filterItems(QString)));
#ifndef MINIMAL_RSGUI
connect(NotifyQt::getInstance(), SIGNAL(ownAvatarChanged()), this, SLOT(updateAvatar()));
@ -185,8 +184,6 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags)
loadmystatusmessage();
#endif // MINIMAL_RSGUI
ui.clearButton->hide();
/* Hide platform specific features */
#ifdef Q_WS_WIN
#endif
@ -284,24 +281,3 @@ void MessengerWindow::updateOwnStatus(const QString &peer_id, int status)
}
#endif // MINIMAL_RSGUI
/* clear Filter */
void MessengerWindow::clearFilter()
{
ui.filterPatternLineEdit->clear();
ui.filterPatternLineEdit->setFocus();
}
void MessengerWindow::filterRegExpChanged()
{
QString text = ui.filterPatternLineEdit->text();
if (text.isEmpty()) {
ui.clearButton->hide();
} else {
ui.clearButton->show();
}
ui.friendList->filterItems(text);
}