From af2257b1a9c47fb95b9e68f7771557d51ba46047 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sat, 27 Oct 2012 15:59:12 +0000 Subject: [PATCH] Added settings for the blinking icons - private chat window/tab - chat lobby tab - all tray notifier git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5729 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/retroshare/rsnotify.h | 9 +++++---- .../src/gui/channels/ChannelUserNotify.cpp | 15 +++++++++++++- .../src/gui/channels/ChannelUserNotify.h | 3 ++- retroshare-gui/src/gui/chat/ChatDialog.h | 1 + .../src/gui/chat/ChatLobbyDialog.cpp | 5 +++++ retroshare-gui/src/gui/chat/ChatLobbyDialog.h | 1 + retroshare-gui/src/gui/chat/ChatTabWidget.cpp | 6 +++++- .../src/gui/chat/ChatUserNotify.cpp | 15 +++++++++++++- retroshare-gui/src/gui/chat/ChatUserNotify.h | 4 ++-- .../src/gui/chat/PopupChatDialog.cpp | 6 ++++++ retroshare-gui/src/gui/chat/PopupChatDialog.h | 1 + .../src/gui/chat/PopupChatWindow.cpp | 6 +++++- retroshare-gui/src/gui/common/UserNotify.cpp | 8 ++++---- retroshare-gui/src/gui/common/UserNotify.h | 4 ++-- .../src/gui/forums/ForumUserNotify.cpp | 15 +++++++++++++- .../src/gui/forums/ForumUserNotify.h | 3 ++- .../src/gui/msgs/MessageUserNotify.cpp | 15 +++++++++++++- .../src/gui/msgs/MessageUserNotify.h | 3 ++- retroshare-gui/src/gui/settings/ChatPage.cpp | 14 +++++++++++++ retroshare-gui/src/gui/settings/ChatPage.ui | 16 ++++++++++++++- .../src/gui/settings/NotifyPage.cpp | 15 +++++++++++--- retroshare-gui/src/gui/settings/NotifyPage.h | 5 +++-- .../src/gui/settings/rsharesettings.cpp | 20 +++++++++++++++++++ .../src/gui/settings/rsharesettings.h | 14 +++++++++++++ .../src/gui/transfers/TransferUserNotify.cpp | 15 +++++++++++++- .../src/gui/transfers/TransferUserNotify.h | 3 ++- retroshare-gui/src/lang/retroshare_de.ts | 12 +++++++++++ retroshare-gui/src/lang/retroshare_en.ts | 12 +++++++++++ 28 files changed, 217 insertions(+), 29 deletions(-) diff --git a/libretroshare/src/retroshare/rsnotify.h b/libretroshare/src/retroshare/rsnotify.h index b9c2818af..fd7c7b35d 100644 --- a/libretroshare/src/retroshare/rsnotify.h +++ b/libretroshare/src/retroshare/rsnotify.h @@ -53,10 +53,11 @@ const uint32_t RS_POPUP_CONNECT_ATTEMPT = 0x0100; /* CHAT flags are here - so they are in the same place as * other Notify flags... not used by libretroshare though */ -const uint32_t RS_CHAT_OPEN = 0x0001; -//const uint32_t free = 0x0002; -const uint32_t RS_CHAT_FOCUS = 0x0004; -const uint32_t RS_CHAT_TABBED_WINDOW = 0x0008; +const uint32_t RS_CHAT_OPEN = 0x0001; +//const uint32_t free = 0x0002; +const uint32_t RS_CHAT_FOCUS = 0x0004; +const uint32_t RS_CHAT_TABBED_WINDOW = 0x0008; +const uint32_t RS_CHAT_BLINK = 0x0010; const uint32_t RS_FEED_TYPE_PEER = 0x0010; const uint32_t RS_FEED_TYPE_CHAN = 0x0020; diff --git a/retroshare-gui/src/gui/channels/ChannelUserNotify.cpp b/retroshare-gui/src/gui/channels/ChannelUserNotify.cpp index 4feb45658..ac88fca68 100644 --- a/retroshare-gui/src/gui/channels/ChannelUserNotify.cpp +++ b/retroshare-gui/src/gui/channels/ChannelUserNotify.cpp @@ -49,9 +49,15 @@ bool ChannelUserNotify::notifyCombined() return (Settings->getTrayNotifyFlags() & TRAYNOTIFY_CHANNELS_COMBINED); } -void ChannelUserNotify::setNotifyEnabled(bool enabled, bool combined) +bool ChannelUserNotify::notifyBlink() +{ + return (Settings->getTrayNotifyBlinkFlags() & TRAYNOTIFY_BLINK_CHANNELS); +} + +void ChannelUserNotify::setNotifyEnabled(bool enabled, bool combined, bool blink) { uint notifyFlags = Settings->getTrayNotifyFlags(); + uint blinkFlags = Settings->getTrayNotifyBlinkFlags(); if (enabled) { notifyFlags |= TRAYNOTIFY_CHANNELS; @@ -65,7 +71,14 @@ void ChannelUserNotify::setNotifyEnabled(bool enabled, bool combined) notifyFlags &= ~TRAYNOTIFY_CHANNELS_COMBINED; } + if (blink) { + blinkFlags |= TRAYNOTIFY_BLINK_CHANNELS; + } else { + blinkFlags &= ~TRAYNOTIFY_BLINK_CHANNELS; + } + Settings->setTrayNotifyFlags(notifyFlags); + Settings->setTrayNotifyBlinkFlags(blinkFlags); } QIcon ChannelUserNotify::getIcon() diff --git a/retroshare-gui/src/gui/channels/ChannelUserNotify.h b/retroshare-gui/src/gui/channels/ChannelUserNotify.h index 21a36fed7..ef1608001 100644 --- a/retroshare-gui/src/gui/channels/ChannelUserNotify.h +++ b/retroshare-gui/src/gui/channels/ChannelUserNotify.h @@ -34,7 +34,8 @@ public: virtual bool hasSetting(QString &name); virtual bool notifyEnabled(); virtual bool notifyCombined(); - virtual void setNotifyEnabled(bool enabled, bool combined); + virtual bool notifyBlink(); + virtual void setNotifyEnabled(bool enabled, bool combined, bool blink); private: virtual QIcon getIcon(); diff --git a/retroshare-gui/src/gui/chat/ChatDialog.h b/retroshare-gui/src/gui/chat/ChatDialog.h index 8c27786c2..32cbe4f83 100644 --- a/retroshare-gui/src/gui/chat/ChatDialog.h +++ b/retroshare-gui/src/gui/chat/ChatDialog.h @@ -45,6 +45,7 @@ public: virtual ChatWidget *getChatWidget() = 0; virtual bool hasPeerStatus() = 0; + virtual bool notifyBlink() = 0; void addToParent(QWidget *newParent); void removeFromParent(QWidget *oldParent); diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp index 3ff521af6..8973afaf7 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp @@ -117,6 +117,11 @@ ChatWidget *ChatLobbyDialog::getChatWidget() return ui.chatWidget; } +bool ChatLobbyDialog::notifyBlink() +{ + return (Settings->getChatLobbyFlags() & RS_CHATLOBBY_BLINK); +} + void ChatLobbyDialog::processSettings(bool load) { Settings->beginGroup(QString("ChatLobbyDialog")); diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.h b/retroshare-gui/src/gui/chat/ChatLobbyDialog.h index 2b56f24a0..0f8acf2f2 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.h +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.h @@ -38,6 +38,7 @@ public: virtual void showDialog(uint chatflags); virtual ChatWidget *getChatWidget(); virtual bool hasPeerStatus() { return false; } + virtual bool notifyBlink(); void setNickname(const QString &nickname); private slots: diff --git a/retroshare-gui/src/gui/chat/ChatTabWidget.cpp b/retroshare-gui/src/gui/chat/ChatTabWidget.cpp index ec52ed40e..21406d415 100644 --- a/retroshare-gui/src/gui/chat/ChatTabWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatTabWidget.cpp @@ -104,7 +104,11 @@ void ChatTabWidget::tabInfoChanged(ChatDialog *dialog) setTabIcon(tab, QIcon(IMAGE_TYPING)); } else if (dialog->hasNewMessages()) { setTabIcon(tab, QIcon(IMAGE_CHAT)); - setBlinking(tab, true); + if (dialog->notifyBlink()) { + setBlinking(tab, true); + } else { + setBlinking(tab, false); + } } else if (dialog->hasPeerStatus()) { setBlinking(tab, false); setTabIcon(tab, QIcon(StatusDefs::imageIM(dialog->getPeerStatus()))); diff --git a/retroshare-gui/src/gui/chat/ChatUserNotify.cpp b/retroshare-gui/src/gui/chat/ChatUserNotify.cpp index a4a5063fe..13b9adc7f 100644 --- a/retroshare-gui/src/gui/chat/ChatUserNotify.cpp +++ b/retroshare-gui/src/gui/chat/ChatUserNotify.cpp @@ -51,9 +51,15 @@ bool ChatUserNotify::notifyCombined() return (Settings->getTrayNotifyFlags() & TRAYNOTIFY_PRIVATECHAT_COMBINED); } -void ChatUserNotify::setNotifyEnabled(bool enabled, bool combined) +bool ChatUserNotify::notifyBlink() +{ + return (Settings->getTrayNotifyBlinkFlags() & TRAYNOTIFY_BLINK_PRIVATECHAT); +} + +void ChatUserNotify::setNotifyEnabled(bool enabled, bool combined, bool blink) { uint notifyFlags = Settings->getTrayNotifyFlags(); + uint blinkFlags = Settings->getTrayNotifyBlinkFlags(); if (enabled) { notifyFlags |= TRAYNOTIFY_PRIVATECHAT; @@ -67,7 +73,14 @@ void ChatUserNotify::setNotifyEnabled(bool enabled, bool combined) notifyFlags &= ~TRAYNOTIFY_PRIVATECHAT_COMBINED; } + if (blink) { + blinkFlags |= TRAYNOTIFY_BLINK_PRIVATECHAT; + } else { + blinkFlags &= ~TRAYNOTIFY_BLINK_PRIVATECHAT; + } + Settings->setTrayNotifyFlags(notifyFlags); + Settings->setTrayNotifyBlinkFlags(blinkFlags); } QIcon ChatUserNotify::getIcon() diff --git a/retroshare-gui/src/gui/chat/ChatUserNotify.h b/retroshare-gui/src/gui/chat/ChatUserNotify.h index faaf27c05..5bba11661 100644 --- a/retroshare-gui/src/gui/chat/ChatUserNotify.h +++ b/retroshare-gui/src/gui/chat/ChatUserNotify.h @@ -34,7 +34,8 @@ public: virtual bool hasSetting(QString &name); virtual bool notifyEnabled(); virtual bool notifyCombined(); - virtual void setNotifyEnabled(bool enabled, bool combined); + virtual bool notifyBlink(); + virtual void setNotifyEnabled(bool enabled, bool combined, bool blink); private slots: void privateChatChanged(int list, int type); @@ -43,7 +44,6 @@ private: virtual QIcon getIcon(); virtual QIcon getMainIcon(bool hasNew); virtual unsigned int getNewCount(); - virtual bool isBlinking() { return true; } virtual void iconClicked(); }; diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp index 4f55eb4e4..9c4afeb50 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp @@ -29,6 +29,7 @@ #include #include +#include #include @@ -92,6 +93,11 @@ ChatWidget *PopupChatDialog::getChatWidget() return ui.chatWidget; } +bool PopupChatDialog::notifyBlink() +{ + return (Settings->getChatFlags() & RS_CHAT_BLINK); +} + void PopupChatDialog::processSettings(bool load) { Settings->beginGroup(QString("PopupChatDialog")); diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.h b/retroshare-gui/src/gui/chat/PopupChatDialog.h index 668fa7149..620d84afc 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.h +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.h @@ -50,6 +50,7 @@ protected: virtual void showDialog(uint chatflags); virtual ChatWidget *getChatWidget(); virtual bool hasPeerStatus() { return true; } + virtual bool notifyBlink(); virtual void updateStatus(int /*status*/) {} diff --git a/retroshare-gui/src/gui/chat/PopupChatWindow.cpp b/retroshare-gui/src/gui/chat/PopupChatWindow.cpp index dbab1166a..43ecedb25 100644 --- a/retroshare-gui/src/gui/chat/PopupChatWindow.cpp +++ b/retroshare-gui/src/gui/chat/PopupChatWindow.cpp @@ -275,7 +275,11 @@ void PopupChatWindow::calculateTitle(ChatDialog *dialog) icon = QIcon(IMAGE_TYPING); } else if (hasNewMessages) { icon = QIcon(IMAGE_CHAT); - mBlinkIcon = icon; + if (Settings->getChatFlags() & RS_CHAT_BLINK) { + mBlinkIcon = icon; + } else { + mBlinkIcon = QIcon(); + } } else { mBlinkIcon = QIcon(); if (cd && cd->hasPeerStatus()) { diff --git a/retroshare-gui/src/gui/common/UserNotify.cpp b/retroshare-gui/src/gui/common/UserNotify.cpp index d33cb3992..6ca5cb0a6 100644 --- a/retroshare-gui/src/gui/common/UserNotify.cpp +++ b/retroshare-gui/src/gui/common/UserNotify.cpp @@ -147,9 +147,9 @@ void UserNotify::trayIconClicked(QSystemTrayIcon::ActivationReason e) void UserNotify::blink(bool on) { - bool blinking = isBlinking(); - if (mTrayIcon) { + bool blinking = notifyBlink(); + if (blinking) { /* blink icon */ mTrayIcon->setIcon(on ? getIcon() : QIcon()); @@ -159,7 +159,7 @@ void UserNotify::blink(bool on) mTrayIcon->setIcon(getIcon()); } } - } - mLastBlinking = blinking; + mLastBlinking = blinking; + } } diff --git a/retroshare-gui/src/gui/common/UserNotify.h b/retroshare-gui/src/gui/common/UserNotify.h index 0598a8de6..ddf748290 100644 --- a/retroshare-gui/src/gui/common/UserNotify.h +++ b/retroshare-gui/src/gui/common/UserNotify.h @@ -42,7 +42,8 @@ public: virtual bool hasSetting(QString &/*name*/) { return false; } virtual bool notifyEnabled() { return false; } virtual bool notifyCombined() { return false; } - virtual void setNotifyEnabled(bool /*enabled*/, bool /*combined*/) {} + virtual bool notifyBlink() { return false; } + virtual void setNotifyEnabled(bool /*enabled*/, bool /*combined*/, bool /*blink*/) {} signals: void countChanged(); @@ -58,7 +59,6 @@ private: virtual QIcon getIcon() { return QIcon(); } virtual QIcon getMainIcon(bool /*hasNew*/) { return QIcon(); } virtual unsigned int getNewCount() { return 0; } - virtual bool isBlinking() { return false; } virtual QString getTrayMessage(bool plural); virtual QString getNotifyMessage(bool plural); diff --git a/retroshare-gui/src/gui/forums/ForumUserNotify.cpp b/retroshare-gui/src/gui/forums/ForumUserNotify.cpp index 7d1ac812a..fa1da8831 100644 --- a/retroshare-gui/src/gui/forums/ForumUserNotify.cpp +++ b/retroshare-gui/src/gui/forums/ForumUserNotify.cpp @@ -49,9 +49,15 @@ bool ForumUserNotify::notifyCombined() return (Settings->getTrayNotifyFlags() & TRAYNOTIFY_FORUMS_COMBINED); } -void ForumUserNotify::setNotifyEnabled(bool enabled, bool combined) +bool ForumUserNotify::notifyBlink() +{ + return (Settings->getTrayNotifyBlinkFlags() & TRAYNOTIFY_BLINK_FORUMS); +} + +void ForumUserNotify::setNotifyEnabled(bool enabled, bool combined, bool blink) { uint notifyFlags = Settings->getTrayNotifyFlags(); + uint blinkFlags = Settings->getTrayNotifyBlinkFlags(); if (enabled) { notifyFlags |= TRAYNOTIFY_FORUMS; @@ -65,7 +71,14 @@ void ForumUserNotify::setNotifyEnabled(bool enabled, bool combined) notifyFlags &= ~TRAYNOTIFY_FORUMS_COMBINED; } + if (blink) { + blinkFlags |= TRAYNOTIFY_BLINK_FORUMS; + } else { + blinkFlags &= ~TRAYNOTIFY_BLINK_FORUMS; + } + Settings->setTrayNotifyFlags(notifyFlags); + Settings->setTrayNotifyBlinkFlags(blinkFlags); } QIcon ForumUserNotify::getIcon() diff --git a/retroshare-gui/src/gui/forums/ForumUserNotify.h b/retroshare-gui/src/gui/forums/ForumUserNotify.h index 550bd6d37..8451bd0b0 100644 --- a/retroshare-gui/src/gui/forums/ForumUserNotify.h +++ b/retroshare-gui/src/gui/forums/ForumUserNotify.h @@ -34,7 +34,8 @@ public: virtual bool hasSetting(QString &name); virtual bool notifyEnabled(); virtual bool notifyCombined(); - virtual void setNotifyEnabled(bool enabled, bool combined); + virtual bool notifyBlink(); + virtual void setNotifyEnabled(bool enabled, bool combined, bool blink); private: virtual QIcon getIcon(); diff --git a/retroshare-gui/src/gui/msgs/MessageUserNotify.cpp b/retroshare-gui/src/gui/msgs/MessageUserNotify.cpp index 5a9123ce4..61691deae 100644 --- a/retroshare-gui/src/gui/msgs/MessageUserNotify.cpp +++ b/retroshare-gui/src/gui/msgs/MessageUserNotify.cpp @@ -49,9 +49,15 @@ bool MessageUserNotify::notifyCombined() return (Settings->getTrayNotifyFlags() & TRAYNOTIFY_MESSAGES_COMBINED); } -void MessageUserNotify::setNotifyEnabled(bool enabled, bool combined) +bool MessageUserNotify::notifyBlink() +{ + return (Settings->getTrayNotifyBlinkFlags() & TRAYNOTIFY_BLINK_MESSAGES); +} + +void MessageUserNotify::setNotifyEnabled(bool enabled, bool combined, bool blink) { uint notifyFlags = Settings->getTrayNotifyFlags(); + uint blinkFlags = Settings->getTrayNotifyBlinkFlags(); if (enabled) { notifyFlags |= TRAYNOTIFY_MESSAGES; @@ -65,7 +71,14 @@ void MessageUserNotify::setNotifyEnabled(bool enabled, bool combined) notifyFlags &= ~TRAYNOTIFY_MESSAGES_COMBINED; } + if (blink) { + blinkFlags |= TRAYNOTIFY_BLINK_MESSAGES; + } else { + blinkFlags &= ~TRAYNOTIFY_BLINK_MESSAGES; + } + Settings->setTrayNotifyFlags(notifyFlags); + Settings->setTrayNotifyBlinkFlags(blinkFlags); } QIcon MessageUserNotify::getIcon() diff --git a/retroshare-gui/src/gui/msgs/MessageUserNotify.h b/retroshare-gui/src/gui/msgs/MessageUserNotify.h index b74004923..9a35b085f 100644 --- a/retroshare-gui/src/gui/msgs/MessageUserNotify.h +++ b/retroshare-gui/src/gui/msgs/MessageUserNotify.h @@ -34,7 +34,8 @@ public: virtual bool hasSetting(QString &name); virtual bool notifyEnabled(); virtual bool notifyCombined(); - virtual void setNotifyEnabled(bool enabled, bool combined); + virtual bool notifyBlink(); + virtual void setNotifyEnabled(bool enabled, bool combined, bool blink); private: virtual QIcon getIcon(); diff --git a/retroshare-gui/src/gui/settings/ChatPage.cpp b/retroshare-gui/src/gui/settings/ChatPage.cpp index 3b1e650b0..27cd2e4e9 100644 --- a/retroshare-gui/src/gui/settings/ChatPage.cpp +++ b/retroshare-gui/src/gui/settings/ChatPage.cpp @@ -165,9 +165,18 @@ ChatPage::save(QString &/*errmsg*/) chatflags |= RS_CHAT_FOCUS; if (ui.chat_tabbedWindow->isChecked()) chatflags |= RS_CHAT_TABBED_WINDOW; + if (ui.chat_Blink->isChecked()) + chatflags |= RS_CHAT_BLINK; Settings->setChatFlags(chatflags); + uint chatLobbyFlags = 0; + + if (ui.chatLobby_Blink->isChecked()) + chatLobbyFlags |= RS_CHATLOBBY_BLINK; + + Settings->setChatLobbyFlags(chatLobbyFlags); + return true; } @@ -215,6 +224,11 @@ ChatPage::load() ui.chat_NewWindow->setChecked(chatflags & RS_CHAT_OPEN); ui.chat_Focus->setChecked(chatflags & RS_CHAT_FOCUS); ui.chat_tabbedWindow->setChecked(chatflags & RS_CHAT_TABBED_WINDOW); + ui.chat_Blink->setChecked(chatflags & RS_CHAT_BLINK); + + uint chatLobbyFlags = Settings->getChatLobbyFlags(); + + ui.chatLobby_Blink->setChecked(chatLobbyFlags & RS_CHATLOBBY_BLINK); } void ChatPage::on_pushButtonChangeChatFont_clicked() diff --git a/retroshare-gui/src/gui/settings/ChatPage.ui b/retroshare-gui/src/gui/settings/ChatPage.ui index 04089e517..2810fb58d 100644 --- a/retroshare-gui/src/gui/settings/ChatPage.ui +++ b/retroshare-gui/src/gui/settings/ChatPage.ui @@ -7,7 +7,7 @@ 0 0 444 - 378 + 390 @@ -148,6 +148,13 @@ Chat Lobby + + + + Blink tab icon + + + @@ -232,6 +239,13 @@ + + + + Blink window/tab icon + + + diff --git a/retroshare-gui/src/gui/settings/NotifyPage.cpp b/retroshare-gui/src/gui/settings/NotifyPage.cpp index cab8564f3..3ca38f6ef 100755 --- a/retroshare-gui/src/gui/settings/NotifyPage.cpp +++ b/retroshare-gui/src/gui/settings/NotifyPage.cpp @@ -61,9 +61,13 @@ NotifyPage::NotifyPage(QWidget * parent, Qt::WFlags flags) QCheckBox *combinedCheckBox = new QCheckBox(tr("Combined"), this); combinedCheckBox->setFont(font); - ui.notifyLayout->addWidget(combinedCheckBox, row++, 1); + ui.notifyLayout->addWidget(combinedCheckBox, row, 1); - mUserNotifySettingList.push_back(UserNotifySetting(userNotify, enabledCheckBox, combinedCheckBox)); + QCheckBox *blinkCheckBox = new QCheckBox(tr("Blink"), this); + blinkCheckBox->setFont(font); + ui.notifyLayout->addWidget(blinkCheckBox, row++, 2); + + mUserNotifySettingList.push_back(UserNotifySetting(userNotify, enabledCheckBox, combinedCheckBox, blinkCheckBox)); } /* Hide platform specific features */ @@ -134,7 +138,7 @@ NotifyPage::save(QString &/*errmsg*/) /* save user notify */ QList::iterator notifyIt; for (notifyIt = mUserNotifySettingList.begin(); notifyIt != mUserNotifySettingList.end(); ++notifyIt) { - notifyIt->mUserNotify->setNotifyEnabled(notifyIt->mEnabledCheckBox->isChecked(), notifyIt->mCombinedCheckBox->isChecked()); + notifyIt->mUserNotify->setNotifyEnabled(notifyIt->mEnabledCheckBox->isChecked(), notifyIt->mCombinedCheckBox->isChecked(), notifyIt->mBlinkCheckBox->isChecked()); } Settings->setNotifyFlags(getNotifyFlags()); @@ -219,6 +223,7 @@ void NotifyPage::load() for (notifyIt = mUserNotifySettingList.begin(); notifyIt != mUserNotifySettingList.end(); ++notifyIt) { notifyIt->mEnabledCheckBox->setChecked(notifyIt->mUserNotify->notifyEnabled()); notifyIt->mCombinedCheckBox->setChecked(notifyIt->mUserNotify->notifyCombined()); + notifyIt->mBlinkCheckBox->setChecked(notifyIt->mUserNotify->notifyBlink()); } notifyToggled(); @@ -230,9 +235,13 @@ void NotifyPage::notifyToggled() for (notifyIt = mUserNotifySettingList.begin(); notifyIt != mUserNotifySettingList.end(); ++notifyIt) { if (notifyIt->mEnabledCheckBox->isChecked()) { notifyIt->mCombinedCheckBox->setEnabled(true); + notifyIt->mBlinkCheckBox->setEnabled(true); } else { notifyIt->mCombinedCheckBox->setChecked(false); notifyIt->mCombinedCheckBox->setEnabled(false); + + notifyIt->mBlinkCheckBox->setChecked(false); + notifyIt->mBlinkCheckBox->setEnabled(false); } } } diff --git a/retroshare-gui/src/gui/settings/NotifyPage.h b/retroshare-gui/src/gui/settings/NotifyPage.h index 432f6e004..d1bb4c3a4 100755 --- a/retroshare-gui/src/gui/settings/NotifyPage.h +++ b/retroshare-gui/src/gui/settings/NotifyPage.h @@ -33,10 +33,11 @@ public: UserNotify *mUserNotify; QCheckBox *mEnabledCheckBox; QCheckBox *mCombinedCheckBox; + QCheckBox *mBlinkCheckBox; public: - UserNotifySetting(UserNotify *userNotify, QCheckBox *enabledCheckBox, QCheckBox *combinedCheckBox) - : mUserNotify(userNotify), mEnabledCheckBox(enabledCheckBox), mCombinedCheckBox(combinedCheckBox) {} + UserNotifySetting(UserNotify *userNotify, QCheckBox *enabledCheckBox, QCheckBox *combinedCheckBox, QCheckBox *blinkCheckBox) + : mUserNotify(userNotify), mEnabledCheckBox(enabledCheckBox), mCombinedCheckBox(combinedCheckBox), mBlinkCheckBox(blinkCheckBox) {} }; class NotifyPage : public ConfigPage diff --git a/retroshare-gui/src/gui/settings/rsharesettings.cpp b/retroshare-gui/src/gui/settings/rsharesettings.cpp index cc77059c8..541a048f5 100644 --- a/retroshare-gui/src/gui/settings/rsharesettings.cpp +++ b/retroshare-gui/src/gui/settings/rsharesettings.cpp @@ -295,6 +295,16 @@ void RshareSettings::setChatFlags(uint flags) setValue(SETTING_CHAT_FLAGS, flags); } +uint RshareSettings::getChatLobbyFlags() +{ + return value("ChatLobbyFlags").toUInt(); +} + +void RshareSettings::setChatLobbyFlags(uint flags) +{ + setValue("ChatLobbyFlags", flags); +} + uint RshareSettings::getNotifyFlags() { return value(SETTING_NOTIFY_FLAGS).toUInt(); @@ -315,6 +325,16 @@ void RshareSettings::setTrayNotifyFlags(uint flags) setValue(SETTING_TRAYNOTIFY_FLAGS, flags); } +uint RshareSettings::getTrayNotifyBlinkFlags() +{ + return value("TrayNotifyBlinkFlags", 0).toUInt(); +} + +void RshareSettings::setTrayNotifyBlinkFlags(uint flags) +{ + setValue("TrayNotifyBlinkFlags", flags); +} + uint RshareSettings::getMessageFlags() { return value("MessageFlags").toUInt(); diff --git a/retroshare-gui/src/gui/settings/rsharesettings.h b/retroshare-gui/src/gui/settings/rsharesettings.h index 33d113f02..063372654 100644 --- a/retroshare-gui/src/gui/settings/rsharesettings.h +++ b/retroshare-gui/src/gui/settings/rsharesettings.h @@ -43,6 +43,14 @@ #define TRAYNOTIFY_FORUMS_COMBINED 0x00000100 #define TRAYNOTIFY_TRANSFERS_COMBINED 0x00000200 +#define TRAYNOTIFY_BLINK_PRIVATECHAT 0x00000001 +#define TRAYNOTIFY_BLINK_MESSAGES 0x00000002 +#define TRAYNOTIFY_BLINK_CHANNELS 0x00000004 +#define TRAYNOTIFY_BLINK_FORUMS 0x00000008 +#define TRAYNOTIFY_BLINK_TRANSFERS 0x00000010 + +#define RS_CHATLOBBY_BLINK 0x00000001 + #define STATUSBAR_DISC 0x00000001 //Forward declaration. @@ -155,12 +163,18 @@ public: uint getChatFlags(); void setChatFlags(uint flags); + uint getChatLobbyFlags(); + void setChatLobbyFlags(uint flags); + uint getNotifyFlags(); void setNotifyFlags(uint flags); uint getTrayNotifyFlags(); void setTrayNotifyFlags(uint flags); + uint getTrayNotifyBlinkFlags(); + void setTrayNotifyBlinkFlags(uint flags); + uint getMessageFlags(); void setMessageFlags(uint flags); diff --git a/retroshare-gui/src/gui/transfers/TransferUserNotify.cpp b/retroshare-gui/src/gui/transfers/TransferUserNotify.cpp index 7610264b2..cd7de93a2 100644 --- a/retroshare-gui/src/gui/transfers/TransferUserNotify.cpp +++ b/retroshare-gui/src/gui/transfers/TransferUserNotify.cpp @@ -49,9 +49,15 @@ bool TransferUserNotify::notifyCombined() return (Settings->getTrayNotifyFlags() & TRAYNOTIFY_TRANSFERS_COMBINED); } -void TransferUserNotify::setNotifyEnabled(bool enabled, bool combined) +bool TransferUserNotify::notifyBlink() +{ + return (Settings->getTrayNotifyBlinkFlags() & TRAYNOTIFY_BLINK_TRANSFERS); +} + +void TransferUserNotify::setNotifyEnabled(bool enabled, bool combined, bool blink) { uint notifyFlags = Settings->getTrayNotifyFlags(); + uint blinkFlags = Settings->getTrayNotifyBlinkFlags(); if (enabled) { notifyFlags |= TRAYNOTIFY_TRANSFERS; @@ -65,7 +71,14 @@ void TransferUserNotify::setNotifyEnabled(bool enabled, bool combined) notifyFlags &= ~TRAYNOTIFY_TRANSFERS_COMBINED; } + if (blink) { + blinkFlags |= TRAYNOTIFY_BLINK_TRANSFERS; + } else { + blinkFlags &= ~TRAYNOTIFY_BLINK_TRANSFERS; + } + Settings->setTrayNotifyFlags(notifyFlags); + Settings->setTrayNotifyBlinkFlags(blinkFlags); } QIcon TransferUserNotify::getIcon() diff --git a/retroshare-gui/src/gui/transfers/TransferUserNotify.h b/retroshare-gui/src/gui/transfers/TransferUserNotify.h index c07dc30cd..e1939394f 100644 --- a/retroshare-gui/src/gui/transfers/TransferUserNotify.h +++ b/retroshare-gui/src/gui/transfers/TransferUserNotify.h @@ -34,7 +34,8 @@ public: virtual bool hasSetting(QString &name); virtual bool notifyEnabled(); virtual bool notifyCombined(); - virtual void setNotifyEnabled(bool enabled, bool combined); + virtual bool notifyBlink(); + virtual void setNotifyEnabled(bool enabled, bool combined, bool blink); private slots: void downloadCountChanged(int count); diff --git a/retroshare-gui/src/lang/retroshare_de.ts b/retroshare-gui/src/lang/retroshare_de.ts index 7aa7d2051..934bef009 100644 --- a/retroshare-gui/src/lang/retroshare_de.ts +++ b/retroshare-gui/src/lang/retroshare_de.ts @@ -1226,6 +1226,14 @@ Bitte wähle einen zum Chatten aus. Chat Lobby Chatlobby + + Blink tab icon + + + + Blink window/tab icon + + ChatStyle @@ -7884,6 +7892,10 @@ Rechtsklick und als Freund hinzufügen um zu verbinden. Test Test + + Blink + + NotifyQt diff --git a/retroshare-gui/src/lang/retroshare_en.ts b/retroshare-gui/src/lang/retroshare_en.ts index 69a7c2880..5b6f84747 100644 --- a/retroshare-gui/src/lang/retroshare_en.ts +++ b/retroshare-gui/src/lang/retroshare_en.ts @@ -1194,6 +1194,14 @@ Please choose one of it to chat with. Chat Lobby + + Blink tab icon + + + + Blink window/tab icon + + ChatStyle @@ -7703,6 +7711,10 @@ Right-click and select 'make friend' to be able to connect. Test + + Blink + + NotifyQt