refactor: Messages::showFirstConnectionMessage check the settings for the values
This commit is contained in:
parent
632b64f12f
commit
047451696a
3 changed files with 8 additions and 12 deletions
|
|
@ -858,13 +858,7 @@ void MainWindow::showFirstConnectedMessage()
|
||||||
if (Settings::value(Settings::Gui::ShownFirstConnectedMessage).toBool())
|
if (Settings::value(Settings::Gui::ShownFirstConnectedMessage).toBool())
|
||||||
return;
|
return;
|
||||||
Settings::setValue(Settings::Gui::ShownFirstConnectedMessage, true);
|
Settings::setValue(Settings::Gui::ShownFirstConnectedMessage, true);
|
||||||
|
messages::showFirstConnectedMessage(this);
|
||||||
const auto isServer = m_coreProcess.mode() == CoreMode::Server;
|
|
||||||
const auto closeToTray = Settings::value(Settings::Gui::CloseToTray).toBool();
|
|
||||||
|
|
||||||
using ProcessMode = Settings::ProcessMode;
|
|
||||||
const auto enableService = Settings::value(Settings::Core::ProcessMode).value<ProcessMode>() == ProcessMode::Service;
|
|
||||||
messages::showFirstConnectedMessage(this, closeToTray, enableService, isServer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::updateStatus()
|
void MainWindow::updateStatus()
|
||||||
|
|
|
||||||
|
|
@ -142,12 +142,11 @@ void showFirstServerStartMessage(QWidget *parent)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void showFirstConnectedMessage(QWidget *parent, bool closeToTray, bool enableService, bool isServer)
|
void showFirstConnectedMessage(QWidget *parent)
|
||||||
{
|
{
|
||||||
|
|
||||||
auto message = QObject::tr("<p>%1 is now connected!</p>").arg(kAppName);
|
auto message = QObject::tr("<p>%1 is now connected!</p>").arg(kAppName);
|
||||||
|
|
||||||
if (isServer) {
|
if (Settings::value(Settings::Core::CoreMode).value<Settings::CoreMode>() == Settings::Server) {
|
||||||
message.append(
|
message.append(
|
||||||
QObject::tr(
|
QObject::tr(
|
||||||
"<p>Try moving your mouse to your other computer. Once there, go ahead "
|
"<p>Try moving your mouse to your other computer. Once there, go ahead "
|
||||||
|
|
@ -159,7 +158,10 @@ void showFirstConnectedMessage(QWidget *parent, bool closeToTray, bool enableSer
|
||||||
message.append(QObject::tr("<p>Try controlling this computer remotely.</p>"));
|
message.append(QObject::tr("<p>Try controlling this computer remotely.</p>"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!closeToTray && !enableService) {
|
using ProcessMode = Settings::ProcessMode;
|
||||||
|
|
||||||
|
if (Settings::value(Settings::Core::ProcessMode).value<ProcessMode>() == ProcessMode::Desktop &&
|
||||||
|
!Settings::value(Settings::Gui::CloseToTray).toBool()) {
|
||||||
message.append(
|
message.append(
|
||||||
QObject::tr(
|
QObject::tr(
|
||||||
"<p>As you do not have the setting enabled to keep %1 running in "
|
"<p>As you do not have the setting enabled to keep %1 running in "
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ void raiseCriticalDialog();
|
||||||
|
|
||||||
void showFirstServerStartMessage(QWidget *parent);
|
void showFirstServerStartMessage(QWidget *parent);
|
||||||
|
|
||||||
void showFirstConnectedMessage(QWidget *parent, bool closeToTray, bool enableService, bool isServer);
|
void showFirstConnectedMessage(QWidget *parent);
|
||||||
|
|
||||||
void showCloseReminder(QWidget *parent);
|
void showCloseReminder(QWidget *parent);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue