hide reset button when search field is empty

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2309 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2010-02-14 02:31:37 +00:00
parent 2f43e4152c
commit 850e756fe3
4 changed files with 410 additions and 157 deletions

View file

@ -119,6 +119,7 @@ SearchDialog::SearchDialog(QWidget *parent)
connect( ui.pushButtonDownload, SIGNAL( released ( void ) ), this, SLOT( download( void ) ) );
connect( ui.cloaseallsearchresultsButton, SIGNAL(clicked()), this, SLOT(searchRemoveAll()));
connect( ui.resetButton, SIGNAL(clicked()), this, SLOT(clearKeyword()));
connect( ui.lineEdit, SIGNAL( textChanged(const QString &)), this, SLOT(togglereset()));
//connect( ui.searchSummaryWidget, SIGNAL( itemSelectionChanged ( void ) ), this, SLOT( selectSearchResults( void ) ) );
@ -173,7 +174,7 @@ SearchDialog::SearchDialog(QWidget *parent)
ui.searchResultWidget->sortItems(SR_NAME_COL, Qt::AscendingOrder);
ui.resetButton->hide();
/* Hide platform specific features */
#ifdef Q_WS_WIN
@ -1114,3 +1115,18 @@ void SearchDialog::sendLinkTo( )
nMsgDialog->show();
}
void SearchDialog::togglereset()
{
QString text = ui.lineEdit->text();
if (text.isEmpty())
{
ui.resetButton->hide();
}
else
{
ui.resetButton->show();
}
}