From 6b154c55e3e80229d39ffe63eb02a16b534fe26a Mon Sep 17 00:00:00 2001 From: Peter L Jones Date: Wed, 14 Jun 2023 17:14:47 +0100 Subject: [PATCH 1/3] Minor formatting changes --- src/main.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 1b47ad4ba2..bbfd4b0412 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -446,9 +446,7 @@ int main ( int argc, char** argv ) if ( GetNumericArgument ( argc, argv, i, "-u", "--numchannels", 1, MAX_NUM_CHANNELS, rDbleArgument ) ) { iNumServerChannels = static_cast ( rDbleArgument ); - qInfo() << qUtf8Printable ( QString ( "- maximum number of channels: %1" ).arg ( iNumServerChannels ) ); - CommandLineOptions << "--numchannels"; ServerOnlyOptions << "--numchannels"; continue; @@ -639,6 +637,7 @@ int main ( int argc, char** argv ) else #endif { + if ( ClientOnlyOptions.size() != 0 ) { qCritical() << qUtf8Printable ( @@ -786,12 +785,10 @@ int main ( int argc, char** argv ) strServerBindIP = ""; } } - #ifndef NO_JSON_RPC - // + // strJsonRpcBind address defaults to loopback and should not be empty, but // in the odd chance that an empty IP is passed, we'll check for it here. - if ( strJsonRpcBindIP.trimmed().isEmpty() ) { qCritical() << qUtf8Printable ( QString ( "JSON-RPC is enabled but the bind address provided is empty, exiting." ) ); @@ -809,7 +806,6 @@ int main ( int argc, char** argv ) exit ( 1 ); } } - #endif } @@ -967,6 +963,7 @@ int main ( int argc, char** argv ) // show dialog ClientDlg.show(); + pApp->exec(); } else @@ -1009,8 +1006,8 @@ int main ( int argc, char** argv ) { new CServerRpc ( &Server, pRpcServer, pRpcServer ); } -#endif +#endif #ifndef HEADLESS if ( bUseGUI ) { From 4c6ab68d576bf04a2b8865860ab19444184efac2 Mon Sep 17 00:00:00 2001 From: Peter L Jones Date: Wed, 14 Jun 2023 17:17:49 +0100 Subject: [PATCH 2/3] Adjust #ifdef block --- src/main.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index bbfd4b0412..a685818260 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -597,20 +597,19 @@ int main ( int argc, char** argv ) bUseGUI = false; qWarning() << "No GUI support compiled. Running in headless mode."; } -#endif - if ( bIsClient ) +#endif #ifdef SERVER_ONLY + if ( bIsClient ) { qCritical() << "Only --server mode is supported in this build."; exit ( 1 ); } -#else - - // TODO create settings in default state, if loading from file do that next, then come back here to - // override from command line options, then create client or server, letting them do the validation +#else + if ( bIsClient ) { + if ( ServerOnlyOptions.size() != 0 ) { qCritical() << qUtf8Printable ( QString ( "%1: Server only option(s) '%2' used. Did you omit '--server'?" ) From 582eee0433c8adbaa1e33bb408c05beaa4df1fa5 Mon Sep 17 00:00:00 2001 From: Peter L Jones Date: Sun, 15 Oct 2023 12:06:32 +0100 Subject: [PATCH 3/3] Adjust "use translations" --- src/main.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a685818260..9082e560a9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -932,13 +932,6 @@ int main ( int argc, char** argv ) CClientSettings Settings ( &Client, strIniFileName ); Settings.Load ( CommandLineOptions ); - // load translation - if ( bUseGUI && bUseTranslation ) - { - CLocale::LoadTranslation ( Settings.strLanguage, pApp ); - CInstPictures::UpdateTableOnLanguageChange(); - } - # ifndef NO_JSON_RPC if ( pRpcServer ) { @@ -949,6 +942,13 @@ int main ( int argc, char** argv ) # ifndef HEADLESS if ( bUseGUI ) { + // load translation + if ( bUseTranslation ) + { + CLocale::LoadTranslation ( Settings.strLanguage, pApp ); + CInstPictures::UpdateTableOnLanguageChange(); + } + // GUI object CClientDlg ClientDlg ( &Client, &Settings, @@ -1015,7 +1015,7 @@ int main ( int argc, char** argv ) Settings.Load ( CommandLineOptions ); // load translation - if ( bUseGUI && bUseTranslation ) + if ( bUseTranslation ) { CLocale::LoadTranslation ( Settings.strLanguage, pApp ); }