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
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?

View file

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

View file

@ -443,6 +443,10 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
SIGNAL ( buttonClicked ( QAbstractButton* ) ), this,
SLOT ( OnSndCrdBufferDelayButtonGroupClicked ( QAbstractButton* ) ) );
QObject::connect ( pClient,
SIGNAL ( CentralServerAddressTypeChanged() ),
this, SLOT ( OnCentralServerAddressTypeChanged() ) );
// Timers ------------------------------------------------------------------
// start timer for status bar
@ -583,6 +587,13 @@ void CClientSettingsDlg::UpdateCentralServerDependency()
{
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
edtCentralServerAddress->blockSignals ( true );
{

View file

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

View file

@ -26,10 +26,12 @@
/* Implementation *************************************************************/
CConnectDlg::CConnectDlg ( const bool bNewShowCompleteRegList,
CConnectDlg::CConnectDlg ( CClient* pNCliP,
const bool bNewShowCompleteRegList,
QWidget* parent,
Qt::WindowFlags f )
: QDialog ( parent, f ),
pClient ( pNCliP ),
strCentralServerAddress ( "" ),
strSelectedAddress ( "" ),
strSelectedServerName ( "" ),
@ -74,6 +76,12 @@ CConnectDlg::CConnectDlg ( const bool bNewShowCompleteRegList,
cbxServerAddr->setAccessibleDescription ( tr ( "Holds the current server "
"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
edtFilter->setWhatsThis ( "<b>" + tr ( "Filter" ) + ":</b> " + tr ( "The server "
"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& ) ),
this, SLOT ( OnServerAddrEditTextChanged ( const QString& ) ) );
QObject::connect ( cbxCentServAddrType, SIGNAL ( activated ( int ) ),
this, SLOT ( OnCentServAddrTypeChanged ( int ) ) );
// check boxes
QObject::connect ( chbExpandAll, SIGNAL ( stateChanged ( int ) ),
this, SLOT ( OnExpandAllStateChanged ( int ) ) );
@ -220,6 +231,11 @@ void CConnectDlg::RequestServerList()
// 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() ) );
cbxCentServAddrType->blockSignals ( false );
// 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

View file

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

View file

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