mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
moved trayicon to own void function
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1846 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
10bc8e7a67
commit
d7a052720a
@ -266,17 +266,31 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
|
||||
/* Create the actions that will go in the tray menu */
|
||||
createActions();
|
||||
/* Creates a tray icon with a context menu and adds it to the system's * notification area. */
|
||||
createTrayIcon();
|
||||
|
||||
/******
|
||||
* This is an annoying warning I get all the time...
|
||||
* (no help!)
|
||||
*
|
||||
*
|
||||
if (!QSystemTrayIcon::isSystemTrayAvailable())
|
||||
QMessageBox::warning(0, tr("System tray is unavailable"),
|
||||
tr("System tray unavailable"));
|
||||
******/
|
||||
QTimer *timer = new QTimer(this);
|
||||
timer->connect(timer, SIGNAL(timeout()), this, SLOT(updateStatus()));
|
||||
timer->start(1000);
|
||||
}
|
||||
|
||||
/** Destructor. */
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete _bandwidthGraph;
|
||||
delete _messengerwindowAct;
|
||||
delete peerstatus;
|
||||
delete dhtstatus;
|
||||
delete natstatus;
|
||||
delete ratesstatus;
|
||||
delete _settings;
|
||||
delete applicationWindow;
|
||||
}
|
||||
|
||||
/** Creates a tray icon with a context menu and adds it to the system
|
||||
* notification area. */
|
||||
void MainWindow::createTrayIcon()
|
||||
{
|
||||
/** Tray icon Menu **/
|
||||
menu = new QMenu(this);
|
||||
QObject::connect(menu, SIGNAL(aboutToShow()), this, SLOT(updateMenu()));
|
||||
@ -309,26 +323,8 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this,
|
||||
SLOT(toggleVisibility(QSystemTrayIcon::ActivationReason)));
|
||||
trayIcon->show();
|
||||
|
||||
QTimer *timer = new QTimer(this);
|
||||
timer->connect(timer, SIGNAL(timeout()), this, SLOT(updateStatus()));
|
||||
timer->start(1000);
|
||||
}
|
||||
|
||||
/** Destructor. */
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete _bandwidthGraph;
|
||||
delete _messengerwindowAct;
|
||||
delete peerstatus;
|
||||
delete dhtstatus;
|
||||
delete natstatus;
|
||||
delete ratesstatus;
|
||||
delete _settings;
|
||||
delete applicationWindow;
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::displaySystrayMsg(const QString& title,const QString& msg)
|
||||
{
|
||||
trayIcon->showMessage(title, msg, QSystemTrayIcon::Information, 3000);
|
||||
|
@ -142,6 +142,8 @@ private:
|
||||
/** Create the actions on the tray menu or menubar */
|
||||
void createActions();
|
||||
|
||||
void createTrayIcon();
|
||||
|
||||
/** Defines the actions for the tray menu */
|
||||
QAction* _settingsAct;
|
||||
QAction* _bandwidthAct;
|
||||
|
Loading…
Reference in New Issue
Block a user