mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
parent
211005e8de
commit
0c393e717a
|
@ -123,6 +123,8 @@ public slots:
|
|||
static void disableGroupCallVol(int groupId);
|
||||
static void enableGroupCallMic(int groupId);
|
||||
static void enableGroupCallVol(int groupId);
|
||||
static bool isGroupCallMicEnabled(int groupId);
|
||||
static bool isGroupCallVolEnabled(int groupId);
|
||||
|
||||
void setPassword(QString& password, PasswordType passtype, uint8_t* salt = nullptr);
|
||||
void clearPassword(PasswordType passtype);
|
||||
|
|
|
@ -690,3 +690,13 @@ void Core::enableGroupCallVol(int groupId)
|
|||
{
|
||||
groupCalls[groupId].muteVol = false;
|
||||
}
|
||||
|
||||
bool Core::isGroupCallMicEnabled(int groupId)
|
||||
{
|
||||
return !groupCalls[groupId].muteMic;
|
||||
}
|
||||
|
||||
bool Core::isGroupCallVolEnabled(int groupId)
|
||||
{
|
||||
return !groupCalls[groupId].muteVol;
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <QDragEnterEvent>
|
||||
#include "src/historykeeper.h"
|
||||
#include "src/misc/flowlayout.h"
|
||||
#include <QDebug>
|
||||
|
||||
GroupChatForm::GroupChatForm(Group* chatGroup)
|
||||
: group(chatGroup), inCall{false}
|
||||
|
@ -203,3 +204,39 @@ void GroupChatForm::onCallClicked()
|
|||
inCall = false;
|
||||
}
|
||||
}
|
||||
|
||||
void GroupChatForm::keyPressEvent(QKeyEvent* ev)
|
||||
{
|
||||
qDebug() << "Press:"<<ev->key();
|
||||
// Push to talk
|
||||
if (ev->key() == Qt::Key_P && inCall)
|
||||
{
|
||||
qDebug() << "Press:"<<ev->key();
|
||||
Core* core = Core::getInstance();
|
||||
if (!core->isGroupCallMicEnabled(group->groupId))
|
||||
{
|
||||
qDebug() << "Press:"<<ev->key();
|
||||
core->enableGroupCallMic(group->groupId);
|
||||
micButton->setObjectName("green");
|
||||
micButton->style()->polish(micButton);
|
||||
Style::repolish(micButton);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GroupChatForm::keyReleaseEvent(QKeyEvent* ev)
|
||||
{
|
||||
qDebug() << "Release:"<<ev->key();
|
||||
// Push to talk
|
||||
if (ev->key() == Qt::Key_P && inCall)
|
||||
{
|
||||
Core* core = Core::getInstance();
|
||||
if (core->isGroupCallMicEnabled(group->groupId))
|
||||
{
|
||||
core->disableGroupCallMic(group->groupId);
|
||||
micButton->setObjectName("red");
|
||||
micButton->style()->polish(micButton);
|
||||
Style::repolish(micButton);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,6 +42,8 @@ protected:
|
|||
// drag & drop
|
||||
void dragEnterEvent(QDragEnterEvent* ev);
|
||||
void dropEvent(QDropEvent* ev);
|
||||
void keyPressEvent(QKeyEvent* ev);
|
||||
void keyReleaseEvent(QKeyEvent* ev);
|
||||
|
||||
private:
|
||||
Group* group;
|
||||
|
|
Loading…
Reference in New Issue
Block a user