duplicate Central Server type dropdown to Connection Setup (#157)

This commit is contained in:
Volker Fischer 2020-05-16 17:35:38 +02:00
parent 1bceb912b0
commit 8788936414
7 changed files with 51 additions and 6 deletions

View file

@ -4,7 +4,10 @@
3.5.4git 3.5.4git
TODO Move Central Server Address Dropdown to Connection Setup (#157) - support intermediate Reaper RPP file while recording, coded by pljones (Ticket #170)
- duplicate Central Server type dropdown to Connection Setup (#157)
TODO Keep lrelease? Does it work as expected? TODO Keep lrelease? Does it work as expected?

View file

@ -39,7 +39,7 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
bConnectDlgWasShown ( false ), bConnectDlgWasShown ( false ),
ClientSettingsDlg ( pNCliP, parent, Qt::Window ), ClientSettingsDlg ( pNCliP, parent, Qt::Window ),
ChatDlg ( parent, Qt::Window ), ChatDlg ( parent, Qt::Window ),
ConnectDlg ( bNewShowComplRegConnList, parent, Qt::Dialog ), ConnectDlg ( pNCliP, bNewShowComplRegConnList, parent, Qt::Dialog ),
AnalyzerConsole ( pNCliP, parent, Qt::Window ), AnalyzerConsole ( pNCliP, parent, Qt::Window ),
MusicianProfileDlg ( pNCliP, parent ) MusicianProfileDlg ( pNCliP, parent )
{ {

View file

@ -443,6 +443,10 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
SIGNAL ( buttonClicked ( QAbstractButton* ) ), this, SIGNAL ( buttonClicked ( QAbstractButton* ) ), this,
SLOT ( OnSndCrdBufferDelayButtonGroupClicked ( QAbstractButton* ) ) ); SLOT ( OnSndCrdBufferDelayButtonGroupClicked ( QAbstractButton* ) ) );
QObject::connect ( pClient,
SIGNAL ( CentralServerAddressTypeChanged() ),
this, SLOT ( OnCentralServerAddressTypeChanged() ) );
// Timers ------------------------------------------------------------------ // Timers ------------------------------------------------------------------
// start timer for status bar // start timer for status bar
@ -583,6 +587,13 @@ void CClientSettingsDlg::UpdateCentralServerDependency()
{ {
const bool bCurUseDefCentServAddr = ( pClient->GetCentralServerAddressType() != AT_MANUAL ); const bool bCurUseDefCentServAddr = ( pClient->GetCentralServerAddressType() != AT_MANUAL );
// update server type combo box (because the value may have ben changed
// by a control in another dialog, e.g., the connect dialog),
// since it is just an update, do not fire signals for the update
cbxCentServAddrType->blockSignals ( true );
cbxCentServAddrType->setCurrentIndex ( static_cast<int> ( pClient->GetCentralServerAddressType() ) );
cbxCentServAddrType->blockSignals ( false );
// make sure the line edit does not fire signals when we update the text // make sure the line edit does not fire signals when we update the text
edtCentralServerAddress->blockSignals ( true ); edtCentralServerAddress->blockSignals ( true );
{ {

View file

@ -102,6 +102,7 @@ protected:
void OnAudioChannelsActivated ( int iChanIdx ); void OnAudioChannelsActivated ( int iChanIdx );
void OnAudioQualityActivated ( int iQualityIdx ); void OnAudioQualityActivated ( int iQualityIdx );
void OnCentServAddrTypeActivated ( int iTypeIdx ); void OnCentServAddrTypeActivated ( int iTypeIdx );
void OnCentralServerAddressTypeChanged() { UpdateCentralServerDependency(); }
void OnDriverSetupClicked(); void OnDriverSetupClicked();
signals: signals:

View file

@ -26,10 +26,12 @@
/* Implementation *************************************************************/ /* Implementation *************************************************************/
CConnectDlg::CConnectDlg ( const bool bNewShowCompleteRegList, CConnectDlg::CConnectDlg ( CClient* pNCliP,
QWidget* parent, const bool bNewShowCompleteRegList,
QWidget* parent,
Qt::WindowFlags f ) Qt::WindowFlags f )
: QDialog ( parent, f ), : QDialog ( parent, f ),
pClient ( pNCliP ),
strCentralServerAddress ( "" ), strCentralServerAddress ( "" ),
strSelectedAddress ( "" ), strSelectedAddress ( "" ),
strSelectedServerName ( "" ), strSelectedServerName ( "" ),
@ -74,6 +76,12 @@ CConnectDlg::CConnectDlg ( const bool bNewShowCompleteRegList,
cbxServerAddr->setAccessibleDescription ( tr ( "Holds the current server " cbxServerAddr->setAccessibleDescription ( tr ( "Holds the current server "
"IP address or URL. It also stores old URLs in the combo box list." ) ); "IP address or URL. It also stores old URLs in the combo box list." ) );
// central server address type combo box
cbxCentServAddrType->clear();
cbxCentServAddrType->addItem ( csCentServAddrTypeToString ( AT_MANUAL ) );
cbxCentServAddrType->addItem ( csCentServAddrTypeToString ( AT_DEFAULT ) );
cbxCentServAddrType->addItem ( csCentServAddrTypeToString ( AT_GENERAL_NORTHAMERICA ) );
// filter // filter
edtFilter->setWhatsThis ( "<b>" + tr ( "Filter" ) + ":</b> " + tr ( "The server " edtFilter->setWhatsThis ( "<b>" + tr ( "Filter" ) + ":</b> " + tr ( "The server "
"list is filtered by the given text. Note that the filter is case insensitive." ) ); "list is filtered by the given text. Note that the filter is case insensitive." ) );
@ -162,6 +170,9 @@ 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& ) ) );
QObject::connect ( cbxCentServAddrType, SIGNAL ( activated ( int ) ),
this, SLOT ( OnCentServAddrTypeChanged ( int ) ) );
// check boxes // check boxes
QObject::connect ( chbExpandAll, SIGNAL ( stateChanged ( int ) ), QObject::connect ( chbExpandAll, SIGNAL ( stateChanged ( int ) ),
this, SLOT ( OnExpandAllStateChanged ( int ) ) ); this, SLOT ( OnExpandAllStateChanged ( int ) ) );
@ -220,6 +231,11 @@ void CConnectDlg::RequestServerList()
// clear filter edit box // clear filter edit box
edtFilter->setText ( "" ); edtFilter->setText ( "" );
// update list combo box (disable events to avoid a signal)
cbxCentServAddrType->blockSignals ( true );
cbxCentServAddrType->setCurrentIndex ( static_cast<int> ( pClient->GetCentralServerAddressType() ) );
cbxCentServAddrType->blockSignals ( false );
// 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

View file

@ -47,8 +47,9 @@ class CConnectDlg : public QDialog, private Ui_CConnectDlgBase
Q_OBJECT Q_OBJECT
public: public:
CConnectDlg ( const bool bNewShowCompleteRegList, CConnectDlg ( CClient* pNCliP,
QWidget* parent = nullptr, const bool bNewShowCompleteRegList,
QWidget* parent = nullptr,
Qt::WindowFlags f = nullptr ); Qt::WindowFlags f = nullptr );
void Init ( const CVector<QString>& vstrIPAddresses ); void Init ( const CVector<QString>& vstrIPAddresses );
@ -88,6 +89,8 @@ protected:
void UpdateListFilter(); void UpdateListFilter();
void ShowAllMusicians ( const bool bState ); void ShowAllMusicians ( const bool bState );
CClient* pClient;
QTimer TimerPing; QTimer TimerPing;
QTimer TimerReRequestServList; QTimer TimerReRequestServList;
QString strCentralServerAddress; QString strCentralServerAddress;
@ -104,6 +107,7 @@ public slots:
void OnServerListItemSelectionChanged(); void OnServerListItemSelectionChanged();
void OnServerListItemDoubleClicked ( QTreeWidgetItem* Item, int ); void OnServerListItemDoubleClicked ( QTreeWidgetItem* Item, int );
void OnServerAddrEditTextChanged ( const QString& ); void OnServerAddrEditTextChanged ( const QString& );
void OnCentServAddrTypeChanged ( int iTypeIdx ) { pClient->SetCentralServerAddressType ( static_cast<ECSAddType> ( iTypeIdx ) ); }
void OnFilterTextEdited ( const QString& ) { UpdateListFilter(); } void OnFilterTextEdited ( const QString& ) { UpdateListFilter(); }
void OnExpandAllStateChanged ( int value ) { ShowAllMusicians ( value == Qt::Checked ); } void OnExpandAllStateChanged ( int value ) { ShowAllMusicians ( value == Qt::Checked ); }
void OnConnectClicked(); void OnConnectClicked();

View file

@ -29,6 +29,16 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item>
<widget class="QLabel" name="lblList">
<property name="text">
<string>List</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cbxCentServAddrType"/>
</item>
<item> <item>
<widget class="QLabel" name="lblFilter"> <widget class="QLabel" name="lblFilter">
<property name="text"> <property name="text">