added a "Show All Musicians" check box in the server list

This commit is contained in:
Volker Fischer 2020-04-14 17:23:53 +02:00
parent 514bd25fee
commit a0f7ee4627
3 changed files with 28 additions and 1 deletions

View file

@ -151,6 +151,10 @@ CConnectDlg::CConnectDlg ( const bool bNewShowCompleteRegList,
QObject::connect ( cbxServerAddr, SIGNAL ( editTextChanged ( const QString& ) ),
this, SLOT ( OnServerAddrEditTextChanged ( const QString& ) ) );
// check boxes
QObject::connect ( chbExpandAll, SIGNAL ( stateChanged ( int ) ),
this, SLOT ( OnExpandAllStateChanged ( int ) ) );
// buttons
QObject::connect ( butCancel, SIGNAL ( clicked() ),
this, SLOT ( close() ) );
@ -205,6 +209,9 @@ void CConnectDlg::RequestServerList()
// clear filter edit box
edtFilter->setText ( "" );
// per default we expand all list items
chbExpandAll->setCheckState ( Qt::Checked );
// get the IP address of the central server (using the ParseNetworAddress
// function) when the connect dialog is opened, this seems to be the correct
// time to do it
@ -494,6 +501,18 @@ void CConnectDlg::OnServerAddrEditTextChanged ( const QString& )
lvwServers->clearSelection();
}
void CConnectDlg::OnExpandAllStateChanged ( int value )
{
if ( value == Qt::Checked )
{
lvwServers->expandAll();
}
else
{
lvwServers->collapseAll();
}
}
void CConnectDlg::UpdateListFilter()
{
const QString sFilterText = edtFilter->text();

View file

@ -101,6 +101,7 @@ public slots:
void OnServerListItemDoubleClicked ( QTreeWidgetItem* Item, int );
void OnServerAddrEditTextChanged ( const QString& );
void OnFilterTextEdited ( const QString& ) { UpdateListFilter(); }
void OnExpandAllStateChanged ( int value );
void OnConnectClicked();
void OnTimerPing();
void OnTimerReRequestServList();

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>521</width>
<height>294</height>
<height>493</height>
</rect>
</property>
<property name="windowTitle">
@ -39,6 +39,13 @@
<item>
<widget class="QLineEdit" name="edtFilter"/>
</item>
<item>
<widget class="QCheckBox" name="chbExpandAll">
<property name="text">
<string>Show All Musicians</string>
</property>
</widget>
</item>
</layout>
</item>
<item>