mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Added alerts and modified groupchat status light to better fit with theme
This commit is contained in:
parent
d92ae3c0fe
commit
aab44382c5
Binary file not shown.
Before Width: | Height: | Size: 605 B After Width: | Height: | Size: 613 B |
Binary file not shown.
Before Width: | Height: | Size: 764 B After Width: | Height: | Size: 796 B |
Binary file not shown.
Before Width: | Height: | Size: 784 B After Width: | Height: | Size: 814 B |
@ -350,13 +350,13 @@ void Widget::onFriendMessageReceived(int friendId, const QString& message)
|
|||||||
if ((f->friendId != f2->friendId) || isFriendWidgetActive == 0)
|
if ((f->friendId != f2->friendId) || isFriendWidgetActive == 0)
|
||||||
{
|
{
|
||||||
f->hasNewMessages = 1;
|
f->hasNewMessages = 1;
|
||||||
playMessageNotification();
|
newMessageAlert();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
f->hasNewMessages = 1;
|
f->hasNewMessages = 1;
|
||||||
playMessageNotification();
|
newMessageAlert();
|
||||||
}
|
}
|
||||||
|
|
||||||
updateFriendStatusLights(friendId);
|
updateFriendStatusLights(friendId);
|
||||||
@ -380,8 +380,9 @@ void Widget::updateFriendStatusLights(int friendId)
|
|||||||
f->widget->statusPic.setPixmap(QPixmap("img/status/dot_away_notification.png"));
|
f->widget->statusPic.setPixmap(QPixmap("img/status/dot_away_notification.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Widget::playMessageNotification()
|
void Widget::newMessageAlert()
|
||||||
{
|
{
|
||||||
|
QApplication::alert(this, 1000);
|
||||||
QSound::play("audio/notification.wav");
|
QSound::play("audio/notification.wav");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -427,7 +428,7 @@ void Widget::onGroupMessageReceived(int groupnumber, int friendgroupnumber, cons
|
|||||||
{
|
{
|
||||||
if (message.contains(Settings::getInstance().getUsername(), Qt::CaseInsensitive))
|
if (message.contains(Settings::getInstance().getUsername(), Qt::CaseInsensitive))
|
||||||
{
|
{
|
||||||
playMessageNotification();
|
newMessageAlert();
|
||||||
g->hasNewMessages = 1;
|
g->hasNewMessages = 1;
|
||||||
g->userWasMentioned = 1;
|
g->userWasMentioned = 1;
|
||||||
g->widget->statusPic.setPixmap(QPixmap("img/status/dot_groupchat_notification.png"));
|
g->widget->statusPic.setPixmap(QPixmap("img/status/dot_groupchat_notification.png"));
|
||||||
|
@ -84,7 +84,7 @@ private:
|
|||||||
GroupWidget* activeGroupWidget;
|
GroupWidget* activeGroupWidget;
|
||||||
void updateFriendStatusLights(int friendId);
|
void updateFriendStatusLights(int friendId);
|
||||||
int isFriendWidgetActive, isGroupWidgetActive;
|
int isFriendWidgetActive, isGroupWidgetActive;
|
||||||
void playMessageNotification();
|
void newMessageAlert();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // WIDGET_H
|
#endif // WIDGET_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user