Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/clientdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,20 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
const bool bShowAnalyzerConsole,
const bool bMuteStream,
const bool bNEnableIPv6,
const bool bNEnableAccessiblePushButtonUi,
QWidget* parent ) :
CBaseDlg ( parent, Qt::Window ), // use Qt::Window to get min/max window buttons
pClient ( pNCliP ),
pSettings ( pNSetP ),
bConnectDlgWasShown ( false ),
bDetectFeedback ( false ),
bEnableIPv6 ( bNEnableIPv6 ),
bEnableAccessiblePushButtonUi ( bNEnableAccessiblePushButtonUi ),
eLastRecorderState ( RS_UNDEFINED ), // for SetMixerBoardDeco
eLastDesign ( GD_ORIGINAL ), // "
ClientSettingsDlg ( pNCliP, pNSetP, parent ),
ChatDlg ( parent ),
ConnectDlg ( pNSetP, bNewShowComplRegConnList, parent ),
ConnectDlg ( pNSetP, bNewShowComplRegConnList, bNEnableIPv6, bNEnableAccessiblePushButtonUi, parent ),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the ipv6 toggle wasn't passed correctly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, so that bug has been hiding for a long time! The parent argument was being converted to a bool, and therefore was always true? Although I can't think what negative effect that would have had in practice.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's another indicator of the overall design problem.

Passing parameters is just the wrong way to do it. This should be signals on CClient with slots wired inside CConnectDlg to get notifications of updates to the values, and getters on CClient to supply the current state. Only CClient should provide this information. Even things like the IPv6 toggle should be controllable through the UI -- so you'd need the CConnectDlg to track changes in that state. CClientDlg would then get passed a thread-safe reference to CClient.

(All for r4.0.0, naturally.)

AnalyzerConsole ( pNCliP, parent )
{
setupUi ( this );
Expand Down Expand Up @@ -1286,11 +1288,11 @@ void CClientDlg::Disconnect()
TimerDetectFeedback.stop();
bDetectFeedback = false;

//### TODO: BEGIN ###//
// is this still required???
// immediately update status bar
// ### TODO: BEGIN ###//
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clang format did this automatically...

// is this still required???
// immediately update status bar
OnTimerStatus();
//### TODO: END ###//
// ### TODO: END ###//

// reset LEDs
ledBuffers->Reset();
Expand Down
2 changes: 2 additions & 0 deletions src/clientdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class CClientDlg : public CBaseDlg, private Ui_CClientDlgBase
const bool bShowAnalyzerConsole,
const bool bMuteStream,
const bool bNEnableIPv6,
const bool bNEnableAccessiblePushButtonUi,
QWidget* parent = nullptr );

protected:
Expand All @@ -110,6 +111,7 @@ class CClientDlg : public CBaseDlg, private Ui_CClientDlgBase
bool bConnectDlgWasShown;
bool bDetectFeedback;
bool bEnableIPv6;
bool bEnableAccessiblePushButtonUi;
ERecorderState eLastRecorderState;
EGUIDesign eLastDesign;
QTimer TimerSigMet;
Expand Down
28 changes: 26 additions & 2 deletions src/connectdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
#include "connectdlg.h"

/* Implementation *************************************************************/
CConnectDlg::CConnectDlg ( CClientSettings* pNSetP, const bool bNewShowCompleteRegList, const bool bNEnableIPv6, QWidget* parent ) :
CConnectDlg::CConnectDlg ( CClientSettings* pNSetP,
const bool bNewShowCompleteRegList,
const bool bNEnableIPv6,
const bool bNEnableAccessiblePushButtonUi,
QWidget* parent ) :
CBaseDlg ( parent, Qt::Dialog ),
pSettings ( pNSetP ),
strSelectedAddress ( "" ),
Expand All @@ -36,7 +40,8 @@ CConnectDlg::CConnectDlg ( CClientSettings* pNSetP, const bool bNewShowCompleteR
bServerListItemWasChosen ( false ),
bListFilterWasActive ( false ),
bShowAllMusicians ( true ),
bEnableIPv6 ( bNEnableIPv6 )
bEnableIPv6 ( bNEnableIPv6 ),
bEnableAccessiblePushButtonUi ( bNEnableAccessiblePushButtonUi )
{
setupUi ( this );

Expand Down Expand Up @@ -460,6 +465,15 @@ void CConnectDlg::SetServerList ( const CHostAddress& InetAddr, const CVector<CS
{
lvwServers->expandItem ( pNewListViewItem );
}

// accessibility: use Push Buttons to allow screen readers to see the fields
if ( bEnableAccessiblePushButtonUi )
{
for ( int i = 0; i < lvwServers->columnCount(); i++ )
{
lvwServers->setItemWidget ( pNewListViewItem, i, new QPushButton ( pNewListViewItem->text ( i ) ) );
}
}
}

// immediately issue the ping measurements and start the ping timer since
Expand Down Expand Up @@ -899,6 +913,16 @@ void CConnectDlg::SetPingTimeAndNumClientsResult ( const CHostAddress& InetAddr,
pCurListViewItem->setText ( LVC_CLIENTS, QString().setNum ( iNumClients ) + "/" + pCurListViewItem->text ( LVC_CLIENTS_MAX_HIDDEN ) );
}

if ( bEnableAccessiblePushButtonUi )
{
// apply text to accessible ui
dynamic_cast<QPushButton*> ( lvwServers->itemWidget ( pCurListViewItem, LVC_PING ) )->setText ( pCurListViewItem->text ( LVC_PING ) );
dynamic_cast<QPushButton*> ( lvwServers->itemWidget ( pCurListViewItem, LVC_CLIENTS ) )
->setText ( pCurListViewItem->text ( LVC_CLIENTS ) );
dynamic_cast<QPushButton*> ( lvwServers->itemWidget ( pCurListViewItem, LVC_VERSION ) )
->setText ( pCurListViewItem->text ( LVC_VERSION ) );
}

// check if the number of child list items matches the number of
// connected clients, if not then request the client names
if ( iNumClients != pCurListViewItem->childCount() )
Expand Down
7 changes: 6 additions & 1 deletion src/connectdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ class CConnectDlg : public CBaseDlg, private Ui_CConnectDlgBase
Q_OBJECT

public:
CConnectDlg ( CClientSettings* pNSetP, const bool bNewShowCompleteRegList, const bool bNEnableIPv6, QWidget* parent = nullptr );
CConnectDlg ( CClientSettings* pNSetP,
const bool bNewShowCompleteRegList,
const bool bNEnableIPv6,
const bool bNEnableAccessiblePushButtonUi,
QWidget* parent = nullptr );

void SetShowAllMusicians ( const bool bState ) { ShowAllMusicians ( bState ); }
bool GetShowAllMusicians() { return bShowAllMusicians; }
Expand Down Expand Up @@ -107,6 +111,7 @@ class CConnectDlg : public CBaseDlg, private Ui_CConnectDlgBase
bool bListFilterWasActive;
bool bShowAllMusicians;
bool bEnableIPv6;
bool bEnableAccessiblePushButtonUi;

public slots:
void OnServerListItemDoubleClicked ( QTreeWidgetItem* Item, int );
Expand Down
93 changes: 53 additions & 40 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,48 +81,50 @@ int main ( int argc, char** argv )
#else
bool bIsClient = true;
#endif
bool bUseGUI = true;
bool bStartMinimized = false;
bool bShowComplRegConnList = false;
bool bDisconnectAllClientsOnQuit = false;
bool bUseDoubleSystemFrameSize = true; // default is 128 samples frame size
bool bUseMultithreading = false;
bool bShowAnalyzerConsole = false;
bool bMuteStream = false;
bool bMuteMeInPersonalMix = false;
bool bDisableRecording = false;
bool bDelayPan = false;
bool bNoAutoJackConnect = false;
bool bUseTranslation = true;
bool bCustomPortNumberGiven = false;
bool bEnableIPv6 = false;
int iNumServerChannels = DEFAULT_USED_NUM_CHANNELS;
quint16 iPortNumber = DEFAULT_PORT_NUMBER;
int iJsonRpcPortNumber = INVALID_PORT;
QString strJsonRpcBindIP = DEFAULT_JSON_RPC_LISTEN_ADDRESS;
quint16 iQosNumber = DEFAULT_QOS_NUMBER;
ELicenceType eLicenceType = LT_NO_LICENCE;
QString strMIDISetup = "";
QString strConnOnStartupAddress = "";
QString strIniFileName = "";
QString strHTMLStatusFileName = "";
QString strLoggingFileName = "";
QString strRecordingDirName = "";
QString strDirectoryAddress = "";
QString strServerListFileName = "";
QString strServerInfo = "";
QString strServerPublicIP = "";
QString strServerBindIP = "";
QString strServerListFilter = "";
QString strWelcomeMessage = "";
QString strClientName = "";
QString strJsonRpcSecretFileName = "";
bool bUseGUI = true;
bool bStartMinimized = false;
bool bShowComplRegConnList = false;
bool bDisconnectAllClientsOnQuit = false;
bool bUseDoubleSystemFrameSize = true; // default is 128 samples frame size
bool bUseMultithreading = false;
bool bShowAnalyzerConsole = false;
bool bMuteStream = false;
bool bMuteMeInPersonalMix = false;
bool bDisableRecording = false;
bool bDelayPan = false;
bool bNoAutoJackConnect = false;
bool bUseTranslation = true;
bool bCustomPortNumberGiven = false;
bool bEnableIPv6 = false;
bool bEnableAccessiblePushButtonUi = false;
int iNumServerChannels = DEFAULT_USED_NUM_CHANNELS;
quint16 iPortNumber = DEFAULT_PORT_NUMBER;
int iJsonRpcPortNumber = INVALID_PORT;
QString strJsonRpcBindIP = DEFAULT_JSON_RPC_LISTEN_ADDRESS;
quint16 iQosNumber = DEFAULT_QOS_NUMBER;
ELicenceType eLicenceType = LT_NO_LICENCE;
QString strMIDISetup = "";
QString strConnOnStartupAddress = "";
QString strIniFileName = "";
QString strHTMLStatusFileName = "";
QString strLoggingFileName = "";
QString strRecordingDirName = "";
QString strDirectoryAddress = "";
QString strServerListFileName = "";
QString strServerInfo = "";
QString strServerPublicIP = "";
QString strServerBindIP = "";
QString strServerListFilter = "";
QString strWelcomeMessage = "";
QString strClientName = "";
QString strJsonRpcSecretFileName = "";

#if defined( HEADLESS ) || defined( SERVER_ONLY )
Q_UNUSED ( bStartMinimized )
Q_UNUSED ( bUseTranslation )
Q_UNUSED ( bShowComplRegConnList )
Q_UNUSED ( bShowAnalyzerConsole )
Q_UNUSED ( bEnableAccessiblePushButtonUi )
Q_UNUSED ( bMuteStream )
#endif
#if defined( SERVER_ONLY )
Expand Down Expand Up @@ -246,6 +248,15 @@ int main ( int argc, char** argv )
continue;
}

// Enable Accessible server list --------------------------------------
if ( GetFlagArgument ( argv, i, "--accessible", "--accessible" ) )
{
bEnableAccessiblePushButtonUi = true;
qInfo() << "- Accessible server list enabled";
CommandLineOptions << "--accessible";
continue;
}

// Server only:

// Disconnect all clients on quit --------------------------------------
Expand Down Expand Up @@ -865,10 +876,10 @@ int main ( int argc, char** argv )
Q_INIT_RESOURCE ( resources );

#ifndef SERVER_ONLY
//### TEST: BEGIN ###//
// activate the following line to activate the test bench,
// CTestbench Testbench ( "127.0.0.1", DEFAULT_PORT_NUMBER );
//### TEST: END ###//
// ### TEST: BEGIN ###//
// activate the following line to activate the test bench,
// CTestbench Testbench ( "127.0.0.1", DEFAULT_PORT_NUMBER );
// ### TEST: END ###//
#endif

#ifdef NO_JSON_RPC
Expand Down Expand Up @@ -961,6 +972,7 @@ int main ( int argc, char** argv )
bShowAnalyzerConsole,
bMuteStream,
bEnableIPv6,
bEnableAccessiblePushButtonUi,
nullptr );

// show dialog
Expand Down Expand Up @@ -1139,6 +1151,7 @@ QString UsageArguments ( char** argv )
" --mutemyown prevent me from hearing what I play in the server mix (headless only)\n"
" --clientname client name (window title and JACK client name)\n"
" --ctrlmidich configure MIDI controller\n"
" --accessible run Client UI in more accessible mode for screen reader users\n"
"\n"
"Example: %1 -s --inifile myinifile.ini\n"
"\n"
Expand Down
Loading