mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-30 09:56:14 -05:00
switch trayicon if online count is 0 or bigger
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1262 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
3d37a0c242
commit
eea261d739
@ -109,6 +109,9 @@
|
||||
#define IMG_HELP ":/images/help.png"
|
||||
#define IMAGE_NEWSFEED ":/images/konqsidebar_news24.png"
|
||||
#define IMAGE_PLUGINS ":/images/extension_32.png"
|
||||
#define IMAGE_NOONLINE ":/images/rstray0.png"
|
||||
#define IMAGE_ONEONLINE ":/images/rstray1.png"
|
||||
#define IMAGE_TWOONLINE ":/images/rstray2.png"
|
||||
|
||||
|
||||
/* Keys for UI Preferences */
|
||||
@ -326,7 +329,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
trayIcon = new QSystemTrayIcon(this);
|
||||
trayIcon->setToolTip(tr("RetroShare"));
|
||||
trayIcon->setContextMenu(menu);
|
||||
trayIcon->setIcon(QIcon(IMAGE_RETROSHARE));
|
||||
trayIcon->setIcon(QIcon(IMAGE_NOONLINE));
|
||||
|
||||
connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this,
|
||||
SLOT(toggleVisibility(QSystemTrayIcon::ActivationReason)));
|
||||
@ -351,6 +354,27 @@ void MainWindow::updateStatus()
|
||||
|
||||
if (natstatus)
|
||||
natstatus->getNATStatus();
|
||||
|
||||
std::list<std::string> ids;
|
||||
rsPeers->getOnlineList(ids);
|
||||
int online = ids.size();
|
||||
|
||||
if (online == 0)
|
||||
{
|
||||
trayIcon->setIcon(QIcon(IMAGE_NOONLINE));
|
||||
}
|
||||
else if (online < 2)
|
||||
{
|
||||
trayIcon->setIcon(QIcon(IMAGE_ONEONLINE));
|
||||
}
|
||||
else if (online < 3)
|
||||
{
|
||||
trayIcon->setIcon(QIcon(IMAGE_TWOONLINE));
|
||||
}
|
||||
else
|
||||
{
|
||||
trayIcon->setIcon(QIcon(IMAGE_RETROSHARE));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -275,6 +275,7 @@
|
||||
<file>images/rstray3.png</file>
|
||||
<file>images/rstray0.png</file>
|
||||
<file>images/rstray1.png</file>
|
||||
<file>images/rstray2.png</file>
|
||||
<file>images/save24.png</file>
|
||||
<file>images/send24.png</file>
|
||||
<file>images/settings.png</file>
|
||||
|
BIN
retroshare-gui/src/gui/images/rstray2.png
Normal file
BIN
retroshare-gui/src/gui/images/rstray2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
Loading…
Reference in New Issue
Block a user