diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 375840973..9d4b54312 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -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 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)); + } } diff --git a/retroshare-gui/src/gui/images.qrc b/retroshare-gui/src/gui/images.qrc index 28e5b2d8e..ed6072e6b 100644 --- a/retroshare-gui/src/gui/images.qrc +++ b/retroshare-gui/src/gui/images.qrc @@ -275,6 +275,7 @@ images/rstray3.png images/rstray0.png images/rstray1.png + images/rstray2.png images/save24.png images/send24.png images/settings.png diff --git a/retroshare-gui/src/gui/images/rstray2.png b/retroshare-gui/src/gui/images/rstray2.png new file mode 100644 index 000000000..e5ee501db Binary files /dev/null and b/retroshare-gui/src/gui/images/rstray2.png differ