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

View file

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

View file

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