Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
feat(systemtray): add "Show" action to context menu
Browse files Browse the repository at this point in the history
Makes it possible for all users to get qTox back from the tray.
  • Loading branch information
sudden6 committed Jun 12, 2016
1 parent f74ba91 commit a851a5b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/widget/widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ void Widget::init()
offlineMsgTimer->start(2*60*1000);

icon_size = 15;

actionActivate = new QAction(this);
connect(actionActivate, &QAction::triggered, this, &Widget::forceShow);

statusOnline = new QAction(this);
statusOnline->setIcon(prepareIcon(getStatusIconPath(Status::Online), icon_size, icon_size));
connect(statusOnline, &QAction::triggered, this, &Widget::setStatusOnline);
Expand All @@ -143,6 +147,7 @@ void Widget::init()
#ifndef Q_OS_OSX
actionQuit->setMenuRole(QAction::QuitRole);
#endif

actionQuit->setIcon(prepareIcon(":/ui/rejectCall/rejectCall.svg", icon_size, icon_size));
connect(actionQuit, &QAction::triggered, qApp, &QApplication::quit);

Expand Down Expand Up @@ -1785,6 +1790,9 @@ void Widget::onTryCreateTrayIcon()
updateIcons();
trayMenu = new QMenu(this);

// adding activate to the top, avoids accidentally clicking quit
trayMenu->addAction(actionActivate);
trayMenu->addSeparator();
trayMenu->addAction(statusOnline);
trayMenu->addAction(statusAway);
trayMenu->addAction(statusBusy);
Expand Down Expand Up @@ -2245,6 +2253,7 @@ void Widget::retranslateUi()
statusBusy->setText(tr("Busy", "Button to set your status to 'Busy'"));
actionLogout->setText(tr("Logout", "Tray action menu to logout user"));
actionQuit->setText(tr("Exit", "Tray action menu to exit tox"));
actionActivate->setText(tr("Activate", "Tray action menu to reactivate qTox window"));

This comment has been minimized.

Copy link
@zetok

zetok Jun 13, 2016

Contributor

ERR?

This comment has been minimized.

Copy link
@sudden6

sudden6 Jun 13, 2016

Author Member

ARGH


if (!Settings::getInstance().getSeparateWindow())
setWindowTitle(fromDialogType(AddDialog));
Expand Down
1 change: 1 addition & 0 deletions src/widget/widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ private slots:
QAction *statusBusy;
QAction *actionLogout;
QAction *actionQuit;
QAction *actionActivate;

QMenu* filterMenu;

Expand Down

0 comments on commit a851a5b

Please sign in to comment.