mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-07 16:45:11 -04:00
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
This commit is contained in:
parent
03e521c024
commit
af2257b1a9
28 changed files with 217 additions and 29 deletions
|
@ -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);
|
||||
|
|
|
@ -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"));
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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())));
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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();
|
||||
};
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include <retroshare/rspeers.h>
|
||||
#include <retroshare/rsiface.h>
|
||||
#include <retroshare/rsnotify.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
@ -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"));
|
||||
|
|
|
@ -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*/) {}
|
||||
|
||||
|
|
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue