bug fix for server list filter, reported by pljones
This commit is contained in:
parent
8e86908d92
commit
6b1dac7ac8
3 changed files with 38 additions and 25 deletions
10
ChangeLog
10
ChangeLog
|
@ -3,18 +3,16 @@
|
|||
|
||||
3.5.2git
|
||||
|
||||
TODO offer the Jamulus ASIO settingspanel in case of an ASIO ERROR to fix, e.g., incorrect sample rate (https://sourceforge.net/p/llcon/discussion/533517/thread/777663cf94/#035f)
|
||||
TODO store Show All Musicians setting in the ini-file
|
||||
|
||||
TODO try to find a way to catch Windows exceptions in case a 64 bit Jamulus tries to load a 32 bit Jack Audio ASIO dll
|
||||
TODO if you select server list filter all text and delete, the filter is not updated
|
||||
|
||||
TODO improve audio drop out behaviour with OPUS64 by tuning the coding rate (it seems that for some coding rates we get loud artifacts
|
||||
on audio drop outs whereas for slightly different rates the behavior is much more pleasent)
|
||||
|
||||
TODO store Show All Musicians setting in the ini-file
|
||||
TODO offer the Jamulus ASIO settingspanel in case of an ASIO ERROR to fix, e.g., incorrect sample rate (https://sourceforge.net/p/llcon/discussion/533517/thread/777663cf94/#035f)
|
||||
|
||||
TODO bug fix: "Start up the new version with the Connection Setup showing. "Show all musicians" is on (as I say). Switch it off before the list is displayed. The
|
||||
checkbox is off - but the list displays all musicians! You need to turn it on and off again to get it to do its thing. (If you wait a little, it's fine -
|
||||
i.e. before it's populated the musicians but after it's displayed the list, turn it off.)", see https://github.com/corrados/jamulus/issues/78
|
||||
TODO try to find a way to catch Windows exceptions in case a 64 bit Jamulus tries to load a 32 bit Jack Audio ASIO dll
|
||||
|
||||
TODO the server list filter seems not to work if --showallservers is used
|
||||
|
||||
|
|
|
@ -36,7 +36,8 @@ CConnectDlg::CConnectDlg ( const bool bNewShowCompleteRegList,
|
|||
bShowCompleteRegList ( bNewShowCompleteRegList ),
|
||||
bServerListReceived ( false ),
|
||||
bServerListItemWasChosen ( false ),
|
||||
bListFilterWasActive ( false )
|
||||
bListFilterWasActive ( false ),
|
||||
bShowAllMusicians ( true )
|
||||
{
|
||||
setupUi ( this );
|
||||
|
||||
|
@ -219,11 +220,8 @@ void CConnectDlg::RequestServerList()
|
|||
// clear filter edit box
|
||||
edtFilter->setText ( "" );
|
||||
|
||||
// per default we expand all list items (not for the show all servers mode)
|
||||
if ( !bShowCompleteRegList )
|
||||
{
|
||||
chbExpandAll->setCheckState ( Qt::Checked );
|
||||
}
|
||||
// update Show All Musicians check box (this will call ShowAllMusicians())
|
||||
chbExpandAll->setCheckState ( bShowAllMusicians ? Qt::Checked : Qt::Unchecked );
|
||||
|
||||
// get the IP address of the central server (using the ParseNetworAddress
|
||||
// function) when the connect dialog is opened, this seems to be the correct
|
||||
|
@ -385,7 +383,7 @@ void CConnectDlg::SetServerList ( const CHostAddress& InetAddr,
|
|||
pNewListViewItem->setData ( 0, Qt::UserRole, CurHostAddress.toString() );
|
||||
|
||||
// per default expand the list item (if not "show all servers")
|
||||
if ( !bShowCompleteRegList )
|
||||
if ( bShowAllMusicians )
|
||||
{
|
||||
lvwServers->expandItem ( pNewListViewItem );
|
||||
}
|
||||
|
@ -514,9 +512,11 @@ void CConnectDlg::OnServerAddrEditTextChanged ( const QString& )
|
|||
lvwServers->clearSelection();
|
||||
}
|
||||
|
||||
void CConnectDlg::OnExpandAllStateChanged ( int value )
|
||||
void CConnectDlg::ShowAllMusicians ( const bool bState )
|
||||
{
|
||||
if ( value == Qt::Checked )
|
||||
bShowAllMusicians = bState;
|
||||
|
||||
if ( bState )
|
||||
{
|
||||
lvwServers->expandAll();
|
||||
}
|
||||
|
@ -537,33 +537,41 @@ void CConnectDlg::UpdateListFilter()
|
|||
|
||||
for ( int iIdx = 0; iIdx < iServerListLen; iIdx++ )
|
||||
{
|
||||
bool bFilterFound = false;
|
||||
QTreeWidgetItem* pCurListViewItem = lvwServers->topLevelItem ( iIdx );
|
||||
bool bFilterFound = false;
|
||||
|
||||
// search server name
|
||||
if ( lvwServers->topLevelItem ( iIdx )->text ( 0 ).indexOf ( sFilterText, 0, Qt::CaseInsensitive ) >= 0 )
|
||||
if ( pCurListViewItem->text ( 0 ).indexOf ( sFilterText, 0, Qt::CaseInsensitive ) >= 0 )
|
||||
{
|
||||
bFilterFound = true;
|
||||
}
|
||||
|
||||
// search location
|
||||
if ( lvwServers->topLevelItem ( iIdx )->text ( 3 ).indexOf ( sFilterText, 0, Qt::CaseInsensitive ) >= 0 )
|
||||
if ( pCurListViewItem->text ( 3 ).indexOf ( sFilterText, 0, Qt::CaseInsensitive ) >= 0 )
|
||||
{
|
||||
bFilterFound = true;
|
||||
}
|
||||
|
||||
// search childs
|
||||
for ( int iCCnt = 0; iCCnt < lvwServers->topLevelItem ( iIdx )->childCount(); iCCnt++ )
|
||||
for ( int iCCnt = 0; iCCnt < pCurListViewItem->childCount(); iCCnt++ )
|
||||
{
|
||||
if ( lvwServers->topLevelItem ( iIdx )->child ( iCCnt )->text ( 0 ).indexOf ( sFilterText, 0, Qt::CaseInsensitive ) >= 0 )
|
||||
if ( pCurListViewItem->child ( iCCnt )->text ( 0 ).indexOf ( sFilterText, 0, Qt::CaseInsensitive ) >= 0 )
|
||||
{
|
||||
bFilterFound = true;
|
||||
}
|
||||
}
|
||||
|
||||
// only update Hide state if ping time was received
|
||||
if ( !lvwServers->topLevelItem ( iIdx )->text ( 1 ).isEmpty() )
|
||||
if ( !pCurListViewItem->text ( 1 ).isEmpty() )
|
||||
{
|
||||
lvwServers->topLevelItem ( iIdx )->setHidden ( !bFilterFound );
|
||||
// only update hide and expand status if the hide state has to be changed to
|
||||
// preserve if user clicked on expand icon manually
|
||||
if ( ( pCurListViewItem->isHidden() && bFilterFound ) ||
|
||||
( !pCurListViewItem->isHidden() && !bFilterFound ) )
|
||||
{
|
||||
pCurListViewItem->setHidden ( !bFilterFound );
|
||||
pCurListViewItem->setExpanded ( bShowAllMusicians );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -577,8 +585,13 @@ void CConnectDlg::UpdateListFilter()
|
|||
|
||||
for ( int iIdx = 0; iIdx < iServerListLen; iIdx++ )
|
||||
{
|
||||
// if ping time is empty, hide item
|
||||
lvwServers->topLevelItem ( iIdx )->setHidden ( lvwServers->topLevelItem ( iIdx )->text ( 1 ).isEmpty() );
|
||||
QTreeWidgetItem* pCurListViewItem = lvwServers->topLevelItem ( iIdx );
|
||||
|
||||
// if ping time is empty, hide item (if not already hidden)
|
||||
if ( pCurListViewItem->text ( 1 ).isEmpty() && !pCurListViewItem->isHidden() )
|
||||
{
|
||||
pCurListViewItem->setHidden ( true );
|
||||
}
|
||||
}
|
||||
|
||||
bListFilterWasActive = false;
|
||||
|
|
|
@ -83,6 +83,7 @@ protected:
|
|||
QTreeWidgetItem* GetParentListViewItem ( QTreeWidgetItem* pItem );
|
||||
void DeleteAllListViewItemChilds ( QTreeWidgetItem* pItem );
|
||||
void UpdateListFilter();
|
||||
void ShowAllMusicians ( const bool bState );
|
||||
|
||||
QTimer TimerPing;
|
||||
QTimer TimerReRequestServList;
|
||||
|
@ -94,13 +95,14 @@ protected:
|
|||
bool bServerListReceived;
|
||||
bool bServerListItemWasChosen;
|
||||
bool bListFilterWasActive;
|
||||
bool bShowAllMusicians;
|
||||
|
||||
public slots:
|
||||
void OnServerListItemSelectionChanged();
|
||||
void OnServerListItemDoubleClicked ( QTreeWidgetItem* Item, int );
|
||||
void OnServerAddrEditTextChanged ( const QString& );
|
||||
void OnFilterTextEdited ( const QString& ) { UpdateListFilter(); }
|
||||
void OnExpandAllStateChanged ( int value );
|
||||
void OnExpandAllStateChanged ( int value ) { ShowAllMusicians ( value == Qt::Checked ); }
|
||||
void OnConnectClicked();
|
||||
void OnTimerPing();
|
||||
void OnTimerReRequestServList();
|
||||
|
|
Loading…
Reference in a new issue