mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04: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 IMG_HELP ":/images/help.png"
|
||||||
#define IMAGE_NEWSFEED ":/images/konqsidebar_news24.png"
|
#define IMAGE_NEWSFEED ":/images/konqsidebar_news24.png"
|
||||||
#define IMAGE_PLUGINS ":/images/extension_32.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 */
|
/* Keys for UI Preferences */
|
||||||
@ -326,7 +329,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
|||||||
trayIcon = new QSystemTrayIcon(this);
|
trayIcon = new QSystemTrayIcon(this);
|
||||||
trayIcon->setToolTip(tr("RetroShare"));
|
trayIcon->setToolTip(tr("RetroShare"));
|
||||||
trayIcon->setContextMenu(menu);
|
trayIcon->setContextMenu(menu);
|
||||||
trayIcon->setIcon(QIcon(IMAGE_RETROSHARE));
|
trayIcon->setIcon(QIcon(IMAGE_NOONLINE));
|
||||||
|
|
||||||
connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this,
|
connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this,
|
||||||
SLOT(toggleVisibility(QSystemTrayIcon::ActivationReason)));
|
SLOT(toggleVisibility(QSystemTrayIcon::ActivationReason)));
|
||||||
@ -352,6 +355,27 @@ void MainWindow::updateStatus()
|
|||||||
if (natstatus)
|
if (natstatus)
|
||||||
natstatus->getNATStatus();
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::updateHashingInfo(const QString& s)
|
void MainWindow::updateHashingInfo(const QString& s)
|
||||||
|
@ -275,6 +275,7 @@
|
|||||||
<file>images/rstray3.png</file>
|
<file>images/rstray3.png</file>
|
||||||
<file>images/rstray0.png</file>
|
<file>images/rstray0.png</file>
|
||||||
<file>images/rstray1.png</file>
|
<file>images/rstray1.png</file>
|
||||||
|
<file>images/rstray2.png</file>
|
||||||
<file>images/save24.png</file>
|
<file>images/save24.png</file>
|
||||||
<file>images/send24.png</file>
|
<file>images/send24.png</file>
|
||||||
<file>images/settings.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