From 519b4af730dc68045e66e7c80ada02564d619e06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignacio=20Rodr=C3=ADguez?= Date: Wed, 20 Jan 2021 18:27:46 +0700 Subject: [PATCH] Main Window receives screen name change (#6916) * corresponding slot and signal * changelog updated Co-authored-by: SerhiiGadzhilov <71632867+SerhiiGadzhilov@users.noreply.github.com> --- ChangeLog | 3 +++ src/gui/src/AppConfig.cpp | 1 + src/gui/src/AppConfig.h | 1 + src/gui/src/MainWindow.cpp | 7 +++++++ src/gui/src/MainWindow.h | 1 + 5 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index fdf1d2277..a1af22a82 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ v1.13.1-snapshot Bug fixes: - #6900 Remaining SonarCloud reported bug items (test fixed) - #6889 Systray Icon on Ubuntu Auto Start (take 2) + +Enhancements: +- #6916 Main Window receives screen name change - #6910 Don't use the word “Version” for release names because it can lead to errors during update checking. - #6918 Removing positional union initialisation =========== diff --git a/src/gui/src/AppConfig.cpp b/src/gui/src/AppConfig.cpp index cfeed4400..8c1810a2a 100644 --- a/src/gui/src/AppConfig.cpp +++ b/src/gui/src/AppConfig.cpp @@ -335,6 +335,7 @@ void AppConfig::setLastVersion(const QString& version) { void AppConfig::setScreenName(const QString &s) { setSettingModified(m_ScreenName, s); + emit screenNameChanged(); } void AppConfig::setPort(int i) { diff --git a/src/gui/src/AppConfig.h b/src/gui/src/AppConfig.h index 35a0a852c..c7e388825 100644 --- a/src/gui/src/AppConfig.h +++ b/src/gui/src/AppConfig.h @@ -293,6 +293,7 @@ protected: signals: void sslToggled() const; void zeroConfToggled(); + void screenNameChanged() const; }; #endif diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index e1a06ddf8..128b5a92e 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -135,7 +135,9 @@ MainWindow::MainWindow (AppConfig& appConfig, m_pWidgetUpdate->hide(); m_VersionChecker.setApp(appPath(appConfig.synergycName())); + m_pLabelScreenName->setText(getScreenName()); + connect(m_AppConfig, SIGNAL(screenNameChanged()), this, SLOT(updateScreenName())); m_pLabelIpAddresses->setText(getIPAddresses()); #if defined(Q_OS_WIN) @@ -1403,3 +1405,8 @@ void MainWindow::windowStateChanged() if (windowState() == Qt::WindowMinimized && appConfig().getMinimizeToTray()) hide(); } + +void MainWindow::updateScreenName() +{ + m_pLabelScreenName->setText(getScreenName()); +} \ No newline at end of file diff --git a/src/gui/src/MainWindow.h b/src/gui/src/MainWindow.h index cb626f08f..15f575b6d 100644 --- a/src/gui/src/MainWindow.h +++ b/src/gui/src/MainWindow.h @@ -143,6 +143,7 @@ public slots: protected slots: void updateLocalFingerprint(); + void updateScreenName(); void on_m_pGroupClient_toggled(bool on); void on_m_pGroupServer_toggled(bool on); bool on_m_pButtonBrowseConfigFile_clicked();