#include <TrayIcon.h>
Public Types | |
enum | BalloonMessageIcon { NoIcon = 0, Information, Warning, Critical } |
Signals | |
void | doubleClicked () |
Public Member Functions | |
TrayIcon (QWidget *parent=0) | |
void | show () |
void | hide () |
void | update (const QString &iconFile, const QString &toolTip) |
void | setToolTip (const QString &toolTip) |
void | setIcon (const QString &iconFile) |
void | setContextMenu (QMenu *contextMenu) |
void | showBalloonMessage (const QString &title, const QString &message, BalloonMessageIcon icon) |
Static Public Member Functions | |
static bool | isTrayIconSupported () |
static bool | supportsBalloonMessages () |
Protected Member Functions | |
bool | event (QEvent *) |
void | mouseButtonDblClick (QMouseEvent *event) |
Definition at line 35 of file TrayIcon.h.
Balloon message status icons.
Definition at line 41 of file TrayIcon.h.
TrayIcon::TrayIcon | ( | QWidget * | parent = 0 |
) |
Default constructor.
Definition at line 30 of file TrayIcon.cpp.
void TrayIcon::doubleClicked | ( | ) | [signal] |
Emitted when the user double-clicks on the tray icon.
Referenced by mouseButtonDblClick().
bool TrayIcon::event | ( | QEvent * | event | ) | [protected] |
Override's QObject' event() method to catch mouse-related events.
Catches and handles mouse-related events.
Definition at line 37 of file TrayIcon.cpp.
References mouseButtonDblClick().
void TrayIcon::hide | ( | ) |
Hide the tray icon.
Call the platform's tray icon implementation to hide the tray icon.
Reimplemented from TrayIconImpl.
Definition at line 79 of file TrayIcon.cpp.
Referenced by MainWindow::~MainWindow().
bool TrayIcon::isTrayIconSupported | ( | ) | [static] |
Returns true if the current platform and tray icon implementation supports tray icons.
Definition at line 134 of file TrayIcon.cpp.
Referenced by MainWindow::setVisible().
void TrayIcon::mouseButtonDblClick | ( | QMouseEvent * | event | ) | [protected] |
Respond to a mouse button being double-clicked.
Responds to a mouse button double-click. On all platforms, we just emit a signal and let the owner of the tray icon decide if they want to do anything.
Definition at line 55 of file TrayIcon.cpp.
References doubleClicked().
Referenced by event().
void TrayIcon::setContextMenu | ( | QMenu * | menu | ) |
Sets the context menu displayed when the tray icon is selected.
Sets the context menu displayed when the tray icon is selected. On Mac, the context menu is displayed when the dock icon is clicked.
Definition at line 101 of file TrayIcon.cpp.
Referenced by MainWindow::createTrayIcon().
void TrayIcon::setIcon | ( | const QString & | iconFile | ) |
Update the tray icon's image.
Call the platform's tray icon implementation to update the icon image.
Reimplemented from TrayIconImpl.
Definition at line 93 of file TrayIcon.cpp.
Referenced by update(), and MainWindow::updateTorStatus().
void TrayIcon::setToolTip | ( | const QString & | toolTip | ) |
Update the tray icon's tooltip.
Call the platform's tray icon implementation to update the icon's tooltip.
Reimplemented from TrayIconImpl.
Definition at line 86 of file TrayIcon.cpp.
Referenced by MainWindow::setStartupProgress(), update(), and MainWindow::updateTorStatus().
void TrayIcon::show | ( | ) |
Show the tray icon.
Call the platform's tray icon implementation to show the tray icon.
Reimplemented from TrayIconImpl.
Definition at line 72 of file TrayIcon.cpp.
Referenced by MainWindow::MainWindow().
void TrayIcon::showBalloonMessage | ( | const QString & | title, | |
const QString & | message, | |||
BalloonMessageIcon | balloonIcon | |||
) |
Displays a balloon message next to the tray icon.
Definition at line 112 of file TrayIcon.cpp.
References Critical, NoIcon, and Warning.
Referenced by MainWindow::newIdentity().
bool TrayIcon::supportsBalloonMessages | ( | ) | [static] |
Returns true if the current platform and tray icon implementation supports tray icon balloon messages.
Definition at line 148 of file TrayIcon.cpp.
Referenced by MainWindow::newIdentity().
void TrayIcon::update | ( | const QString & | iconFile, | |
const QString & | toolTip | |||
) |
Updates the icon image and tooltip.
Update the tray icon's image and tooltip.
Definition at line 64 of file TrayIcon.cpp.
References setIcon(), and setToolTip().