зеркало из https://github.com/nextcloud/desktop.git
Systray now a singleton with instance(), show tray on finished wizard
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
This commit is contained in:
Родитель
738127525f
Коммит
86b915d42e
|
@ -390,7 +390,7 @@ void Application::slotownCloudWizardDone(int res)
|
|||
Utility::setLaunchOnStartup(_theme->appName(), _theme->appNameGUI(), true);
|
||||
}
|
||||
|
||||
_gui->slotShowSettings();
|
||||
Systray::instance()->showWindow();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -116,7 +116,6 @@ GeneralSettings::GeneralSettings(QWidget *parent)
|
|||
connect(_ui->ignoredFilesButton, &QAbstractButton::clicked, this, &GeneralSettings::slotIgnoreFilesEditor);
|
||||
|
||||
// accountAdded means the wizard was finished and the wizard might change some options.
|
||||
// Update 01/2020: Show new tray window instead
|
||||
connect(AccountManager::instance(), &AccountManager::accountAdded, this, &GeneralSettings::loadMiscSettings);
|
||||
|
||||
customizeStyle();
|
||||
|
|
|
@ -71,7 +71,7 @@ ownCloudGui::ownCloudGui(Application *parent)
|
|||
, _recentActionsMenu(nullptr)
|
||||
, _app(parent)
|
||||
{
|
||||
_tray = new Systray();
|
||||
_tray = Systray::instance();
|
||||
_tray->setParent(this);
|
||||
// for the beginning, set the offline icon until the account was verified
|
||||
_tray->setIcon(Theme::instance()->folderOfflineIcon(/*systray?*/ true));
|
||||
|
|
|
@ -229,7 +229,6 @@ void SettingsDialog::accountAdded(AccountState *s)
|
|||
connect(accountSettings, &AccountSettings::folderChanged, _gui, &ownCloudGui::slotFoldersChanged);
|
||||
connect(accountSettings, &AccountSettings::openFolderAlias,
|
||||
_gui, &ownCloudGui::slotFolderOpenAction);
|
||||
connect(accountSettings, &AccountSettings::showIssuesList, this, &SettingsDialog::showIssuesList);
|
||||
connect(s->account().data(), &Account::accountChangedAvatar, this, &SettingsDialog::slotAccountAvatarChanged);
|
||||
connect(s->account().data(), &Account::accountChangedDisplayName, this, &SettingsDialog::slotAccountDisplayNameChanged);
|
||||
|
||||
|
|
|
@ -36,7 +36,17 @@
|
|||
|
||||
namespace OCC {
|
||||
|
||||
Systray::Systray() // TODO: make singleton, provide ::instance()
|
||||
Systray *Systray::_instance = nullptr;
|
||||
|
||||
Systray *Systray::instance()
|
||||
{
|
||||
if (_instance == nullptr) {
|
||||
_instance = new Systray();
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
|
||||
Systray::Systray()
|
||||
: _isOpen(false)
|
||||
, _syncIsPaused(false)
|
||||
, _trayComponent(nullptr)
|
||||
|
@ -62,10 +72,6 @@ Systray::Systray() // TODO: make singleton, provide ::instance()
|
|||
this, &Systray::showWindow);
|
||||
}
|
||||
|
||||
Systray::~Systray()
|
||||
{
|
||||
}
|
||||
|
||||
void Systray::create()
|
||||
{
|
||||
if (_trayContext == nullptr) {
|
||||
|
|
|
@ -43,8 +43,9 @@ class Systray
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Systray();
|
||||
~Systray();
|
||||
static Systray *instance();
|
||||
virtual ~Systray() {};
|
||||
|
||||
void create();
|
||||
void showMessage(const QString &title, const QString &message, MessageIcon icon = Information, int millisecondsTimeoutHint = 10000);
|
||||
void setToolTip(const QString &tip);
|
||||
|
@ -72,6 +73,8 @@ private slots:
|
|||
void slotChangeActivityModel();
|
||||
|
||||
private:
|
||||
static Systray *_instance;
|
||||
Systray();
|
||||
bool _isOpen;
|
||||
bool _syncIsPaused;
|
||||
QQmlEngine *_trayEngine;
|
||||
|
|
Загрузка…
Ссылка в новой задаче