From 6977a17156e0a06e59929482cb753977b54ed981 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Sat, 16 May 2020 11:24:50 +0200 Subject: [PATCH] some central server address clean up --- ChangeLog | 7 +++- src/clientdlg.cpp | 2 +- src/clientsettingsdlg.cpp | 8 ++-- src/global.h | 9 ++--- src/res/translation/translation_de_DE.ts | 48 +++++++++++++++--------- src/res/translation/translation_es_ES.ts | 48 +++++++++++++++--------- src/res/translation/translation_fr_FR.ts | 48 +++++++++++++++--------- src/res/translation/translation_nl_NL.ts | 48 +++++++++++++++--------- src/res/translation/translation_pt_PT.ts | 48 +++++++++++++++--------- src/serverdlg.cpp | 8 ++-- src/settings.cpp | 4 +- src/util.cpp | 8 ++-- src/util.h | 20 +++++++++- 13 files changed, 192 insertions(+), 114 deletions(-) diff --git a/ChangeLog b/ChangeLog index 61548692..2b51c946 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,12 @@ + + + 3.5.4git -TODO server list split on query +TODO Your Mix at Server (Ticket #187) + +TODO Move Central Server Address Dropdown to Connection Setup (#157) TODO Keep lrelease? Does it work as expected? diff --git a/src/clientdlg.cpp b/src/clientdlg.cpp index 1f1fe8a2..0f7b229b 100755 --- a/src/clientdlg.cpp +++ b/src/clientdlg.cpp @@ -700,7 +700,7 @@ void CClientDlg::OnConnectDlgAccepted() if ( strSelectedAddress.isEmpty() ) { strSelectedAddress = DEFAULT_SERVER_ADDRESS; - strMixerBoardLabel = DEFAULT_SERVER_NAME; + strMixerBoardLabel = tr ( "Central Server" ); } } diff --git a/src/clientsettingsdlg.cpp b/src/clientsettingsdlg.cpp index 0e18604c..77608ea9 100755 --- a/src/clientsettingsdlg.cpp +++ b/src/clientsettingsdlg.cpp @@ -346,9 +346,9 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent, // central server address type combo box cbxCentServAddrType->clear(); - cbxCentServAddrType->addItem ( tr ( "Manual" ) ); // AT_MANUAL - cbxCentServAddrType->addItem ( tr ( "Default" ) ); // AT_DEFAULT - cbxCentServAddrType->addItem ( tr ( "Default (North America)" ) ); // AT_NORTH_AMERICA + cbxCentServAddrType->addItem ( csAddTypeToString ( AT_MANUAL ) ); + cbxCentServAddrType->addItem ( csAddTypeToString ( AT_DEFAULT ) ); + cbxCentServAddrType->addItem ( csAddTypeToString ( AT_GENERAL_NORTHAMERICA ) ); cbxCentServAddrType->setCurrentIndex ( static_cast ( pClient->GetCentralServerAddressType() ) ); UpdateCentralServerDependency(); @@ -590,7 +590,7 @@ void CClientSettingsDlg::UpdateCentralServerDependency() { // if the default central server is used, just show a text of the // server name - edtCentralServerAddress->setText ( DEFAULT_SERVER_NAME ); + edtCentralServerAddress->setText ( tr ( "Predefined Address" ) ); } else { diff --git a/src/global.h b/src/global.h index 3df12e59..24ed8e70 100755 --- a/src/global.h +++ b/src/global.h @@ -101,9 +101,10 @@ LED bar: lbr #define SYSTEM_FRAME_SIZE_SAMPLES 64 #define DOUBLE_SYSTEM_FRAME_SIZE_SAMPLES ( 2 * SYSTEM_FRAME_SIZE_SAMPLES ) -// default server address +// default server address and port numbers #define DEFAULT_SERVER_ADDRESS "jamulus.fischvolk.de" -#define DEFAULT_SERVER_NAME "Central Server" +#define DEFAULT_PORT_NUMBER 22124 +#define CENTSERV_GENERAL_NORTHAMERICA "jamulus.fischvolk.de:22224" // getting started and software manual URL #define CLIENT_GETTING_STARTED_URL "https://github.com/corrados/jamulus/wiki/Software-Manual" @@ -116,10 +117,6 @@ LED bar: lbr #define WELL_KNOWN_PORT 53 // DNS #define IP_LOOKUP_TIMEOUT 500 // ms -// defined port numbers for client and server -#define DEFAULT_PORT_NUMBER 22124 -#define DEFAULT_PORT_NUMBER_NORTHAMERICA 22224 - // system sample rate (the sound card and audio coder works on this sample rate) #define SYSTEM_SAMPLE_RATE_HZ 48000 // Hz diff --git a/src/res/translation/translation_de_DE.ts b/src/res/translation/translation_de_DE.ts index 5ac3716f..f1b66add 100644 --- a/src/res/translation/translation_de_DE.ts +++ b/src/res/translation/translation_de_DE.ts @@ -633,6 +633,11 @@ The CPU of the client or server is at 100%. Die CPU des Computers ist voll ausgelastet. + + + Central Server + + user @@ -1135,17 +1140,17 @@ Hoch - + Manual Manuell - + Default Standard - + Default (North America) Standard (Nordamerika) @@ -1170,6 +1175,11 @@ Buffer Delay: Puffergröße: + + + Predefined Address + + The selected audio device could not be used because of the following error: @@ -2044,19 +2054,21 @@ Server - + + Predefined Address + + + Manual - Manuell + Manuell - Default - Standard + Standard - Default (North America) - Standard (Nordamerika) + Standard (Nordamerika) @@ -2069,42 +2081,42 @@ &Fenster - + Unregistered Nicht registriert - + Bad address Ungültige Adresse - + Registration requested Registrierung angefordert - + Registration failed Registrierung fehlgeschlagen - + Check server version Überprüfe Version des Servers - + Registered Registriert - + Central Server full Zentralserver voll - + Unknown value Unbekannter Wert @@ -2359,7 +2371,7 @@ global - + For more information use the What's This help (help menu, right mouse button or Shift+F1) Für weitere Informationen verwende die Kontexthilfe (Hilfe-Menü, rechte Maustaste oder Tastenkombination Shift+F1) diff --git a/src/res/translation/translation_es_ES.ts b/src/res/translation/translation_es_ES.ts index 1137a958..38068bf3 100644 --- a/src/res/translation/translation_es_ES.ts +++ b/src/res/translation/translation_es_ES.ts @@ -637,6 +637,11 @@ The CPU of the client or server is at 100%. El procesador del cliente o del servidor está al 100%. + + + Central Server + + user @@ -1139,17 +1144,17 @@ Alta - + Manual Manual - + Default Por defecto - + Default (North America) Por defecto (Norteamérica) @@ -1174,6 +1179,11 @@ Buffer Delay: Retardo Buffer: + + + Predefined Address + + The selected audio device could not be used because of the following error: @@ -2052,19 +2062,21 @@ - + + Predefined Address + + + Manual - Manual + Manual - Default - Por defecto + Por defecto - Default (North America) - Por defecto (Norteamérica) + Por defecto (Norteamérica) @@ -2077,42 +2089,42 @@ &Ventana - + Unregistered Sin registrar - + Bad address Dirección no válida - + Registration requested Registro solicitado - + Registration failed Error de registro - + Check server version Comprueba la versión del servidor - + Registered Registrado - + Central Server full Servidor Central lleno - + Unknown value Valor desconocido @@ -2367,7 +2379,7 @@ global - + For more information use the What's This help (help menu, right mouse button or Shift+F1) Para más información utiliza ¿Qué es Esto? (menú de ayuda, botón derecho del ratón o Shift+F1) diff --git a/src/res/translation/translation_fr_FR.ts b/src/res/translation/translation_fr_FR.ts index 971ed813..ae06c835 100644 --- a/src/res/translation/translation_fr_FR.ts +++ b/src/res/translation/translation_fr_FR.ts @@ -645,6 +645,11 @@ The CPU of the client or server is at 100%. Le processeur du client ou du serveur est à 100%. + + + Central Server + + user @@ -1147,17 +1152,17 @@ Haute - + Manual Manuel - + Default Défaut - + Default (North America) Défault (Amérique du Nord) @@ -1182,6 +1187,11 @@ Buffer Delay: Délai de temporisation : + + + Predefined Address + + The selected audio device could not be used because of the following error: @@ -2056,19 +2066,21 @@ serveur - + + Predefined Address + + + Manual - Manuel + Manuel - Default - Défaut + Défaut - Default (North America) - Défaut (Amérique du nord) + Défaut (Amérique du nord) @@ -2081,42 +2093,42 @@ &Fenêtre - + Unregistered Non inscrit - + Bad address Mauvaise adresse - + Registration requested Inscription demandée - + Registration failed Échec de l'inscription - + Check server version Vérifier la version du serveur - + Registered Inscrit - + Central Server full Serveur central rempli - + Unknown value Valeur inconnue @@ -2371,7 +2383,7 @@ global - + For more information use the What's This help (help menu, right mouse button or Shift+F1) diff --git a/src/res/translation/translation_nl_NL.ts b/src/res/translation/translation_nl_NL.ts index ba5ebe81..b2dd4bf5 100644 --- a/src/res/translation/translation_nl_NL.ts +++ b/src/res/translation/translation_nl_NL.ts @@ -633,6 +633,11 @@ R R + + + Central Server + + user @@ -1135,17 +1140,17 @@ Hoog - + Manual Handmatig - + Default Standaard - + Default (North America) Standaard (Noord-Amerika) @@ -1170,6 +1175,11 @@ Buffer Delay: Buffervertraging: + + + Predefined Address + + The selected audio device could not be used because of the following error: @@ -2044,19 +2054,21 @@ server - + + Predefined Address + + + Manual - Handmatig + Handmatig - Default - Standaard + Standaard - Default (North America) - Standaard (Noord-Amerika) + Standaard (Noord-Amerika) @@ -2069,42 +2081,42 @@ &Window - + Unregistered Niet geregistreerd - + Bad address Slecht adres - + Registration requested Aanmelding gevraagd - + Registration failed Registratie is mislukt - + Check server version Controleer de versie van de server - + Registered Geregistreerd - + Central Server full Centrale server vol - + Unknown value Onbekende waarde @@ -2359,7 +2371,7 @@ global - + For more information use the What's This help (help menu, right mouse button or Shift+F1) Voor meer informatie gebruik de Wat Is Dit hulp (helpmenu, rechtermuisklik of Shift+F1) diff --git a/src/res/translation/translation_pt_PT.ts b/src/res/translation/translation_pt_PT.ts index 4d6f8b56..e58b3548 100644 --- a/src/res/translation/translation_pt_PT.ts +++ b/src/res/translation/translation_pt_PT.ts @@ -645,6 +645,11 @@ The CPU of the client or server is at 100%. O CPU do cliente ou servidor está a 100%. + + + Central Server + + user @@ -1147,17 +1152,17 @@ Alta - + Manual Manual - + Default Servidor Padrão - + Default (North America) Servidor Padrão (America do Norte) @@ -1182,6 +1187,11 @@ Buffer Delay: Atraso do buffer: + + + Predefined Address + + The selected audio device could not be used because of the following error: @@ -2056,19 +2066,21 @@ - + + Predefined Address + + + Manual - Manual + Manual - Default - Servidor Padrão + Servidor Padrão - Default (North America) - Servidor Padrão (America do Norte) + Servidor Padrão (America do Norte) @@ -2081,42 +2093,42 @@ &Janela - + Unregistered Não Registado - + Bad address Endereço incorrecto - + Registration requested Registo solicitado - + Registration failed Falha no registo - + Check server version Verifique versão do servidor - + Registered Registado - + Central Server full Servidor Central Cheio - + Unknown value Valor desconhecido @@ -2371,7 +2383,7 @@ global - + For more information use the What's This help (help menu, right mouse button or Shift+F1) Para mais informações, use O que é isto (menu Ajuda, botão direito do rato ou Shift + F1) diff --git a/src/serverdlg.cpp b/src/serverdlg.cpp index 7df039ed..5f73cc50 100755 --- a/src/serverdlg.cpp +++ b/src/serverdlg.cpp @@ -188,9 +188,9 @@ lvwClients->setMinimumHeight ( 140 ); // central server address type combo box cbxCentServAddrType->clear(); - cbxCentServAddrType->addItem ( tr ( "Manual" ) ); // AT_MANUAL - cbxCentServAddrType->addItem ( tr ( "Default" ) ); // AT_DEFAULT - cbxCentServAddrType->addItem ( tr ( "Default (North America)" ) ); // AT_NORTH_AMERICA + cbxCentServAddrType->addItem ( csAddTypeToString ( AT_MANUAL ) ); + cbxCentServAddrType->addItem ( csAddTypeToString ( AT_DEFAULT ) ); + cbxCentServAddrType->addItem ( csAddTypeToString ( AT_GENERAL_NORTHAMERICA ) ); cbxCentServAddrType->setCurrentIndex ( static_cast ( pServer->GetCentralServerAddressType() ) ); // update server name line edit @@ -522,7 +522,7 @@ void CServerDlg::UpdateGUIDependencies() { // if the default central server is used, just show a text of the // server name - edtCentralServerAddress->setText ( DEFAULT_SERVER_NAME ); + edtCentralServerAddress->setText ( tr ( "Predefined Address" ) ); } else { diff --git a/src/settings.cpp b/src/settings.cpp index 7ae68c17..23d65e3a 100755 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -288,7 +288,7 @@ void CSettings::Load() // central server address type if ( GetNumericIniSet ( IniXMLDocument, "client", "centservaddrtype", - 0, 2 /* AT_NORTH_AMERICA */, iValue ) ) + 0, 2 /* AT_GENERAL_NORTHAMERICA */, iValue ) ) { pClient->SetCentralServerAddressType ( static_cast ( iValue ) ); } @@ -359,7 +359,7 @@ if ( GetFlagIniSet ( IniXMLDocument, "client", "defcentservaddr", bValue ) ) // central server address type (note that it is important // to set this setting prior to the "central server address") if ( GetNumericIniSet ( IniXMLDocument, "server", "centservaddrtype", - 0, 2 /* AT_NORTH_AMERICA */, iValue ) ) + 0, 2 /* AT_GENERAL_NORTHAMERICA */, iValue ) ) { pServer->SetCentralServerAddressType ( static_cast ( iValue ) ); } diff --git a/src/util.cpp b/src/util.cpp index 91a17abc..825919a6 100755 --- a/src/util.cpp +++ b/src/util.cpp @@ -950,9 +950,9 @@ QString NetworkUtil::GetCentralServerAddress ( const ECSAddType eCentralServerAd { switch ( eCentralServerAddressType ) { - case AT_MANUAL: return strCentralServerAddress; - case AT_NORTH_AMERICA: return QString ( "%1:%2" ).arg ( DEFAULT_SERVER_ADDRESS ).arg ( DEFAULT_PORT_NUMBER_NORTHAMERICA ); - default: return DEFAULT_SERVER_ADDRESS; // AT_DEFAULT + case AT_MANUAL: return strCentralServerAddress; + case AT_GENERAL_NORTHAMERICA: return CENTSERV_GENERAL_NORTHAMERICA; + default: return DEFAULT_SERVER_ADDRESS; // AT_DEFAULT } } @@ -1328,7 +1328,7 @@ ECSAddType CLocale::GetCentralServerAddressType ( const QLocale::Country eCountr case QLocale::Canada: case QLocale::Mexico: case QLocale::Greenland: - return AT_NORTH_AMERICA; + return AT_GENERAL_NORTHAMERICA; default: return AT_DEFAULT; diff --git a/src/util.h b/src/util.h index a2d52844..66518b5b 100755 --- a/src/util.h +++ b/src/util.h @@ -565,11 +565,27 @@ enum ELicenceType // Central server address type ------------------------------------------------- enum ECSAddType { + // used for settings -> enum values must be fixed! AT_MANUAL = 0, - AT_DEFAULT = 1, // Europe and others - AT_NORTH_AMERICA = 2 + AT_DEFAULT = 1, + AT_GENERAL_NORTHAMERICA = 2 }; +inline QString csAddTypeToString ( ECSAddType eAddrType ) +{ + switch ( eAddrType ) + { + case AT_MANUAL: + return QCoreApplication::translate ( "CClientSettingsDlg", "Manual" ); + + case AT_GENERAL_NORTHAMERICA: + return QCoreApplication::translate ( "CClientSettingsDlg", "Default (North America)" ); + + default: // AT_DEFAULT + return QCoreApplication::translate ( "CClientSettingsDlg", "Default" ); + } +} + // Slave server registration state --------------------------------------------- enum ESvrRegStatus