mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-11 04:18:34 -05: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
@ -57,6 +57,7 @@ const uint32_t RS_CHAT_OPEN = 0x0001;
|
|||||||
//const uint32_t free = 0x0002;
|
//const uint32_t free = 0x0002;
|
||||||
const uint32_t RS_CHAT_FOCUS = 0x0004;
|
const uint32_t RS_CHAT_FOCUS = 0x0004;
|
||||||
const uint32_t RS_CHAT_TABBED_WINDOW = 0x0008;
|
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_PEER = 0x0010;
|
||||||
const uint32_t RS_FEED_TYPE_CHAN = 0x0020;
|
const uint32_t RS_FEED_TYPE_CHAN = 0x0020;
|
||||||
|
@ -49,9 +49,15 @@ bool ChannelUserNotify::notifyCombined()
|
|||||||
return (Settings->getTrayNotifyFlags() & TRAYNOTIFY_CHANNELS_COMBINED);
|
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 notifyFlags = Settings->getTrayNotifyFlags();
|
||||||
|
uint blinkFlags = Settings->getTrayNotifyBlinkFlags();
|
||||||
|
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
notifyFlags |= TRAYNOTIFY_CHANNELS;
|
notifyFlags |= TRAYNOTIFY_CHANNELS;
|
||||||
@ -65,7 +71,14 @@ void ChannelUserNotify::setNotifyEnabled(bool enabled, bool combined)
|
|||||||
notifyFlags &= ~TRAYNOTIFY_CHANNELS_COMBINED;
|
notifyFlags &= ~TRAYNOTIFY_CHANNELS_COMBINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (blink) {
|
||||||
|
blinkFlags |= TRAYNOTIFY_BLINK_CHANNELS;
|
||||||
|
} else {
|
||||||
|
blinkFlags &= ~TRAYNOTIFY_BLINK_CHANNELS;
|
||||||
|
}
|
||||||
|
|
||||||
Settings->setTrayNotifyFlags(notifyFlags);
|
Settings->setTrayNotifyFlags(notifyFlags);
|
||||||
|
Settings->setTrayNotifyBlinkFlags(blinkFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon ChannelUserNotify::getIcon()
|
QIcon ChannelUserNotify::getIcon()
|
||||||
|
@ -34,7 +34,8 @@ public:
|
|||||||
virtual bool hasSetting(QString &name);
|
virtual bool hasSetting(QString &name);
|
||||||
virtual bool notifyEnabled();
|
virtual bool notifyEnabled();
|
||||||
virtual bool notifyCombined();
|
virtual bool notifyCombined();
|
||||||
virtual void setNotifyEnabled(bool enabled, bool combined);
|
virtual bool notifyBlink();
|
||||||
|
virtual void setNotifyEnabled(bool enabled, bool combined, bool blink);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual QIcon getIcon();
|
virtual QIcon getIcon();
|
||||||
|
@ -45,6 +45,7 @@ public:
|
|||||||
|
|
||||||
virtual ChatWidget *getChatWidget() = 0;
|
virtual ChatWidget *getChatWidget() = 0;
|
||||||
virtual bool hasPeerStatus() = 0;
|
virtual bool hasPeerStatus() = 0;
|
||||||
|
virtual bool notifyBlink() = 0;
|
||||||
|
|
||||||
void addToParent(QWidget *newParent);
|
void addToParent(QWidget *newParent);
|
||||||
void removeFromParent(QWidget *oldParent);
|
void removeFromParent(QWidget *oldParent);
|
||||||
|
@ -117,6 +117,11 @@ ChatWidget *ChatLobbyDialog::getChatWidget()
|
|||||||
return ui.chatWidget;
|
return ui.chatWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ChatLobbyDialog::notifyBlink()
|
||||||
|
{
|
||||||
|
return (Settings->getChatLobbyFlags() & RS_CHATLOBBY_BLINK);
|
||||||
|
}
|
||||||
|
|
||||||
void ChatLobbyDialog::processSettings(bool load)
|
void ChatLobbyDialog::processSettings(bool load)
|
||||||
{
|
{
|
||||||
Settings->beginGroup(QString("ChatLobbyDialog"));
|
Settings->beginGroup(QString("ChatLobbyDialog"));
|
||||||
|
@ -38,6 +38,7 @@ public:
|
|||||||
virtual void showDialog(uint chatflags);
|
virtual void showDialog(uint chatflags);
|
||||||
virtual ChatWidget *getChatWidget();
|
virtual ChatWidget *getChatWidget();
|
||||||
virtual bool hasPeerStatus() { return false; }
|
virtual bool hasPeerStatus() { return false; }
|
||||||
|
virtual bool notifyBlink();
|
||||||
void setNickname(const QString &nickname);
|
void setNickname(const QString &nickname);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
@ -104,7 +104,11 @@ void ChatTabWidget::tabInfoChanged(ChatDialog *dialog)
|
|||||||
setTabIcon(tab, QIcon(IMAGE_TYPING));
|
setTabIcon(tab, QIcon(IMAGE_TYPING));
|
||||||
} else if (dialog->hasNewMessages()) {
|
} else if (dialog->hasNewMessages()) {
|
||||||
setTabIcon(tab, QIcon(IMAGE_CHAT));
|
setTabIcon(tab, QIcon(IMAGE_CHAT));
|
||||||
|
if (dialog->notifyBlink()) {
|
||||||
setBlinking(tab, true);
|
setBlinking(tab, true);
|
||||||
|
} else {
|
||||||
|
setBlinking(tab, false);
|
||||||
|
}
|
||||||
} else if (dialog->hasPeerStatus()) {
|
} else if (dialog->hasPeerStatus()) {
|
||||||
setBlinking(tab, false);
|
setBlinking(tab, false);
|
||||||
setTabIcon(tab, QIcon(StatusDefs::imageIM(dialog->getPeerStatus())));
|
setTabIcon(tab, QIcon(StatusDefs::imageIM(dialog->getPeerStatus())));
|
||||||
|
@ -51,9 +51,15 @@ bool ChatUserNotify::notifyCombined()
|
|||||||
return (Settings->getTrayNotifyFlags() & TRAYNOTIFY_PRIVATECHAT_COMBINED);
|
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 notifyFlags = Settings->getTrayNotifyFlags();
|
||||||
|
uint blinkFlags = Settings->getTrayNotifyBlinkFlags();
|
||||||
|
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
notifyFlags |= TRAYNOTIFY_PRIVATECHAT;
|
notifyFlags |= TRAYNOTIFY_PRIVATECHAT;
|
||||||
@ -67,7 +73,14 @@ void ChatUserNotify::setNotifyEnabled(bool enabled, bool combined)
|
|||||||
notifyFlags &= ~TRAYNOTIFY_PRIVATECHAT_COMBINED;
|
notifyFlags &= ~TRAYNOTIFY_PRIVATECHAT_COMBINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (blink) {
|
||||||
|
blinkFlags |= TRAYNOTIFY_BLINK_PRIVATECHAT;
|
||||||
|
} else {
|
||||||
|
blinkFlags &= ~TRAYNOTIFY_BLINK_PRIVATECHAT;
|
||||||
|
}
|
||||||
|
|
||||||
Settings->setTrayNotifyFlags(notifyFlags);
|
Settings->setTrayNotifyFlags(notifyFlags);
|
||||||
|
Settings->setTrayNotifyBlinkFlags(blinkFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon ChatUserNotify::getIcon()
|
QIcon ChatUserNotify::getIcon()
|
||||||
|
@ -34,7 +34,8 @@ public:
|
|||||||
virtual bool hasSetting(QString &name);
|
virtual bool hasSetting(QString &name);
|
||||||
virtual bool notifyEnabled();
|
virtual bool notifyEnabled();
|
||||||
virtual bool notifyCombined();
|
virtual bool notifyCombined();
|
||||||
virtual void setNotifyEnabled(bool enabled, bool combined);
|
virtual bool notifyBlink();
|
||||||
|
virtual void setNotifyEnabled(bool enabled, bool combined, bool blink);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void privateChatChanged(int list, int type);
|
void privateChatChanged(int list, int type);
|
||||||
@ -43,7 +44,6 @@ private:
|
|||||||
virtual QIcon getIcon();
|
virtual QIcon getIcon();
|
||||||
virtual QIcon getMainIcon(bool hasNew);
|
virtual QIcon getMainIcon(bool hasNew);
|
||||||
virtual unsigned int getNewCount();
|
virtual unsigned int getNewCount();
|
||||||
virtual bool isBlinking() { return true; }
|
|
||||||
virtual void iconClicked();
|
virtual void iconClicked();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include <retroshare/rspeers.h>
|
#include <retroshare/rspeers.h>
|
||||||
#include <retroshare/rsiface.h>
|
#include <retroshare/rsiface.h>
|
||||||
|
#include <retroshare/rsnotify.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
@ -92,6 +93,11 @@ ChatWidget *PopupChatDialog::getChatWidget()
|
|||||||
return ui.chatWidget;
|
return ui.chatWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PopupChatDialog::notifyBlink()
|
||||||
|
{
|
||||||
|
return (Settings->getChatFlags() & RS_CHAT_BLINK);
|
||||||
|
}
|
||||||
|
|
||||||
void PopupChatDialog::processSettings(bool load)
|
void PopupChatDialog::processSettings(bool load)
|
||||||
{
|
{
|
||||||
Settings->beginGroup(QString("PopupChatDialog"));
|
Settings->beginGroup(QString("PopupChatDialog"));
|
||||||
|
@ -50,6 +50,7 @@ protected:
|
|||||||
virtual void showDialog(uint chatflags);
|
virtual void showDialog(uint chatflags);
|
||||||
virtual ChatWidget *getChatWidget();
|
virtual ChatWidget *getChatWidget();
|
||||||
virtual bool hasPeerStatus() { return true; }
|
virtual bool hasPeerStatus() { return true; }
|
||||||
|
virtual bool notifyBlink();
|
||||||
|
|
||||||
virtual void updateStatus(int /*status*/) {}
|
virtual void updateStatus(int /*status*/) {}
|
||||||
|
|
||||||
|
@ -275,7 +275,11 @@ void PopupChatWindow::calculateTitle(ChatDialog *dialog)
|
|||||||
icon = QIcon(IMAGE_TYPING);
|
icon = QIcon(IMAGE_TYPING);
|
||||||
} else if (hasNewMessages) {
|
} else if (hasNewMessages) {
|
||||||
icon = QIcon(IMAGE_CHAT);
|
icon = QIcon(IMAGE_CHAT);
|
||||||
|
if (Settings->getChatFlags() & RS_CHAT_BLINK) {
|
||||||
mBlinkIcon = icon;
|
mBlinkIcon = icon;
|
||||||
|
} else {
|
||||||
|
mBlinkIcon = QIcon();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mBlinkIcon = QIcon();
|
mBlinkIcon = QIcon();
|
||||||
if (cd && cd->hasPeerStatus()) {
|
if (cd && cd->hasPeerStatus()) {
|
||||||
|
@ -147,9 +147,9 @@ void UserNotify::trayIconClicked(QSystemTrayIcon::ActivationReason e)
|
|||||||
|
|
||||||
void UserNotify::blink(bool on)
|
void UserNotify::blink(bool on)
|
||||||
{
|
{
|
||||||
bool blinking = isBlinking();
|
|
||||||
|
|
||||||
if (mTrayIcon) {
|
if (mTrayIcon) {
|
||||||
|
bool blinking = notifyBlink();
|
||||||
|
|
||||||
if (blinking) {
|
if (blinking) {
|
||||||
/* blink icon */
|
/* blink icon */
|
||||||
mTrayIcon->setIcon(on ? getIcon() : QIcon());
|
mTrayIcon->setIcon(on ? getIcon() : QIcon());
|
||||||
@ -159,7 +159,7 @@ void UserNotify::blink(bool on)
|
|||||||
mTrayIcon->setIcon(getIcon());
|
mTrayIcon->setIcon(getIcon());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
mLastBlinking = blinking;
|
mLastBlinking = blinking;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,8 @@ public:
|
|||||||
virtual bool hasSetting(QString &/*name*/) { return false; }
|
virtual bool hasSetting(QString &/*name*/) { return false; }
|
||||||
virtual bool notifyEnabled() { return false; }
|
virtual bool notifyEnabled() { return false; }
|
||||||
virtual bool notifyCombined() { 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:
|
signals:
|
||||||
void countChanged();
|
void countChanged();
|
||||||
@ -58,7 +59,6 @@ private:
|
|||||||
virtual QIcon getIcon() { return QIcon(); }
|
virtual QIcon getIcon() { return QIcon(); }
|
||||||
virtual QIcon getMainIcon(bool /*hasNew*/) { return QIcon(); }
|
virtual QIcon getMainIcon(bool /*hasNew*/) { return QIcon(); }
|
||||||
virtual unsigned int getNewCount() { return 0; }
|
virtual unsigned int getNewCount() { return 0; }
|
||||||
virtual bool isBlinking() { return false; }
|
|
||||||
|
|
||||||
virtual QString getTrayMessage(bool plural);
|
virtual QString getTrayMessage(bool plural);
|
||||||
virtual QString getNotifyMessage(bool plural);
|
virtual QString getNotifyMessage(bool plural);
|
||||||
|
@ -49,9 +49,15 @@ bool ForumUserNotify::notifyCombined()
|
|||||||
return (Settings->getTrayNotifyFlags() & TRAYNOTIFY_FORUMS_COMBINED);
|
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 notifyFlags = Settings->getTrayNotifyFlags();
|
||||||
|
uint blinkFlags = Settings->getTrayNotifyBlinkFlags();
|
||||||
|
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
notifyFlags |= TRAYNOTIFY_FORUMS;
|
notifyFlags |= TRAYNOTIFY_FORUMS;
|
||||||
@ -65,7 +71,14 @@ void ForumUserNotify::setNotifyEnabled(bool enabled, bool combined)
|
|||||||
notifyFlags &= ~TRAYNOTIFY_FORUMS_COMBINED;
|
notifyFlags &= ~TRAYNOTIFY_FORUMS_COMBINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (blink) {
|
||||||
|
blinkFlags |= TRAYNOTIFY_BLINK_FORUMS;
|
||||||
|
} else {
|
||||||
|
blinkFlags &= ~TRAYNOTIFY_BLINK_FORUMS;
|
||||||
|
}
|
||||||
|
|
||||||
Settings->setTrayNotifyFlags(notifyFlags);
|
Settings->setTrayNotifyFlags(notifyFlags);
|
||||||
|
Settings->setTrayNotifyBlinkFlags(blinkFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon ForumUserNotify::getIcon()
|
QIcon ForumUserNotify::getIcon()
|
||||||
|
@ -34,7 +34,8 @@ public:
|
|||||||
virtual bool hasSetting(QString &name);
|
virtual bool hasSetting(QString &name);
|
||||||
virtual bool notifyEnabled();
|
virtual bool notifyEnabled();
|
||||||
virtual bool notifyCombined();
|
virtual bool notifyCombined();
|
||||||
virtual void setNotifyEnabled(bool enabled, bool combined);
|
virtual bool notifyBlink();
|
||||||
|
virtual void setNotifyEnabled(bool enabled, bool combined, bool blink);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual QIcon getIcon();
|
virtual QIcon getIcon();
|
||||||
|
@ -49,9 +49,15 @@ bool MessageUserNotify::notifyCombined()
|
|||||||
return (Settings->getTrayNotifyFlags() & TRAYNOTIFY_MESSAGES_COMBINED);
|
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 notifyFlags = Settings->getTrayNotifyFlags();
|
||||||
|
uint blinkFlags = Settings->getTrayNotifyBlinkFlags();
|
||||||
|
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
notifyFlags |= TRAYNOTIFY_MESSAGES;
|
notifyFlags |= TRAYNOTIFY_MESSAGES;
|
||||||
@ -65,7 +71,14 @@ void MessageUserNotify::setNotifyEnabled(bool enabled, bool combined)
|
|||||||
notifyFlags &= ~TRAYNOTIFY_MESSAGES_COMBINED;
|
notifyFlags &= ~TRAYNOTIFY_MESSAGES_COMBINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (blink) {
|
||||||
|
blinkFlags |= TRAYNOTIFY_BLINK_MESSAGES;
|
||||||
|
} else {
|
||||||
|
blinkFlags &= ~TRAYNOTIFY_BLINK_MESSAGES;
|
||||||
|
}
|
||||||
|
|
||||||
Settings->setTrayNotifyFlags(notifyFlags);
|
Settings->setTrayNotifyFlags(notifyFlags);
|
||||||
|
Settings->setTrayNotifyBlinkFlags(blinkFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon MessageUserNotify::getIcon()
|
QIcon MessageUserNotify::getIcon()
|
||||||
|
@ -34,7 +34,8 @@ public:
|
|||||||
virtual bool hasSetting(QString &name);
|
virtual bool hasSetting(QString &name);
|
||||||
virtual bool notifyEnabled();
|
virtual bool notifyEnabled();
|
||||||
virtual bool notifyCombined();
|
virtual bool notifyCombined();
|
||||||
virtual void setNotifyEnabled(bool enabled, bool combined);
|
virtual bool notifyBlink();
|
||||||
|
virtual void setNotifyEnabled(bool enabled, bool combined, bool blink);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual QIcon getIcon();
|
virtual QIcon getIcon();
|
||||||
|
@ -165,9 +165,18 @@ ChatPage::save(QString &/*errmsg*/)
|
|||||||
chatflags |= RS_CHAT_FOCUS;
|
chatflags |= RS_CHAT_FOCUS;
|
||||||
if (ui.chat_tabbedWindow->isChecked())
|
if (ui.chat_tabbedWindow->isChecked())
|
||||||
chatflags |= RS_CHAT_TABBED_WINDOW;
|
chatflags |= RS_CHAT_TABBED_WINDOW;
|
||||||
|
if (ui.chat_Blink->isChecked())
|
||||||
|
chatflags |= RS_CHAT_BLINK;
|
||||||
|
|
||||||
Settings->setChatFlags(chatflags);
|
Settings->setChatFlags(chatflags);
|
||||||
|
|
||||||
|
uint chatLobbyFlags = 0;
|
||||||
|
|
||||||
|
if (ui.chatLobby_Blink->isChecked())
|
||||||
|
chatLobbyFlags |= RS_CHATLOBBY_BLINK;
|
||||||
|
|
||||||
|
Settings->setChatLobbyFlags(chatLobbyFlags);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,6 +224,11 @@ ChatPage::load()
|
|||||||
ui.chat_NewWindow->setChecked(chatflags & RS_CHAT_OPEN);
|
ui.chat_NewWindow->setChecked(chatflags & RS_CHAT_OPEN);
|
||||||
ui.chat_Focus->setChecked(chatflags & RS_CHAT_FOCUS);
|
ui.chat_Focus->setChecked(chatflags & RS_CHAT_FOCUS);
|
||||||
ui.chat_tabbedWindow->setChecked(chatflags & RS_CHAT_TABBED_WINDOW);
|
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()
|
void ChatPage::on_pushButtonChangeChatFont_clicked()
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>444</width>
|
<width>444</width>
|
||||||
<height>378</height>
|
<height>390</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
@ -148,6 +148,13 @@
|
|||||||
<string>Chat Lobby</string>
|
<string>Chat Lobby</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="chatLobby_Blink">
|
||||||
|
<property name="text">
|
||||||
|
<string>Blink tab icon</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -232,6 +239,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="chat_Blink">
|
||||||
|
<property name="text">
|
||||||
|
<string>Blink window/tab icon</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -61,9 +61,13 @@ NotifyPage::NotifyPage(QWidget * parent, Qt::WFlags flags)
|
|||||||
|
|
||||||
QCheckBox *combinedCheckBox = new QCheckBox(tr("Combined"), this);
|
QCheckBox *combinedCheckBox = new QCheckBox(tr("Combined"), this);
|
||||||
combinedCheckBox->setFont(font);
|
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 */
|
/* Hide platform specific features */
|
||||||
@ -134,7 +138,7 @@ NotifyPage::save(QString &/*errmsg*/)
|
|||||||
/* save user notify */
|
/* save user notify */
|
||||||
QList<UserNotifySetting>::iterator notifyIt;
|
QList<UserNotifySetting>::iterator notifyIt;
|
||||||
for (notifyIt = mUserNotifySettingList.begin(); notifyIt != mUserNotifySettingList.end(); ++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());
|
Settings->setNotifyFlags(getNotifyFlags());
|
||||||
@ -219,6 +223,7 @@ void NotifyPage::load()
|
|||||||
for (notifyIt = mUserNotifySettingList.begin(); notifyIt != mUserNotifySettingList.end(); ++notifyIt) {
|
for (notifyIt = mUserNotifySettingList.begin(); notifyIt != mUserNotifySettingList.end(); ++notifyIt) {
|
||||||
notifyIt->mEnabledCheckBox->setChecked(notifyIt->mUserNotify->notifyEnabled());
|
notifyIt->mEnabledCheckBox->setChecked(notifyIt->mUserNotify->notifyEnabled());
|
||||||
notifyIt->mCombinedCheckBox->setChecked(notifyIt->mUserNotify->notifyCombined());
|
notifyIt->mCombinedCheckBox->setChecked(notifyIt->mUserNotify->notifyCombined());
|
||||||
|
notifyIt->mBlinkCheckBox->setChecked(notifyIt->mUserNotify->notifyBlink());
|
||||||
}
|
}
|
||||||
|
|
||||||
notifyToggled();
|
notifyToggled();
|
||||||
@ -230,9 +235,13 @@ void NotifyPage::notifyToggled()
|
|||||||
for (notifyIt = mUserNotifySettingList.begin(); notifyIt != mUserNotifySettingList.end(); ++notifyIt) {
|
for (notifyIt = mUserNotifySettingList.begin(); notifyIt != mUserNotifySettingList.end(); ++notifyIt) {
|
||||||
if (notifyIt->mEnabledCheckBox->isChecked()) {
|
if (notifyIt->mEnabledCheckBox->isChecked()) {
|
||||||
notifyIt->mCombinedCheckBox->setEnabled(true);
|
notifyIt->mCombinedCheckBox->setEnabled(true);
|
||||||
|
notifyIt->mBlinkCheckBox->setEnabled(true);
|
||||||
} else {
|
} else {
|
||||||
notifyIt->mCombinedCheckBox->setChecked(false);
|
notifyIt->mCombinedCheckBox->setChecked(false);
|
||||||
notifyIt->mCombinedCheckBox->setEnabled(false);
|
notifyIt->mCombinedCheckBox->setEnabled(false);
|
||||||
|
|
||||||
|
notifyIt->mBlinkCheckBox->setChecked(false);
|
||||||
|
notifyIt->mBlinkCheckBox->setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,10 +33,11 @@ public:
|
|||||||
UserNotify *mUserNotify;
|
UserNotify *mUserNotify;
|
||||||
QCheckBox *mEnabledCheckBox;
|
QCheckBox *mEnabledCheckBox;
|
||||||
QCheckBox *mCombinedCheckBox;
|
QCheckBox *mCombinedCheckBox;
|
||||||
|
QCheckBox *mBlinkCheckBox;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UserNotifySetting(UserNotify *userNotify, QCheckBox *enabledCheckBox, QCheckBox *combinedCheckBox)
|
UserNotifySetting(UserNotify *userNotify, QCheckBox *enabledCheckBox, QCheckBox *combinedCheckBox, QCheckBox *blinkCheckBox)
|
||||||
: mUserNotify(userNotify), mEnabledCheckBox(enabledCheckBox), mCombinedCheckBox(combinedCheckBox) {}
|
: mUserNotify(userNotify), mEnabledCheckBox(enabledCheckBox), mCombinedCheckBox(combinedCheckBox), mBlinkCheckBox(blinkCheckBox) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class NotifyPage : public ConfigPage
|
class NotifyPage : public ConfigPage
|
||||||
|
@ -295,6 +295,16 @@ void RshareSettings::setChatFlags(uint flags)
|
|||||||
setValue(SETTING_CHAT_FLAGS, flags);
|
setValue(SETTING_CHAT_FLAGS, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint RshareSettings::getChatLobbyFlags()
|
||||||
|
{
|
||||||
|
return value("ChatLobbyFlags").toUInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RshareSettings::setChatLobbyFlags(uint flags)
|
||||||
|
{
|
||||||
|
setValue("ChatLobbyFlags", flags);
|
||||||
|
}
|
||||||
|
|
||||||
uint RshareSettings::getNotifyFlags()
|
uint RshareSettings::getNotifyFlags()
|
||||||
{
|
{
|
||||||
return value(SETTING_NOTIFY_FLAGS).toUInt();
|
return value(SETTING_NOTIFY_FLAGS).toUInt();
|
||||||
@ -315,6 +325,16 @@ void RshareSettings::setTrayNotifyFlags(uint flags)
|
|||||||
setValue(SETTING_TRAYNOTIFY_FLAGS, 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()
|
uint RshareSettings::getMessageFlags()
|
||||||
{
|
{
|
||||||
return value("MessageFlags").toUInt();
|
return value("MessageFlags").toUInt();
|
||||||
|
@ -43,6 +43,14 @@
|
|||||||
#define TRAYNOTIFY_FORUMS_COMBINED 0x00000100
|
#define TRAYNOTIFY_FORUMS_COMBINED 0x00000100
|
||||||
#define TRAYNOTIFY_TRANSFERS_COMBINED 0x00000200
|
#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
|
#define STATUSBAR_DISC 0x00000001
|
||||||
|
|
||||||
//Forward declaration.
|
//Forward declaration.
|
||||||
@ -155,12 +163,18 @@ public:
|
|||||||
uint getChatFlags();
|
uint getChatFlags();
|
||||||
void setChatFlags(uint flags);
|
void setChatFlags(uint flags);
|
||||||
|
|
||||||
|
uint getChatLobbyFlags();
|
||||||
|
void setChatLobbyFlags(uint flags);
|
||||||
|
|
||||||
uint getNotifyFlags();
|
uint getNotifyFlags();
|
||||||
void setNotifyFlags(uint flags);
|
void setNotifyFlags(uint flags);
|
||||||
|
|
||||||
uint getTrayNotifyFlags();
|
uint getTrayNotifyFlags();
|
||||||
void setTrayNotifyFlags(uint flags);
|
void setTrayNotifyFlags(uint flags);
|
||||||
|
|
||||||
|
uint getTrayNotifyBlinkFlags();
|
||||||
|
void setTrayNotifyBlinkFlags(uint flags);
|
||||||
|
|
||||||
uint getMessageFlags();
|
uint getMessageFlags();
|
||||||
void setMessageFlags(uint flags);
|
void setMessageFlags(uint flags);
|
||||||
|
|
||||||
|
@ -49,9 +49,15 @@ bool TransferUserNotify::notifyCombined()
|
|||||||
return (Settings->getTrayNotifyFlags() & TRAYNOTIFY_TRANSFERS_COMBINED);
|
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 notifyFlags = Settings->getTrayNotifyFlags();
|
||||||
|
uint blinkFlags = Settings->getTrayNotifyBlinkFlags();
|
||||||
|
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
notifyFlags |= TRAYNOTIFY_TRANSFERS;
|
notifyFlags |= TRAYNOTIFY_TRANSFERS;
|
||||||
@ -65,7 +71,14 @@ void TransferUserNotify::setNotifyEnabled(bool enabled, bool combined)
|
|||||||
notifyFlags &= ~TRAYNOTIFY_TRANSFERS_COMBINED;
|
notifyFlags &= ~TRAYNOTIFY_TRANSFERS_COMBINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (blink) {
|
||||||
|
blinkFlags |= TRAYNOTIFY_BLINK_TRANSFERS;
|
||||||
|
} else {
|
||||||
|
blinkFlags &= ~TRAYNOTIFY_BLINK_TRANSFERS;
|
||||||
|
}
|
||||||
|
|
||||||
Settings->setTrayNotifyFlags(notifyFlags);
|
Settings->setTrayNotifyFlags(notifyFlags);
|
||||||
|
Settings->setTrayNotifyBlinkFlags(blinkFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon TransferUserNotify::getIcon()
|
QIcon TransferUserNotify::getIcon()
|
||||||
|
@ -34,7 +34,8 @@ public:
|
|||||||
virtual bool hasSetting(QString &name);
|
virtual bool hasSetting(QString &name);
|
||||||
virtual bool notifyEnabled();
|
virtual bool notifyEnabled();
|
||||||
virtual bool notifyCombined();
|
virtual bool notifyCombined();
|
||||||
virtual void setNotifyEnabled(bool enabled, bool combined);
|
virtual bool notifyBlink();
|
||||||
|
virtual void setNotifyEnabled(bool enabled, bool combined, bool blink);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void downloadCountChanged(int count);
|
void downloadCountChanged(int count);
|
||||||
|
@ -1226,6 +1226,14 @@ Bitte wähle einen zum Chatten aus.</translation>
|
|||||||
<source>Chat Lobby</source>
|
<source>Chat Lobby</source>
|
||||||
<translation type="unfinished">Chatlobby</translation>
|
<translation type="unfinished">Chatlobby</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Blink tab icon</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Blink window/tab icon</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ChatStyle</name>
|
<name>ChatStyle</name>
|
||||||
@ -7884,6 +7892,10 @@ Rechtsklick und als Freund hinzufügen um zu verbinden.</translation>
|
|||||||
<source>Test</source>
|
<source>Test</source>
|
||||||
<translation>Test</translation>
|
<translation>Test</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Blink</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>NotifyQt</name>
|
<name>NotifyQt</name>
|
||||||
|
@ -1194,6 +1194,14 @@ Please choose one of it to chat with.</source>
|
|||||||
<source>Chat Lobby</source>
|
<source>Chat Lobby</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Blink tab icon</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Blink window/tab icon</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ChatStyle</name>
|
<name>ChatStyle</name>
|
||||||
@ -7703,6 +7711,10 @@ Right-click and select 'make friend' to be able to connect.</source>
|
|||||||
<source>Test</source>
|
<source>Test</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Blink</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>NotifyQt</name>
|
<name>NotifyQt</name>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user