Move data and storage to advanced settings.

This commit is contained in:
John Preston 2018-09-19 13:29:51 +03:00
parent 9388e154cf
commit 00e4cfc345
4 changed files with 28 additions and 14 deletions

View File

@ -331,7 +331,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_settings_language" = "Language";
"lng_settings_default_scale" = "Default interface scale";
"lng_settings_edit_info" = "Edit information";
"lng_settings_local_storage" = "Local storage";
"lng_settings_connection_type" = "Connection type";
"lng_settings_downloading_update" = "Downloading update {progress}...";
"lng_settings_use_night_mode" = "Use night mode";
@ -362,6 +361,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_settings_password_title" = "Two-step verification";
"lng_settings_sessions_title" = "Active sessions";
"lng_settings_destroy_title" = "Delete my account";
"lng_settings_network_proxy" = "Network and proxy";
"lng_settings_version_info" = "Version and updates";
"lng_settings_system_integration" = "System integration";
"lng_backgrounds_header" = "Choose your new chat background";
"lng_theme_sure_keep" = "Keep this theme?";
@ -472,7 +474,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_cloud_password_is_same" = "Password was not changed";
"lng_cloud_password_passport_losing" = "Warning! All data saved in your Telegram Passport will be lost!";
"lng_connection_type" = "Connection type:";
"lng_connection_auto_connecting" = "Default (connecting...)";
"lng_connection_auto" = "Default ({transport} used)";
"lng_connection_proxy_connecting" = "Connecting through proxy...";
@ -968,7 +969,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_media_video" = "Video";
"lng_media_audio" = "Voice message";
"lng_media_auto_settings" = "Automatic media download settings";
"lng_media_auto_settings" = "Automatic media download";
"lng_media_auto_photo" = "Automatic photo download";
"lng_media_auto_audio" = "Automatic voice message download";
"lng_media_auto_gif" = "Automatic GIF download";

View File

@ -384,7 +384,7 @@ void SetupStickersEmoji(not_null<Ui::VerticalLayout*> container) {
void SetupMessages(not_null<Ui::VerticalLayout*> container) {
AddDivider(container);
AddSkip(container, st::settingsSectionSkip);
AddSkip(container);
AddSubsectionTitle(container, lng_settings_messages);
@ -459,7 +459,7 @@ void SetupExport(not_null<Ui::VerticalLayout*> container) {
void SetupLocalStorage(not_null<Ui::VerticalLayout*> container) {
AddButton(
container,
lng_settings_local_storage,
lng_settings_manage_local_storage,
st::settingsButton
)->addClickHandler([] {
LocalStorageBox::Show(&Auth().data().cache());
@ -470,7 +470,7 @@ void SetupDataStorage(not_null<Ui::VerticalLayout*> container) {
using namespace rpl::mappers;
AddDivider(container);
AddSkip(container, st::settingsSectionSkip);
AddSkip(container);
AddSubsectionTitle(container, lng_settings_data_storage);
@ -538,7 +538,7 @@ void SetupDataStorage(not_null<Ui::VerticalLayout*> container) {
void SetupChatBackground(not_null<Ui::VerticalLayout*> container) {
AddDivider(container);
AddSkip(container, st::settingsSectionSkip);
AddSkip(container);
AddSubsectionTitle(container, lng_settings_section_background);
@ -688,7 +688,6 @@ void Chat::setupContent() {
SetupStickersEmoji(content);
SetupMessages(content);
SetupDataStorage(content);
SetupChatBackground(content);
SetupThemeOptions(content);

View File

@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Settings {
void SetupDataStorage(not_null<Ui::VerticalLayout*> container);
void SetupNightMode(not_null<Ui::VerticalLayout*> container);
void SetupUseDefaultTheme(not_null<Ui::VerticalLayout*> container);

View File

@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "settings/settings_general.h"
#include "settings/settings_common.h"
#include "settings/settings_chat.h"
#include "ui/wrap/vertical_layout.h"
#include "ui/wrap/slide_wrap.h"
#include "ui/widgets/labels.h"
@ -395,24 +396,36 @@ void General::setupContent() {
AddDivider(content);
}
};
const auto addUpdate = [&] {
if (HasUpdate()) {
addDivider();
AddSkip(content);
AddSubsectionTitle(content, lng_settings_version_info);
SetupUpdate(content);
AddSkip(content);
}
};
if (!cAutoUpdate()) {
addUpdate();
}
if (HasConnectionType()) {
addDivider();
AddSkip(content);
AddSubsectionTitle(content, lng_settings_network_proxy);
SetupConnectionType(content);
AddSkip(content);
}
if (HasUpdate()) {
addDivider();
AddSkip(content);
SetupUpdate(content);
AddSkip(content);
}
SetupDataStorage(content);
if (HasTray()) {
addDivider();
AddSkip(content);
AddSubsectionTitle(content, lng_settings_system_integration);
SetupTray(content);
AddSkip(content);
}
if (cAutoUpdate()) {
addUpdate();
}
Ui::ResizeFitChild(this, content);
}