refactor: use Settings::Gui::ShownFirstConnectionMessage to control message popup on initial connection a to client / server

This commit is contained in:
sithlord48
2025-11-30 14:06:46 -05:00
committed by Chris Rizzitello
parent b4e4277e08
commit 8e8ab25fd0
3 changed files with 6 additions and 2 deletions

View File

@ -104,6 +104,7 @@ This section contains options used by the GUI it will begin with `[gui]`
| symbolicTrayIcon | `true` or `false` | When true use the monocolor (symbolic) icon false uses a colorful icon for the tray [default: true] |
| windowGeometry | QRect | Geometry of the window used to restore the window geometry after exiting the app |
| showGenericClientFailureDialog | `true` or `false` | When `true` client connection errors will not show popup error messages [default: true] |
| shownFirstConnectedMessage | `true` or `false` | When `true` GUI has shown the user the message for connecting the first time [default: false] |
### Log

View File

@ -73,6 +73,7 @@ public:
inline static const auto SymbolicTrayIcon = QStringLiteral("gui/symbolicTrayIcon");
inline static const auto WindowGeometry = QStringLiteral("gui/windowGeometry");
inline static const auto ShowGenericClientFailureDialog = QStringLiteral("gui/showGenericClientFailureDialog");
inline static const auto ShownFirstConnectedMessage = QStringLiteral("gui/shownFirstConnectedMessage");
};
struct Log
{
@ -211,6 +212,7 @@ private:
, Settings::Gui::SymbolicTrayIcon
, Settings::Gui::WindowGeometry
, Settings::Gui::ShowGenericClientFailureDialog
, Settings::Gui::ShownFirstConnectedMessage
, Settings::Security::Certificate
, Settings::Security::CheckPeers
, Settings::Security::KeySize
@ -222,6 +224,7 @@ private:
// When checking the default values this list contains the ones that default to false.
inline static const QStringList m_defaultFalseValues = {
Settings::Gui::Autohide
, Settings::Gui::ShownFirstConnectedMessage
, Settings::Core::StartedBefore
, Settings::Core::PreventSleep
, Settings::Core::UseWlClipboard

View File

@ -881,9 +881,9 @@ void MainWindow::closeEvent(QCloseEvent *event)
void MainWindow::showFirstConnectedMessage()
{
if (Settings::value(Settings::Core::StartedBefore).toBool())
if (Settings::value(Settings::Gui::ShownFirstConnectedMessage).toBool())
return;
Settings::setValue(Settings::Core::StartedBefore, true);
Settings::setValue(Settings::Gui::ShownFirstConnectedMessage, true);
const auto isServer = m_coreProcess.mode() == CoreMode::Server;
const auto closeToTray = Settings::value(Settings::Gui::CloseToTray).toBool();