Added option to disable pre launch warning and delay

This commit is contained in:
Odizinne 2025-04-21 22:56:09 +02:00 committed by Cameron Gutman
parent 11dc244857
commit 65c04fd560
4 changed files with 35 additions and 16 deletions

View File

@ -1236,6 +1236,17 @@ Flickable {
} }
} }
CheckBox {
id: configurationWarningsCheck
width: parent.width
text: qsTr("Show configuration warnings")
font.pointSize: 12
checked: StreamingPreferences.configurationWarnings
onCheckedChanged: {
StreamingPreferences.configurationWarnings = checked
}
}
CheckBox { CheckBox {
visible: SystemProperties.hasDiscordIntegration visible: SystemProperties.hasDiscordIntegration
id: discordPresenceCheck id: discordPresenceCheck

View File

@ -35,6 +35,7 @@
#define SER_STARTWINDOWED "startwindowed" #define SER_STARTWINDOWED "startwindowed"
#define SER_FRAMEPACING "framepacing" #define SER_FRAMEPACING "framepacing"
#define SER_CONNWARNINGS "connwarnings" #define SER_CONNWARNINGS "connwarnings"
#define SER_CONFWARNINGS "confwarnings"
#define SER_UIDISPLAYMODE "uidisplaymode" #define SER_UIDISPLAYMODE "uidisplaymode"
#define SER_RICHPRESENCE "richpresence" #define SER_RICHPRESENCE "richpresence"
#define SER_GAMEPADMOUSE "gamepadmouse" #define SER_GAMEPADMOUSE "gamepadmouse"
@ -134,6 +135,7 @@ void StreamingPreferences::reload()
absoluteTouchMode = settings.value(SER_ABSTOUCHMODE, true).toBool(); absoluteTouchMode = settings.value(SER_ABSTOUCHMODE, true).toBool();
framePacing = settings.value(SER_FRAMEPACING, false).toBool(); framePacing = settings.value(SER_FRAMEPACING, false).toBool();
connectionWarnings = settings.value(SER_CONNWARNINGS, true).toBool(); connectionWarnings = settings.value(SER_CONNWARNINGS, true).toBool();
configurationWarnings = settings.value(SER_CONFWARNINGS, true).toBool();
richPresence = settings.value(SER_RICHPRESENCE, true).toBool(); richPresence = settings.value(SER_RICHPRESENCE, true).toBool();
gamepadMouse = settings.value(SER_GAMEPADMOUSE, true).toBool(); gamepadMouse = settings.value(SER_GAMEPADMOUSE, true).toBool();
detectNetworkBlocking = settings.value(SER_DETECTNETBLOCKING, true).toBool(); detectNetworkBlocking = settings.value(SER_DETECTNETBLOCKING, true).toBool();
@ -331,6 +333,7 @@ void StreamingPreferences::save()
settings.setValue(SER_ABSTOUCHMODE, absoluteTouchMode); settings.setValue(SER_ABSTOUCHMODE, absoluteTouchMode);
settings.setValue(SER_FRAMEPACING, framePacing); settings.setValue(SER_FRAMEPACING, framePacing);
settings.setValue(SER_CONNWARNINGS, connectionWarnings); settings.setValue(SER_CONNWARNINGS, connectionWarnings);
settings.setValue(SER_CONFWARNINGS, configurationWarnings);
settings.setValue(SER_RICHPRESENCE, richPresence); settings.setValue(SER_RICHPRESENCE, richPresence);
settings.setValue(SER_GAMEPADMOUSE, gamepadMouse); settings.setValue(SER_GAMEPADMOUSE, gamepadMouse);
settings.setValue(SER_PACKETSIZE, packetSize); settings.setValue(SER_PACKETSIZE, packetSize);

View File

@ -124,6 +124,7 @@ public:
Q_PROPERTY(bool absoluteTouchMode MEMBER absoluteTouchMode NOTIFY absoluteTouchModeChanged) Q_PROPERTY(bool absoluteTouchMode MEMBER absoluteTouchMode NOTIFY absoluteTouchModeChanged)
Q_PROPERTY(bool framePacing MEMBER framePacing NOTIFY framePacingChanged) Q_PROPERTY(bool framePacing MEMBER framePacing NOTIFY framePacingChanged)
Q_PROPERTY(bool connectionWarnings MEMBER connectionWarnings NOTIFY connectionWarningsChanged) Q_PROPERTY(bool connectionWarnings MEMBER connectionWarnings NOTIFY connectionWarningsChanged)
Q_PROPERTY(bool configurationWarnings MEMBER configurationWarnings NOTIFY configurationWarningsChanged)
Q_PROPERTY(bool richPresence MEMBER richPresence NOTIFY richPresenceChanged) Q_PROPERTY(bool richPresence MEMBER richPresence NOTIFY richPresenceChanged)
Q_PROPERTY(bool gamepadMouse MEMBER gamepadMouse NOTIFY gamepadMouseChanged) Q_PROPERTY(bool gamepadMouse MEMBER gamepadMouse NOTIFY gamepadMouseChanged)
Q_PROPERTY(bool detectNetworkBlocking MEMBER detectNetworkBlocking NOTIFY detectNetworkBlockingChanged) Q_PROPERTY(bool detectNetworkBlocking MEMBER detectNetworkBlocking NOTIFY detectNetworkBlockingChanged)
@ -164,6 +165,7 @@ public:
bool absoluteTouchMode; bool absoluteTouchMode;
bool framePacing; bool framePacing;
bool connectionWarnings; bool connectionWarnings;
bool configurationWarnings;
bool richPresence; bool richPresence;
bool gamepadMouse; bool gamepadMouse;
bool detectNetworkBlocking; bool detectNetworkBlocking;
@ -209,6 +211,7 @@ signals:
void windowModeChanged(); void windowModeChanged();
void framePacingChanged(); void framePacingChanged();
void connectionWarningsChanged(); void connectionWarningsChanged();
void configurationWarningsChanged();
void richPresenceChanged(); void richPresenceChanged();
void gamepadMouseChanged(); void gamepadMouseChanged();
void detectNetworkBlockingChanged(); void detectNetworkBlockingChanged();

View File

@ -929,24 +929,26 @@ bool Session::initialize()
return false; return false;
} }
// Display launch warnings in Qt only after destroying SDL's window. if (m_Preferences->configurationWarnings) {
// This avoids conflicts between the windows on display subsystems // Display launch warnings in Qt only after destroying SDL's window.
// such as KMSDRM that only support a single window. // This avoids conflicts between the windows on display subsystems
for (const auto &text : m_LaunchWarnings) { // such as KMSDRM that only support a single window.
// Emit the warning to the UI for (const auto &text : m_LaunchWarnings) {
emit displayLaunchWarning(text); // Emit the warning to the UI
emit displayLaunchWarning(text);
// Wait a little bit so the user can actually read what we just said. // Wait a little bit so the user can actually read what we just said.
// This wait is a little longer than the actual toast timeout (3 seconds) // This wait is a little longer than the actual toast timeout (3 seconds)
// to allow it to transition off the screen before continuing. // to allow it to transition off the screen before continuing.
uint32_t start = SDL_GetTicks(); uint32_t start = SDL_GetTicks();
while (!SDL_TICKS_PASSED(SDL_GetTicks(), start + 3500)) { while (!SDL_TICKS_PASSED(SDL_GetTicks(), start + 3500)) {
SDL_Delay(5); SDL_Delay(5);
if (!m_ThreadedExec) { if (!m_ThreadedExec) {
// Pump the UI loop while we wait if we're on the main thread // Pump the UI loop while we wait if we're on the main thread
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents); QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
QCoreApplication::sendPostedEvents(); QCoreApplication::sendPostedEvents();
}
} }
} }
} }