Merge pull request #219 from SunboX/app-reset-question

added question for app reset to prevent involuntary damage
This commit is contained in:
André Fiedler 2017-07-04 21:43:27 +02:00 коммит произвёл GitHub
Родитель 2363b13b57 d910612481
Коммит fefa376fb6
3 изменённых файлов: 30 добавлений и 3 удалений

Просмотреть файл

@ -254,7 +254,7 @@ Would you like to inform the application developers and submit the prepared erro
<data name="QuotaUsedOfTotal" xml:space="preserve">
<value>{0} of {1} used</value>
</data>
<data name="ReseTthisApp.Content" xml:space="preserve">
<data name="Button_ResetThisApp.Content" xml:space="preserve">
<value>Reset this app</value>
</data>
<data name="Retry" xml:space="preserve">
@ -676,4 +676,10 @@ Please try again later.</value>
<data name="AppBar_UncheckAll.Label" xml:space="preserve">
<value>Uncheck all</value>
</data>
<data name="ResetThisApp_Description" xml:space="preserve">
<value>Are you sure you want to reset this app? This will reset all application and all your synchronisation settings.</value>
</data>
<data name="ResetThisApp_Title" xml:space="preserve">
<value>Reset this app</value>
</data>
</root>

Просмотреть файл

@ -170,8 +170,29 @@ namespace NextcloudApp.ViewModels
string.Format(_resourceLoader.GetString("ClientVersion"),
$"{Package.Current.Id.Version.Major}.{Package.Current.Id.Version.Minor}.{Package.Current.Id.Version.Build}");
private void Reset()
private async void Reset()
{
var dialog = new ContentDialog
{
Title = _resourceLoader.GetString("ResetThisApp_Title"),
Content = new TextBlock
{
Text = _resourceLoader.GetString("ResetThisApp_Description"),
TextWrapping = TextWrapping.WrapWholeWords,
Margin = new Thickness(0, 20, 0, 0)
},
PrimaryButtonText = _resourceLoader.GetString("Yes"),
SecondaryButtonText = _resourceLoader.GetString("No")
};
dialog.IsPrimaryButtonEnabled = dialog.IsSecondaryButtonEnabled = true;
var result = await _dialogService.ShowAsync(dialog);
if (result != ContentDialogResult.Primary)
{
return;
}
SettingsService.Instance.Reset();
SyncDbUtils.Reset();
_navigationService.Navigate(PageToken.Login.ToString(), null);

Просмотреть файл

@ -152,7 +152,7 @@
Height="1" />
<Button
x:Uid="ReseTthisApp"
x:Uid="Button_ResetThisApp"
Content="Reset this app"
Margin="0,12,0,12"
Command="{Binding ResetCommand}"/>