-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
419 additions
and
61 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
Source/Steam Library Manager/Forms/InstallationWizard/Final.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<UserControl x:Class="Steam_Library_Manager.Forms.InstallationWizard.Final" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
d:DesignHeight="600" d:DesignWidth="500"> | ||
<StackPanel Orientation="Vertical"> | ||
<StackPanel Orientation="Horizontal"> | ||
<iconPacks:PackIconMaterial Kind="CheckAll" Height="48" Width="48" Margin="5, 0" /> | ||
<TextBlock TextWrapping="Wrap" FontSize="28">Installation is completed!</TextBlock> | ||
</StackPanel> | ||
<Button Name="CloseButton" HorizontalAlignment="Stretch" Content="Close" Height="50" Margin="0,10" Style="{StaticResource AccentedSquareButtonStyle}" Click="CloseButton_OnClick" /> | ||
</StackPanel> | ||
</UserControl> |
29 changes: 29 additions & 0 deletions
29
Source/Steam Library Manager/Forms/InstallationWizard/Final.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Diagnostics; | ||
using System.Windows; | ||
|
||
namespace Steam_Library_Manager.Forms.InstallationWizard | ||
{ | ||
/// <summary> | ||
/// Interaction logic for Final.xaml | ||
/// </summary> | ||
public partial class Final | ||
{ | ||
public Final() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void CloseButton_OnClick(object sender, RoutedEventArgs e) | ||
{ | ||
try | ||
{ | ||
Window.GetWindow(this)?.Close(); | ||
} | ||
catch (Exception) | ||
{ | ||
Debug.WriteLine("Failed to get window for installation wizard?"); | ||
} | ||
} | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
Source/Steam Library Manager/Forms/InstallationWizard/Library.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<UserControl x:Class="Steam_Library_Manager.Forms.InstallationWizard.Library" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" | ||
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:SLM="clr-namespace:Steam_Library_Manager" | ||
mc:Ignorable="d" | ||
d:DesignHeight="500" d:DesignWidth="800"> | ||
<GroupBox Header="Library Settings"> | ||
<StackPanel Orientation="Vertical"> | ||
<GroupBox Header="Steam"> | ||
<WrapPanel Orientation="Vertical"> | ||
<StackPanel Orientation="Horizontal" Height="50" Margin="0, 5, 0, 0"> | ||
<TextBox Width="300" Text="{SLM:SettingBinding steamInstallationPath}" IsReadOnly="True" mah:TextBoxHelper.Watermark="Steam Installation Path" mah:TextBoxHelper.UseFloatingWatermark="True" /> | ||
<Button Name="SteamInstallationPathSelector" Margin="5,0,0,0" Width="60" Content="{iconPacks:Material Kind=FolderOpen}" Click="SteamInstallationPathSelector_OnClick" /> | ||
</StackPanel> | ||
<mah:ToggleSwitch ThumbIndicatorBrush="{DynamicResource AccentColorBrush}" Margin="0, 5" Header="Steam Library Support" IsChecked="{SLM:SettingBinding Steam_IsEnabled}" Style="{StaticResource MahApps.Metro.Styles.ToggleSwitch.Win10}"> | ||
<mah:ToggleSwitch.ToolTip> | ||
<ToolTip> | ||
<StackPanel> | ||
<TextBlock FontWeight="Bold" Text="Steam Library Support" /> | ||
<TextBlock Text="Enables/Disables Steam Library functionality for SLM" /> | ||
</StackPanel> | ||
</ToolTip> | ||
</mah:ToggleSwitch.ToolTip> | ||
</mah:ToggleSwitch> | ||
</WrapPanel> | ||
</GroupBox> | ||
<GroupBox Header="Origin"> | ||
<mah:ToggleSwitch ThumbIndicatorBrush="{DynamicResource AccentColorBrush}" Margin="5" Header="Origin Library Support" IsChecked="{SLM:SettingBinding Origin_IsEnabled}" Style="{StaticResource MahApps.Metro.Styles.ToggleSwitch.Win10}"> | ||
<mah:ToggleSwitch.ToolTip> | ||
<ToolTip> | ||
<StackPanel> | ||
<TextBlock FontWeight="Bold" Text="Origin Library Support" /> | ||
<TextBlock Text="Enables/Disables Origin Library functionality for SLM" /> | ||
</StackPanel> | ||
</ToolTip> | ||
</mah:ToggleSwitch.ToolTip> | ||
</mah:ToggleSwitch> | ||
</GroupBox> | ||
<GroupBox Header="Uplay"> | ||
<WrapPanel Orientation="Vertical"> | ||
<StackPanel Orientation="Horizontal" Height="50" Margin="0, 5, 0, 0"> | ||
<TextBox Width="300" Text="{SLM:SettingBinding UplayExePath}" IsReadOnly="True" mah:TextBoxHelper.Watermark="Uplay Executable Path" mah:TextBoxHelper.UseFloatingWatermark="True" /> | ||
<Button Name="UplayExecutablePathSelector" Margin="5,0,0,0" Width="60" Content="{iconPacks:Material Kind=FileFind}" Click="UplayExecutablePathSelector_OnClick" /> | ||
</StackPanel> | ||
<StackPanel Orientation="Horizontal" Height="50" Margin="0, 5, 0, 0"> | ||
<TextBox Width="300" Text="{SLM:SettingBinding UplayDbPath}" IsReadOnly="True" mah:TextBoxHelper.Watermark="Uplay Database File Path" mah:TextBoxHelper.UseFloatingWatermark="True" /> | ||
<Button Name="UplayDbPathSelector" Margin="5,0,0,0" Width="60" Content="{iconPacks:Material Kind=FileFind}" Click="UplayDbPathSelector_OnClick" /> | ||
<Button Name="UplayDbPathClearButton" Margin="5,0,0,0" Width="60" Content="{iconPacks:Material Kind=Close}" Click="UplayDbPathClearButton_OnClick" /> | ||
</StackPanel> | ||
<mah:ToggleSwitch ThumbIndicatorBrush="{DynamicResource AccentColorBrush}" Margin="5" Header="Uplay Library Support" IsChecked="{SLM:SettingBinding Uplay_IsEnabled}" Style="{StaticResource MahApps.Metro.Styles.ToggleSwitch.Win10}"> | ||
<mah:ToggleSwitch.ToolTip> | ||
<ToolTip> | ||
<StackPanel> | ||
<TextBlock FontWeight="Bold" Text="Uplay Library Support" /> | ||
<TextBlock Text="Enables/Disables Uplay Library functionality for SLM" /> | ||
</StackPanel> | ||
</ToolTip> | ||
</mah:ToggleSwitch.ToolTip> | ||
</mah:ToggleSwitch> | ||
</WrapPanel> | ||
</GroupBox> | ||
</StackPanel> | ||
</GroupBox> | ||
</UserControl> |
96 changes: 96 additions & 0 deletions
96
Source/Steam Library Manager/Forms/InstallationWizard/Library.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
using Microsoft.Win32; | ||
using System; | ||
using System.IO; | ||
using System.Windows; | ||
|
||
namespace Steam_Library_Manager.Forms.InstallationWizard | ||
{ | ||
/// <summary> | ||
/// Interaction logic for Steam.xaml | ||
/// </summary> | ||
public partial class Library | ||
{ | ||
private static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger(); | ||
|
||
public Library() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void SteamInstallationPathSelector_OnClick(object sender, RoutedEventArgs e) | ||
{ | ||
var steamPathSelector = new OpenFileDialog() | ||
{ | ||
Filter = "Steam Executable (Steam.exe)|Steam.exe" | ||
}; | ||
|
||
if (steamPathSelector.ShowDialog() != true) return; | ||
|
||
if (Directory.Exists(Path.GetDirectoryName(steamPathSelector.FileName))) | ||
Properties.Settings.Default.steamInstallationPath = Path.GetDirectoryName(steamPathSelector.FileName); | ||
|
||
if (!string.IsNullOrEmpty(Properties.Settings.Default.steamInstallationPath)) | ||
{ | ||
Definitions.Global.Steam.VdfFilePath = Path.Combine(Properties.Settings.Default.steamInstallationPath, "config", "config.vdf"); | ||
} | ||
} | ||
|
||
private void UplayExecutablePathSelector_OnClick(object sender, RoutedEventArgs e) | ||
{ | ||
try | ||
{ | ||
using (var dialog = new System.Windows.Forms.OpenFileDialog()) | ||
{ | ||
dialog.Filter = "Uplay executable file|Uplay.exe|All executable files (*.exe)|*.exe"; | ||
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) | ||
{ | ||
Properties.Settings.Default.UplayExePath = dialog.FileName; | ||
} | ||
} | ||
} | ||
catch (Exception ex) | ||
{ | ||
Logger.Error(ex); | ||
} | ||
} | ||
|
||
private async void UplayDbPathSelector_OnClick(object sender, RoutedEventArgs e) | ||
{ | ||
try | ||
{ | ||
using (var dialog = new System.Windows.Forms.OpenFileDialog()) | ||
{ | ||
dialog.Filter = "Uplay Database File|configurations"; | ||
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) | ||
{ | ||
Properties.Settings.Default.UplayDbPath = dialog.FileName; | ||
|
||
if (File.Exists(Properties.Settings.Default.UplayDbPath)) | ||
{ | ||
await Functions.Uplay.InitializeUplayDb(); | ||
} | ||
} | ||
} | ||
} | ||
catch (Exception ex) | ||
{ | ||
Logger.Error(ex); | ||
} | ||
throw new NotImplementedException(); | ||
} | ||
|
||
private async void UplayDbPathClearButton_OnClick(object sender, RoutedEventArgs e) | ||
{ | ||
try | ||
{ | ||
Properties.Settings.Default.UplayDbPath = string.Empty; | ||
|
||
await Functions.Uplay.InitializeUplayDb(); | ||
} | ||
catch (Exception ex) | ||
{ | ||
Logger.Error(ex); | ||
} | ||
} | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
Source/Steam Library Manager/Forms/InstallationWizard/Welcome.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<UserControl x:Class="Steam_Library_Manager.Forms.InstallationWizard.Welcome" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:localization="clr-namespace:Gu.Localization;assembly=Gu.Localization" | ||
xmlns:l="clr-namespace:Gu.Wpf.Localization;assembly=Gu.Wpf.Localization" | ||
xmlns:SLM="clr-namespace:Steam_Library_Manager" | ||
xmlns:Enums="clr-namespace:Steam_Library_Manager.Definitions.Enums" | ||
xmlns:p="clr-namespace:Steam_Library_Manager.Properties" | ||
mc:Ignorable="d" | ||
d:DesignHeight="600" d:DesignWidth="500"> | ||
<GroupBox Header="{l:Static p:Resources.Forms_Settings_GeneralSettings}"> | ||
<WrapPanel> | ||
<TextBlock TextWrapping="Wrap">This installation wizard will help you set basics of SLM for first time use. Please start with selecting a default language, theme base and accent.</TextBlock> | ||
<TextBlock TextWrapping="Wrap">Alternatively, you can close this window to use SLM's default options.</TextBlock> | ||
<Separator Width="20" Height="30" Background="Transparent" /> | ||
<ComboBox BorderBrush="{DynamicResource AccentColorBrush}" Margin="0, 0, 5, 0" mah:TextBoxHelper.Watermark="{l:Static p:Resources.Forms_Settings_ThemeBase}" mah:TextBoxHelper.UseFloatingWatermark="True" HorizontalAlignment="Left" Height="50" | ||
VerticalContentAlignment="Center" VerticalAlignment="Top" Width="240" | ||
SelectedItem="{Binding Setting_BaseTheme}" ItemsSource="{SLM:EnumBindingSource {x:Type Enums:BaseTheme}}"> | ||
</ComboBox> | ||
|
||
<ComboBox BorderBrush="{DynamicResource AccentColorBrush}" mah:TextBoxHelper.Watermark="{l:Static p:Resources.Forms_Settings_ThemeAccent}" mah:TextBoxHelper.UseFloatingWatermark="True" HorizontalAlignment="Left" Height="50" | ||
VerticalContentAlignment="Center" VerticalAlignment="Top" Width="240" SelectedItem="{Binding Setting_ThemeAccent}" | ||
ItemsSource="{SLM:EnumBindingSource {x:Type Enums:ThemeAccents}}"> | ||
</ComboBox> | ||
|
||
<ComboBox BorderBrush="{DynamicResource AccentColorBrush}" Margin="0, 5" mah:TextBoxHelper.Watermark="{l:Static p:Resources.Forms_Settings_Language}" mah:TextBoxHelper.UseFloatingWatermark="True" | ||
VerticalContentAlignment="Center" VerticalAlignment="Top" Height="50" Width="240" | ||
SelectedItem="{Binding Path=(localization:Translator.Culture)}" ItemsSource="{Binding Path=(localization:Translator.Cultures)}" SelectionChanged="Selector_OnSelectionChanged"> | ||
</ComboBox> | ||
<!-- Check for Updates at Startup --> | ||
<mah:ToggleSwitch ThumbIndicatorBrush="{DynamicResource AccentColorBrush}" Margin="5" Header="{l:Static p:Resources.Forms_Settings_CheckForUpdatesOnStartup}" OnLabel="Yes" OffLabel="No" | ||
IsChecked="{SLM:SettingBinding CheckforUpdatesAtStartup}" | ||
HorizontalAlignment="Left" VerticalAlignment="Top" Style="{StaticResource MahApps.Metro.Styles.ToggleSwitch.Win10}"> | ||
<mah:ToggleSwitch.ToolTip> | ||
<ToolTip> | ||
<StackPanel> | ||
<TextBlock FontWeight="Bold" Text="Check for Updates at Startup" /> | ||
<TextBlock Text="Attempts for a new version control at startup." /> | ||
</StackPanel> | ||
</ToolTip> | ||
</mah:ToggleSwitch.ToolTip> | ||
</mah:ToggleSwitch> | ||
</WrapPanel> | ||
</GroupBox> | ||
</UserControl> |
20 changes: 20 additions & 0 deletions
20
Source/Steam Library Manager/Forms/InstallationWizard/Welcome.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System.Windows.Controls; | ||
|
||
namespace Steam_Library_Manager.Forms.InstallationWizard | ||
{ | ||
/// <summary> | ||
/// Interaction logic for Welcome.xaml | ||
/// </summary> | ||
public partial class Welcome | ||
{ | ||
public Welcome() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void Selector_OnSelectionChanged(object sender, SelectionChangedEventArgs e) | ||
{ | ||
Properties.Settings.Default.Language = Gu.Localization.Translator.CurrentCulture.TwoLetterISOLanguageName; | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
Source/Steam Library Manager/Forms/InstallationWizard/Wizard.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<mah:MetroWindow x:Class="Steam_Library_Manager.Forms.InstallationWizard.Wizard" | ||
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:Steam_Library_Manager.Forms.InstallationWizard" | ||
xmlns:controls="clr-namespace:MvvmWizard.Controls;assembly=MvvmWizard" | ||
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" | ||
mc:Ignorable="d" | ||
MinHeight="650" MinWidth="500" Height="650" Width="500" Closing="Wizard_OnClosing" | ||
WindowStyle="None" ShowMaxRestoreButton="False" ShowTitleBar="True" ShowMinButton="False" WindowStartupLocation="CenterScreen" | ||
Title="Steam Library Manager: Installation Wizard" TitleCharacterCasing="Normal"> | ||
<controls:Wizard Name="WizardControl" SummaryVisibility="Visible" AllowNavigationOnSummaryItemClick="True" TransitionButtonsHorizontalAlignment="Center" SummaryHorizontalAlignment="Center" SummaryMargin="10,0"> | ||
<controls:WizardStep BackButtonVisibility="Collapsed"> | ||
<local:Welcome /> | ||
</controls:WizardStep> | ||
|
||
<controls:WizardStep> | ||
<local:Library /> | ||
</controls:WizardStep> | ||
|
||
<controls:WizardStep SkipButtonVisibility="Collapsed" ForwardButtonVisibility="Collapsed"> | ||
<local:Final /> | ||
</controls:WizardStep> | ||
</controls:Wizard> | ||
</mah:MetroWindow> |
20 changes: 20 additions & 0 deletions
20
Source/Steam Library Manager/Forms/InstallationWizard/Wizard.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System.ComponentModel; | ||
|
||
namespace Steam_Library_Manager.Forms.InstallationWizard | ||
{ | ||
/// <summary> | ||
/// Interaction logic for Wizard.xaml | ||
/// </summary> | ||
public partial class Wizard | ||
{ | ||
public Wizard() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void Wizard_OnClosing(object sender, CancelEventArgs e) | ||
{ | ||
Properties.Settings.Default.InstallationWizardShown = true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.