mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Hamburger button state is now correct (no more double clicks) but it's a bit hacky
Changed Help tooltip location in New Database Settings page Suggest Save As when opening DB when another is opened and there is a save error
This commit is contained in:
@@ -75,12 +75,12 @@ namespace ModernKeePass
|
|||||||
Resuming += OnResuming;
|
Resuming += OnResuming;
|
||||||
UnhandledException += OnUnhandledException;
|
UnhandledException += OnUnhandledException;
|
||||||
|
|
||||||
_messenger.Register<SaveErrorMessage>(this, async message => await HandelSaveError(message.Message));
|
_messenger.Register<SaveErrorMessage>(this, async message => await HandleSaveError(message));
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task HandelSaveError(string message)
|
private async Task HandleSaveError(SaveErrorMessage message)
|
||||||
{
|
{
|
||||||
_notification.Show(_resource.GetResourceValue("MessageDialogSaveErrorTitle"), message);
|
_notification.Show(_resource.GetResourceValue("MessageDialogSaveErrorTitle"), message?.Message);
|
||||||
var database = await _mediator.Send(new GetDatabaseQuery());
|
var database = await _mediator.Send(new GetDatabaseQuery());
|
||||||
var file = await _file.CreateFile($"{database.Name} - copy",
|
var file = await _file.CreateFile($"{database.Name} - copy",
|
||||||
Domain.Common.Constants.Extensions.Kdbx,
|
Domain.Common.Constants.Extensions.Kdbx,
|
||||||
|
@@ -513,7 +513,7 @@
|
|||||||
<data name="SettingsSaveDatabaseSuspendDesc.Text" xml:space="preserve">
|
<data name="SettingsSaveDatabaseSuspendDesc.Text" xml:space="preserve">
|
||||||
<value>This settings is generally recommended. If you enable it, database will automatically be saved on application suspension and closing, provided your database is less than 1MB big. Saving bigger databases may take too long and Windows may then forcibly kill the app before saving is finished, resulting in your changes not being saved.</value>
|
<value>This settings is generally recommended. If you enable it, database will automatically be saved on application suspension and closing, provided your database is less than 1MB big. Saving bigger databases may take too long and Windows may then forcibly kill the app before saving is finished, resulting in your changes not being saved.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NewGroupTextBox" xml:space="preserve">
|
<data name="NewGroupTextBox.ButtonTooltip" xml:space="preserve">
|
||||||
<value>New group name</value>
|
<value>New group name</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
@@ -492,9 +492,6 @@
|
|||||||
<data name="NewImportFormat.Text" xml:space="preserve">
|
<data name="NewImportFormat.Text" xml:space="preserve">
|
||||||
<value>Format</value>
|
<value>Format</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NewImportFormatHelp.Text" xml:space="preserve">
|
|
||||||
<value>Le fichier CSV doit être formatté de la façon suivante: Nom du compte;Login;Mot de passe:URL;Commentaires</value>
|
|
||||||
</data>
|
|
||||||
<data name="CloseButton.Content" xml:space="preserve">
|
<data name="CloseButton.Content" xml:space="preserve">
|
||||||
<value>Fermer sans sauvegarder</value>
|
<value>Fermer sans sauvegarder</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -516,7 +513,7 @@
|
|||||||
<data name="CompositeKeyConfirmPassword.PlaceholderText" xml:space="preserve">
|
<data name="CompositeKeyConfirmPassword.PlaceholderText" xml:space="preserve">
|
||||||
<value>Confirmer le mot de passe</value>
|
<value>Confirmer le mot de passe</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NewGroupTextBox" xml:space="preserve">
|
<data name="NewGroupTextBox.ButtonTooltip" xml:space="preserve">
|
||||||
<value>Nom du groupe</value>
|
<value>Nom du groupe</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
@@ -183,8 +183,8 @@ namespace ModernKeePass.ViewModels
|
|||||||
}
|
}
|
||||||
catch (SaveException exception)
|
catch (SaveException exception)
|
||||||
{
|
{
|
||||||
// TODO: Implement save as
|
|
||||||
_notification.Show(exception.Source, exception.Message);
|
_notification.Show(exception.Source, exception.Message);
|
||||||
|
MessengerInstance.Send(new SaveErrorMessage { Message = exception.Message });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -268,12 +268,22 @@
|
|||||||
</Storyboard>
|
</Storyboard>
|
||||||
</VisualState>
|
</VisualState>
|
||||||
</VisualStateGroup>
|
</VisualStateGroup>
|
||||||
<VisualStateGroup x:Name="TopMenuGroup">
|
<VisualStateGroup x:Name="PageLayout">
|
||||||
<VisualState x:Name="Small">
|
<VisualState x:Name="Small">
|
||||||
<Storyboard>
|
<Storyboard>
|
||||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="AddEntryTextBlock" Storyboard.TargetProperty="Visibility">
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="AddEntryTextBlock" Storyboard.TargetProperty="Visibility">
|
||||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
|
<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
|
||||||
</ObjectAnimationUsingKeyFrames>
|
</ObjectAnimationUsingKeyFrames>
|
||||||
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HamburgerMenu" Storyboard.TargetProperty="IsOpen">
|
||||||
|
<DiscreteObjectKeyFrame KeyTime="0" Value="False"/>
|
||||||
|
</ObjectAnimationUsingKeyFrames>
|
||||||
|
</Storyboard>
|
||||||
|
</VisualState>
|
||||||
|
<VisualState x:Name="Medium">
|
||||||
|
<Storyboard>
|
||||||
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HamburgerMenu" Storyboard.TargetProperty="IsOpen">
|
||||||
|
<DiscreteObjectKeyFrame KeyTime="0" Value="False"/>
|
||||||
|
</ObjectAnimationUsingKeyFrames>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
</VisualState>
|
</VisualState>
|
||||||
<VisualState x:Name="Large">
|
<VisualState x:Name="Large">
|
||||||
@@ -281,6 +291,9 @@
|
|||||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="AddEntryTextBlock" Storyboard.TargetProperty="Visibility">
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="AddEntryTextBlock" Storyboard.TargetProperty="Visibility">
|
||||||
<DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
|
<DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
|
||||||
</ObjectAnimationUsingKeyFrames>
|
</ObjectAnimationUsingKeyFrames>
|
||||||
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="HamburgerMenu" Storyboard.TargetProperty="IsOpen">
|
||||||
|
<DiscreteObjectKeyFrame KeyTime="0" Value="True"/>
|
||||||
|
</ObjectAnimationUsingKeyFrames>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
</VisualState>
|
</VisualState>
|
||||||
</VisualStateGroup>
|
</VisualStateGroup>
|
||||||
|
@@ -1,7 +1,4 @@
|
|||||||
using System;
|
using Windows.ApplicationModel.DataTransfer;
|
||||||
using System.Linq;
|
|
||||||
using Windows.ApplicationModel.DataTransfer;
|
|
||||||
using Windows.Storage.Streams;
|
|
||||||
using Windows.UI.Xaml;
|
using Windows.UI.Xaml;
|
||||||
using Windows.UI.Xaml.Controls;
|
using Windows.UI.Xaml.Controls;
|
||||||
using Windows.UI.Xaml.Navigation;
|
using Windows.UI.Xaml.Navigation;
|
||||||
|
@@ -6,15 +6,14 @@
|
|||||||
xmlns:viewModels="using:ModernKeePass.ViewModels"
|
xmlns:viewModels="using:ModernKeePass.ViewModels"
|
||||||
x:Class="ModernKeePass.Views.AboutPage"
|
x:Class="ModernKeePass.Views.AboutPage"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
<Page.DataContext>
|
<Page.DataContext>
|
||||||
<viewModels:AboutVm/>
|
<viewModels:AboutVm/>
|
||||||
</Page.DataContext>
|
</Page.DataContext>
|
||||||
|
|
||||||
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||||
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Margin="10,0,0,0">
|
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Margin="10,0,0,0">
|
||||||
<Run Text="{Binding Name}"/>
|
<Run Text="{Binding Name}" />
|
||||||
<Run Text="version"/>
|
<Run Text="version" />
|
||||||
<Run Text="{Binding Version}" />
|
<Run Text="{Binding Version}" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Margin="30,0,0,0">
|
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Margin="30,0,0,0">
|
||||||
@@ -23,7 +22,7 @@
|
|||||||
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Margin="30,0,0,0">
|
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Margin="30,0,0,0">
|
||||||
<Run x:Uid="AboutHomepage" />
|
<Run x:Uid="AboutHomepage" />
|
||||||
<Hyperlink NavigateUri="https://wismna.github.io/ModernKeePass/">
|
<Hyperlink NavigateUri="https://wismna.github.io/ModernKeePass/">
|
||||||
<Run Text="https://wismna.github.io/ModernKeePass/"/>
|
<Run Text="https://wismna.github.io/ModernKeePass/" />
|
||||||
</Hyperlink>
|
</Hyperlink>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Margin="10,0,0,0">
|
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Margin="10,0,0,0">
|
||||||
|
@@ -20,10 +20,10 @@
|
|||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<TextBlock Text="Import" Style="{StaticResource SubheaderTextBlockStyle}" />
|
<TextBlock Text="Import" Style="{StaticResource SubheaderTextBlockStyle}" />
|
||||||
<HyperlinkButton Grid.Column="0" Grid.Row="1" Content="Select file..." Style="{StaticResource MainColorHyperlinkButton}" Click="ImportFileButton_OnClick" />
|
<HyperlinkButton Grid.Column="0" Grid.Row="1" Content="Select file..." />
|
||||||
<StackPanel Grid.Column="1" Grid.Row="1" >
|
<StackPanel Grid.Column="1" Grid.Row="1" >
|
||||||
<TextBlock Text="Format" Style="{StaticResource BodyTextBlockStyle}" Margin="0,0,0,10" />
|
<TextBlock Text="Format" Style="{StaticResource BodyTextBlockStyle}" Margin="0,0,0,10" />
|
||||||
<ComboBox Style="{StaticResource MainColorComboBox}">
|
<ComboBox>
|
||||||
<ComboBoxItem>CSV</ComboBoxItem>
|
<ComboBoxItem>CSV</ComboBoxItem>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
@@ -32,6 +32,6 @@
|
|||||||
<RadioButton GroupName="ImportDestination" Content="New database" />
|
<RadioButton GroupName="ImportDestination" Content="New database" />
|
||||||
<RadioButton GroupName="ImportDestination" Content="Currently opened database" />
|
<RadioButton GroupName="ImportDestination" Content="Currently opened database" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Button Grid.Column="3" Grid.Row="1" Content="Import" Style="{StaticResource MainColorButton}" />
|
<Button Grid.Column="3" Grid.Row="1" Content="Import" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Page>
|
</Page>
|
||||||
|
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
|
||||||
using Windows.Storage.Pickers;
|
|
||||||
using Windows.UI.Xaml;
|
|
||||||
|
|
||||||
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
|
|
||||||
|
|
||||||
namespace ModernKeePass.Views
|
namespace ModernKeePass.Views
|
||||||
{
|
{
|
||||||
@@ -15,21 +11,5 @@ namespace ModernKeePass.Views
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void ImportFileButton_OnClick(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
var picker =
|
|
||||||
new FileOpenPicker
|
|
||||||
{
|
|
||||||
ViewMode = PickerViewMode.List,
|
|
||||||
SuggestedStartLocation = PickerLocationId.DocumentsLibrary
|
|
||||||
};
|
|
||||||
picker.FileTypeFilter.Add(".csv");
|
|
||||||
|
|
||||||
// Application now has read/write access to the picked file
|
|
||||||
var file = await picker.PickSingleFileAsync().AsTask();
|
|
||||||
if (file == null) return;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,18 +13,12 @@
|
|||||||
</StackPanel.Resources>
|
</StackPanel.Resources>
|
||||||
<TextBlock x:Uid="SettingsNewDatabaseDesc" Style="{StaticResource TextBlockSettingsHeaderStyle}" Margin="5,0,0,10"/>
|
<TextBlock x:Uid="SettingsNewDatabaseDesc" Style="{StaticResource TextBlockSettingsHeaderStyle}" Margin="5,0,0,10"/>
|
||||||
<ToggleSwitch x:Uid="SettingsNewDatabaseSample" IsOn="{Binding IsCreateSample, Mode=TwoWay}" />
|
<ToggleSwitch x:Uid="SettingsNewDatabaseSample" IsOn="{Binding IsCreateSample, Mode=TwoWay}" />
|
||||||
<TextBlock x:Uid="SettingsNewDatabaseKdf" Style="{StaticResource TextBlockSettingsHeaderStyle}" Margin="5,20,0,10" />
|
<StackPanel Orientation="Horizontal" Margin="5,20,0,10">
|
||||||
<Grid>
|
<TextBlock x:Uid="SettingsNewDatabaseKdf" Style="{StaticResource TextBlockSettingsHeaderStyle}" />
|
||||||
<Grid.ColumnDefinitions>
|
<Button Style="{StaticResource TextBlockButtonStyle}" Foreground="{StaticResource ButtonPointerOverForegroundThemeBrush}" Margin="0,-2,0,0">
|
||||||
<ColumnDefinition Width="Auto" />
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
<ColumnDefinition Width="Auto" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<ComboBox Grid.Column="1" ItemsSource="{Binding Source={StaticResource KeyDerivations}}" SelectedItem="{Binding DatabaseFormatVersion, Mode=TwoWay}" DisplayMemberPath="DisplayText" />
|
|
||||||
<Button Grid.Column="2" Style="{StaticResource TextBlockButtonStyle}">
|
|
||||||
<SymbolIcon Symbol="Help" RenderTransformOrigin="0.5,0.5">
|
<SymbolIcon Symbol="Help" RenderTransformOrigin="0.5,0.5">
|
||||||
<SymbolIcon.RenderTransform>
|
<SymbolIcon.RenderTransform>
|
||||||
<CompositeTransform ScaleX="0.7" ScaleY="0.7"/>
|
<CompositeTransform ScaleX="0.6" ScaleY="0.6"/>
|
||||||
</SymbolIcon.RenderTransform>
|
</SymbolIcon.RenderTransform>
|
||||||
</SymbolIcon>
|
</SymbolIcon>
|
||||||
<Button.Flyout>
|
<Button.Flyout>
|
||||||
@@ -33,6 +27,7 @@
|
|||||||
</Flyout>
|
</Flyout>
|
||||||
</Button.Flyout>
|
</Button.Flyout>
|
||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</StackPanel>
|
||||||
|
<ComboBox ItemsSource="{Binding Source={StaticResource KeyDerivations}}" SelectedItem="{Binding DatabaseFormatVersion, Mode=TwoWay}" DisplayMemberPath="DisplayText" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Page>
|
</Page>
|
||||||
|
@@ -60,7 +60,7 @@
|
|||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<ToggleButton Style="{StaticResource HamburgerToggleButton}" Unchecked="ToggleButton_OnUnchecked">
|
<ToggleButton Style="{StaticResource HamburgerToggleButton}" IsChecked="{Binding IsOpen, ElementName=UserControl}" Unchecked="ToggleButton_OnUnchecked">
|
||||||
<interactivity:Interaction.Behaviors>
|
<interactivity:Interaction.Behaviors>
|
||||||
<core:EventTriggerBehavior EventName="Checked">
|
<core:EventTriggerBehavior EventName="Checked">
|
||||||
<core:GoToStateAction StateName="Expanded" />
|
<core:GoToStateAction StateName="Expanded" />
|
||||||
|
@@ -99,6 +99,18 @@ namespace ModernKeePass.Views.UserControls
|
|||||||
typeof(HamburgerMenuUserControl),
|
typeof(HamburgerMenuUserControl),
|
||||||
new PropertyMetadata(-1, (o, args) => { }));
|
new PropertyMetadata(-1, (o, args) => { }));
|
||||||
|
|
||||||
|
public bool IsOpen
|
||||||
|
{
|
||||||
|
get { return (bool)GetValue(IsOpenProperty); }
|
||||||
|
set { SetValue(IsOpenProperty, value); }
|
||||||
|
}
|
||||||
|
public static readonly DependencyProperty IsOpenProperty =
|
||||||
|
DependencyProperty.Register(
|
||||||
|
nameof(IsOpen),
|
||||||
|
typeof(bool),
|
||||||
|
typeof(HamburgerMenuUserControl),
|
||||||
|
new PropertyMetadata(false, (o, args) => { }));
|
||||||
|
|
||||||
public ICommand ActionButtonCommand
|
public ICommand ActionButtonCommand
|
||||||
{
|
{
|
||||||
get { return (ICommand)GetValue(ActionButtonCommandProperty); }
|
get { return (ICommand)GetValue(ActionButtonCommandProperty); }
|
||||||
|
@@ -78,6 +78,7 @@
|
|||||||
</VisualStateGroup>
|
</VisualStateGroup>
|
||||||
</VisualStateManager.VisualStateGroups>
|
</VisualStateManager.VisualStateGroups>
|
||||||
<interactivity:Interaction.Behaviors>
|
<interactivity:Interaction.Behaviors>
|
||||||
|
<!-- TODO: Correct the Runtime template binding error (even though it is actually working as intended) -->
|
||||||
<core:DataTriggerBehavior Binding="{Binding IsError}" Value="True">
|
<core:DataTriggerBehavior Binding="{Binding IsError}" Value="True">
|
||||||
<core:GoToStateAction StateName="Error"/>
|
<core:GoToStateAction StateName="Error"/>
|
||||||
</core:DataTriggerBehavior>
|
</core:DataTriggerBehavior>
|
||||||
|
Reference in New Issue
Block a user