diff --git a/src/settings-ui/Settings.UI/PowerToys.Settings.csproj b/src/settings-ui/Settings.UI/PowerToys.Settings.csproj index 2451855cd2..1a4791df34 100644 --- a/src/settings-ui/Settings.UI/PowerToys.Settings.csproj +++ b/src/settings-ui/Settings.UI/PowerToys.Settings.csproj @@ -22,6 +22,7 @@ + @@ -132,6 +133,9 @@ Always + + MSBuild:Compile + diff --git a/src/settings-ui/Settings.UI/SettingsXAML/App.xaml b/src/settings-ui/Settings.UI/SettingsXAML/App.xaml index c380b770b2..ef4066cceb 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/App.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/App.xaml @@ -15,6 +15,7 @@ + diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Controls/Card.xaml b/src/settings-ui/Settings.UI/SettingsXAML/Controls/Dashboard/Card.xaml similarity index 100% rename from src/settings-ui/Settings.UI/SettingsXAML/Controls/Card.xaml rename to src/settings-ui/Settings.UI/SettingsXAML/Controls/Dashboard/Card.xaml diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Controls/Card.xaml.cs b/src/settings-ui/Settings.UI/SettingsXAML/Controls/Dashboard/Card.xaml.cs similarity index 100% rename from src/settings-ui/Settings.UI/SettingsXAML/Controls/Card.xaml.cs rename to src/settings-ui/Settings.UI/SettingsXAML/Controls/Dashboard/Card.xaml.cs diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Controls/Dashboard/CheckUpdateControl.xaml b/src/settings-ui/Settings.UI/SettingsXAML/Controls/Dashboard/CheckUpdateControl.xaml new file mode 100644 index 0000000000..267ecd2076 --- /dev/null +++ b/src/settings-ui/Settings.UI/SettingsXAML/Controls/Dashboard/CheckUpdateControl.xaml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Controls/Dashboard/CheckUpdateControl.xaml.cs b/src/settings-ui/Settings.UI/SettingsXAML/Controls/Dashboard/CheckUpdateControl.xaml.cs new file mode 100644 index 0000000000..36a20fd340 --- /dev/null +++ b/src/settings-ui/Settings.UI/SettingsXAML/Controls/Dashboard/CheckUpdateControl.xaml.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using Microsoft.PowerToys.Settings.UI.Library; +using Microsoft.PowerToys.Settings.UI.Services; +using Microsoft.PowerToys.Settings.UI.Views; +using Microsoft.UI.Xaml.Controls; + +namespace Microsoft.PowerToys.Settings.UI.Controls +{ + public sealed partial class CheckUpdateControl : UserControl + { + public bool UpdateAvailable { get; set; } + + public UpdatingSettings UpdateSettingsConfig { get; set; } + + public CheckUpdateControl() + { + InitializeComponent(); + UpdateSettingsConfig = UpdatingSettings.LoadSettings(); + UpdateAvailable = UpdateSettingsConfig != null && (UpdateSettingsConfig.State == UpdatingSettings.UpdatingState.ReadyToInstall || UpdateSettingsConfig.State == UpdatingSettings.UpdatingState.ReadyToDownload); + } + + private void SWVersionButtonClicked(object sender, Microsoft.UI.Xaml.RoutedEventArgs e) + { + NavigationService.Navigate(typeof(GeneralPage)); + } + } +} diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Controls/Dashboard/ShortcutConflictControl.xaml b/src/settings-ui/Settings.UI/SettingsXAML/Controls/Dashboard/ShortcutConflictControl.xaml new file mode 100644 index 0000000000..ed3e153682 --- /dev/null +++ b/src/settings-ui/Settings.UI/SettingsXAML/Controls/Dashboard/ShortcutConflictControl.xaml @@ -0,0 +1,33 @@ + + + + + + + diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Controls/Dashboard/ShortcutConflictControl.xaml.cs b/src/settings-ui/Settings.UI/SettingsXAML/Controls/Dashboard/ShortcutConflictControl.xaml.cs new file mode 100644 index 0000000000..9b0c0f4574 --- /dev/null +++ b/src/settings-ui/Settings.UI/SettingsXAML/Controls/Dashboard/ShortcutConflictControl.xaml.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; +using Windows.Foundation; +using Windows.Foundation.Collections; + +namespace Microsoft.PowerToys.Settings.UI.Controls +{ + public sealed partial class ShortcutConflictControl : UserControl + { + public ShortcutConflictControl() + { + InitializeComponent(); + GetShortcutConflicts(); + } + + private void GetShortcutConflicts() + { + // TO DO: Implement the logic to retrieve and display shortcut conflicts. Make sure to Collapse this control if not conflicts are found. + } + + private void ShortcutConflictBtn_Click(object sender, RoutedEventArgs e) + { + // TO DO: Handle the button click event to show the shortcut conflicts window. + } + } +} diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Views/DashboardPage.xaml b/src/settings-ui/Settings.UI/SettingsXAML/Views/DashboardPage.xaml index 1b240cdaed..1539a3be17 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Views/DashboardPage.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/Views/DashboardPage.xaml @@ -135,96 +135,8 @@ Grid.Column="1" Orientation="Horizontal" Spacing="16"> - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -301,7 +213,6 @@ Foreground="{ThemeResource TextFillColorSecondaryBrush}" Visibility="{x:Bind ViewModel.ActionModules.Count, Mode=OneWay, Converter={StaticResource DoubleToInvertedVisibilityConverter}}" /> - - _settingsRepository; private GeneralSettings generalSettingsConfig; private Windows.ApplicationModel.Resources.ResourceLoader resourceLoader = Helpers.ResourceLoaderInstance.ResourceLoader; @@ -68,9 +64,6 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels } GetShortcutModules(); - - UpdateSettingsConfig = UpdatingSettings.LoadSettings(); - UpdateAvailable = UpdateSettingsConfig != null && (UpdateSettingsConfig.State == UpdatingSettings.UpdatingState.ReadyToInstall || UpdateSettingsConfig.State == UpdatingSettings.UpdatingState.ReadyToDownload); } private void AddDashboardListItem(ModuleType moduleType)