2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Add push-to-talk with global shortcut on Windows.

This commit is contained in:
John Preston
2020-12-03 21:17:15 +03:00
parent f4dfd738ec
commit d41e93fb1c
12 changed files with 217 additions and 21 deletions

View File

@@ -109,7 +109,9 @@ QByteArray Settings::serialize() const {
<< qint32(_nativeWindowFrame.current() ? 1 : 0)
<< qint32(_systemDarkModeEnabled.current() ? 1 : 0)
<< _callVideoInputDeviceId
<< qint32(_ipRevealWarning ? 1 : 0);
<< qint32(_ipRevealWarning ? 1 : 0)
<< qint32(_groupCallPushToTalk ? 1 : 0)
<< _groupCallPushToTalkShortcut;
}
return result;
}
@@ -177,6 +179,8 @@ void Settings::addFromSerialized(const QByteArray &serialized) {
qint32 nativeWindowFrame = _nativeWindowFrame.current() ? 1 : 0;
qint32 systemDarkModeEnabled = _systemDarkModeEnabled.current() ? 1 : 0;
qint32 ipRevealWarning = _ipRevealWarning ? 1 : 0;
qint32 groupCallPushToTalk = _groupCallPushToTalk ? 1 : 0;
QByteArray groupCallPushToTalkShortcut = _groupCallPushToTalkShortcut;
stream >> themesAccentColors;
if (!stream.atEnd()) {
@@ -263,6 +267,11 @@ void Settings::addFromSerialized(const QByteArray &serialized) {
if (!stream.atEnd()) {
stream >> ipRevealWarning;
}
if (!stream.atEnd()) {
stream
>> groupCallPushToTalk
>> groupCallPushToTalkShortcut;
}
if (stream.status() != QDataStream::Ok) {
LOG(("App Error: "
"Bad data for Core::Settings::constructFromSerialized()"));
@@ -354,6 +363,8 @@ void Settings::addFromSerialized(const QByteArray &serialized) {
_notifyFromAll = (notifyFromAll == 1);
_nativeWindowFrame = (nativeWindowFrame == 1);
_systemDarkModeEnabled = (systemDarkModeEnabled == 1);
_groupCallPushToTalk = (groupCallPushToTalk == 1);
_groupCallPushToTalkShortcut = groupCallPushToTalkShortcut;
}
bool Settings::chatWide() const {

View File

@@ -217,6 +217,18 @@ public:
void setCallAudioDuckingEnabled(bool value) {
_callAudioDuckingEnabled = value;
}
[[nodiscard]] bool groupCallPushToTalk() const {
return _groupCallPushToTalk;
}
void setGroupCallPushToTalk(bool value) {
_groupCallPushToTalk = value;
}
[[nodiscard]] QByteArray groupCallPushToTalkShortcut() const {
return _groupCallPushToTalkShortcut;
}
void setGroupCallPushToTalkShortcut(const QByteArray &serialized) {
_groupCallPushToTalkShortcut = serialized;
}
[[nodiscard]] Window::Theme::AccentColors &themesAccentColors() {
return _themesAccentColors;
}
@@ -513,6 +525,8 @@ private:
int _callOutputVolume = 100;
int _callInputVolume = 100;
bool _callAudioDuckingEnabled = true;
bool _groupCallPushToTalk = false;
QByteArray _groupCallPushToTalkShortcut;
Window::Theme::AccentColors _themesAccentColors;
bool _lastSeenWarningSeen = false;
Ui::SendFilesWay _sendFilesWay;