mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-11-09 17:06:24 +08:00
[feat] add configurable video pause on minimize, refs #143
This commit is contained in:
@@ -154,6 +154,8 @@ int ConfigCenter::Load() {
|
||||
ini_->GetBoolValue(section_, "trusted_devices_only", true));
|
||||
save_remote_previews_.store(
|
||||
ini_->GetBoolValue(section_, "save_remote_previews", true));
|
||||
pause_video_when_minimized_.store(
|
||||
ini_->GetBoolValue(section_, "pause_video_when_minimized", true));
|
||||
portable_service_prompt_suppressed_ =
|
||||
ini_->GetBoolValue(section_, "portable_service_prompt_suppressed",
|
||||
portable_service_prompt_suppressed_);
|
||||
@@ -253,6 +255,8 @@ int ConfigCenter::Save() {
|
||||
ini_->SetBoolValue(section_, "trusted_devices_only", trusted_devices_only_.load());
|
||||
ini_->SetBoolValue(section_, "save_remote_previews",
|
||||
save_remote_previews_.load());
|
||||
ini_->SetBoolValue(section_, "pause_video_when_minimized",
|
||||
pause_video_when_minimized_.load());
|
||||
ini_->SetBoolValue(section_, "portable_service_prompt_suppressed",
|
||||
portable_service_prompt_suppressed_);
|
||||
ini_->SetValue(section_, "sponsorship_prompt_dismissed_version",
|
||||
@@ -467,6 +471,18 @@ bool ConfigCenter::IsSaveRemotePreviews() const {
|
||||
return save_remote_previews_.load();
|
||||
}
|
||||
|
||||
int ConfigCenter::SetPauseVideoWhenMinimized(bool enabled) {
|
||||
if (StoreValues({{"pause_video_when_minimized", enabled ? "true" : "false"}}) != 0) {
|
||||
return -1;
|
||||
}
|
||||
pause_video_when_minimized_.store(enabled);
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool ConfigCenter::IsPauseVideoWhenMinimized() const {
|
||||
return pause_video_when_minimized_.load();
|
||||
}
|
||||
|
||||
int ConfigCenter::SetPortableServicePromptSuppressed(bool suppressed) {
|
||||
portable_service_prompt_suppressed_ = suppressed;
|
||||
ini_->SetBoolValue(section_, "portable_service_prompt_suppressed",
|
||||
|
||||
@@ -57,6 +57,7 @@ class ConfigCenter {
|
||||
int SetLockOnDisconnect(bool enabled);
|
||||
int SetTrustedDevicesOnly(bool enabled);
|
||||
int SetSaveRemotePreviews(bool enabled);
|
||||
int SetPauseVideoWhenMinimized(bool enabled);
|
||||
int SetPortableServicePromptSuppressed(bool suppressed);
|
||||
int SetSponsorshipPromptDismissedVersion(const std::string& version);
|
||||
int SetFileTransferSavePath(const std::string& path);
|
||||
@@ -83,6 +84,7 @@ class ConfigCenter {
|
||||
bool IsLockOnDisconnect() const;
|
||||
bool IsTrustedDevicesOnly() const;
|
||||
bool IsSaveRemotePreviews() const;
|
||||
bool IsPauseVideoWhenMinimized() const;
|
||||
bool IsPortableServicePromptSuppressed() const;
|
||||
std::string GetSponsorshipPromptDismissedVersion() const;
|
||||
std::string GetFileTransferSavePath() const;
|
||||
@@ -117,6 +119,7 @@ class ConfigCenter {
|
||||
std::atomic<bool> lock_on_disconnect_{true};
|
||||
std::atomic<bool> trusted_devices_only_{false};
|
||||
std::atomic<bool> save_remote_previews_{true};
|
||||
std::atomic<bool> pause_video_when_minimized_{true};
|
||||
bool portable_service_prompt_suppressed_ = false;
|
||||
std::string sponsorship_prompt_dismissed_version_;
|
||||
std::string file_transfer_save_path_ = "";
|
||||
|
||||
Reference in New Issue
Block a user