Skip to content

Commit

Permalink
Merge pull request #133 from Leo-Corporation/vNext
Browse files Browse the repository at this point in the history
Version 2.2.0.2202
  • Loading branch information
lpeyr authored Feb 14, 2022
2 parents f9ec57d + 0ef157d commit 9443b5a
Show file tree
Hide file tree
Showing 26 changed files with 1,715 additions and 238 deletions.
6 changes: 4 additions & 2 deletions Passliss.Setup/Setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Passliss"
#define MyAppVersion "2.1.0.2201"
#define MyAppFullVersion "2.1.0.2201"
#define MyAppVersion "2.2.0.2202"
#define MyAppFullVersion "2.2.0.2202"
#define MyAppPublisher "Léo Corporation"
#define MyAppURL "https://leocorporation.dev/"
#define MyAppExeName "Passliss.exe"
Expand Down Expand Up @@ -38,6 +38,8 @@ WizardStyle=modern
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
; Remove the line below if there are compilation errors
Name: "chinesesimplified"; MessagesFile: "compiler:Languages\ChineseSimplified.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Expand Down
262 changes: 260 additions & 2 deletions Passliss/App.xaml

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion Passliss/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
using Passliss.Classes;
using Passliss.Windows;
using System.Windows;

namespace Passliss
Expand All @@ -45,7 +46,14 @@ protected override void OnStartup(StartupEventArgs e)
Global.StrenghtPage = new(); // Create a new strenght page
Global.EncryptPage = new(); // Create a new encryption page

base.OnStartup(e);
if (Global.Settings.IsFirstRun.Value)
{
new FirstRunWindow().Show(); // Show first run experience
}
else
{
new MainWindow().Show(); // Open Passliss
}
}
}
}
2 changes: 1 addition & 1 deletion Passliss/Classes/Global.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public static class Global
/// <summary>
/// The current version of Passliss.
/// </summary>
public static string Version => "2.1.0.2201";
public static string Version => "2.2.0.2202";

/// <summary>
/// GitHub link for the last version (<see cref="string"/>).
Expand Down
152 changes: 76 additions & 76 deletions Passliss/Pages/EncryptPage.xaml

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions Passliss/Pages/FirstRunPages/LanguagePage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<Page x:Class="Passliss.Pages.FirstRunPages.LanguagePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Passliss.Pages.FirstRunPages"
xmlns:lang="clr-namespace:Passliss.Properties"
mc:Ignorable="d" FontFamily="..\..\Fonts\#Montserrat"
d:DesignHeight="450" d:DesignWidth="800" Foreground="{Binding Source={StaticResource Foreground1}}"
Title="LanguagePage">

<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>

<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="&#xF834;" Foreground="{Binding Source={StaticResource Foreground1}}" FontSize="100" HorizontalAlignment="Center" FontFamily="..\..\Fonts\#FluentSystemIcons-Regular"/>
<TextBlock Text="{x:Static lang:Resources.Language}" Foreground="{Binding Source={StaticResource Foreground1}}" FontWeight="Bold" FontSize="20" Margin="0,10,0,0" HorizontalAlignment="Center"/>

<ComboBox SelectionChanged="LangComboBox_SelectionChanged" BorderThickness="2" Padding="5" Style="{DynamicResource ComboBoxStyle1}" x:Name="LangComboBox" Background="Transparent" BorderBrush="{Binding Source={StaticResource AccentColor}}" Foreground="{Binding Source={StaticResource Foreground1}}" HorizontalAlignment="Center" Margin="0,5,0,0" VerticalAlignment="Center"/>
<Button x:Name="LangApplyBtn" Background="{Binding Source={StaticResource AccentColor}}" Foreground="{Binding Source={StaticResource WindowButtonsHoverForeground1}}" Padding="10,5,10,5" Style="{StaticResource TabButtonStyle}" FontWeight="Bold" Cursor="Hand" VerticalAlignment="Center" Click="LangApplyBtn_Click" Visibility="Hidden" HorizontalAlignment="Center" Margin="0,10,0,0">
<StackPanel Orientation="Horizontal">
<TextBlock Text="&#xE98E;" FontWeight="Regular" FontFamily="..\..\Fonts\#FluentlyIcons" Margin="0,0,5,0" VerticalAlignment="Center"/>
<TextBlock Text="{x:Static lang:Resources.Apply}" VerticalAlignment="Center"/>
</StackPanel>
</Button>
</StackPanel>

<Border x:Name="border" Background="{Binding Source={StaticResource LightAccentColor}}" CornerRadius="5" Padding="10" Margin="10" Grid.Row="1">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Foreground="{Binding Source={StaticResource AccentColor}}" Text="&#xEA38;" FontSize="14" FontFamily="..\..\Fonts\#FluentlyIcons" Margin="0,0,10,0" VerticalAlignment="Center"/>
<TextBlock Foreground="{Binding Source={StaticResource AccentColor}}" Text="{x:Static lang:Resources.ChangesApplyAfterRestart}" FontSize="14" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Left" MaxWidth="766" Width="500"/>
</StackPanel>
</Border>
</Grid>
</Page>
74 changes: 74 additions & 0 deletions Passliss/Pages/FirstRunPages/LanguagePage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
MIT License
Copyright (c) Léo Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
using Passliss.Classes;
using System.Windows;
using System.Windows.Controls;

namespace Passliss.Pages.FirstRunPages
{
/// <summary>
/// Interaction logic for LanguagePage.xaml
/// </summary>
public partial class LanguagePage : Page
{
public LanguagePage()
{
InitializeComponent();
InitUI(); // Load the UI
}

private void InitUI()
{
// Load LangComboBox
LangComboBox.Items.Clear(); // Clear
LangComboBox.Items.Add(Properties.Resources.Default); // Add "default"

for (int i = 0; i < Global.LanguageList.Count; i++)
{
LangComboBox.Items.Add(Global.LanguageList[i]);
}

LangComboBox.SelectedIndex = (Global.Settings.Language == "_default") ? 0 : Global.LanguageCodeList.IndexOf(Global.Settings.Language) + 1;
LangApplyBtn.Visibility = Visibility.Collapsed; // Hide
}

private void LangComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
LangApplyBtn.Visibility = Visibility.Visible; // Show
}

private void LangApplyBtn_Click(object sender, RoutedEventArgs e)
{
Global.Settings.Language = LangComboBox.Text switch
{
"English (United States)" => Global.LanguageCodeList[0], // Set the settings value
"Français (France)" => Global.LanguageCodeList[1], // Set the settings value
"中文(简体)" => Global.LanguageCodeList[2], // Set the settings value
_ => "_default" // Set the settings value
};
SettingsManager.Save(); // Save the changes
LangApplyBtn.Visibility = Visibility.Hidden; // Hide
}
}
}
118 changes: 118 additions & 0 deletions Passliss/Pages/FirstRunPages/ThemePage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<Page x:Class="Passliss.Pages.FirstRunPages.ThemePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Passliss.Pages.FirstRunPages"
xmlns:lang="clr-namespace:Passliss.Properties"
mc:Ignorable="d" FontFamily="..\..\Fonts\#Montserrat"
d:DesignHeight="450" d:DesignWidth="800" Foreground="{Binding Source={StaticResource Foreground1}}"
Title="ThemePage">

<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>

<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>

<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="&#xF33C;" Margin="30 0" FontSize="100" FontFamily="..\..\Fonts\#FluentSystemIcons-Regular" VerticalAlignment="Center"/>
<TextBlock Text="{x:Static lang:Resources.Theme}" FontWeight="Bold" FontSize="16" HorizontalAlignment="Center"/>
</StackPanel>

<StackPanel Margin="10" Grid.Column="1">
<TextBlock Text="{x:Static lang:Resources.WelcomeThemeTitle}" FontWeight="Bold" FontSize="16"/>
<TextBlock Text="{x:Static lang:Resources.ChangeTheme}" Foreground="{Binding Source={StaticResource Foreground1}}" FontSize="14" Margin="0,0,0,15"/>

<StackPanel Orientation="Horizontal">
<Border x:Name="LightBorder" CornerRadius="10" Margin="5,20,5,5" Background="{Binding Source={StaticResource Background1}}" BorderThickness="3" BorderBrush="{x:Null}" MouseEnter="Border_MouseEnter" MouseLeave="Border_MouseLeave" Cursor="Hand" MouseLeftButtonUp="LightBorder_MouseLeftButtonUp">
<StackPanel Orientation="Vertical">
<Rectangle RadiusX="10" RadiusY="10" Width="100" Height="100" HorizontalAlignment="Center">
<Rectangle.Fill>
<ImageBrush ImageSource="..\..\Images\LightTheme.png"/>
</Rectangle.Fill>
</Rectangle>
<RadioButton Style="{DynamicResource RadioButtonStyle1}" x:Name="LightRadioBtn" Checked="LightRadioBtn_Checked" GroupName="ThemeRadioGroup" Content="{x:Static lang:Resources.Light}" Foreground="{Binding Source={StaticResource Foreground1}}" Background="{Binding Source={StaticResource Background1}}" BorderBrush="{Binding Source={StaticResource AccentColor}}" FontWeight="Bold" FontSize="13" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,2,0,2"/>
</StackPanel>

<Border.Triggers>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard>
<Storyboard>
<ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" BeginTime="00:00:00">
<SplineThicknessKeyFrame KeyTime="00:00:00" Value="5,20,5,5" />
<SplineThicknessKeyFrame KeyTime="00:00:00.2" Value="5,5,5,5" />
</ThicknessAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Border.Triggers>
</Border>
<Border x:Name="DarkBorder" CornerRadius="10" Margin="5,21,5,5" Background="{Binding Source={StaticResource Background1}}" BorderThickness="3" BorderBrush="{x:Null}" MouseEnter="Border_MouseEnter" MouseLeave="Border_MouseLeave" Cursor="Hand" MouseLeftButtonUp="DarkBorder_MouseLeftButtonUp">
<StackPanel Orientation="Vertical">
<Rectangle RadiusX="10" RadiusY="10" Width="100" Height="100" HorizontalAlignment="Center">
<Rectangle.Fill>
<ImageBrush ImageSource="..\..\Images\DarkTheme.png"/>
</Rectangle.Fill>
</Rectangle>
<RadioButton Style="{DynamicResource RadioButtonStyle1}" x:Name="DarkRadioBtn" Checked="DarkRadioBtn_Checked" GroupName="ThemeRadioGroup" Content="{x:Static lang:Resources.Dark}" Foreground="{Binding Source={StaticResource Foreground1}}" Background="{Binding Source={StaticResource Background1}}" BorderBrush="{Binding Source={StaticResource AccentColor}}" FontWeight="Bold" FontSize="13" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,2,0,2"/>
</StackPanel>

<Border.Triggers>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard>
<Storyboard>
<ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" BeginTime="00:00:0.2">
<SplineThicknessKeyFrame KeyTime="00:00:00" Value="5,20,5,5" />
<SplineThicknessKeyFrame KeyTime="00:00:00.2" Value="5,5,5,5" />
</ThicknessAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Border.Triggers>
</Border>
<Border x:Name="SystemBorder" CornerRadius="10" Margin="5,20,5,5" Background="{Binding Source={StaticResource Background1}}" BorderThickness="3" BorderBrush="{x:Null}" MouseEnter="Border_MouseEnter" MouseLeave="Border_MouseLeave" Cursor="Hand" MouseLeftButtonUp="SystemBorder_MouseLeftButtonUp">
<StackPanel Orientation="Vertical">
<Rectangle RadiusX="10" RadiusY="10" Width="100" Height="100" HorizontalAlignment="Center">
<Rectangle.Fill>
<ImageBrush ImageSource="..\..\Images\SystemTheme.png"/>
</Rectangle.Fill>
</Rectangle>
<RadioButton Style="{DynamicResource RadioButtonStyle1}" x:Name="SystemRadioBtn" Checked="SystemRadioBtn_Checked" GroupName="ThemeRadioGroup" Content="{x:Static lang:Resources.System}" Foreground="{Binding Source={StaticResource Foreground1}}" Background="{Binding Source={StaticResource Background1}}" BorderBrush="{Binding Source={StaticResource AccentColor}}" FontWeight="Bold" FontSize="13" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,2,0,2"/>
</StackPanel>

<Border.Triggers>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard>
<Storyboard>
<ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" BeginTime="00:00:0.4">
<SplineThicknessKeyFrame KeyTime="00:00:00" Value="5,20,5,5" />
<SplineThicknessKeyFrame KeyTime="00:00:00.2" Value="5,5,5,5" />
</ThicknessAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Border.Triggers>
</Border>
<Button x:Name="ThemeApplyBtn" Background="{Binding Source={StaticResource AccentColor}}" Foreground="{Binding Source={StaticResource WindowButtonsHoverForeground1}}" Padding="10,5,10,5" Style="{StaticResource TabButtonStyle}" FontWeight="Bold" Cursor="Hand" VerticalAlignment="Center" Click="ThemeApplyBtn_Click" Visibility="Hidden">
<StackPanel Orientation="Horizontal">
<TextBlock Text="&#xE98E;" FontWeight="Regular" FontFamily="..\..\Fonts\#FluentlyIcons" Margin="0,0,5,0" VerticalAlignment="Center"/>
<TextBlock Text="{x:Static lang:Resources.Apply}" VerticalAlignment="Center"/>
</StackPanel>
</Button>
</StackPanel>
</StackPanel>

<Border x:Name="border" Background="{Binding Source={StaticResource LightAccentColor}}" CornerRadius="5" Padding="10" Margin="10" Grid.Row="1" Grid.ColumnSpan="2">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Foreground="{Binding Source={StaticResource AccentColor}}" Text="&#xEA38;" FontSize="14" FontFamily="..\..\Fonts\#FluentlyIcons" Margin="0,0,10,0" VerticalAlignment="Center"/>
<TextBlock Foreground="{Binding Source={StaticResource AccentColor}}" Text="{x:Static lang:Resources.ChangesApplyAfterRestart}" FontSize="14" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Left" MaxWidth="766" Width="500"/>
</StackPanel>
</Border>
</Grid>
</Page>
Loading

0 comments on commit 9443b5a

Please sign in to comment.