Adhere to change request
This commit is contained in:
parent
fc8f3a80ed
commit
5d54b12b1c
@ -66,7 +66,7 @@ protected:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void moveBack();
|
void moveBack();
|
||||||
void trayOptionChanged(const bool value);
|
void trayOptionChanged(bool value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Layouts
|
// Layouts
|
||||||
|
@ -94,9 +94,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
pageStack_->setCurrentWidget(chat_page_);
|
pageStack_->setCurrentWidget(chat_page_);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(userSettingsPage_, &UserSettingsPage::trayOptionChanged, this, [=](const bool value) {
|
connect(userSettingsPage_, SIGNAL(trayOptionChanged(bool)), trayIcon_, SLOT(setVisible(bool)));
|
||||||
trayIcon_->setVisible(value);
|
|
||||||
});
|
|
||||||
|
|
||||||
connect(trayIcon_,
|
connect(trayIcon_,
|
||||||
SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
|
SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
|
||||||
@ -117,7 +115,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
|
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
|
||||||
trayIcon_->setVisible(settings.value("user/window/tray", true).toBool());
|
trayIcon_->setVisible(userSettings_->isTrayEnabled());
|
||||||
|
|
||||||
if (hasActiveUser()) {
|
if (hasActiveUser()) {
|
||||||
QString token = settings.value("auth/access_token").toString();
|
QString token = settings.value("auth/access_token").toString();
|
||||||
@ -259,8 +257,7 @@ MainWindow::showUserSettingsPage()
|
|||||||
void
|
void
|
||||||
MainWindow::closeEvent(QCloseEvent *event)
|
MainWindow::closeEvent(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
QSettings settings;
|
if (isVisible() && userSettings_->isTrayEnabled()) {
|
||||||
if (isVisible() && settings.value("user/window/tray", true).toBool()) {
|
|
||||||
event->ignore();
|
event->ignore();
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user