mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
config: put alerts text to locale data
This commit is contained in:
@ -12,3 +12,6 @@ OBSWebsocket.NotifyDisconnect.Title="WebSocket client disconnected"
|
||||
OBSWebsocket.NotifyDisconnect.Message="Client %1 disconnected"
|
||||
OBSWebsocket.Server.StartFailed.Title="WebSocket Server failure"
|
||||
OBSWebsocket.Server.StartFailed.Message="The obs-websocket 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.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."
|
@ -203,6 +203,12 @@ void Config::OnFrontendEvent(enum obs_frontend_event event, void* param)
|
||||
{
|
||||
auto config = reinterpret_cast<Config*>(param);
|
||||
|
||||
obs_frontend_push_ui_translation(obs_module_get_string);
|
||||
QString startMessage = QObject::tr("OBSWebsocket.ProfileChanged.Started");
|
||||
QString stopMessage = QObject::tr("OBSWebsocket.ProfileChanged.Stopped");
|
||||
QString restartMessage = QObject::tr("OBSWebsocket.ProfileChanged.Restarted");
|
||||
obs_frontend_pop_ui_translation();
|
||||
|
||||
if (event == OBS_FRONTEND_EVENT_PROFILE_CHANGED) {
|
||||
auto previousEnabled = config->ServerEnabled;
|
||||
auto previousPort = config->ServerPort;
|
||||
@ -218,21 +224,12 @@ void Config::OnFrontendEvent(enum obs_frontend_event event, void* param)
|
||||
server->start(config->ServerPort);
|
||||
|
||||
if (previousEnabled != config->ServerEnabled) {
|
||||
Utils::SysTrayNotify(
|
||||
QString("WebSockets server enabled in this profile. Server started."),
|
||||
QSystemTrayIcon::MessageIcon::Information
|
||||
);
|
||||
Utils::SysTrayNotify(startMessage, QSystemTrayIcon::MessageIcon::Information);
|
||||
} else {
|
||||
Utils::SysTrayNotify(
|
||||
QString("WebSockets server port changed in this profile. Server restarted."),
|
||||
QSystemTrayIcon::MessageIcon::Information
|
||||
);
|
||||
Utils::SysTrayNotify(restartMessage, QSystemTrayIcon::MessageIcon::Information);
|
||||
}
|
||||
} else {
|
||||
Utils::SysTrayNotify(
|
||||
QString("WebSockets server disabled in this profile. Server stopped."),
|
||||
QSystemTrayIcon::MessageIcon::Information
|
||||
);
|
||||
Utils::SysTrayNotify(stopMessage, QSystemTrayIcon::MessageIcon::Information);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user