1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Make notifications consistent

Notify of AV and FT requests if we're selected but not active or minimised, and add sound (consistent with how message notifications work)
This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-08-31 18:29:55 +02:00
parent f531d5672d
commit 76971f5238
3 changed files with 12 additions and 5 deletions

View File

@ -377,12 +377,13 @@ void ChatForm::onFileRecvRequest(ToxFile file)
connect(Widget::getInstance()->getCore(), &Core::fileTransferCancelled, fileTrans, &FileTransfertWidget::onFileTransferCancelled);
connect(Widget::getInstance()->getCore(), &Core::fileTransferFinished, fileTrans, &FileTransfertWidget::onFileTransferFinished);
if (!f->widget->isActive())
Widget* w = Widget::getInstance();
if (!w->isFriendWidgetCurActiveWidget(f)|| w->getIsWindowMinimized() || !w->isActiveWindow())
{
f->hasNewEvents = 1;
// FIXME: add sound alert, as for incoming message
w->newMessageAlert();
f->hasNewEvents=true;
f->widget->updateStatusLight();
}
f->widget->updateStatusLight();
}
void ChatForm::onAvInvite(int FriendId, int CallId, bool video)
@ -411,7 +412,7 @@ void ChatForm::onAvInvite(int FriendId, int CallId, bool video)
}
Widget* w = Widget::getInstance();
if (!w->isFriendWidgetCurActiveWidget(f))
if (!w->isFriendWidgetCurActiveWidget(f)|| w->getIsWindowMinimized() || !w->isActiveWindow())
{
w->newMessageAlert();
f->hasNewEvents=true;

View File

@ -1146,3 +1146,8 @@ bool Widget::eventFilter(QObject *, QEvent *event)
}
return false;
}
bool Widget::getIsWindowMinimized()
{
return static_cast<bool>(isWindowMinimized);
}

View File

@ -58,6 +58,7 @@ public:
void showTestCamview();
void newMessageAlert();
bool isFriendWidgetCurActiveWidget(Friend* f);
bool getIsWindowMinimized();
~Widget();
virtual void closeEvent(QCloseEvent *event);