mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
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:
parent
fc05314af0
commit
9992d6ae12
@ -166,7 +166,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
m_bStatusLoadDone = false;
|
||||
isIdle = false;
|
||||
|
||||
trayIconCombined = NULL;
|
||||
notifyMenu = NULL;
|
||||
trayIconMessages = NULL;
|
||||
trayIconForums = NULL;
|
||||
trayIconChannels = NULL;
|
||||
@ -258,7 +258,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
|
||||
forumAction = createPageAction(QIcon(IMAGE_FORUMS), tr("Forums"), grp));
|
||||
|
||||
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 ;
|
||||
|
||||
@ -397,8 +397,13 @@ void MainWindow::createTrayIcon()
|
||||
QObject::connect(trayMenu, SIGNAL(aboutToShow()), this, SLOT(updateMenu()));
|
||||
toggleVisibilityAction = trayMenu->addAction(QIcon(IMAGE_RETROSHARE), tr("Show/Hide"), this, SLOT(toggleVisibilitycontextmenu()));
|
||||
|
||||
QMenu *pStatusMenu = trayMenu->addMenu(tr("Status"));
|
||||
initializeStatusObject(pStatusMenu, true);
|
||||
/* Create status menu */
|
||||
QMenu *statusMenu = trayMenu->addMenu(tr("Status"));
|
||||
initializeStatusObject(statusMenu, true);
|
||||
|
||||
/* Create notify menu */
|
||||
notifyMenu = trayMenu->addMenu(tr("Notify"));
|
||||
notifyMenu->menuAction()->setVisible(false);
|
||||
|
||||
trayMenu->addSeparator();
|
||||
trayMenu->addAction(QIcon(IMAGE_RSM16), tr("Open Messenger"), this, SLOT(showMessengerWindow()));
|
||||
@ -434,44 +439,25 @@ void MainWindow::createTrayIcon()
|
||||
|
||||
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();
|
||||
|
||||
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);
|
||||
}
|
||||
/* Delete notify actions */
|
||||
DELETE_OBJECT(trayActionMessages);
|
||||
DELETE_OBJECT(trayActionForums);
|
||||
DELETE_OBJECT(trayActionChannels);
|
||||
DELETE_OBJECT(trayActionChat);
|
||||
DELETE_OBJECT(trayActionTransfers);
|
||||
|
||||
/* Create systray icons or actions */
|
||||
if (notifyFlag & TRAYNOTIFY_MESSAGES) {
|
||||
if (trayMenu) {
|
||||
DELETE_ICON(trayIconMessages);
|
||||
if (notifyFlag & TRAYNOTIFY_MESSAGES_COMBINED) {
|
||||
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->setData(tr("Messages"));
|
||||
// trayActionMessages->setData(tr("Messages"));
|
||||
} else if (trayIconMessages == NULL) {
|
||||
// Create the tray icon for messages
|
||||
trayIconMessages = new QSystemTrayIcon(this);
|
||||
@ -479,16 +465,17 @@ void MainWindow::createNotifyIcons()
|
||||
connect(trayIconMessages, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconMessagesClicked(QSystemTrayIcon::ActivationReason)));
|
||||
}
|
||||
} else {
|
||||
DELETE_ICON(trayIconMessages);
|
||||
DELETE_OBJECT(trayIconMessages);
|
||||
DELETE_OBJECT(trayActionMessages);
|
||||
}
|
||||
|
||||
if (notifyFlag & TRAYNOTIFY_FORUMS) {
|
||||
if (trayMenu) {
|
||||
DELETE_ICON(trayIconForums);
|
||||
if (notifyFlag & TRAYNOTIFY_FORUMS_COMBINED) {
|
||||
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->setData(tr("Forums"));
|
||||
// trayActionForums->setData(tr("Forums"));
|
||||
} else if (trayIconForums == NULL) {
|
||||
// Create the tray icon for forums
|
||||
trayIconForums = new QSystemTrayIcon(this);
|
||||
@ -496,16 +483,17 @@ void MainWindow::createNotifyIcons()
|
||||
connect(trayIconForums, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconForumsClicked(QSystemTrayIcon::ActivationReason)));
|
||||
}
|
||||
} else {
|
||||
DELETE_ICON(trayIconForums);
|
||||
DELETE_OBJECT(trayIconForums);
|
||||
DELETE_OBJECT(trayActionForums);
|
||||
}
|
||||
|
||||
if (notifyFlag & TRAYNOTIFY_CHANNELS) {
|
||||
if (trayMenu) {
|
||||
DELETE_ICON(trayIconChannels);
|
||||
if (notifyFlag & TRAYNOTIFY_CHANNELS_COMBINED) {
|
||||
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->setData(tr("Channels"));
|
||||
// trayActionChannels->setData(tr("Channels"));
|
||||
} else if (trayIconChannels == NULL) {
|
||||
// Create the tray icon for channels
|
||||
trayIconChannels = new QSystemTrayIcon(this);
|
||||
@ -513,16 +501,17 @@ void MainWindow::createNotifyIcons()
|
||||
connect(trayIconChannels, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconChannelsClicked(QSystemTrayIcon::ActivationReason)));
|
||||
}
|
||||
} else {
|
||||
DELETE_ICON(trayIconChannels);
|
||||
DELETE_OBJECT(trayIconChannels);
|
||||
DELETE_OBJECT(trayActionChannels);
|
||||
}
|
||||
|
||||
if (notifyFlag & TRAYNOTIFY_PRIVATECHAT) {
|
||||
if (trayMenu) {
|
||||
DELETE_ICON(trayIconChat);
|
||||
if (notifyFlag & TRAYNOTIFY_PRIVATECHAT_COMBINED) {
|
||||
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->setData(tr("Chat"));
|
||||
// trayActionChat->setData(tr("Chat"));
|
||||
} else if (trayIconChat == NULL) {
|
||||
// Create the tray icon for chat
|
||||
trayIconChat = new QSystemTrayIcon(this);
|
||||
@ -530,16 +519,17 @@ void MainWindow::createNotifyIcons()
|
||||
connect(trayIconChat, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconChatClicked(QSystemTrayIcon::ActivationReason)));
|
||||
}
|
||||
} else {
|
||||
DELETE_ICON(trayIconChat);
|
||||
DELETE_OBJECT(trayIconChat);
|
||||
DELETE_OBJECT(trayActionChat);
|
||||
}
|
||||
|
||||
if (notifyFlag & TRAYNOTIFY_TRANSFERS) {
|
||||
if (trayMenu) {
|
||||
DELETE_ICON(trayIconTransfers);
|
||||
if (notifyFlag & TRAYNOTIFY_TRANSFERS_COMBINED) {
|
||||
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->setData(tr("Transfers"));
|
||||
// trayActionTransfers->setData(tr("Transfers"));
|
||||
} else if (trayIconTransfers == NULL) {
|
||||
// Create the tray icon for transfers
|
||||
trayIconTransfers = new QSystemTrayIcon(this);
|
||||
@ -547,7 +537,8 @@ void MainWindow::createNotifyIcons()
|
||||
connect(trayIconTransfers, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconTransfersClicked(QSystemTrayIcon::ActivationReason)));
|
||||
}
|
||||
} else {
|
||||
DELETE_ICON(trayIconTransfers);
|
||||
DELETE_OBJECT(trayIconTransfers);
|
||||
DELETE_OBJECT(trayActionTransfers);
|
||||
}
|
||||
|
||||
/* call once */
|
||||
@ -557,7 +548,7 @@ void MainWindow::createNotifyIcons()
|
||||
privateChatChanged(NOTIFY_LIST_PRIVATE_INCOMING_CHAT, NOTIFY_TYPE_ADD);
|
||||
// transfer
|
||||
|
||||
#undef DELETE_ICON
|
||||
#undef DELETE_OBJECT
|
||||
}
|
||||
|
||||
/*static*/ void MainWindow::installGroupChatNotifier()
|
||||
@ -614,6 +605,7 @@ void MainWindow::updateMessages()
|
||||
}
|
||||
|
||||
if (trayActionMessages) {
|
||||
trayActionMessages->setData(newInboxCount);
|
||||
if (newInboxCount) {
|
||||
if (newInboxCount > 1) {
|
||||
trayActionMessages->setText(tr("%1 new messages").arg(newInboxCount));
|
||||
@ -655,6 +647,7 @@ void MainWindow::updateForums()
|
||||
}
|
||||
|
||||
if (trayActionForums) {
|
||||
trayActionForums->setData(newMessageCount);
|
||||
if (newMessageCount) {
|
||||
if (newMessageCount > 1) {
|
||||
trayActionForums->setText(tr("%1 new messages").arg(newMessageCount));
|
||||
@ -696,6 +689,7 @@ void MainWindow::updateChannels(int type)
|
||||
}
|
||||
|
||||
if (trayActionChannels) {
|
||||
trayActionChannels->setData(newMessageCount);
|
||||
if (newMessageCount) {
|
||||
if (newMessageCount > 1) {
|
||||
trayActionChannels->setText(tr("%1 new messages").arg(newMessageCount));
|
||||
@ -733,6 +727,7 @@ void MainWindow::updateTransfers(int count)
|
||||
}
|
||||
|
||||
if (trayActionTransfers) {
|
||||
trayActionTransfers->setData(count);
|
||||
if (count) {
|
||||
if (count > 1) {
|
||||
trayActionTransfers->setText(tr("%1 completed downloads").arg(count));
|
||||
@ -750,27 +745,32 @@ void MainWindow::updateTransfers(int count)
|
||||
|
||||
void MainWindow::updateTrayCombine()
|
||||
{
|
||||
if (trayIconCombined) {
|
||||
QMenu *trayMenu = trayIconCombined->contextMenu();
|
||||
QList<QAction*> actions = trayMenu->actions();
|
||||
notifyToolTip.clear();
|
||||
|
||||
bool visible = false;
|
||||
QString toolTip;
|
||||
bool visible = false;
|
||||
|
||||
if (notifyMenu) {
|
||||
QList<QAction*> actions = notifyMenu->actions();
|
||||
int count = 0;
|
||||
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);
|
||||
count += (*actionIt)->data().toInt();
|
||||
// ToolTip is too long to show all services
|
||||
// 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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
notifyMenu->menuAction()->setVisible(visible);
|
||||
}
|
||||
|
||||
void MainWindow::updateStatus()
|
||||
@ -803,23 +803,40 @@ void MainWindow::updateStatus()
|
||||
discstatus->update();
|
||||
}
|
||||
|
||||
QString trayIconResource;
|
||||
|
||||
if (nOnlineCount == 0)
|
||||
{
|
||||
trayIcon->setIcon(QIcon(IMAGE_NOONLINE));
|
||||
trayIconResource = IMAGE_NOONLINE;
|
||||
}
|
||||
else if (nOnlineCount < 2)
|
||||
{
|
||||
trayIcon->setIcon(QIcon(IMAGE_ONEONLINE));
|
||||
trayIconResource = IMAGE_ONEONLINE;
|
||||
}
|
||||
else if (nOnlineCount < 3)
|
||||
{
|
||||
trayIcon->setIcon(QIcon(IMAGE_TWOONLINE));
|
||||
trayIconResource = IMAGE_TWOONLINE;
|
||||
}
|
||||
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";
|
||||
|
||||
if (nOnlineCount == 1) {
|
||||
@ -830,6 +847,10 @@ void MainWindow::updateStatus()
|
||||
|
||||
tray += "\n" + nameAndLocation;
|
||||
|
||||
if (!notifyToolTip.isEmpty()) {
|
||||
tray += "\n";
|
||||
tray += notifyToolTip;
|
||||
}
|
||||
trayIcon->setToolTip(tray);
|
||||
}
|
||||
|
||||
@ -856,6 +877,7 @@ void MainWindow::privateChatChanged(int list, int type)
|
||||
}
|
||||
|
||||
if (trayActionChat) {
|
||||
trayActionChat->setData(chatCount);
|
||||
if (chatCount) {
|
||||
if (chatCount > 1) {
|
||||
trayActionChat->setText(tr("%1 new messages").arg(chatCount));
|
||||
|
@ -226,12 +226,13 @@ private:
|
||||
QString nameAndLocation;
|
||||
|
||||
QSystemTrayIcon *trayIcon;
|
||||
QSystemTrayIcon *trayIconCombined;
|
||||
QSystemTrayIcon *trayIconMessages;
|
||||
QSystemTrayIcon *trayIconForums;
|
||||
QSystemTrayIcon *trayIconChannels;
|
||||
QSystemTrayIcon *trayIconChat;
|
||||
QSystemTrayIcon *trayIconTransfers;
|
||||
QMenu *notifyMenu;
|
||||
QString notifyToolTip;
|
||||
QAction *trayActionMessages;
|
||||
QAction *trayActionForums;
|
||||
QAction *trayActionChannels;
|
||||
|
@ -356,7 +356,7 @@
|
||||
<file>images/rstray0.png</file>
|
||||
<file>images/rstray1.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-48.png</file>
|
||||
<file>images/security-low-48.png</file>
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.3 KiB |
BIN
retroshare-gui/src/gui/images/rstray_star.png
Normal file
BIN
retroshare-gui/src/gui/images/rstray_star.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 341 B |
@ -36,6 +36,12 @@ NotifyPage::NotifyPage(QWidget * parent, Qt::WFlags flags)
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
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 */
|
||||
#ifdef Q_WS_WIN
|
||||
|
||||
@ -96,8 +102,17 @@ NotifyPage::save(QString &errmsg)
|
||||
traynotifyflags |= TRAYNOTIFY_FORUMS;
|
||||
if (ui.trayNotify_Transfer->isChecked())
|
||||
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->setTrayNotifyFlags(traynotifyflags);
|
||||
@ -154,7 +169,12 @@ void NotifyPage::load()
|
||||
ui.trayNotify_Channels->setChecked(traynotifyflags & TRAYNOTIFY_CHANNELS);
|
||||
ui.trayNotify_Forums->setChecked(traynotifyflags & TRAYNOTIFY_FORUMS);
|
||||
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());
|
||||
|
||||
@ -180,4 +200,26 @@ void NotifyPage::load()
|
||||
QPoint margin = Settings->getToasterMargin();
|
||||
ui.spinBoxToasterXMargin->setValue(margin.x());
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -40,6 +40,9 @@ public:
|
||||
/** Loads the settings for this page */
|
||||
void load();
|
||||
|
||||
private slots:
|
||||
void privatChatToggled();
|
||||
|
||||
private:
|
||||
/** Qt Designer generated object */
|
||||
Ui::NotifyPage ui;
|
||||
|
@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>408</width>
|
||||
<width>427</width>
|
||||
<height>425</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -582,53 +582,78 @@
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="trayNotify_PrivateChat">
|
||||
<property name="text">
|
||||
<string>Private Message</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="trayNotify_Messages">
|
||||
<property name="text">
|
||||
<string>Message</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="trayNotify_Channels">
|
||||
<property name="text">
|
||||
<string>Channel Post</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="trayNotify_Forums">
|
||||
<property name="text">
|
||||
<string>Forum Post</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="trayNotify_Transfer">
|
||||
<property name="text">
|
||||
<string>Download completed</string>
|
||||
</property>
|
||||
</widget>
|
||||
</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>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="trayNotify_PrivateChat">
|
||||
<property name="text">
|
||||
<string>Private Message</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="trayNotify_Messages">
|
||||
<property name="text">
|
||||
<string>Message</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="trayNotify_Channels">
|
||||
<property name="text">
|
||||
<string>Channel Post</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="trayNotify_Forums">
|
||||
<property name="text">
|
||||
<string>Forum Post</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="trayNotify_Transfer">
|
||||
<property name="text">
|
||||
<string>Download completed</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="trayNotify_PrivateChatCombined">
|
||||
<property name="text">
|
||||
<string>Combined</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="trayNotify_MessagesCombined">
|
||||
<property name="text">
|
||||
<string>Combined</string>
|
||||
</property>
|
||||
</widget>
|
||||
</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>
|
||||
</widget>
|
||||
|
@ -309,7 +309,7 @@ void RshareSettings::setNotifyFlags(uint flags)
|
||||
|
||||
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)
|
||||
|
@ -31,14 +31,17 @@
|
||||
#include "rsettings.h"
|
||||
|
||||
/* Defines for get/setTrayNotifyFlags */
|
||||
#define TRAYNOTIFY_PRIVATECHAT 0x00000001
|
||||
#define TRAYNOTIFY_MESSAGES 0x00000002
|
||||
#define TRAYNOTIFY_CHANNELS 0x00000004
|
||||
#define TRAYNOTIFY_FORUMS 0x00000008
|
||||
#define TRAYNOTIFY_TRANSFERS 0x00000010
|
||||
#define TRAYNOTIFY_ALL 0x0000001F
|
||||
#define TRAYNOTIFY_PRIVATECHAT 0x00000001
|
||||
#define TRAYNOTIFY_MESSAGES 0x00000002
|
||||
#define TRAYNOTIFY_CHANNELS 0x00000004
|
||||
#define TRAYNOTIFY_FORUMS 0x00000008
|
||||
#define TRAYNOTIFY_TRANSFERS 0x00000010
|
||||
|
||||
#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
|
||||
|
||||
|
Binary file not shown.
@ -5894,55 +5894,58 @@ p, li { white-space: pre-wrap; }
|
||||
</message>
|
||||
<message>
|
||||
<location line="+8"/>
|
||||
<location line="+302"/>
|
||||
<source>Transfers</source>
|
||||
<translation>Übertragungen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-294"/>
|
||||
<location line="+226"/>
|
||||
<location line="+8"/>
|
||||
<source>Messages</source>
|
||||
<translation>Nachrichten</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-223"/>
|
||||
<location line="+257"/>
|
||||
<location line="+3"/>
|
||||
<source>Channels</source>
|
||||
<translation>Kanäle</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-254"/>
|
||||
<location line="+3"/>
|
||||
<source>Blogs</source>
|
||||
<translation>Blogs</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+154"/>
|
||||
<location line="+151"/>
|
||||
<source>Notify</source>
|
||||
<translation>Meldungen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+8"/>
|
||||
<source>Dht Details</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+117"/>
|
||||
<source>Chat</source>
|
||||
<translation>Chat</translation>
|
||||
<translation type="obsolete">Chat</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+94"/>
|
||||
<location line="+41"/>
|
||||
<location line="+41"/>
|
||||
<location line="+160"/>
|
||||
<location line="+217"/>
|
||||
<location line="+42"/>
|
||||
<location line="+42"/>
|
||||
<location line="+73"/>
|
||||
<location line="+115"/>
|
||||
<source>%1 new messages</source>
|
||||
<translation>%1 neue Nachrichten</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-240"/>
|
||||
<location line="+41"/>
|
||||
<location line="+41"/>
|
||||
<location line="+160"/>
|
||||
<location line="-270"/>
|
||||
<location line="+42"/>
|
||||
<location line="+42"/>
|
||||
<location line="+71"/>
|
||||
<location line="+117"/>
|
||||
<source>%1 new message</source>
|
||||
<translation>%1 neue Nachricht</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-138"/>
|
||||
<location line="-166"/>
|
||||
<source>You have %1 completed downloads</source>
|
||||
<translation>Du hast %1 fertige Downloads</translation>
|
||||
</message>
|
||||
@ -5952,17 +5955,17 @@ p, li { white-space: pre-wrap; }
|
||||
<translation>Du hast %1 fertigen Download</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+11"/>
|
||||
<location line="+12"/>
|
||||
<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>
|
||||
<translation>%1 fertiger Download</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+83"/>
|
||||
<location line="+105"/>
|
||||
<source>Down: %1 (kB/s)</source>
|
||||
<translation>Runter: %1 (kB/s)</translation>
|
||||
</message>
|
||||
@ -5977,7 +5980,7 @@ p, li { white-space: pre-wrap; }
|
||||
<translation>%1 Freunde verbunden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+659"/>
|
||||
<location line="+664"/>
|
||||
<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>
|
||||
</message>
|
||||
@ -5987,23 +5990,23 @@ p, li { white-space: pre-wrap; }
|
||||
<translation>Link ist fehlerhaft.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-667"/>
|
||||
<location line="-672"/>
|
||||
<source>%1 friend connected</source>
|
||||
<translation>%1 Freund verbunden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+300"/>
|
||||
<location line="+305"/>
|
||||
<source>Internal Error</source>
|
||||
<translation>Interener Fehler</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../gui/MainWindow.ui" line="+88"/>
|
||||
<location filename="../gui/MainWindow.cpp" line="-712"/>
|
||||
<location filename="../gui/MainWindow.cpp" line="-748"/>
|
||||
<source>Options</source>
|
||||
<translation>Optionen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../gui/MainWindow.cpp" line="+745"/>
|
||||
<location filename="../gui/MainWindow.cpp" line="+781"/>
|
||||
<source>Hide</source>
|
||||
<translation>Verbergen</translation>
|
||||
</message>
|
||||
@ -6013,7 +6016,7 @@ p, li { white-space: pre-wrap; }
|
||||
<translation>Zeigen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-734"/>
|
||||
<location line="-770"/>
|
||||
<source>RetroShare</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
@ -6044,7 +6047,7 @@ p, li { white-space: pre-wrap; }
|
||||
<translation>Schnellstart Assistent</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../gui/MainWindow.cpp" line="-189"/>
|
||||
<location filename="../gui/MainWindow.cpp" line="-194"/>
|
||||
<source>Search</source>
|
||||
<translation>Suchen</translation>
|
||||
</message>
|
||||
@ -6064,28 +6067,28 @@ p, li { white-space: pre-wrap; }
|
||||
<translation>Anzeigen/Verbergen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+22"/>
|
||||
<location line="+27"/>
|
||||
<source>&Quit</source>
|
||||
<translation>&Schliessen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+186"/>
|
||||
<location line="+41"/>
|
||||
<location line="+41"/>
|
||||
<location line="+160"/>
|
||||
<location line="+191"/>
|
||||
<location line="+42"/>
|
||||
<location line="+42"/>
|
||||
<location line="+188"/>
|
||||
<source>You have %1 new messages</source>
|
||||
<translation>Du hast %1 neue Nachrichten</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-240"/>
|
||||
<location line="+41"/>
|
||||
<location line="+41"/>
|
||||
<location line="+160"/>
|
||||
<location line="-270"/>
|
||||
<location line="+42"/>
|
||||
<location line="+42"/>
|
||||
<location line="+188"/>
|
||||
<source>You have %1 new message</source>
|
||||
<translation>Du hast %1 neue Nachricht</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-444"/>
|
||||
<location line="-479"/>
|
||||
<source>Bandwidth Graph</source>
|
||||
<translation>Bandbreiten-Graph</translation>
|
||||
</message>
|
||||
@ -6114,7 +6117,7 @@ p, li { white-space: pre-wrap; }
|
||||
<translation type="obsolete">Verknüpfungs-Wolke</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-122"/>
|
||||
<location line="-127"/>
|
||||
<source>Unfinished</source>
|
||||
<translation>unfertig</translation>
|
||||
</message>
|
||||
@ -6124,7 +6127,7 @@ p, li { white-space: pre-wrap; }
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../gui/MainWindow.cpp" line="+119"/>
|
||||
<location filename="../gui/MainWindow.cpp" line="+124"/>
|
||||
<source>Help</source>
|
||||
<translation>Hilfe</translation>
|
||||
</message>
|
||||
@ -6134,18 +6137,17 @@ p, li { white-space: pre-wrap; }
|
||||
<translation>Über</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../gui/MainWindow.cpp" line="-157"/>
|
||||
<location line="+233"/>
|
||||
<location filename="../gui/MainWindow.cpp" line="-162"/>
|
||||
<source>Forums</source>
|
||||
<translation>Foren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-304"/>
|
||||
<location line="-71"/>
|
||||
<source>RetroShare %1 a secure decentralised communication platform</source>
|
||||
<translation>RetroShare %1 eine sichere und dezentralisierte Kommunikationsplattform</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+218"/>
|
||||
<location line="+223"/>
|
||||
<source>Open Messages</source>
|
||||
<translation>Öffne Nachrichten</translation>
|
||||
</message>
|
||||
@ -6155,12 +6157,12 @@ p, li { white-space: pre-wrap; }
|
||||
<translation>Anwendungen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-127"/>
|
||||
<location line="-132"/>
|
||||
<source>Plugins</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+826"/>
|
||||
<location line="+867"/>
|
||||
<source>Do you really want to exit RetroShare ?</source>
|
||||
<translation>Willst Du RetroShare wirklich beenden?</translation>
|
||||
</message>
|
||||
@ -6170,7 +6172,7 @@ p, li { white-space: pre-wrap; }
|
||||
<translation>Wirklich beenden?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-726"/>
|
||||
<location line="-767"/>
|
||||
<source>Low disk space warning</source>
|
||||
<translation>Wenig Festplatenspeicher</translation>
|
||||
</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>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+12"/>
|
||||
<location line="+13"/>
|
||||
<source>Status</source>
|
||||
<translation>Status</translation>
|
||||
</message>
|
||||
@ -8144,7 +8146,7 @@ p, li { white-space: pre-wrap; }
|
||||
<translation>Systray Icon</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+6"/>
|
||||
<location line="+8"/>
|
||||
<source>Private Message</source>
|
||||
<translation>Private Nachricht</translation>
|
||||
</message>
|
||||
@ -8165,17 +8167,25 @@ p, li { white-space: pre-wrap; }
|
||||
</message>
|
||||
<message>
|
||||
<location line="+7"/>
|
||||
<location line="+67"/>
|
||||
<location line="+97"/>
|
||||
<source>Download completed</source>
|
||||
<translation>Download fertig</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-53"/>
|
||||
<source>Combined icon</source>
|
||||
<translation>Kombiniertes Icon</translation>
|
||||
<translation type="obsolete">Kombiniertes Icon</translation>
|
||||
</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>
|
||||
<translation></translation>
|
||||
</message>
|
||||
@ -8235,12 +8245,12 @@ p, li { white-space: pre-wrap; }
|
||||
<translation>Zeige Systemabschnitts-Nachricht an</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-236"/>
|
||||
<location line="-268"/>
|
||||
<source>Add feeds at end</source>
|
||||
<translation>Feeds am Ende anfügen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../gui/settings/NotifyPage.cpp" line="+165"/>
|
||||
<location filename="../gui/settings/NotifyPage.cpp" line="+185"/>
|
||||
<source>Top Left</source>
|
||||
<translation>Oben Links</translation>
|
||||
</message>
|
||||
@ -9427,7 +9437,7 @@ Do you want to send them a Message instead</source>
|
||||
<translation>Immer im Vordergrund</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../gui/chat/PopupChatWindow.cpp" line="+282"/>
|
||||
<location filename="../gui/chat/PopupChatWindow.cpp" line="+288"/>
|
||||
<source>RetroShare</source>
|
||||
<translation>RetroShare</translation>
|
||||
</message>
|
||||
|
@ -21,7 +21,8 @@
|
||||
|
||||
#include <util/PixmapMerging.h>
|
||||
|
||||
#include <QtGui/QtGui>
|
||||
#include <QPixmap>
|
||||
#include <QPainter>
|
||||
|
||||
QPixmap PixmapMerging::merge(const std::string & foregroundPixmapData, const std::string & backgroundPixmapFilename) {
|
||||
QImage foregroundImage;
|
||||
|
Loading…
Reference in New Issue
Block a user