Removed the single notify systray icon (combined icon) and combined it with the normal RetroShare systray icon.

The user can choose, which notify icon is shown as single icon in systray or with the normal RetroShare icon.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4442 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2011-07-13 19:24:33 +00:00
parent fc05314af0
commit 9992d6ae12
13 changed files with 298 additions and 191 deletions

View File

@ -166,7 +166,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
m_bStatusLoadDone = false; m_bStatusLoadDone = false;
isIdle = false; isIdle = false;
trayIconCombined = NULL; notifyMenu = NULL;
trayIconMessages = NULL; trayIconMessages = NULL;
trayIconForums = NULL; trayIconForums = NULL;
trayIconChannels = NULL; trayIconChannels = NULL;
@ -258,7 +258,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
forumAction = createPageAction(QIcon(IMAGE_FORUMS), tr("Forums"), grp)); forumAction = createPageAction(QIcon(IMAGE_FORUMS), tr("Forums"), grp));
std::cerr << "Looking for interfaces in existing plugins:" << std::endl; std::cerr << "Looking for interfaces in existing plugins:" << std::endl;
for(uint32_t i = 0;i<rsPlugins->nbPlugins();++i) for(int i = 0;i<rsPlugins->nbPlugins();++i)
{ {
QIcon icon ; QIcon icon ;
@ -397,8 +397,13 @@ void MainWindow::createTrayIcon()
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()));
QMenu *pStatusMenu = trayMenu->addMenu(tr("Status")); /* Create status menu */
initializeStatusObject(pStatusMenu, true); QMenu *statusMenu = trayMenu->addMenu(tr("Status"));
initializeStatusObject(statusMenu, true);
/* Create notify menu */
notifyMenu = trayMenu->addMenu(tr("Notify"));
notifyMenu->menuAction()->setVisible(false);
trayMenu->addSeparator(); trayMenu->addSeparator();
trayMenu->addAction(QIcon(IMAGE_RSM16), tr("Open Messenger"), this, SLOT(showMessengerWindow())); trayMenu->addAction(QIcon(IMAGE_RSM16), tr("Open Messenger"), this, SLOT(showMessengerWindow()));
@ -434,44 +439,25 @@ void MainWindow::createTrayIcon()
void MainWindow::createNotifyIcons() void MainWindow::createNotifyIcons()
{ {
#define DELETE_ICON(x) if (x) { delete(x); x = NULL; } #define DELETE_OBJECT(x) if (x) { delete(x); x = NULL; }
int notifyFlag = Settings->getTrayNotifyFlags(); int notifyFlag = Settings->getTrayNotifyFlags();
QMenu *trayMenu = NULL; /* Delete notify actions */
DELETE_OBJECT(trayActionMessages);
/* Delete combined systray icon and rebuild it */ DELETE_OBJECT(trayActionForums);
trayActionMessages = NULL; DELETE_OBJECT(trayActionChannels);
trayActionForums = NULL; DELETE_OBJECT(trayActionChat);
trayActionChannels = NULL; DELETE_OBJECT(trayActionTransfers);
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 */ /* Create systray icons or actions */
if (notifyFlag & TRAYNOTIFY_MESSAGES) { if (notifyFlag & TRAYNOTIFY_MESSAGES) {
if (trayMenu) { if (notifyFlag & TRAYNOTIFY_MESSAGES_COMBINED) {
DELETE_ICON(trayIconMessages); DELETE_OBJECT(trayIconMessages);
trayActionMessages = trayMenu->addAction(QIcon(":/images/newmsg.png"), "", this, SLOT(trayIconMessagesClicked())); trayActionMessages = notifyMenu->addAction(QIcon(":/images/newmsg.png"), "", this, SLOT(trayIconMessagesClicked()));
trayActionMessages->setVisible(false); trayActionMessages->setVisible(false);
trayActionMessages->setData(tr("Messages")); // trayActionMessages->setData(tr("Messages"));
} else if (trayIconMessages == NULL) { } else if (trayIconMessages == NULL) {
// Create the tray icon for messages // Create the tray icon for messages
trayIconMessages = new QSystemTrayIcon(this); trayIconMessages = new QSystemTrayIcon(this);
@ -479,16 +465,17 @@ void MainWindow::createNotifyIcons()
connect(trayIconMessages, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconMessagesClicked(QSystemTrayIcon::ActivationReason))); connect(trayIconMessages, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconMessagesClicked(QSystemTrayIcon::ActivationReason)));
} }
} else { } else {
DELETE_ICON(trayIconMessages); DELETE_OBJECT(trayIconMessages);
DELETE_OBJECT(trayActionMessages);
} }
if (notifyFlag & TRAYNOTIFY_FORUMS) { if (notifyFlag & TRAYNOTIFY_FORUMS) {
if (trayMenu) { if (notifyFlag & TRAYNOTIFY_FORUMS_COMBINED) {
DELETE_ICON(trayIconForums); DELETE_OBJECT(trayIconForums);
trayActionForums = trayMenu->addAction(QIcon(":/images/konversation16.png"), "", this, SLOT(trayIconForumsClicked())); trayActionForums = notifyMenu->addAction(QIcon(":/images/konversation16.png"), "", this, SLOT(trayIconForumsClicked()));
trayActionForums->setVisible(false); trayActionForums->setVisible(false);
trayActionForums->setData(tr("Forums")); // trayActionForums->setData(tr("Forums"));
} else if (trayIconForums == NULL) { } else if (trayIconForums == NULL) {
// Create the tray icon for forums // Create the tray icon for forums
trayIconForums = new QSystemTrayIcon(this); trayIconForums = new QSystemTrayIcon(this);
@ -496,16 +483,17 @@ void MainWindow::createNotifyIcons()
connect(trayIconForums, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconForumsClicked(QSystemTrayIcon::ActivationReason))); connect(trayIconForums, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconForumsClicked(QSystemTrayIcon::ActivationReason)));
} }
} else { } else {
DELETE_ICON(trayIconForums); DELETE_OBJECT(trayIconForums);
DELETE_OBJECT(trayActionForums);
} }
if (notifyFlag & TRAYNOTIFY_CHANNELS) { if (notifyFlag & TRAYNOTIFY_CHANNELS) {
if (trayMenu) { if (notifyFlag & TRAYNOTIFY_CHANNELS_COMBINED) {
DELETE_ICON(trayIconChannels); DELETE_OBJECT(trayIconChannels);
trayActionChannels = trayMenu->addAction(QIcon(":/images/channels16.png"), "", this, SLOT(trayIconChannelsClicked())); trayActionChannels = notifyMenu->addAction(QIcon(":/images/channels16.png"), "", this, SLOT(trayIconChannelsClicked()));
trayActionChannels->setVisible(false); trayActionChannels->setVisible(false);
trayActionChannels->setData(tr("Channels")); // trayActionChannels->setData(tr("Channels"));
} else if (trayIconChannels == NULL) { } else if (trayIconChannels == NULL) {
// Create the tray icon for channels // Create the tray icon for channels
trayIconChannels = new QSystemTrayIcon(this); trayIconChannels = new QSystemTrayIcon(this);
@ -513,16 +501,17 @@ void MainWindow::createNotifyIcons()
connect(trayIconChannels, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconChannelsClicked(QSystemTrayIcon::ActivationReason))); connect(trayIconChannels, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconChannelsClicked(QSystemTrayIcon::ActivationReason)));
} }
} else { } else {
DELETE_ICON(trayIconChannels); DELETE_OBJECT(trayIconChannels);
DELETE_OBJECT(trayActionChannels);
} }
if (notifyFlag & TRAYNOTIFY_PRIVATECHAT) { if (notifyFlag & TRAYNOTIFY_PRIVATECHAT) {
if (trayMenu) { if (notifyFlag & TRAYNOTIFY_PRIVATECHAT_COMBINED) {
DELETE_ICON(trayIconChat); DELETE_OBJECT(trayIconChat);
trayActionChat = trayMenu->addAction(QIcon(":/images/chat.png"), "", this, SLOT(trayIconChatClicked())); trayActionChat = notifyMenu->addAction(QIcon(":/images/chat.png"), "", this, SLOT(trayIconChatClicked()));
trayActionChat->setVisible(false); trayActionChat->setVisible(false);
trayActionChat->setData(tr("Chat")); // trayActionChat->setData(tr("Chat"));
} else if (trayIconChat == NULL) { } else if (trayIconChat == NULL) {
// Create the tray icon for chat // Create the tray icon for chat
trayIconChat = new QSystemTrayIcon(this); trayIconChat = new QSystemTrayIcon(this);
@ -530,16 +519,17 @@ void MainWindow::createNotifyIcons()
connect(trayIconChat, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconChatClicked(QSystemTrayIcon::ActivationReason))); connect(trayIconChat, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconChatClicked(QSystemTrayIcon::ActivationReason)));
} }
} else { } else {
DELETE_ICON(trayIconChat); DELETE_OBJECT(trayIconChat);
DELETE_OBJECT(trayActionChat);
} }
if (notifyFlag & TRAYNOTIFY_TRANSFERS) { if (notifyFlag & TRAYNOTIFY_TRANSFERS) {
if (trayMenu) { if (notifyFlag & TRAYNOTIFY_TRANSFERS_COMBINED) {
DELETE_ICON(trayIconTransfers); DELETE_OBJECT(trayIconTransfers);
trayActionTransfers = trayMenu->addAction(QIcon(":/images/ktorrent32.png"), "", this, SLOT(trayIconTransfersClicked())); trayActionTransfers = notifyMenu->addAction(QIcon(":/images/ktorrent32.png"), "", this, SLOT(trayIconTransfersClicked()));
trayActionTransfers->setVisible(false); trayActionTransfers->setVisible(false);
trayActionTransfers->setData(tr("Transfers")); // trayActionTransfers->setData(tr("Transfers"));
} else if (trayIconTransfers == NULL) { } else if (trayIconTransfers == NULL) {
// Create the tray icon for transfers // Create the tray icon for transfers
trayIconTransfers = new QSystemTrayIcon(this); trayIconTransfers = new QSystemTrayIcon(this);
@ -547,7 +537,8 @@ void MainWindow::createNotifyIcons()
connect(trayIconTransfers, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconTransfersClicked(QSystemTrayIcon::ActivationReason))); connect(trayIconTransfers, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconTransfersClicked(QSystemTrayIcon::ActivationReason)));
} }
} else { } else {
DELETE_ICON(trayIconTransfers); DELETE_OBJECT(trayIconTransfers);
DELETE_OBJECT(trayActionTransfers);
} }
/* call once */ /* call once */
@ -557,7 +548,7 @@ void MainWindow::createNotifyIcons()
privateChatChanged(NOTIFY_LIST_PRIVATE_INCOMING_CHAT, NOTIFY_TYPE_ADD); privateChatChanged(NOTIFY_LIST_PRIVATE_INCOMING_CHAT, NOTIFY_TYPE_ADD);
// transfer // transfer
#undef DELETE_ICON #undef DELETE_OBJECT
} }
/*static*/ void MainWindow::installGroupChatNotifier() /*static*/ void MainWindow::installGroupChatNotifier()
@ -614,6 +605,7 @@ void MainWindow::updateMessages()
} }
if (trayActionMessages) { if (trayActionMessages) {
trayActionMessages->setData(newInboxCount);
if (newInboxCount) { if (newInboxCount) {
if (newInboxCount > 1) { if (newInboxCount > 1) {
trayActionMessages->setText(tr("%1 new messages").arg(newInboxCount)); trayActionMessages->setText(tr("%1 new messages").arg(newInboxCount));
@ -655,6 +647,7 @@ void MainWindow::updateForums()
} }
if (trayActionForums) { if (trayActionForums) {
trayActionForums->setData(newMessageCount);
if (newMessageCount) { if (newMessageCount) {
if (newMessageCount > 1) { if (newMessageCount > 1) {
trayActionForums->setText(tr("%1 new messages").arg(newMessageCount)); trayActionForums->setText(tr("%1 new messages").arg(newMessageCount));
@ -696,6 +689,7 @@ void MainWindow::updateChannels(int type)
} }
if (trayActionChannels) { if (trayActionChannels) {
trayActionChannels->setData(newMessageCount);
if (newMessageCount) { if (newMessageCount) {
if (newMessageCount > 1) { if (newMessageCount > 1) {
trayActionChannels->setText(tr("%1 new messages").arg(newMessageCount)); trayActionChannels->setText(tr("%1 new messages").arg(newMessageCount));
@ -733,6 +727,7 @@ void MainWindow::updateTransfers(int count)
} }
if (trayActionTransfers) { if (trayActionTransfers) {
trayActionTransfers->setData(count);
if (count) { if (count) {
if (count > 1) { if (count > 1) {
trayActionTransfers->setText(tr("%1 completed downloads").arg(count)); trayActionTransfers->setText(tr("%1 completed downloads").arg(count));
@ -750,28 +745,33 @@ void MainWindow::updateTransfers(int count)
void MainWindow::updateTrayCombine() void MainWindow::updateTrayCombine()
{ {
if (trayIconCombined) { notifyToolTip.clear();
QMenu *trayMenu = trayIconCombined->contextMenu();
QList<QAction*> actions = trayMenu->actions();
bool visible = false; bool visible = false;
QString toolTip;
if (notifyMenu) {
QList<QAction*> actions = notifyMenu->actions();
int count = 0;
QList<QAction*>::iterator actionIt; QList<QAction*>::iterator actionIt;
for (actionIt = actions.begin(); actionIt != actions.end(); actionIt++) { for (actionIt = actions.begin(); actionIt != actions.end(); actionIt++) {
if ((*actionIt)->isVisible()) { if ((*actionIt)->isVisible()) {
visible = true; visible = true;
if (toolTip.isEmpty() == false) {
toolTip += "\r"; count += (*actionIt)->data().toInt();
} // ToolTip is too long to show all services
toolTip += (*actionIt)->data().toString() + ":" + (*actionIt)->text(); // if (notifyToolTip.isEmpty() == false) {
// notifyToolTip += "\r";
// }
// notifyToolTip += (*actionIt)->data().toString() + ":" + (*actionIt)->text();
} }
if (visible) {
notifyToolTip = ((count == 1) ? tr("%1 new message") : tr("%1 new messages")).arg(count);
} }
trayIconCombined->setToolTip(toolTip);
trayIconCombined->setVisible(visible);
} }
} }
notifyMenu->menuAction()->setVisible(visible);
}
void MainWindow::updateStatus() void MainWindow::updateStatus()
{ {
@ -803,23 +803,40 @@ void MainWindow::updateStatus()
discstatus->update(); discstatus->update();
} }
QString trayIconResource;
if (nOnlineCount == 0) if (nOnlineCount == 0)
{ {
trayIcon->setIcon(QIcon(IMAGE_NOONLINE)); trayIconResource = IMAGE_NOONLINE;
} }
else if (nOnlineCount < 2) else if (nOnlineCount < 2)
{ {
trayIcon->setIcon(QIcon(IMAGE_ONEONLINE)); trayIconResource = IMAGE_ONEONLINE;
} }
else if (nOnlineCount < 3) else if (nOnlineCount < 3)
{ {
trayIcon->setIcon(QIcon(IMAGE_TWOONLINE)); trayIconResource = IMAGE_TWOONLINE;
} }
else else
{ {
trayIcon->setIcon(QIcon(IMAGE_RETROSHARE)); trayIconResource = IMAGE_RETROSHARE;
} }
QIcon icon;
if (notifyMenu && notifyMenu->menuAction()->isVisible()) {
QPixmap trayImage(trayIconResource);
QPixmap overlayImage(":/images/rstray_star.png");
QPainter painter(&trayImage);
painter.drawPixmap(0, 0, overlayImage);
icon.addPixmap(trayImage);
} else {
icon = QIcon(trayIconResource);
}
trayIcon->setIcon(icon);
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"; 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) {
@ -830,6 +847,10 @@ void MainWindow::updateStatus()
tray += "\n" + nameAndLocation; tray += "\n" + nameAndLocation;
if (!notifyToolTip.isEmpty()) {
tray += "\n";
tray += notifyToolTip;
}
trayIcon->setToolTip(tray); trayIcon->setToolTip(tray);
} }
@ -856,6 +877,7 @@ void MainWindow::privateChatChanged(int list, int type)
} }
if (trayActionChat) { if (trayActionChat) {
trayActionChat->setData(chatCount);
if (chatCount) { if (chatCount) {
if (chatCount > 1) { if (chatCount > 1) {
trayActionChat->setText(tr("%1 new messages").arg(chatCount)); trayActionChat->setText(tr("%1 new messages").arg(chatCount));

View File

@ -226,12 +226,13 @@ private:
QString nameAndLocation; QString nameAndLocation;
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;
QMenu *notifyMenu;
QString notifyToolTip;
QAction *trayActionMessages; QAction *trayActionMessages;
QAction *trayActionForums; QAction *trayActionForums;
QAction *trayActionChannels; QAction *trayActionChannels;

View File

@ -356,7 +356,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/rstray_star.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.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

View File

@ -36,6 +36,12 @@ NotifyPage::NotifyPage(QWidget * parent, Qt::WFlags flags)
/* Invoke the Qt Designer generated object setup routine */ /* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this); ui.setupUi(this);
connect(ui.trayNotify_PrivateChat, SIGNAL(toggled(bool)), this, SLOT(privatChatToggled()));
connect(ui.trayNotify_Messages, SIGNAL(toggled(bool)), this, SLOT(privatChatToggled()));
connect(ui.trayNotify_Channels, SIGNAL(toggled(bool)), this, SLOT(privatChatToggled()));
connect(ui.trayNotify_Forums, SIGNAL(toggled(bool)), this, SLOT(privatChatToggled()));
connect(ui.trayNotify_Transfer, SIGNAL(toggled(bool)), this, SLOT(privatChatToggled()));
/* Hide platform specific features */ /* Hide platform specific features */
#ifdef Q_WS_WIN #ifdef Q_WS_WIN
@ -96,8 +102,17 @@ 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; if (ui.trayNotify_PrivateChatCombined->isChecked())
traynotifyflags |= TRAYNOTIFY_PRIVATECHAT_COMBINED;
if (ui.trayNotify_MessagesCombined->isChecked())
traynotifyflags |= TRAYNOTIFY_MESSAGES_COMBINED;
if (ui.trayNotify_ChannelsCombined->isChecked())
traynotifyflags |= TRAYNOTIFY_CHANNELS_COMBINED;
if (ui.trayNotify_ForumsCombined->isChecked())
traynotifyflags |= TRAYNOTIFY_FORUMS_COMBINED;
if (ui.trayNotify_TransferCombined->isChecked())
traynotifyflags |= TRAYNOTIFY_TRANSFERS_COMBINED;
Settings->setNotifyFlags(notifyflags); Settings->setNotifyFlags(notifyflags);
Settings->setTrayNotifyFlags(traynotifyflags); Settings->setTrayNotifyFlags(traynotifyflags);
@ -154,7 +169,12 @@ 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.trayNotify_PrivateChatCombined->setChecked(traynotifyflags & TRAYNOTIFY_PRIVATECHAT_COMBINED);
ui.trayNotify_MessagesCombined->setChecked(traynotifyflags & TRAYNOTIFY_MESSAGES_COMBINED);
ui.trayNotify_ChannelsCombined->setChecked(traynotifyflags & TRAYNOTIFY_CHANNELS_COMBINED);
ui.trayNotify_ForumsCombined->setChecked(traynotifyflags & TRAYNOTIFY_FORUMS_COMBINED);
ui.trayNotify_TransferCombined->setChecked(traynotifyflags & TRAYNOTIFY_TRANSFERS_COMBINED);
ui.addFeedsAtEnd->setChecked(Settings->getAddFeedsAtEnd()); ui.addFeedsAtEnd->setChecked(Settings->getAddFeedsAtEnd());
@ -180,4 +200,26 @@ void NotifyPage::load()
QPoint margin = Settings->getToasterMargin(); QPoint margin = Settings->getToasterMargin();
ui.spinBoxToasterXMargin->setValue(margin.x()); ui.spinBoxToasterXMargin->setValue(margin.x());
ui.spinBoxToasterYMargin->setValue(margin.y()); ui.spinBoxToasterYMargin->setValue(margin.y());
privatChatToggled();
}
void NotifyPage::privatChatToggled()
{
QList<QPair<QCheckBox*, QCheckBox*> > checkboxes;
checkboxes << qMakePair(ui.trayNotify_PrivateChat, ui.trayNotify_PrivateChatCombined)
<< qMakePair(ui.trayNotify_Messages, ui.trayNotify_MessagesCombined)
<< qMakePair(ui.trayNotify_Channels, ui.trayNotify_ChannelsCombined)
<< qMakePair(ui.trayNotify_Forums, ui.trayNotify_ForumsCombined)
<< qMakePair(ui.trayNotify_Transfer, ui.trayNotify_TransferCombined);
QList<QPair<QCheckBox*, QCheckBox*> >::iterator checkboxIt;
for (checkboxIt = checkboxes.begin(); checkboxIt != checkboxes.end(); checkboxIt++) {
if (checkboxIt->first->isChecked()) {
checkboxIt->second->setEnabled(true);
} else {
checkboxIt->second->setChecked(false);
checkboxIt->second->setEnabled(false);
}
}
} }

View File

@ -40,6 +40,9 @@ public:
/** Loads the settings for this page */ /** Loads the settings for this page */
void load(); void load();
private slots:
void privatChatToggled();
private: private:
/** Qt Designer generated object */ /** Qt Designer generated object */
Ui::NotifyPage ui; Ui::NotifyPage ui;

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>408</width> <width>427</width>
<height>425</height> <height>425</height>
</rect> </rect>
</property> </property>
@ -582,54 +582,79 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_5"> <layout class="QVBoxLayout" name="verticalLayout_5">
<item> <item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QCheckBox" name="trayNotify_PrivateChat"> <widget class="QCheckBox" name="trayNotify_PrivateChat">
<property name="text"> <property name="text">
<string>Private Message</string> <string>Private Message</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="1" column="0">
<widget class="QCheckBox" name="trayNotify_Messages"> <widget class="QCheckBox" name="trayNotify_Messages">
<property name="text"> <property name="text">
<string>Message</string> <string>Message</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="2" column="0">
<widget class="QCheckBox" name="trayNotify_Channels"> <widget class="QCheckBox" name="trayNotify_Channels">
<property name="text"> <property name="text">
<string>Channel Post</string> <string>Channel Post</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="3" column="0">
<widget class="QCheckBox" name="trayNotify_Forums"> <widget class="QCheckBox" name="trayNotify_Forums">
<property name="text"> <property name="text">
<string>Forum Post</string> <string>Forum Post</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="4" column="0">
<widget class="QCheckBox" name="trayNotify_Transfer"> <widget class="QCheckBox" name="trayNotify_Transfer">
<property name="text"> <property name="text">
<string>Download completed</string> <string>Download completed</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="0" column="1">
<widget class="Line" name="line_2"> <widget class="QCheckBox" name="trayNotify_PrivateChatCombined">
<property name="orientation"> <property name="text">
<enum>Qt::Horizontal</enum> <string>Combined</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="1" column="1">
<widget class="QCheckBox" name="trayNotify_CombinedIcon"> <widget class="QCheckBox" name="trayNotify_MessagesCombined">
<property name="text"> <property name="text">
<string>Combined icon</string> <string>Combined</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1">
<widget class="QCheckBox" name="trayNotify_ChannelsCombined">
<property name="text">
<string>Combined</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="trayNotify_ForumsCombined">
<property name="text">
<string>Combined</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="trayNotify_TransferCombined">
<property name="text">
<string>Combined</string>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>

View File

@ -309,7 +309,7 @@ void RshareSettings::setNotifyFlags(uint flags)
uint RshareSettings::getTrayNotifyFlags() uint RshareSettings::getTrayNotifyFlags()
{ {
return value(SETTING_TRAYNOTIFY_FLAGS, TRAYNOTIFY_ALL).toUInt(); return value(SETTING_TRAYNOTIFY_FLAGS, TRAYNOTIFY_PRIVATECHAT | TRAYNOTIFY_MESSAGES | TRAYNOTIFY_CHANNELS | TRAYNOTIFY_FORUMS | TRAYNOTIFY_TRANSFERS).toUInt();
} }
void RshareSettings::setTrayNotifyFlags(uint flags) void RshareSettings::setTrayNotifyFlags(uint flags)

View File

@ -36,9 +36,12 @@
#define TRAYNOTIFY_CHANNELS 0x00000004 #define TRAYNOTIFY_CHANNELS 0x00000004
#define TRAYNOTIFY_FORUMS 0x00000008 #define TRAYNOTIFY_FORUMS 0x00000008
#define TRAYNOTIFY_TRANSFERS 0x00000010 #define TRAYNOTIFY_TRANSFERS 0x00000010
#define TRAYNOTIFY_ALL 0x0000001F
#define TRAYNOTIFY_COMBINEDICON 0x80000000 #define TRAYNOTIFY_PRIVATECHAT_COMBINED 0x00000020
#define TRAYNOTIFY_MESSAGES_COMBINED 0x00000040
#define TRAYNOTIFY_CHANNELS_COMBINED 0x00000080
#define TRAYNOTIFY_FORUMS_COMBINED 0x00000100
#define TRAYNOTIFY_TRANSFERS_COMBINED 0x00000200
#define STATUSBAR_DISC 0x00000001 #define STATUSBAR_DISC 0x00000001

View File

@ -5894,55 +5894,58 @@ p, li { white-space: pre-wrap; }
</message> </message>
<message> <message>
<location line="+8"/> <location line="+8"/>
<location line="+302"/>
<source>Transfers</source> <source>Transfers</source>
<translation>Übertragungen</translation> <translation>Übertragungen</translation>
</message> </message>
<message> <message>
<location line="-294"/> <location line="+8"/>
<location line="+226"/>
<source>Messages</source> <source>Messages</source>
<translation>Nachrichten</translation> <translation>Nachrichten</translation>
</message> </message>
<message> <message>
<location line="-223"/> <location line="+3"/>
<location line="+257"/>
<source>Channels</source> <source>Channels</source>
<translation>Kanäle</translation> <translation>Kanäle</translation>
</message> </message>
<message> <message>
<location line="-254"/> <location line="+3"/>
<source>Blogs</source> <source>Blogs</source>
<translation>Blogs</translation> <translation>Blogs</translation>
</message> </message>
<message> <message>
<location line="+154"/> <location line="+151"/>
<source>Notify</source>
<translation>Meldungen</translation>
</message>
<message>
<location line="+8"/>
<source>Dht Details</source> <source>Dht Details</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location line="+117"/>
<source>Chat</source> <source>Chat</source>
<translation>Chat</translation> <translation type="obsolete">Chat</translation>
</message> </message>
<message> <message>
<location line="+94"/> <location line="+217"/>
<location line="+41"/> <location line="+42"/>
<location line="+41"/> <location line="+42"/>
<location line="+160"/> <location line="+73"/>
<location line="+115"/>
<source>%1 new messages</source> <source>%1 new messages</source>
<translation>%1 neue Nachrichten</translation> <translation>%1 neue Nachrichten</translation>
</message> </message>
<message> <message>
<location line="-240"/> <location line="-270"/>
<location line="+41"/> <location line="+42"/>
<location line="+41"/> <location line="+42"/>
<location line="+160"/> <location line="+71"/>
<location line="+117"/>
<source>%1 new message</source> <source>%1 new message</source>
<translation>%1 neue Nachricht</translation> <translation>%1 neue Nachricht</translation>
</message> </message>
<message> <message>
<location line="-138"/> <location line="-166"/>
<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>
@ -5952,17 +5955,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="+11"/> <location line="+12"/>
<source>%1 completed downloads</source> <source>%1 completed downloads</source>
<translation>%1 fertige Downloads</translation> <translation>%1 fertige Downloads</translation>
</message> </message>
<message> <message>
<location line="+2"/> <location line="+2"/>
<source>%1 completed download</source> <source>%1 completed download</source>
<translation>%1 fertigen Download</translation> <translation>%1 fertiger Download</translation>
</message> </message>
<message> <message>
<location line="+83"/> <location line="+105"/>
<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>
@ -5977,7 +5980,7 @@ p, li { white-space: pre-wrap; }
<translation>%1 Freunde verbunden</translation> <translation>%1 Freunde verbunden</translation>
</message> </message>
<message> <message>
<location line="+659"/> <location line="+664"/>
<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>
@ -5987,23 +5990,23 @@ p, li { white-space: pre-wrap; }
<translation>Link ist fehlerhaft.</translation> <translation>Link ist fehlerhaft.</translation>
</message> </message>
<message> <message>
<location line="-667"/> <location line="-672"/>
<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="+300"/> <location line="+305"/>
<source>Internal Error</source> <source>Internal Error</source>
<translation>Interener Fehler</translation> <translation>Interener Fehler</translation>
</message> </message>
<message> <message>
<location filename="../gui/MainWindow.ui" line="+88"/> <location filename="../gui/MainWindow.ui" line="+88"/>
<location filename="../gui/MainWindow.cpp" line="-712"/> <location filename="../gui/MainWindow.cpp" line="-748"/>
<source>Options</source> <source>Options</source>
<translation>Optionen</translation> <translation>Optionen</translation>
</message> </message>
<message> <message>
<location filename="../gui/MainWindow.cpp" line="+745"/> <location filename="../gui/MainWindow.cpp" line="+781"/>
<source>Hide</source> <source>Hide</source>
<translation>Verbergen</translation> <translation>Verbergen</translation>
</message> </message>
@ -6013,7 +6016,7 @@ p, li { white-space: pre-wrap; }
<translation>Zeigen</translation> <translation>Zeigen</translation>
</message> </message>
<message> <message>
<location line="-734"/> <location line="-770"/>
<source>RetroShare</source> <source>RetroShare</source>
<translation></translation> <translation></translation>
</message> </message>
@ -6044,7 +6047,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="-189"/> <location filename="../gui/MainWindow.cpp" line="-194"/>
<source>Search</source> <source>Search</source>
<translation>Suchen</translation> <translation>Suchen</translation>
</message> </message>
@ -6064,28 +6067,28 @@ p, li { white-space: pre-wrap; }
<translation>Anzeigen/Verbergen</translation> <translation>Anzeigen/Verbergen</translation>
</message> </message>
<message> <message>
<location line="+22"/> <location line="+27"/>
<source>&amp;Quit</source> <source>&amp;Quit</source>
<translation>&amp;Schliessen</translation> <translation>&amp;Schliessen</translation>
</message> </message>
<message> <message>
<location line="+186"/> <location line="+191"/>
<location line="+41"/> <location line="+42"/>
<location line="+41"/> <location line="+42"/>
<location line="+160"/> <location line="+188"/>
<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="-240"/> <location line="-270"/>
<location line="+41"/> <location line="+42"/>
<location line="+41"/> <location line="+42"/>
<location line="+160"/> <location line="+188"/>
<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="-444"/> <location line="-479"/>
<source>Bandwidth Graph</source> <source>Bandwidth Graph</source>
<translation>Bandbreiten-Graph</translation> <translation>Bandbreiten-Graph</translation>
</message> </message>
@ -6114,7 +6117,7 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Verknüpfungs-Wolke</translation> <translation type="obsolete">Verknüpfungs-Wolke</translation>
</message> </message>
<message> <message>
<location line="-122"/> <location line="-127"/>
<source>Unfinished</source> <source>Unfinished</source>
<translation>unfertig</translation> <translation>unfertig</translation>
</message> </message>
@ -6124,7 +6127,7 @@ p, li { white-space: pre-wrap; }
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../gui/MainWindow.cpp" line="+119"/> <location filename="../gui/MainWindow.cpp" line="+124"/>
<source>Help</source> <source>Help</source>
<translation>Hilfe</translation> <translation>Hilfe</translation>
</message> </message>
@ -6134,18 +6137,17 @@ p, li { white-space: pre-wrap; }
<translation>Über</translation> <translation>Über</translation>
</message> </message>
<message> <message>
<location filename="../gui/MainWindow.cpp" line="-157"/> <location filename="../gui/MainWindow.cpp" line="-162"/>
<location line="+233"/>
<source>Forums</source> <source>Forums</source>
<translation>Foren</translation> <translation>Foren</translation>
</message> </message>
<message> <message>
<location line="-304"/> <location line="-71"/>
<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="+218"/> <location line="+223"/>
<source>Open Messages</source> <source>Open Messages</source>
<translation>Öffne Nachrichten</translation> <translation>Öffne Nachrichten</translation>
</message> </message>
@ -6155,12 +6157,12 @@ p, li { white-space: pre-wrap; }
<translation>Anwendungen</translation> <translation>Anwendungen</translation>
</message> </message>
<message> <message>
<location line="-127"/> <location line="-132"/>
<source>Plugins</source> <source>Plugins</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location line="+826"/> <location line="+867"/>
<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>
@ -6170,7 +6172,7 @@ p, li { white-space: pre-wrap; }
<translation>Wirklich beenden?</translation> <translation>Wirklich beenden?</translation>
</message> </message>
<message> <message>
<location line="-726"/> <location line="-767"/>
<source>Low disk space warning</source> <source>Low disk space warning</source>
<translation>Wenig Festplatenspeicher</translation> <translation>Wenig Festplatenspeicher</translation>
</message> </message>
@ -6198,7 +6200,7 @@ Normalerweise hält RetroShare jetzt sicher alle Festplattenzugriffe auf das Ver
Bitte gib etwas Speicher frei und drücke OK.</translation> Bitte gib etwas Speicher frei und drücke OK.</translation>
</message> </message>
<message> <message>
<location line="+12"/> <location line="+13"/>
<source>Status</source> <source>Status</source>
<translation>Status</translation> <translation>Status</translation>
</message> </message>
@ -8144,7 +8146,7 @@ p, li { white-space: pre-wrap; }
<translation>Systray Icon</translation> <translation>Systray Icon</translation>
</message> </message>
<message> <message>
<location line="+6"/> <location line="+8"/>
<source>Private Message</source> <source>Private Message</source>
<translation>Private Nachricht</translation> <translation>Private Nachricht</translation>
</message> </message>
@ -8165,17 +8167,25 @@ p, li { white-space: pre-wrap; }
</message> </message>
<message> <message>
<location line="+7"/> <location line="+7"/>
<location line="+67"/> <location line="+97"/>
<source>Download completed</source> <source>Download completed</source>
<translation>Download fertig</translation> <translation>Download fertig</translation>
</message> </message>
<message> <message>
<location line="-53"/>
<source>Combined icon</source> <source>Combined icon</source>
<translation>Kombiniertes Icon</translation> <translation type="obsolete">Kombiniertes Icon</translation>
</message> </message>
<message> <message>
<location line="+27"/> <location line="-90"/>
<location line="+7"/>
<location line="+7"/>
<location line="+7"/>
<location line="+7"/>
<source>Combined</source>
<translation>Kombiniert</translation>
</message>
<message>
<location line="+36"/>
<source>Toasters</source> <source>Toasters</source>
<translation></translation> <translation></translation>
</message> </message>
@ -8235,12 +8245,12 @@ p, li { white-space: pre-wrap; }
<translation>Zeige Systemabschnitts-Nachricht an</translation> <translation>Zeige Systemabschnitts-Nachricht an</translation>
</message> </message>
<message> <message>
<location line="-236"/> <location line="-268"/>
<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>
<message> <message>
<location filename="../gui/settings/NotifyPage.cpp" line="+165"/> <location filename="../gui/settings/NotifyPage.cpp" line="+185"/>
<source>Top Left</source> <source>Top Left</source>
<translation>Oben Links</translation> <translation>Oben Links</translation>
</message> </message>
@ -9427,7 +9437,7 @@ Do you want to send them a Message instead</source>
<translation>Immer im Vordergrund</translation> <translation>Immer im Vordergrund</translation>
</message> </message>
<message> <message>
<location filename="../gui/chat/PopupChatWindow.cpp" line="+282"/> <location filename="../gui/chat/PopupChatWindow.cpp" line="+288"/>
<source>RetroShare</source> <source>RetroShare</source>
<translation>RetroShare</translation> <translation>RetroShare</translation>
</message> </message>

View File

@ -21,7 +21,8 @@
#include <util/PixmapMerging.h> #include <util/PixmapMerging.h>
#include <QtGui/QtGui> #include <QPixmap>
#include <QPainter>
QPixmap PixmapMerging::merge(const std::string & foregroundPixmapData, const std::string & backgroundPixmapFilename) { QPixmap PixmapMerging::merge(const std::string & foregroundPixmapData, const std::string & backgroundPixmapFilename) {
QImage foregroundImage; QImage foregroundImage;