|
|
|
@ -2,24 +2,27 @@
|
|
|
|
|
|
|
|
|
|
#include <QApplication>
|
|
|
|
|
|
|
|
|
|
void SystemTray::setup()
|
|
|
|
|
|
|
|
|
|
SystemTray::SystemTray(MainWindow *mainWindow, QWidget *parent)
|
|
|
|
|
: QWidget(parent),
|
|
|
|
|
m_parent(mainWindow)
|
|
|
|
|
{
|
|
|
|
|
m_systemTrayIcon = new QSystemTrayIcon(0);
|
|
|
|
|
|
|
|
|
|
m_minimizeAction = new QAction(tr("Mi&nimize"), m_systemTrayIcon);
|
|
|
|
|
connect(m_minimizeAction, SIGNAL(triggered()), m_mainWindow,
|
|
|
|
|
connect(m_minimizeAction, SIGNAL(triggered()), m_parent,
|
|
|
|
|
SLOT(hide()));
|
|
|
|
|
|
|
|
|
|
m_maximizeAction = new QAction(tr("Ma&ximize"), m_systemTrayIcon);
|
|
|
|
|
connect(m_maximizeAction, SIGNAL(triggered()), m_mainWindow,
|
|
|
|
|
connect(m_maximizeAction, SIGNAL(triggered()), m_parent,
|
|
|
|
|
SLOT(showMaximized()));
|
|
|
|
|
|
|
|
|
|
m_restoreAction = new QAction(tr("&Restore"), m_systemTrayIcon);
|
|
|
|
|
connect(m_restoreAction, SIGNAL(triggered()), m_mainWindow,
|
|
|
|
|
connect(m_restoreAction, SIGNAL(triggered()), m_parent,
|
|
|
|
|
SLOT(showNormal()));
|
|
|
|
|
|
|
|
|
|
m_quitAction = new QAction(tr("&Quit"), m_systemTrayIcon);
|
|
|
|
|
connect(m_quitAction, SIGNAL(triggered()), qApp,
|
|
|
|
|
connect(m_quitAction, SIGNAL(triggered()), m_parent,
|
|
|
|
|
SLOT(quit()));
|
|
|
|
|
|
|
|
|
|
m_trayIconMenu = new QMenu(this);
|
|
|
|
@ -34,15 +37,3 @@ void SystemTray::setup()
|
|
|
|
|
m_icon = new QIcon(":/qtmindmap.svg");
|
|
|
|
|
m_systemTrayIcon->setIcon(QIcon(":/qtmindmap.svg"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SystemTray::SystemTray(MainWindow *mainWindow, QWidget *parent) :
|
|
|
|
|
QWidget(parent),
|
|
|
|
|
m_mainWindow(mainWindow)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SystemTray::show()
|
|
|
|
|
{
|
|
|
|
|
m_systemTrayIcon->show();
|
|
|
|
|
}
|
|
|
|
|