mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-28 21:27:53 +00:00
[Option][GUI] Remember image compression
This commit is contained in:
parent
bca35c2cbb
commit
cda999862f
@ -155,6 +155,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/localimageloader.h"
|
#include "storage/localimageloader.h"
|
||||||
#include "storage/localstorage.h"
|
#include "storage/localstorage.h"
|
||||||
@ -1361,7 +1362,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) {
|
||||||
|
@ -395,6 +395,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;
|
||||||
|
@ -594,6 +594,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…
x
Reference in New Issue
Block a user