commit
140d927463
@ -549,8 +549,28 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge
|
|||||||
cameraFrameRateCombo_ = new QComboBox{this};
|
cameraFrameRateCombo_ = new QComboBox{this};
|
||||||
timelineMaxWidthSpin_ = new QSpinBox{this};
|
timelineMaxWidthSpin_ = new QSpinBox{this};
|
||||||
|
|
||||||
if (!settings_->tray())
|
trayToggle_->setChecked(settings_->tray());
|
||||||
|
startInTrayToggle_->setChecked(settings_->startInTray());
|
||||||
|
avatarCircles_->setChecked(settings_->avatarCircles());
|
||||||
|
decryptSidebar_->setChecked(settings_->decryptSidebar());
|
||||||
|
shareKeysWithTrustedUsers_->setChecked(settings_->shareKeysWithTrustedUsers());
|
||||||
|
groupViewToggle_->setChecked(settings_->groupView());
|
||||||
|
timelineButtonsToggle_->setChecked(settings_->buttonsInTimeline());
|
||||||
|
typingNotifications_->setChecked(settings_->typingNotifications());
|
||||||
|
messageHoverHighlight_->setChecked(settings_->messageHoverHighlight());
|
||||||
|
enlargeEmojiOnlyMessages_->setChecked(settings_->enlargeEmojiOnlyMessages());
|
||||||
|
sortByImportance_->setChecked(settings_->sortByImportance());
|
||||||
|
readReceipts_->setChecked(settings_->readReceipts());
|
||||||
|
markdown_->setChecked(settings_->markdown());
|
||||||
|
desktopNotifications_->setChecked(settings_->hasDesktopNotifications());
|
||||||
|
alertOnNotification_->setChecked(settings_->hasAlertOnNotification());
|
||||||
|
useStunServer_->setChecked(settings_->useStunServer());
|
||||||
|
mobileMode_->setChecked(settings_->mobileMode());
|
||||||
|
|
||||||
|
if (!settings_->tray()) {
|
||||||
|
startInTrayToggle_->setState(false);
|
||||||
startInTrayToggle_->setDisabled(true);
|
startInTrayToggle_->setDisabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
avatarCircles_->setFixedSize(64, 48);
|
avatarCircles_->setFixedSize(64, 48);
|
||||||
|
|
||||||
@ -870,79 +890,85 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge
|
|||||||
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentTextChanged),
|
static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentTextChanged),
|
||||||
[this](const QString &frameRate) { settings_->setCameraFrameRate(frameRate); });
|
[this](const QString &frameRate) { settings_->setCameraFrameRate(frameRate); });
|
||||||
|
|
||||||
connect(trayToggle_, &Toggle::toggled, this, [this](bool disabled) {
|
connect(trayToggle_, &Toggle::toggled, this, [this](bool enabled) {
|
||||||
settings_->setTray(!disabled);
|
settings_->setTray(enabled);
|
||||||
if (disabled) {
|
if (enabled) {
|
||||||
startInTrayToggle_->setDisabled(true);
|
startInTrayToggle_->setChecked(false);
|
||||||
} else {
|
|
||||||
startInTrayToggle_->setEnabled(true);
|
startInTrayToggle_->setEnabled(true);
|
||||||
|
startInTrayToggle_->setState(false);
|
||||||
|
settings_->setStartInTray(false);
|
||||||
|
} else {
|
||||||
|
startInTrayToggle_->setChecked(false);
|
||||||
|
startInTrayToggle_->setState(false);
|
||||||
|
startInTrayToggle_->setDisabled(true);
|
||||||
|
settings_->setStartInTray(false);
|
||||||
}
|
}
|
||||||
emit trayOptionChanged(!disabled);
|
emit trayOptionChanged(enabled);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(startInTrayToggle_, &Toggle::toggled, this, [this](bool disabled) {
|
connect(startInTrayToggle_, &Toggle::toggled, this, [this](bool enabled) {
|
||||||
settings_->setStartInTray(!disabled);
|
settings_->setStartInTray(enabled);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(mobileMode_, &Toggle::toggled, this, [this](bool disabled) {
|
connect(mobileMode_, &Toggle::toggled, this, [this](bool enabled) {
|
||||||
settings_->setMobileMode(!disabled);
|
settings_->setMobileMode(enabled);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(groupViewToggle_, &Toggle::toggled, this, [this](bool disabled) {
|
connect(groupViewToggle_, &Toggle::toggled, this, [this](bool enabled) {
|
||||||
settings_->setGroupView(!disabled);
|
settings_->setGroupView(enabled);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(decryptSidebar_, &Toggle::toggled, this, [this](bool disabled) {
|
connect(decryptSidebar_, &Toggle::toggled, this, [this](bool enabled) {
|
||||||
settings_->setDecryptSidebar(!disabled);
|
settings_->setDecryptSidebar(enabled);
|
||||||
emit decryptSidebarChanged();
|
emit decryptSidebarChanged();
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(shareKeysWithTrustedUsers_, &Toggle::toggled, this, [this](bool disabled) {
|
connect(shareKeysWithTrustedUsers_, &Toggle::toggled, this, [this](bool enabled) {
|
||||||
settings_->setShareKeysWithTrustedUsers(!disabled);
|
settings_->setShareKeysWithTrustedUsers(enabled);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(avatarCircles_, &Toggle::toggled, this, [this](bool disabled) {
|
connect(avatarCircles_, &Toggle::toggled, this, [this](bool enabled) {
|
||||||
settings_->setAvatarCircles(!disabled);
|
settings_->setAvatarCircles(enabled);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(markdown_, &Toggle::toggled, this, [this](bool disabled) {
|
connect(markdown_, &Toggle::toggled, this, [this](bool enabled) {
|
||||||
settings_->setMarkdown(!disabled);
|
settings_->setMarkdown(enabled);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(typingNotifications_, &Toggle::toggled, this, [this](bool disabled) {
|
connect(typingNotifications_, &Toggle::toggled, this, [this](bool enabled) {
|
||||||
settings_->setTypingNotifications(!disabled);
|
settings_->setTypingNotifications(enabled);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(sortByImportance_, &Toggle::toggled, this, [this](bool disabled) {
|
connect(sortByImportance_, &Toggle::toggled, this, [this](bool enabled) {
|
||||||
settings_->setSortByImportance(!disabled);
|
settings_->setSortByImportance(enabled);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(timelineButtonsToggle_, &Toggle::toggled, this, [this](bool disabled) {
|
connect(timelineButtonsToggle_, &Toggle::toggled, this, [this](bool enabled) {
|
||||||
settings_->setButtonsInTimeline(!disabled);
|
settings_->setButtonsInTimeline(enabled);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(readReceipts_, &Toggle::toggled, this, [this](bool disabled) {
|
connect(readReceipts_, &Toggle::toggled, this, [this](bool enabled) {
|
||||||
settings_->setReadReceipts(!disabled);
|
settings_->setReadReceipts(enabled);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(desktopNotifications_, &Toggle::toggled, this, [this](bool disabled) {
|
connect(desktopNotifications_, &Toggle::toggled, this, [this](bool enabled) {
|
||||||
settings_->setDesktopNotifications(!disabled);
|
settings_->setDesktopNotifications(enabled);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(alertOnNotification_, &Toggle::toggled, this, [this](bool disabled) {
|
connect(alertOnNotification_, &Toggle::toggled, this, [this](bool enabled) {
|
||||||
settings_->setAlertOnNotification(!disabled);
|
settings_->setAlertOnNotification(enabled);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(messageHoverHighlight_, &Toggle::toggled, this, [this](bool disabled) {
|
connect(messageHoverHighlight_, &Toggle::toggled, this, [this](bool enabled) {
|
||||||
settings_->setMessageHoverHighlight(!disabled);
|
settings_->setMessageHoverHighlight(enabled);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(enlargeEmojiOnlyMessages_, &Toggle::toggled, this, [this](bool disabled) {
|
connect(enlargeEmojiOnlyMessages_, &Toggle::toggled, this, [this](bool enabled) {
|
||||||
settings_->setEnlargeEmojiOnlyMessages(!disabled);
|
settings_->setEnlargeEmojiOnlyMessages(enabled);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(useStunServer_, &Toggle::toggled, this, [this](bool disabled) {
|
connect(useStunServer_, &Toggle::toggled, this, [this](bool enabled) {
|
||||||
settings_->setUseStunServer(!disabled);
|
settings_->setUseStunServer(enabled);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(timelineMaxWidthSpin_,
|
connect(timelineMaxWidthSpin_,
|
||||||
@ -971,23 +997,22 @@ UserSettingsPage::showEvent(QShowEvent *)
|
|||||||
utils::restoreCombobox(themeCombo_, settings_->theme());
|
utils::restoreCombobox(themeCombo_, settings_->theme());
|
||||||
utils::restoreCombobox(ringtoneCombo_, settings_->ringtone());
|
utils::restoreCombobox(ringtoneCombo_, settings_->ringtone());
|
||||||
|
|
||||||
// FIXME: Toggle treats true as "off"
|
trayToggle_->setState(settings_->tray());
|
||||||
trayToggle_->setState(!settings_->tray());
|
startInTrayToggle_->setState(settings_->startInTray());
|
||||||
startInTrayToggle_->setState(!settings_->startInTray());
|
groupViewToggle_->setState(settings_->groupView());
|
||||||
groupViewToggle_->setState(!settings_->groupView());
|
decryptSidebar_->setState(settings_->decryptSidebar());
|
||||||
decryptSidebar_->setState(!settings_->decryptSidebar());
|
shareKeysWithTrustedUsers_->setState(settings_->shareKeysWithTrustedUsers());
|
||||||
shareKeysWithTrustedUsers_->setState(!settings_->shareKeysWithTrustedUsers());
|
avatarCircles_->setState(settings_->avatarCircles());
|
||||||
avatarCircles_->setState(!settings_->avatarCircles());
|
typingNotifications_->setState(settings_->typingNotifications());
|
||||||
typingNotifications_->setState(!settings_->typingNotifications());
|
sortByImportance_->setState(settings_->sortByImportance());
|
||||||
sortByImportance_->setState(!settings_->sortByImportance());
|
timelineButtonsToggle_->setState(settings_->buttonsInTimeline());
|
||||||
timelineButtonsToggle_->setState(!settings_->buttonsInTimeline());
|
mobileMode_->setState(settings_->mobileMode());
|
||||||
mobileMode_->setState(!settings_->mobileMode());
|
readReceipts_->setState(settings_->readReceipts());
|
||||||
readReceipts_->setState(!settings_->readReceipts());
|
markdown_->setState(settings_->markdown());
|
||||||
markdown_->setState(!settings_->markdown());
|
desktopNotifications_->setState(settings_->hasDesktopNotifications());
|
||||||
desktopNotifications_->setState(!settings_->hasDesktopNotifications());
|
alertOnNotification_->setState(settings_->hasAlertOnNotification());
|
||||||
alertOnNotification_->setState(!settings_->hasAlertOnNotification());
|
messageHoverHighlight_->setState(settings_->messageHoverHighlight());
|
||||||
messageHoverHighlight_->setState(!settings_->messageHoverHighlight());
|
enlargeEmojiOnlyMessages_->setState(settings_->enlargeEmojiOnlyMessages());
|
||||||
enlargeEmojiOnlyMessages_->setState(!settings_->enlargeEmojiOnlyMessages());
|
|
||||||
deviceIdValue_->setText(QString::fromStdString(http::client()->device_id()));
|
deviceIdValue_->setText(QString::fromStdString(http::client()->device_id()));
|
||||||
timelineMaxWidthSpin_->setValue(settings_->timelineMaxWidth());
|
timelineMaxWidthSpin_->setValue(settings_->timelineMaxWidth());
|
||||||
|
|
||||||
@ -1010,7 +1035,7 @@ UserSettingsPage::showEvent(QShowEvent *)
|
|||||||
utils::restoreCombobox(cameraResolutionCombo_, cameraResolution);
|
utils::restoreCombobox(cameraResolutionCombo_, cameraResolution);
|
||||||
utils::restoreCombobox(cameraFrameRateCombo_, cameraFrameRate);
|
utils::restoreCombobox(cameraFrameRateCombo_, cameraFrameRate);
|
||||||
|
|
||||||
useStunServer_->setState(!settings_->useStunServer());
|
useStunServer_->setState(settings_->useStunServer());
|
||||||
|
|
||||||
deviceFingerprintValue_->setText(
|
deviceFingerprintValue_->setText(
|
||||||
utils::humanReadableFingerprint(olm::client()->identity_keys().ed25519));
|
utils::humanReadableFingerprint(olm::client()->identity_keys().ed25519));
|
||||||
|
@ -857,7 +857,8 @@ WebRTCSession::acceptOffer(const std::string &sdp)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// avoid a race that sometimes leaves the generated answer without media tracks (a=ssrc lines)
|
// avoid a race that sometimes leaves the generated answer without media tracks (a=ssrc
|
||||||
|
// lines)
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
||||||
|
|
||||||
// set-remote-description first, then create-answer
|
// set-remote-description first, then create-answer
|
||||||
|
@ -22,7 +22,7 @@ Toggle::Toggle(QWidget *parent)
|
|||||||
void
|
void
|
||||||
Toggle::setState(bool isEnabled)
|
Toggle::setState(bool isEnabled)
|
||||||
{
|
{
|
||||||
thumb_->setShift(isEnabled ? Position::Right : Position::Left);
|
thumb_->setShift(isEnabled ? Position::Left : Position::Right);
|
||||||
setupProperties();
|
setupProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user