mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-30 22:25:12 +00:00
Add export my data button in Settings.
This commit is contained in:
@@ -469,6 +469,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_settings_calls_privacy" = "Phone calls privacy";
|
||||
"lng_settings_groups_invite_privacy" = "Group invite settings";
|
||||
"lng_settings_show_sessions" = "Show all sessions";
|
||||
"lng_settings_export_data" = "Export all my data";
|
||||
"lng_settings_self_destruct" = "Account self-destruct settings";
|
||||
"lng_settings_change_phone" = "Change phone number";
|
||||
|
||||
|
@@ -12,6 +12,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "styles/style_settings.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "application.h"
|
||||
#include "auth_session.h"
|
||||
#include "data/data_session.h"
|
||||
#include "platform/platform_specific.h"
|
||||
#include "base/openssl_help.h"
|
||||
#include "boxes/sessions_box.h"
|
||||
@@ -234,8 +236,9 @@ void PrivacyWidget::createControls() {
|
||||
_autoLock->hide(anim::type::instant);
|
||||
}
|
||||
createChildRow(_cloudPasswordState, marginSmall);
|
||||
createChildRow(_showAllSessions, marginSmall, lang(lng_settings_show_sessions), SLOT(onShowSessions()));
|
||||
createChildRow(_selfDestruction, marginSmall, lang(lng_settings_self_destruct), SLOT(onSelfDestruction()));
|
||||
createChildRow(_showAllSessions, marginSmall, lang(lng_settings_show_sessions), SLOT(onShowSessions()));
|
||||
createChildRow(_exportData, marginSmall, lang(lng_settings_export_data), SLOT(onExportData()));
|
||||
}
|
||||
|
||||
void PrivacyWidget::autoLockUpdated() {
|
||||
@@ -280,4 +283,12 @@ void PrivacyWidget::onSelfDestruction() {
|
||||
Ui::show(Box<SelfDestructionBox>());
|
||||
}
|
||||
|
||||
void PrivacyWidget::onExportData() {
|
||||
Ui::hideSettingsAndLayer();
|
||||
App::CallDelayed(
|
||||
st::boxDuration,
|
||||
&Auth(),
|
||||
[] { Auth().data().startExport(); });
|
||||
}
|
||||
|
||||
} // namespace Settings
|
||||
|
@@ -87,6 +87,7 @@ private slots:
|
||||
void onAutoLock();
|
||||
void onShowSessions();
|
||||
void onSelfDestruction();
|
||||
void onExportData();
|
||||
|
||||
private:
|
||||
static QString GetAutoLockText();
|
||||
@@ -103,6 +104,7 @@ private:
|
||||
CloudPasswordState *_cloudPasswordState = nullptr;
|
||||
Ui::LinkButton *_showAllSessions = nullptr;
|
||||
Ui::LinkButton *_selfDestruction = nullptr;
|
||||
Ui::LinkButton *_exportData = nullptr;
|
||||
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user