add special server list filter for filtering occupied servers by using "#" (#397)

This commit is contained in:
Volker Fischer 2020-07-04 08:24:35 +02:00
parent 6f95d052bf
commit 9af0ae13e9
2 changed files with 13 additions and 3 deletions

View File

@ -9,6 +9,8 @@
- new app icon for Jamulus, created by geheimerEichkater (#410)
- add special server list filter for filtering occupied servers by using "#" (#397)
- bug fix: grouping faders in the client should be proportional (see discussion in #202, #419)

View File

@ -227,9 +227,6 @@ void CConnectDlg::RequestServerList()
// clear server list view
lvwServers->clear();
// clear filter edit box
edtFilter->setText ( "" );
// update list combo box (disable events to avoid a signal)
cbxCentServAddrType->blockSignals ( true );
cbxCentServAddrType->setCurrentIndex ( static_cast<int> ( pClient->GetCentralServerAddressType() ) );
@ -481,6 +478,9 @@ void CConnectDlg::SetConnClientsList ( const CHostAddress& InetAddr,
// to show the children
lvwServers->setRootIsDecorated ( true );
}
// the clients list may have changed, update the filter selection
UpdateListFilter();
}
}
@ -569,6 +569,14 @@ void CConnectDlg::UpdateListFilter()
bFilterFound = true;
}
// special case: filter for occupied servers
// DEFINITION: if "#" is set at the beginning of the filter text, we show
// occupied servers (#397)
if ( ( sFilterText.indexOf ( "#" ) == 0 ) && ( pCurListViewItem->childCount() > 0 ) )
{
bFilterFound = true;
}
// search children
for ( int iCCnt = 0; iCCnt < pCurListViewItem->childCount(); iCCnt++ )
{