Utility::setLaunchOnStartup(_theme->appName(), _theme->appNameGUI(), true);
}
- _gui->slotShowSettings();
+ Systray::instance()->showWindow();
}
}
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();
, _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));
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);
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)
this, &Systray::showWindow);
}
-Systray::~Systray()
-{
-}
-
void Systray::create()
{
if (_trayContext == nullptr) {
{
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);
void slotChangeActivityModel();
private:
+ static Systray *_instance;
+ Systray();
bool _isOpen;
bool _syncIsPaused;
QQmlEngine *_trayEngine;