Skip to content

Commit 5aa6746

Browse files
authored
Merge pull request #17 from Atlas-OS/na-beta-releases
Beta v0.1.4
2 parents 4cb16f8 + f16881a commit 5aa6746

11 files changed

+133
-43
lines changed

AtlasToolbox/App.xaml.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using AtlasToolbox.Utils;
1717
using System.Diagnostics;
1818
using System.Collections.ObjectModel;
19+
using System.Diagnostics.Contracts;
1920

2021
namespace AtlasToolbox
2122
{
@@ -31,6 +32,8 @@ public partial class App : Application
3132
public static string CurrentCategory { get; set; }
3233

3334
private static Mutex _mutex = new(true, "{AtlasToolbox}");
35+
36+
public static string Version { get; set; }
3437
public App()
3538
{
3639
ConfigureNLog();
@@ -92,7 +95,7 @@ protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs ar
9295
DebugSettings.BindingFailed += DebugSettings_BindingFailed;
9396
}
9497
#endif
95-
98+
Version = RegistryHelper.GetValue($@"HKLM\SOFTWARE\AtlasOS\Toolbox", "Channel") + " v" + RegistryHelper.GetValue($@"HKLM\SOFTWARE\AtlasOS\Toolbox", "VersionNumber");
9699
if (CompatibilityHelper.IsCompatible())
97100
{
98101
Task.Run(() => StartNamedPipeServer());

AtlasToolbox/AtlasToolbox.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
<None Remove="Resources\HeaderTemplates.xaml" />
4343
<None Remove="SoftwarePage.xaml" />
4444
<None Remove="Views\ContentDialogView.xaml" />
45+
<None Remove="Views\NewProfilePage.xaml" />
4546
</ItemGroup>
4647
<ItemGroup>
4748
<Content Include="assets\**">
@@ -191,6 +192,9 @@
191192
<Pack>True</Pack>
192193
<PackagePath>\</PackagePath>
193194
</None>
195+
<Page Update="Views\NewProfilePage.xaml">
196+
<Generator>MSBuild:Compile</Generator>
197+
</Page>
194198
<Page Update="FWindow.xaml">
195199
<Generator>MSBuild:Compile</Generator>
196200
</Page>

AtlasToolbox/Commands/MultiOptionSaveConfigurationCommand.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Threading.Tasks;
66
using AtlasToolbox.Services.ConfigurationServices;
77
using AtlasToolbox.Stores;
8+
using AtlasToolbox.Utils;
89
using AtlasToolbox.ViewModels;
910
using MVVMEssentials.Commands;
1011

@@ -34,6 +35,8 @@ protected override async Task ExecuteAsync(object parameter)
3435
{
3536
int currentSetting = _configurationItemViewModel.Options.IndexOf(_configurationStore.CurrentSetting);
3637

38+
RecentTogglesHelper.AddRecentToggle(_configurationItemViewModel.Key, currentSetting.ToString());
39+
3740
_configurationItemViewModel.IsBusy = true;
3841

3942
try

AtlasToolbox/MainWindow.xaml.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ public MainWindow()
2626

2727
//Window parameters
2828
WindowManager.Get(this).Width = 1250;
29-
WindowManager.Get(this).MinWidth = 1250;
30-
3129
WindowManager.Get(this).Height = 850;
32-
WindowManager.Get(this).MinHeight = 850;
30+
WindowManager.Get(this).IsResizable = false;
31+
WindowManager.Get(this).IsMaximizable = false;
3332

3433
CenterWindowOnScreen();
3534
ExtendsContentIntoTitleBar = true;

AtlasToolbox/Views/HomePage.xaml

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
Margin="75,0,0,0"
4848
VerticalAlignment="Center"
4949
Orientation="Vertical">
50+
<TextBlock x:Name="WinVer" />
51+
<TextBlock x:Name="AtlasVer" Margin="0,0,0,20" />
5052
<TextBlock
5153
x:Name="subHeaderBlock"
5254
FontSize="18"
@@ -89,6 +91,10 @@
8991
x:Uid="Set_Profile"
9092
Click="SetProfile_Click"
9193
Text="Set this profile" />
94+
<MenuFlyoutItem
95+
x:Uid="Delete"
96+
Click="DeleteProfile"
97+
Text="Delete" />
9298
</MenuFlyout>
9399
</Grid.ContextFlyout>
94100
<TextBlock Text="{x:Bind Name}" />
@@ -112,12 +118,11 @@
112118
HorizontalAlignment="Left"
113119
BorderBrush="#36363e"
114120
BorderThickness="2"
115-
CornerRadius="5"
116-
>
121+
CornerRadius="5">
117122
<ListView.ItemTemplate>
118123
<DataTemplate x:DataType="model:RecentToggle">
119124
<Grid>
120-
<TextBlock Text="{Binding Description}"/>
125+
<TextBlock Text="{Binding Description}" />
121126
</Grid>
122127
</DataTemplate>
123128
</ListView.ItemTemplate>
@@ -126,23 +131,10 @@
126131
Grid.Row="2"
127132
Margin="36,0,0,24"
128133
Orientation="Horizontal">
129-
<TextBox
130-
x:Name="ProfileNameTextBox"
131-
Width="210"
132-
HorizontalAlignment="Left"
133-
VerticalAlignment="Top"
134-
Text="{Binding Name}"
135-
TextChanged="ProfileNameTextBox_TextChanged" />
136-
<Button
137-
Margin="12,0,0,0"
138-
VerticalAlignment="Top"
139-
Click="AddProfile"
140-
Content="Add" />
141134
<Button
142-
Margin="12,0,0,0"
143135
VerticalAlignment="Top"
144-
Click="DeleteProfile"
145-
Content="Delete" />
136+
Click="Button_Click"
137+
Content="Create a new profile" />
146138
</StackPanel>
147139
</Grid>
148140
</ScrollViewer>

AtlasToolbox/Views/HomePage.xaml.cs

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using Microsoft.UI.Xaml.Input;
1111
using Microsoft.UI.Xaml.Media;
1212
using Microsoft.UI.Xaml.Navigation;
13+
using Microsoft.Xaml.Interactivity;
1314
using System;
1415
using System.Collections.Generic;
1516
using System.ComponentModel;
@@ -30,28 +31,27 @@ public sealed partial class HomePage : Page
3031

3132
public HomePage()
3233
{
34+
OperatingSystem os = Environment.OSVersion;
35+
3336
RecentTogglesHelper.LoadRecentToggles();
3437
this.InitializeComponent();
3538
_viewModel = App._host.Services.GetRequiredService<HomePageViewModel>();
3639
this.DataContext = _viewModel;
40+
WinVer.Text = "Windows Version: " + RegistryHelper.GetValue("HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "DisplayVersion").ToString();
41+
AtlasVer.Text = "Playbook version: " + RegistryHelper.GetValue("HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "RegisteredOrganization").ToString();
3742

3843
List<object> list = new();
3944

40-
for (int i = 0; i > 9; i++)
45+
for (int i = 0; i < 9; i++)
4146
{
4247
list.Add(RecentTogglesHelper.recentToggles[i]);
48+
if (RecentTogglesHelper.recentToggles.Count == i + 1) i = 10;
4349
}
4450
RecentTogglesList.ItemsSource = list;
4551
ProfilesListView.ItemsSource = _viewModel.ProfilesList;
4652
ProfilesListView.SelectedItem = _viewModel.ProfileSelected;
4753
}
4854

49-
private void AddProfile(object sender, RoutedEventArgs e)
50-
{
51-
_viewModel.AddProfileCommand.Execute(null);
52-
ProfileNameTextBox.Text = "";
53-
}
54-
5555
/// <summary>
5656
/// Deletes the profile
5757
/// </summary>
@@ -63,7 +63,7 @@ private async void DeleteProfile(object sender, RoutedEventArgs e)
6363
{
6464
var selectedItem = ProfilesListView.SelectedItem as Profiles;
6565

66-
if (selectedItem.Key != "default.txt")
66+
if (selectedItem.Key != "default.json")
6767
{
6868
ContentDialog dialog = new ContentDialog();
6969

@@ -103,10 +103,13 @@ private async void SetProfile_Click(object sender, RoutedEventArgs e)
103103
dialog.PrimaryButtonText = "Yes";
104104
dialog.CloseButtonText = "No";
105105
dialog.DefaultButton = ContentDialogButton.Primary;
106-
dialog.PrimaryButtonCommand = _viewModel.SetProfileCommand;
107106

108107
var result = await dialog.ShowAsync();
109-
RestartPCPrompt();
108+
if (result == ContentDialogResult.Primary)
109+
{
110+
RestartPCPrompt();
111+
_viewModel.SetProfileCommand.Execute(this);
112+
}
110113
}
111114

112115
/// <summary>
@@ -125,11 +128,36 @@ private async void RestartPCPrompt()
125128
dialog.PrimaryButtonCommand = new RelayCommand(ComputerStateHelper.RestartComputer);
126129

127130
var result = await dialog.ShowAsync();
131+
if (result == ContentDialogResult.Primary)
132+
{
133+
ComputerStateHelper.RestartComputer();
134+
}
135+
}
136+
137+
private async void NewProfile()
138+
{
139+
ContentDialog dialog = new ContentDialog();
140+
141+
dialog.XamlRoot = this.XamlRoot;
142+
dialog.Style = Application.Current.Resources["DefaultContentDialogStyle"] as Style;
143+
dialog.Title = "Create a new profile";
144+
dialog.PrimaryButtonText = "Create";
145+
dialog.CloseButtonText = "Cancel";
146+
dialog.Content = new NewProfilePage(_viewModel);
147+
dialog.DefaultButton = ContentDialogButton.Primary;
148+
149+
var result = await dialog.ShowAsync();
150+
151+
if (result == ContentDialogResult.Primary)
152+
{
153+
_viewModel.AddProfileCommand.Execute(null);
154+
}
155+
Name = "";
128156
}
129157

130-
private void ProfileNameTextBox_TextChanged(object sender, TextChangedEventArgs e)
158+
private void Button_Click(object sender, RoutedEventArgs e)
131159
{
132-
_viewModel.Name = ProfileNameTextBox.Text;
160+
NewProfile();
133161
}
134162
}
135163
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Page
3+
x:Class="AtlasToolbox.Views.NewProfilePage"
4+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
5+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
6+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
7+
xmlns:local="using:AtlasToolbox.Views"
8+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
9+
xmlns:viewmodel="using:AtlasToolbox.ViewModels"
10+
d:DataContext="{d:DesignInstance Type=viewmodel:HomePageViewModel}"
11+
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
12+
mc:Ignorable="d">
13+
14+
<Grid>
15+
<StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
16+
<!-- Content body -->
17+
<TextBlock Text="Your current configuration will be saved to this profile" TextWrapping="Wrap" />
18+
<TextBox
19+
x:Name="ProfileName"
20+
PlaceholderText="Name"
21+
TextChanged="TextBox_TextChanged" />
22+
</StackPanel>
23+
</Grid>
24+
</Page>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Runtime.InteropServices.WindowsRuntime;
6+
using AtlasToolbox.ViewModels;
7+
using Microsoft.Extensions.DependencyInjection;
8+
using Microsoft.UI.Xaml;
9+
using Microsoft.UI.Xaml.Controls;
10+
using Microsoft.UI.Xaml.Controls.Primitives;
11+
using Microsoft.UI.Xaml.Data;
12+
using Microsoft.UI.Xaml.Input;
13+
using Microsoft.UI.Xaml.Media;
14+
using Microsoft.UI.Xaml.Navigation;
15+
using Windows.Foundation;
16+
using Windows.Foundation.Collections;
17+
18+
// To learn more about WinUI, the WinUI project structure,
19+
// and more about our project templates, see: http://aka.ms/winui-project-info.
20+
21+
namespace AtlasToolbox.Views
22+
{
23+
public sealed partial class NewProfilePage : Page
24+
{
25+
private static HomePageViewModel _viewModel;
26+
public NewProfilePage(HomePageViewModel homePageViewModel)
27+
{
28+
this.InitializeComponent();
29+
this.DataContext = homePageViewModel;
30+
_viewModel = homePageViewModel;
31+
}
32+
33+
private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
34+
{
35+
_viewModel.Name = ProfileName.Text;
36+
}
37+
}
38+
}

AtlasToolbox/Views/SettingsPage.xaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,9 @@
3333
</StackPanel>
3434
<StackPanel>
3535
<TextBlock Style="{StaticResource CategoryTitle}" Text="About" />
36-
<controls:SettingsExpander
37-
Description="© 2024 Microsoft. All rights reserved."
38-
Header="AtlasOS Toolbox"
39-
Style="{StaticResource ConfigurationSettingsExpanderTemplate}">
36+
<controls:SettingsExpander Header="AtlasOS Toolbox" Style="{StaticResource ConfigurationSettingsExpanderTemplate}">
4037
<controls:SettingsExpander.HeaderIcon>
41-
<BitmapIcon ShowAsMonochrome="False" UriSource="/assets/logo/toolbox-logo.png" />
38+
<BitmapIcon ShowAsMonochrome="False" UriSource="/assets/logo/toolbox-icon.ico" />
4239
</controls:SettingsExpander.HeaderIcon>
4340
<TextBlock
4441
Foreground="{ThemeResource TextFillColorSecondaryBrush}"

AtlasToolbox/Views/SettingsPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public string Version
1616
{
1717
get
1818
{
19-
return ConfigurationManager.AppSettings.Get("ToolboxVersion");
19+
return App.Version;
2020
}
2121
}
2222

Installer/setup.iss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

44
#define MyAppName "Atlas Toolbox"
5-
#define MyAppVersion "0.1.2"
5+
#define MyAppVersion "0.1.4"
66
#define MyAppPublisher "AtlasOS"
77
#define MyAppURL "https://www.atlasos.net/"
88
#define MyAppExeName "AtlasToolbox.exe"
99
#define MyAppAssocName MyAppName + ""
1010
#define MyAppAssocExt ".exe"
1111
#define MyAppAssocKey StringChange(MyAppAssocName, " ", "") + MyAppAssocExt
12+
#define AppChannel "Beta"
1213

1314
[Setup]
1415
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
@@ -49,14 +50,15 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{
4950
[Files]
5051
Source: "D:\a\atlas-toolbox\atlas-toolbox\Deploy\src\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
5152
Source: "D:\a\atlas-toolbox\atlas-toolbox\Installer\Toolbox\*"; DestDir: "C:\Windows\AtlasModules\Toolbox"; Flags: ignoreversion recursesubdirs
52-
;Source: "C:\Users\TheyCreeper\Desktop\AtlasToolbox\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
53-
;Source: "C:\Users\TheyCreeper\Documents\Dev\atlas-toolbox\Installer\Toolbox\*"; DestDir: "C:\Windows\AtlasModules\Toolbox"; Flags: ignoreversion recursesubdirs
5453

5554
[Registry]
5655
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocExt}\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocKey}"; ValueData: ""; Flags: uninsdeletevalue
5756
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}"; ValueType: string; ValueName: ""; ValueData: "{#MyAppAssocName}"; Flags: uninsdeletekey
5857
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\{#MyAppExeName},0"
5958
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1"""
59+
Root: HKLM; Subkey: "Software\AtlasOS\Toolbox"; ValueType: string; ValueName: "Channel"; ValueData: "{#AppChannel}"
60+
Root: HKLM; Subkey: "Software\AtlasOS\Toolbox"; ValueType: string; ValueName: "Version"; ValueData: "{#MyAppVersion}"
61+
6062

6163
[Icons]
6264
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"

0 commit comments

Comments
 (0)