From 0f434004a8fe9faf66a15ba240fba5dcf08873d6 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 30 Apr 2020 10:08:56 -0700 Subject: [PATCH] Add websocketpp error message to error dialog box --- data/locale/en-US.ini | 4 ++-- src/WSServer.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/locale/en-US.ini b/data/locale/en-US.ini index 8725e18d..607ab2f2 100644 --- a/data/locale/en-US.ini +++ b/data/locale/en-US.ini @@ -10,7 +10,7 @@ OBSWebsocket.NotifyConnect.Message="Client %1 connected" OBSWebsocket.NotifyDisconnect.Title="WebSocket client disconnected" OBSWebsocket.NotifyDisconnect.Message="Client %1 disconnected" OBSWebsocket.Server.StartFailed.Title="WebSockets Server failure" -OBSWebsocket.Server.StartFailed.Message="The WebSockets server failed to start, maybe because:\n - TCP port %1 may currently be in use elsewhere on this system, possibly by another application. Try setting a different TCP port in the WebSocket server settings, or stop any application that could be using this port.\n - An unknown network error happened on your system. Try again by changing settings, restarting OBS or restarting your system." +OBSWebsocket.Server.StartFailed.Message="The WebSockets server failed to start, maybe because:\n - TCP port %1 may currently be in use elsewhere on this system, possibly by another application. Try setting a different TCP port in the WebSocket server settings, or stop any application that could be using this port.\n - Error message: %2" OBSWebsocket.ProfileChanged.Started="WebSockets server enabled in this profile. Server started." OBSWebsocket.ProfileChanged.Stopped="WebSockets server disabled in this profile. Server stopped." -OBSWebsocket.ProfileChanged.Restarted="WebSockets server port changed in this profile. Server restarted." \ No newline at end of file +OBSWebsocket.ProfileChanged.Restarted="WebSockets server port changed in this profile. Server restarted." diff --git a/src/WSServer.cpp b/src/WSServer.cpp index c9f09362..effb935d 100644 --- a/src/WSServer.cpp +++ b/src/WSServer.cpp @@ -83,7 +83,7 @@ void WSServer::start(quint16 port) obs_frontend_push_ui_translation(obs_module_get_string); QString errorTitle = tr("OBSWebsocket.Server.StartFailed.Title"); - QString errorMessage = tr("OBSWebsocket.Server.StartFailed.Message").arg(_serverPort); + QString errorMessage = tr("OBSWebsocket.Server.StartFailed.Message").arg(_serverPort).arg(errorCodeMessage.c_str()); obs_frontend_pop_ui_translation(); QMainWindow* mainWindow = reinterpret_cast(obs_frontend_get_main_window());