Added a combined notify icon in systray. You can enable/disable this in the NotifyPage.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3871 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-11-26 00:54:18 +00:00
parent 546fa15364
commit 162c54aae4
9 changed files with 413 additions and 113 deletions

View File

@ -158,6 +158,18 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
m_bStatusLoadDone = false; m_bStatusLoadDone = false;
isIdle = false; isIdle = false;
trayIconCombined = NULL;
trayIconMessages = NULL;
trayIconForums = NULL;
trayIconChannels = NULL;
trayIconChat = NULL;
trayIconTransfers = NULL;
trayActionMessages = NULL;
trayActionForums = NULL;
trayActionChannels = NULL;
trayActionChat = NULL;
trayActionTransfers = NULL;
setWindowTitle(tr("RetroShare %1 a secure decentralised communication platform").arg(retroshareVersion())); setWindowTitle(tr("RetroShare %1 a secure decentralised communication platform").arg(retroshareVersion()));
/* add url handler for RetroShare links */ /* add url handler for RetroShare links */
@ -298,12 +310,6 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
/* Set focus to the current page */ /* Set focus to the current page */
ui.stackPages->currentWidget()->setFocus(); ui.stackPages->currentWidget()->setFocus();
/* call once */
updateMessages();
updateForums();
updateChannels(NOTIFY_TYPE_ADD);
privateChatChanged(NOTIFY_LIST_PRIVATE_INCOMING_CHAT, NOTIFY_TYPE_ADD);
idle = new Idle(); idle = new Idle();
idle->start(); idle->start();
connect(idle, SIGNAL(secondsIdle(int)), this, SLOT(checkAndSetIdle(int))); connect(idle, SIGNAL(secondsIdle(int)), this, SLOT(checkAndSetIdle(int)));
@ -357,7 +363,7 @@ void MainWindow::displayDiskSpaceWarning(int loc,int size_limit_mb)
void MainWindow::createTrayIcon() void MainWindow::createTrayIcon()
{ {
/** Tray icon Menu **/ /** Tray icon Menu **/
trayMenu = new QMenu(this); QMenu *trayMenu = new QMenu(this);
QObject::connect(trayMenu, SIGNAL(aboutToShow()), this, SLOT(updateMenu())); QObject::connect(trayMenu, SIGNAL(aboutToShow()), this, SLOT(updateMenu()));
toggleVisibilityAction = trayMenu->addAction(QIcon(IMAGE_RETROSHARE), tr("Show/Hide"), this, SLOT(toggleVisibilitycontextmenu())); toggleVisibilityAction = trayMenu->addAction(QIcon(IMAGE_RETROSHARE), tr("Show/Hide"), this, SLOT(toggleVisibilitycontextmenu()));
@ -390,30 +396,135 @@ void MainWindow::createTrayIcon()
connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(toggleVisibility(QSystemTrayIcon::ActivationReason))); connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(toggleVisibility(QSystemTrayIcon::ActivationReason)));
trayIcon->show(); trayIcon->show();
createNotifyIcons();
}
void MainWindow::createNotifyIcons()
{
#define DELETE_ICON(x) if (x) { delete(x); x = NULL; }
int notifyFlag = Settings->getTrayNotifyFlags();
QMenu *trayMenu = NULL;
/* Delete combined systray icon and rebuild it */
trayActionMessages = NULL;
trayActionForums = NULL;
trayActionChannels = NULL;
trayActionChat = NULL;
trayActionTransfers = NULL;
DELETE_ICON(trayIconCombined);
if (notifyFlag & TRAYNOTIFY_COMBINEDICON) {
/* Delete single systray icons */
DELETE_ICON(trayIconMessages);
DELETE_ICON(trayIconForums);
DELETE_ICON(trayIconChannels);
DELETE_ICON(trayIconChat);
DELETE_ICON(trayIconTransfers);
/* Create combined systray icon */
trayIconCombined = new QSystemTrayIcon(this);
trayIconCombined->setIcon(QIcon(":/images/rstray_new.png"));
trayMenu = new QMenu(this);
trayIconCombined->setContextMenu(trayMenu);
}
/* Create systray icons or actions */
if (notifyFlag & TRAYNOTIFY_MESSAGES) {
if (trayMenu) {
DELETE_ICON(trayIconMessages);
trayActionMessages = trayMenu->addAction(QIcon(":/images/newmsg.png"), "", this, SLOT(trayIconMessagesClicked()));
trayActionMessages->setVisible(false);
trayActionMessages->setData(tr("Messages"));
} else if (trayIconMessages == NULL) {
// Create the tray icon for messages // Create the tray icon for messages
trayIconMessages = new QSystemTrayIcon(this); trayIconMessages = new QSystemTrayIcon(this);
trayIconMessages->setIcon(QIcon(":/images/newmsg.png")); trayIconMessages->setIcon(QIcon(":/images/newmsg.png"));
connect(trayIconMessages, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconMessagesClicked(QSystemTrayIcon::ActivationReason))); connect(trayIconMessages, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconMessagesClicked(QSystemTrayIcon::ActivationReason)));
}
} else {
DELETE_ICON(trayIconMessages);
}
if (notifyFlag & TRAYNOTIFY_FORUMS) {
if (trayMenu) {
DELETE_ICON(trayIconForums);
trayActionForums = trayMenu->addAction(QIcon(":/images/konversation16.png"), "", this, SLOT(trayIconForumsClicked()));
trayActionForums->setVisible(false);
trayActionForums->setData(tr("Forums"));
} else if (trayIconForums == NULL) {
// Create the tray icon for forums // Create the tray icon for forums
trayIconForums = new QSystemTrayIcon(this); trayIconForums = new QSystemTrayIcon(this);
trayIconForums->setIcon(QIcon(":/images/konversation16.png")); trayIconForums->setIcon(QIcon(":/images/konversation16.png"));
connect(trayIconForums, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconForumsClicked(QSystemTrayIcon::ActivationReason))); connect(trayIconForums, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconForumsClicked(QSystemTrayIcon::ActivationReason)));
}
} else {
DELETE_ICON(trayIconForums);
}
if (notifyFlag & TRAYNOTIFY_CHANNELS) {
if (trayMenu) {
DELETE_ICON(trayIconChannels);
trayActionChannels = trayMenu->addAction(QIcon(":/images/channels16.png"), "", this, SLOT(trayIconChannelsClicked()));
trayActionChannels->setVisible(false);
trayActionChannels->setData(tr("Channels"));
} else if (trayIconChannels == NULL) {
// Create the tray icon for channels // Create the tray icon for channels
trayIconChannels = new QSystemTrayIcon(this); trayIconChannels = new QSystemTrayIcon(this);
trayIconChannels->setIcon(QIcon(":/images/channels16.png")); trayIconChannels->setIcon(QIcon(":/images/channels16.png"));
connect(trayIconChannels, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconChannelsClicked(QSystemTrayIcon::ActivationReason))); connect(trayIconChannels, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconChannelsClicked(QSystemTrayIcon::ActivationReason)));
}
} else {
DELETE_ICON(trayIconChannels);
}
if (notifyFlag & TRAYNOTIFY_PRIVATECHAT) {
if (trayMenu) {
DELETE_ICON(trayIconChat);
trayActionChat = trayMenu->addAction(QIcon(":/images/chat.png"), "", this, SLOT(trayIconChatClicked()));
trayActionChat->setVisible(false);
trayActionChat->setData(tr("Chat"));
} else if (trayIconChat == NULL) {
// Create the tray icon for chat // Create the tray icon for chat
trayIconChat = new QSystemTrayIcon(this); trayIconChat = new QSystemTrayIcon(this);
trayIconChat->setIcon(QIcon(":/images/chat.png")); trayIconChat->setIcon(QIcon(":/images/chat.png"));
connect(trayIconChat, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconChatClicked(QSystemTrayIcon::ActivationReason))); connect(trayIconChat, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconChatClicked(QSystemTrayIcon::ActivationReason)));
}
} else {
DELETE_ICON(trayIconChat);
}
if (notifyFlag & TRAYNOTIFY_TRANSFERS) {
if (trayMenu) {
DELETE_ICON(trayIconTransfers);
trayActionTransfers = trayMenu->addAction(QIcon(":/images/ktorrent32.png"), "", this, SLOT(trayIconTransfersClicked()));
trayActionTransfers->setVisible(false);
trayActionTransfers->setData(tr("Transfers"));
} else if (trayIconTransfers == NULL) {
// Create the tray icon for transfers // Create the tray icon for transfers
trayIconTransfers = new QSystemTrayIcon(this); trayIconTransfers = new QSystemTrayIcon(this);
trayIconTransfers->setIcon(QIcon(":/images/ktorrent32.png")); trayIconTransfers->setIcon(QIcon(":/images/ktorrent32.png"));
connect(trayIconTransfers, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconTransfersClicked(QSystemTrayIcon::ActivationReason))); connect(trayIconTransfers, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconTransfersClicked(QSystemTrayIcon::ActivationReason)));
}
} else {
DELETE_ICON(trayIconTransfers);
}
/* call once */
updateMessages();
updateForums();
updateChannels(NOTIFY_TYPE_ADD);
privateChatChanged(NOTIFY_LIST_PRIVATE_INCOMING_CHAT, NOTIFY_TYPE_ADD);
// transfer
#undef DELETE_ICON
} }
/*static*/ void MainWindow::installGroupChatNotifier() /*static*/ void MainWindow::installGroupChatNotifier()
@ -430,6 +541,16 @@ void MainWindow::createTrayIcon()
} }
} }
/*static*/ void MainWindow::installNotifyIcons()
{
if (_instance == NULL) {
// nothing to do
return;
}
_instance->createNotifyIcons();
}
void MainWindow::displaySystrayMsg(const QString& title,const QString& msg) void MainWindow::displaySystrayMsg(const QString& title,const QString& msg)
{ {
trayIcon->showMessage(title, msg, QSystemTrayIcon::Information, 3000); trayIcon->showMessage(title, msg, QSystemTrayIcon::Information, 3000);
@ -446,16 +567,33 @@ void MainWindow::updateMessages()
messageAction->setIcon(QIcon(QPixmap(":/images/evolution.png"))) ; messageAction->setIcon(QIcon(QPixmap(":/images/evolution.png"))) ;
} }
if (newInboxCount && (Settings->getTrayNotifyFlags() & TRAYNOTIFY_MESSAGES)) { if (trayIconMessages) {
if (newInboxCount) {
if (newInboxCount > 1) { if (newInboxCount > 1) {
trayIconMessages->setToolTip(tr("RetroShare") + "\n" + tr("You have %1 new messages").arg(newInboxCount)); trayIconMessages->setToolTip("RetroShare\n" + tr("You have %1 new messages").arg(newInboxCount));
} else { } else {
trayIconMessages->setToolTip(tr("RetroShare") + "\n" + tr("You have %1 new message").arg(newInboxCount)); trayIconMessages->setToolTip("RetroShare\n" + tr("You have %1 new message").arg(newInboxCount));
} }
trayIconMessages->show(); trayIconMessages->show();
} else { } else {
trayIconMessages->hide(); trayIconMessages->hide();
} }
}
if (trayActionMessages) {
if (newInboxCount) {
if (newInboxCount > 1) {
trayActionMessages->setText(tr("%1 new messages").arg(newInboxCount));
} else {
trayActionMessages->setText(tr("%1 new message").arg(newInboxCount));
}
trayActionMessages->setVisible(true);
} else {
trayActionMessages->setVisible(false);
}
}
updateTrayCombine();
} }
void MainWindow::updateForums() void MainWindow::updateForums()
@ -470,16 +608,33 @@ void MainWindow::updateForums()
forumAction->setIcon(QIcon(IMAGE_FORUMS)) ; forumAction->setIcon(QIcon(IMAGE_FORUMS)) ;
} }
if (newMessageCount && (Settings->getTrayNotifyFlags() & TRAYNOTIFY_FORUMS)) { if (trayIconForums) {
if (newMessageCount) {
if (newMessageCount > 1) { if (newMessageCount > 1) {
trayIconForums->setToolTip(tr("RetroShare") + "\n" + tr("You have %1 new messages").arg(newMessageCount)); trayIconForums->setToolTip("RetroShare\n" + tr("You have %1 new messages").arg(newMessageCount));
} else { } else {
trayIconForums->setToolTip(tr("RetroShare") + "\n" + tr("You have %1 new message").arg(newMessageCount)); trayIconForums->setToolTip("RetroShare\n" + tr("You have %1 new message").arg(newMessageCount));
} }
trayIconForums->show(); trayIconForums->show();
} else { } else {
trayIconForums->hide(); trayIconForums->hide();
} }
}
if (trayActionForums) {
if (newMessageCount) {
if (newMessageCount > 1) {
trayActionForums->setText(tr("%1 new messages").arg(newMessageCount));
} else {
trayActionForums->setText(tr("%1 new message").arg(newMessageCount));
}
trayActionForums->setVisible(true);
} else {
trayActionForums->setVisible(false);
}
}
updateTrayCombine();
} }
void MainWindow::updateChannels(int type) void MainWindow::updateChannels(int type)
@ -494,16 +649,33 @@ void MainWindow::updateChannels(int type)
channelAction->setIcon(QIcon(IMAGE_CHANNELS)) ; channelAction->setIcon(QIcon(IMAGE_CHANNELS)) ;
} }
if (newMessageCount && (Settings->getTrayNotifyFlags() & TRAYNOTIFY_CHANNELS)) { if (trayIconChannels) {
if (newMessageCount) {
if (newMessageCount > 1) { if (newMessageCount > 1) {
trayIconChannels->setToolTip(tr("RetroShare") + "\n" + tr("You have %1 new messages").arg(newMessageCount)); trayIconChannels->setToolTip("RetroShare\n" + tr("You have %1 new messages").arg(newMessageCount));
} else { } else {
trayIconChannels->setToolTip(tr("RetroShare") + "\n" + tr("You have %1 new message").arg(newMessageCount)); trayIconChannels->setToolTip("RetroShare\n" + tr("You have %1 new message").arg(newMessageCount));
} }
trayIconChannels->show(); trayIconChannels->show();
} else { } else {
trayIconChannels->hide(); trayIconChannels->hide();
} }
}
if (trayActionChannels) {
if (newMessageCount) {
if (newMessageCount > 1) {
trayActionChannels->setText(tr("%1 new messages").arg(newMessageCount));
} else {
trayActionChannels->setText(tr("%1 new message").arg(newMessageCount));
}
trayActionChannels->setVisible(true);
} else {
trayActionChannels->setVisible(false);
}
}
updateTrayCombine();
} }
void MainWindow::updateTransfers(int count) void MainWindow::updateTransfers(int count)
@ -514,16 +686,58 @@ void MainWindow::updateTransfers(int count)
transferAction->setIcon(QIcon(IMAGE_TRANSFERS)) ; transferAction->setIcon(QIcon(IMAGE_TRANSFERS)) ;
} }
if (count && (Settings->getTrayNotifyFlags() & TRAYNOTIFY_TRANSFERS)) { if (trayIconTransfers) {
if (count) {
if (count > 1) { if (count > 1) {
trayIconTransfers->setToolTip(tr("RetroShare") + "\n" + tr("You have %1 completed downloads").arg(count)); trayIconTransfers->setToolTip("RetroShare\n" + tr("You have %1 completed downloads").arg(count));
} else { } else {
trayIconTransfers->setToolTip(tr("RetroShare") + "\n" + tr("You have %1 completed download").arg(count)); trayIconTransfers->setToolTip("RetroShare\n" + tr("You have %1 completed download").arg(count));
} }
trayIconTransfers->show(); trayIconTransfers->show();
} else { } else {
trayIconTransfers->hide(); trayIconTransfers->hide();
} }
}
if (trayActionTransfers) {
if (count) {
if (count > 1) {
trayActionTransfers->setText(tr("%1 completed downloads").arg(count));
} else {
trayActionTransfers->setText(tr("%1 completed download").arg(count));
}
trayActionTransfers->setVisible(true);
} else {
trayActionTransfers->setVisible(false);
}
}
updateTrayCombine();
}
void MainWindow::updateTrayCombine()
{
if (trayIconCombined) {
QMenu *trayMenu = trayIconCombined->contextMenu();
QList<QAction*> actions = trayMenu->actions();
bool visible = false;
QString toolTip;
QList<QAction*>::iterator actionIt;
for (actionIt = actions.begin(); actionIt != actions.end(); actionIt++) {
if ((*actionIt)->isVisible()) {
visible = true;
if (toolTip.isEmpty() == false) {
toolTip += "\r";
}
toolTip += (*actionIt)->data().toString() + ":" + (*actionIt)->text();
}
}
trayIconCombined->setToolTip(toolTip);
trayIconCombined->setVisible(visible);
}
} }
void MainWindow::updateStatus() void MainWindow::updateStatus()
@ -569,7 +783,7 @@ void MainWindow::updateStatus()
trayIcon->setIcon(QIcon(IMAGE_RETROSHARE)); trayIcon->setIcon(QIcon(IMAGE_RETROSHARE));
} }
QString tray = tr("RetroShare") + "\n" + tr("Down: %1 (kB/s)").arg(downKb, 0, 'f', 2) + " | " + tr("Up: %1 (kB/s)").arg(upKb, 0, 'f', 2) + "\n"; QString tray = "RetroShare\n" + tr("Down: %1 (kB/s)").arg(downKb, 0, 'f', 2) + " | " + tr("Up: %1 (kB/s)").arg(upKb, 0, 'f', 2) + "\n";
if (nOnlineCount == 1) { if (nOnlineCount == 1) {
tray += tr("%1 friend connected").arg(nOnlineCount); tray += tr("%1 friend connected").arg(nOnlineCount);
@ -589,12 +803,34 @@ void MainWindow::privateChatChanged(int list, int type)
/* than count the chat messages */ /* than count the chat messages */
int chatCount = rsMsgs->getPrivateChatQueueCount(true); int chatCount = rsMsgs->getPrivateChatQueueCount(true);
if (chatCount && (Settings->getTrayNotifyFlags() & TRAYNOTIFY_PRIVATECHAT)) { if (trayIconChat) {
if (chatCount) {
if (chatCount > 1) {
trayIconChat->setToolTip("RetroShare\n" + tr("You have %1 new messages").arg(chatCount));
} else {
trayIconChat->setToolTip("RetroShare\n" + tr("You have %1 new message").arg(chatCount));
}
trayIconChat->show(); trayIconChat->show();
} else { } else {
trayIconChat->hide(); trayIconChat->hide();
} }
} }
if (trayActionChat) {
if (chatCount) {
if (chatCount > 1) {
trayActionChat->setText(tr("%1 new messages").arg(chatCount));
} else {
trayActionChat->setText(tr("%1 new message").arg(chatCount));
}
trayActionChat->setVisible(true);
} else {
trayActionChat->setVisible(false);;
}
}
updateTrayCombine();
}
} }
void MainWindow::postModDirectories(bool update_local) void MainWindow::postModDirectories(bool update_local)

View File

@ -131,6 +131,7 @@ public:
PluginsPage* pluginsPage ; PluginsPage* pluginsPage ;
static void installGroupChatNotifier(); static void installGroupChatNotifier();
static void installNotifyIcons();
/* initialize widget with status informations, status constant stored in data or in Qt::UserRole */ /* initialize widget with status informations, status constant stored in data or in Qt::UserRole */
void initializeStatusObject(QObject *pObject, bool bConnect); void initializeStatusObject(QObject *pObject, bool bConnect);
@ -164,11 +165,13 @@ private slots:
void toggleVisibility(QSystemTrayIcon::ActivationReason e); void toggleVisibility(QSystemTrayIcon::ActivationReason e);
void toggleVisibilitycontextmenu(); void toggleVisibilitycontextmenu();
void trayIconMessagesClicked(QSystemTrayIcon::ActivationReason e);
void trayIconForumsClicked(QSystemTrayIcon::ActivationReason e); /* default parameter for connect with the actions of the combined systray icon */
void trayIconChannelsClicked(QSystemTrayIcon::ActivationReason e); void trayIconMessagesClicked(QSystemTrayIcon::ActivationReason e = QSystemTrayIcon::Trigger);
void trayIconChatClicked(QSystemTrayIcon::ActivationReason e); void trayIconForumsClicked(QSystemTrayIcon::ActivationReason e = QSystemTrayIcon::Trigger);
void trayIconTransfersClicked(QSystemTrayIcon::ActivationReason e); void trayIconChannelsClicked(QSystemTrayIcon::ActivationReason e = QSystemTrayIcon::Trigger);
void trayIconChatClicked(QSystemTrayIcon::ActivationReason e = QSystemTrayIcon::Trigger);
void trayIconTransfersClicked(QSystemTrayIcon::ActivationReason e = QSystemTrayIcon::Trigger);
/** Toolbar fns. */ /** Toolbar fns. */
void addFriend(); void addFriend();
@ -206,6 +209,8 @@ private:
void createActions(); void createActions();
void createTrayIcon(); void createTrayIcon();
void createNotifyIcons();
void updateTrayCombine();
static MainWindow *_instance; static MainWindow *_instance;
@ -231,13 +236,18 @@ private:
void loadStyleSheet(const QString &sheetName); void loadStyleSheet(const QString &sheetName);
QSystemTrayIcon *trayIcon; QSystemTrayIcon *trayIcon;
QSystemTrayIcon *trayIconCombined;
QSystemTrayIcon *trayIconMessages; QSystemTrayIcon *trayIconMessages;
QSystemTrayIcon *trayIconForums; QSystemTrayIcon *trayIconForums;
QSystemTrayIcon *trayIconChannels; QSystemTrayIcon *trayIconChannels;
QSystemTrayIcon *trayIconChat; QSystemTrayIcon *trayIconChat;
QSystemTrayIcon *trayIconTransfers; QSystemTrayIcon *trayIconTransfers;
QAction *trayActionMessages;
QAction *trayActionForums;
QAction *trayActionChannels;
QAction *trayActionChat;
QAction *trayActionTransfers;
QAction *toggleVisibilityAction, *toolAct; QAction *toggleVisibilityAction, *toolAct;
QMenu *trayMenu;
PeerStatus *peerstatus; PeerStatus *peerstatus;
NATStatus *natstatus; NATStatus *natstatus;

View File

@ -354,6 +354,7 @@
<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/rstray2.png</file>
<file>images/rstray_new.png</file>
<file>images/security-high-16.png</file> <file>images/security-high-16.png</file>
<file>images/security-high-48.png</file> <file>images/security-high-48.png</file>
<file>images/security-low-48.png</file> <file>images/security-low-48.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -114,6 +114,8 @@ NotifyPage::save(QString &errmsg)
traynotifyflags |= TRAYNOTIFY_FORUMS; traynotifyflags |= TRAYNOTIFY_FORUMS;
if (ui.trayNotify_Transfer->isChecked()) if (ui.trayNotify_Transfer->isChecked())
traynotifyflags |= TRAYNOTIFY_TRANSFERS; traynotifyflags |= TRAYNOTIFY_TRANSFERS;
if (ui.trayNotify_CombinedIcon->isChecked())
traynotifyflags |= TRAYNOTIFY_COMBINEDICON;
Settings->setNotifyFlags(notifyflags); Settings->setNotifyFlags(notifyflags);
Settings->setTrayNotifyFlags(traynotifyflags); Settings->setTrayNotifyFlags(traynotifyflags);
@ -122,6 +124,7 @@ NotifyPage::save(QString &errmsg)
Settings->setDisplayTrayGroupChat(ui.systray_GroupChat->isChecked()); Settings->setDisplayTrayGroupChat(ui.systray_GroupChat->isChecked());
MainWindow::installGroupChatNotifier(); MainWindow::installGroupChatNotifier();
MainWindow::installNotifyIcons();
Settings->setAddFeedsAtEnd(ui.addFeedsAtEnd->isChecked()); Settings->setAddFeedsAtEnd(ui.addFeedsAtEnd->isChecked());
@ -164,6 +167,7 @@ void NotifyPage::load()
ui.trayNotify_Channels->setChecked(traynotifyflags & TRAYNOTIFY_CHANNELS); ui.trayNotify_Channels->setChecked(traynotifyflags & TRAYNOTIFY_CHANNELS);
ui.trayNotify_Forums->setChecked(traynotifyflags & TRAYNOTIFY_FORUMS); ui.trayNotify_Forums->setChecked(traynotifyflags & TRAYNOTIFY_FORUMS);
ui.trayNotify_Transfer->setChecked(traynotifyflags & TRAYNOTIFY_TRANSFERS); ui.trayNotify_Transfer->setChecked(traynotifyflags & TRAYNOTIFY_TRANSFERS);
ui.trayNotify_CombinedIcon->setChecked(traynotifyflags & TRAYNOTIFY_COMBINEDICON);
ui.addFeedsAtEnd->setChecked(Settings->getAddFeedsAtEnd()); ui.addFeedsAtEnd->setChecked(Settings->getAddFeedsAtEnd());
} }

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>396</width> <width>408</width>
<height>425</height> <height>425</height>
</rect> </rect>
</property> </property>
@ -616,6 +616,20 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="trayNotify_CombinedIcon">
<property name="text">
<string>Combined icon</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>

View File

@ -32,12 +32,14 @@
#include "rsettings.h" #include "rsettings.h"
/* Defines for get/setTrayNotifyFlags */ /* Defines for get/setTrayNotifyFlags */
#define TRAYNOTIFY_PRIVATECHAT 0x01 #define TRAYNOTIFY_PRIVATECHAT 0x00000001
#define TRAYNOTIFY_MESSAGES 0x02 #define TRAYNOTIFY_MESSAGES 0x00000002
#define TRAYNOTIFY_CHANNELS 0x04 #define TRAYNOTIFY_CHANNELS 0x00000004
#define TRAYNOTIFY_FORUMS 0x08 #define TRAYNOTIFY_FORUMS 0x00000008
#define TRAYNOTIFY_TRANSFERS 0x10 #define TRAYNOTIFY_TRANSFERS 0x00000010
#define TRAYNOTIFY_ALL 0x1F #define TRAYNOTIFY_ALL 0x0000001F
#define TRAYNOTIFY_COMBINEDICON 0x80000000
//Forward declaration. //Forward declaration.
class QWidget; class QWidget;

View File

@ -5100,7 +5100,7 @@ p, li { white-space: pre-wrap; }
<context> <context>
<name>MainWindow</name> <name>MainWindow</name>
<message> <message>
<location filename="../gui/MainWindow.cpp" line="+202"/> <location filename="../gui/MainWindow.cpp" line="+214"/>
<source>Network</source> <source>Network</source>
<translation>Netzwerk</translation> <translation>Netzwerk</translation>
</message> </message>
@ -5111,26 +5111,50 @@ p, li { white-space: pre-wrap; }
</message> </message>
<message> <message>
<location line="+8"/> <location line="+8"/>
<location line="+283"/>
<source>Transfers</source> <source>Transfers</source>
<translation>Übertragungen</translation> <translation>Übertragungen</translation>
</message> </message>
<message> <message>
<location line="+8"/> <location line="-275"/>
<location line="+207"/>
<source>Messages</source> <source>Messages</source>
<translation>Nachrichten</translation> <translation>Nachrichten</translation>
</message> </message>
<message> <message>
<location line="+3"/> <location line="-204"/>
<location line="+238"/>
<source>Channels</source> <source>Channels</source>
<translation>Kanäle</translation> <translation>Kanäle</translation>
</message> </message>
<message> <message>
<location line="+4"/> <location line="-234"/>
<source>Blogs</source> <source>Blogs</source>
<translation type="unfinished">Blogs</translation> <translation type="unfinished">Blogs</translation>
</message> </message>
<message> <message>
<location line="+290"/> <location line="+251"/>
<source>Chat</source>
<translation>Chat</translation>
</message>
<message>
<location line="+94"/>
<location line="+41"/>
<location line="+41"/>
<location line="+154"/>
<source>%1 new messages</source>
<translation>%1 neue Nachrichten</translation>
</message>
<message>
<location line="-234"/>
<location line="+41"/>
<location line="+41"/>
<location line="+154"/>
<source>%1 new message</source>
<translation>%1 neue Nachricht</translation>
</message>
<message>
<location line="-132"/>
<source>You have %1 completed downloads</source> <source>You have %1 completed downloads</source>
<translation>Du hast %1 fertige Downloads</translation> <translation>Du hast %1 fertige Downloads</translation>
</message> </message>
@ -5140,7 +5164,17 @@ p, li { white-space: pre-wrap; }
<translation>Du hast %1 fertigen Download</translation> <translation>Du hast %1 fertigen Download</translation>
</message> </message>
<message> <message>
<location line="+51"/> <location line="+11"/>
<source>%1 completed downloads</source>
<translation>%1 fertige Downloads</translation>
</message>
<message>
<location line="+2"/>
<source>%1 completed download</source>
<translation>%1 fertigen Download</translation>
</message>
<message>
<location line="+79"/>
<source>Down: %1 (kB/s)</source> <source>Down: %1 (kB/s)</source>
<translation>Runter: %1 (kB/s)</translation> <translation>Runter: %1 (kB/s)</translation>
</message> </message>
@ -5155,7 +5189,7 @@ p, li { white-space: pre-wrap; }
<translation>%1 Freunde verbunden</translation> <translation>%1 Freunde verbunden</translation>
</message> </message>
<message> <message>
<location line="+655"/> <location line="+677"/>
<source>It seems to be an old RetroShare link. Please use copy instead.</source> <source>It seems to be an old RetroShare link. Please use copy instead.</source>
<translation>Es scheint ein alter RetroShare Link zu sein. Bitte kopiere den Link stattdessen.</translation> <translation>Es scheint ein alter RetroShare Link zu sein. Bitte kopiere den Link stattdessen.</translation>
</message> </message>
@ -5165,12 +5199,12 @@ p, li { white-space: pre-wrap; }
<translation>Link ist fehlerhaft.</translation> <translation>Link ist fehlerhaft.</translation>
</message> </message>
<message> <message>
<location line="-663"/> <location line="-685"/>
<source>%1 friend connected</source> <source>%1 friend connected</source>
<translation>%1 Freund verbunden</translation> <translation>%1 Freund verbunden</translation>
</message> </message>
<message> <message>
<location line="+296"/> <location line="+318"/>
<source>Internal Error</source> <source>Internal Error</source>
<translation>Interener Fehler</translation> <translation>Interener Fehler</translation>
</message> </message>
@ -5191,16 +5225,7 @@ p, li { white-space: pre-wrap; }
<translation>Zeigen</translation> <translation>Zeigen</translation>
</message> </message>
<message> <message>
<location line="-518"/> <location line="-748"/>
<location line="+65"/>
<location line="+2"/>
<location line="+22"/>
<location line="+2"/>
<location line="+22"/>
<location line="+2"/>
<location line="+18"/>
<location line="+2"/>
<location line="+51"/>
<source>RetroShare</source> <source>RetroShare</source>
<translation></translation> <translation></translation>
</message> </message>
@ -5231,7 +5256,7 @@ p, li { white-space: pre-wrap; }
<translation>Schnellstart Assistent</translation> <translation>Schnellstart Assistent</translation>
</message> </message>
<message> <message>
<location filename="../gui/MainWindow.cpp" line="-362"/> <location filename="../gui/MainWindow.cpp" line="-170"/>
<source>Search</source> <source>Search</source>
<translation>Suchen</translation> <translation>Suchen</translation>
</message> </message>
@ -5246,7 +5271,7 @@ p, li { white-space: pre-wrap; }
<translation>Messenger</translation> <translation>Messenger</translation>
</message> </message>
<message> <message>
<location filename="../gui/MainWindow.cpp" line="+144"/> <location filename="../gui/MainWindow.cpp" line="+138"/>
<source>Show/Hide</source> <source>Show/Hide</source>
<translation>Anzeigen/Verbergen</translation> <translation>Anzeigen/Verbergen</translation>
</message> </message>
@ -5256,21 +5281,23 @@ p, li { white-space: pre-wrap; }
<translation>&amp;Schliessen</translation> <translation>&amp;Schliessen</translation>
</message> </message>
<message> <message>
<location line="+70"/> <location line="+186"/>
<location line="+24"/> <location line="+41"/>
<location line="+24"/> <location line="+41"/>
<location line="+154"/>
<source>You have %1 new messages</source> <source>You have %1 new messages</source>
<translation>Du hast %1 neue Nachrichten</translation> <translation>Du hast %1 neue Nachrichten</translation>
</message> </message>
<message> <message>
<location line="-46"/> <location line="-234"/>
<location line="+24"/> <location line="+41"/>
<location line="+24"/> <location line="+41"/>
<location line="+154"/>
<source>You have %1 new message</source> <source>You have %1 new message</source>
<translation>Du hast %1 neue Nachricht</translation> <translation>Du hast %1 neue Nachricht</translation>
</message> </message>
<message> <message>
<location line="+330"/> <location line="+256"/>
<source>Bandwidth Graph</source> <source>Bandwidth Graph</source>
<translation>Bandbreiten-Graph</translation> <translation>Bandbreiten-Graph</translation>
</message> </message>
@ -5285,7 +5312,7 @@ p, li { white-space: pre-wrap; }
<translation>Schliessen</translation> <translation>Schliessen</translation>
</message> </message>
<message> <message>
<location filename="../gui/MainWindow.cpp" line="-456"/> <location filename="../gui/MainWindow.cpp" line="-686"/>
<source>Minimize</source> <source>Minimize</source>
<translation>Minimieren</translation> <translation>Minimieren</translation>
</message> </message>
@ -5295,7 +5322,7 @@ p, li { white-space: pre-wrap; }
<translation>Maximieren</translation> <translation>Maximieren</translation>
</message> </message>
<message> <message>
<location line="-142"/> <location line="-136"/>
<source>Links Cloud</source> <source>Links Cloud</source>
<translation>Verknüpfungs-Wolke</translation> <translation>Verknüpfungs-Wolke</translation>
</message> </message>
@ -5310,7 +5337,7 @@ p, li { white-space: pre-wrap; }
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../gui/MainWindow.cpp" line="+589"/> <location filename="../gui/MainWindow.cpp" line="+813"/>
<source>Help</source> <source>Help</source>
<translation>Hilfe</translation> <translation>Hilfe</translation>
</message> </message>
@ -5320,17 +5347,18 @@ p, li { white-space: pre-wrap; }
<translation>Über</translation> <translation>Über</translation>
</message> </message>
<message> <message>
<location filename="../gui/MainWindow.cpp" line="-610"/> <location filename="../gui/MainWindow.cpp" line="-834"/>
<location line="+213"/>
<source>Forums</source> <source>Forums</source>
<translation>Foren</translation> <translation>Foren</translation>
</message> </message>
<message> <message>
<location line="-72"/> <location line="-285"/>
<source>RetroShare %1 a secure decentralised communication platform</source> <source>RetroShare %1 a secure decentralised communication platform</source>
<translation>RetroShare %1 eine sichere und dezentralisierte Kommunikationsplattform</translation> <translation>RetroShare %1 eine sichere und dezentralisierte Kommunikationsplattform</translation>
</message> </message>
<message> <message>
<location line="+676"/> <location line="+900"/>
<source>Open Messages</source> <source>Open Messages</source>
<translation>Öffne Nachrichten</translation> <translation>Öffne Nachrichten</translation>
</message> </message>
@ -5340,12 +5368,12 @@ p, li { white-space: pre-wrap; }
<translation>Anwendungen</translation> <translation>Anwendungen</translation>
</message> </message>
<message> <message>
<location line="-597"/> <location line="-821"/>
<source>Plugins</source> <source>Plugins</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location line="+613"/> <location line="+837"/>
<source>Do you really want to exit RetroShare ?</source> <source>Do you really want to exit RetroShare ?</source>
<translation>Willst Du RetroShare wirklich beenden?</translation> <translation>Willst Du RetroShare wirklich beenden?</translation>
</message> </message>
@ -5355,7 +5383,7 @@ p, li { white-space: pre-wrap; }
<translation>Wirklich beenden?</translation> <translation>Wirklich beenden?</translation>
</message> </message>
<message> <message>
<location line="-507"/> <location line="-737"/>
<source>Low disk space warning</source> <source>Low disk space warning</source>
<translation>Wenig Festplatenspeicher</translation> <translation>Wenig Festplatenspeicher</translation>
</message> </message>
@ -7017,12 +7045,17 @@ p, li { white-space: pre-wrap; }
</message> </message>
<message> <message>
<location line="+7"/> <location line="+7"/>
<location line="+53"/> <location line="+67"/>
<source>Download completed</source> <source>Download completed</source>
<translation>Download fertig</translation> <translation>Download fertig</translation>
</message> </message>
<message> <message>
<location line="-26"/> <location line="-53"/>
<source>Combined icon</source>
<translation>Kombiniertes Icon</translation>
</message>
<message>
<location line="+27"/>
<source>Toasters</source> <source>Toasters</source>
<translation></translation> <translation></translation>
</message> </message>
@ -7067,7 +7100,7 @@ p, li { white-space: pre-wrap; }
<translation>Zeige Systemabschnitts-Nachricht an</translation> <translation>Zeige Systemabschnitts-Nachricht an</translation>
</message> </message>
<message> <message>
<location line="-143"/> <location line="-157"/>
<source>Add feeds at end</source> <source>Add feeds at end</source>
<translation>Feeds am Ende anfügen</translation> <translation>Feeds am Ende anfügen</translation>
</message> </message>