[Option][GUI] Remember image compression
This commit is contained in:
parent
4eb79608a2
commit
05e02a522f
4 changed files with 24 additions and 1 deletions
|
|
@ -144,6 +144,8 @@
|
||||||
"ktg_forward_force_old_unquoted": "Old unquoted forward method",
|
"ktg_forward_force_old_unquoted": "Old unquoted forward method",
|
||||||
"ktg_forward_force_old_unquoted_desc": "Old method copies messages content on client rather than server. Currently it's used only for \"Regroup media\" grouping mode, since new one doesn't support it. If for some reason unquoted forward doesn't work correctly, try switching this option.",
|
"ktg_forward_force_old_unquoted_desc": "Old method copies messages content on client rather than server. Currently it's used only for \"Regroup media\" grouping mode, since new one doesn't support it. If for some reason unquoted forward doesn't work correctly, try switching this option.",
|
||||||
"ktg_disable_chat_themes": "Disable chat themes",
|
"ktg_disable_chat_themes": "Disable chat themes",
|
||||||
|
"ktg_settings_remember_compress_images": "Remember compress images",
|
||||||
|
"ktg_settings_compress_images_default": "Compress images by default",
|
||||||
"ktg_forward_quiz_unquoted": "Sorry, quizzes that are currently open and unvoted on cannot be forwarded unquoted.",
|
"ktg_forward_quiz_unquoted": "Sorry, quizzes that are currently open and unvoted on cannot be forwarded unquoted.",
|
||||||
"ktg_in_app_update_disabled": "In-app updater is disabled.",
|
"ktg_in_app_update_disabled": "In-app updater is disabled.",
|
||||||
"dummy_last_string": ""
|
"dummy_last_string": ""
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
*/
|
*/
|
||||||
#include "boxes/send_files_box.h"
|
#include "boxes/send_files_box.h"
|
||||||
|
|
||||||
|
#include "kotato/kotato_settings.h"
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
#include "storage/localstorage.h"
|
#include "storage/localstorage.h"
|
||||||
#include "storage/storage_media_prepare.h"
|
#include "storage/storage_media_prepare.h"
|
||||||
|
|
@ -1394,7 +1395,8 @@ void SendFilesBox::saveSendWaySettings() {
|
||||||
way.setGroupFiles(oldWay.groupFiles());
|
way.setGroupFiles(oldWay.groupFiles());
|
||||||
}
|
}
|
||||||
if (_list.overrideSendImagesAsPhotos == way.sendImagesAsPhotos()
|
if (_list.overrideSendImagesAsPhotos == way.sendImagesAsPhotos()
|
||||||
|| _sendImagesAsPhotos->isHidden()) {
|
|| _sendImagesAsPhotos->isHidden()
|
||||||
|
|| !::Kotato::JsonSettings::GetBool("remember_compress_images")) {
|
||||||
way.setSendImagesAsPhotos(oldWay.sendImagesAsPhotos());
|
way.setSendImagesAsPhotos(oldWay.sendImagesAsPhotos());
|
||||||
}
|
}
|
||||||
if (way != oldWay) {
|
if (way != oldWay) {
|
||||||
|
|
|
||||||
|
|
@ -355,6 +355,9 @@ const std::map<QString, Definition, std::greater<QString>> DefinitionMap {
|
||||||
{ "disable_chat_themes", {
|
{ "disable_chat_themes", {
|
||||||
.type = SettingType::BoolSetting,
|
.type = SettingType::BoolSetting,
|
||||||
.defaultValue = false, }},
|
.defaultValue = false, }},
|
||||||
|
{ "remember_compress_images", {
|
||||||
|
.type = SettingType::BoolSetting,
|
||||||
|
.defaultValue = false, }},
|
||||||
};
|
};
|
||||||
|
|
||||||
using OldOptionKey = QString;
|
using OldOptionKey = QString;
|
||||||
|
|
|
||||||
|
|
@ -543,6 +543,22 @@ void SetupKotatoOther(
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
SettingsMenuJsonSwitch(ktg_settings_remember_compress_images, remember_compress_images);
|
||||||
|
container->add(object_ptr<Button>(
|
||||||
|
container,
|
||||||
|
rktr("ktg_settings_compress_images_default"),
|
||||||
|
st::settingsButtonNoIcon
|
||||||
|
))->toggleOn(
|
||||||
|
rpl::single(Core::App().settings().sendFilesWay().sendImagesAsPhotos())
|
||||||
|
)->toggledValue(
|
||||||
|
) | rpl::filter([](bool enabled) {
|
||||||
|
return (enabled != Core::App().settings().sendFilesWay().sendImagesAsPhotos());
|
||||||
|
}) | rpl::start_with_next([](bool enabled) {
|
||||||
|
auto way = Core::App().settings().sendFilesWay();
|
||||||
|
way.setSendImagesAsPhotos(enabled);
|
||||||
|
Core::App().settings().setSendFilesWay(way);
|
||||||
|
Core::App().saveSettingsDelayed();
|
||||||
|
}, container->lifetime());
|
||||||
SettingsMenuJsonSwitch(ktg_settings_ffmpeg_multithread, ffmpeg_multithread);
|
SettingsMenuJsonSwitch(ktg_settings_ffmpeg_multithread, ffmpeg_multithread);
|
||||||
|
|
||||||
Ui::AddSkip(container);
|
Ui::AddSkip(container);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue