Skip to content

Commit

Permalink
Reorganize settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
marticliment committed Jul 2, 2024
1 parent 35b092d commit 43c3a47
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 52 deletions.
127 changes: 76 additions & 51 deletions src/UniGetUI/Interface/Pages/SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
Url="https://marticliment.com/resources/annoucements/unigetui"
/>
<widgets:TranslatedTextBlock FontSize="40" FontWeight="Bold" WrappingMode="NoWrap" Text="WingetUI Settings" Suffix=" ." HorizontalAlignment="Stretch"/>

<!-- General Settings -->
<widgets:SettingsEntry
x:Name="GeneralSettingsExpander"
Text="General preferences"
Expand All @@ -67,37 +69,16 @@
</StackPanel>
</Toolkit:SettingsCard.Description>
</widgets:ComboboxCard>
<widgets:ButtonCard
<!--widgets:ButtonCard
Text="Open the welcome wizard"
ButtonText="Open"
Click="OpenWelcomeWizard"
IsEnabled="False"
/>
/-->
<widgets:CheckboxCard
Text="Update WingetUI automatically"
SettingName="DisableAutoUpdateWingetUI"
/>
<widgets:CheckboxCard
x:Name="DisableAutoCheckForUpdates"
Text="Check for package updates periodically"
SettingName="DisableAutoCheckforUpdates"
/>
<widgets:ComboboxCard
x:Name="UpdatesCheckIntervalSelector"
Text="Check for updates every:"
SettingName="UpdatesCheckInterval"
ValueChanged="UpdatesCheckIntervalSelector_ValueChanged"
/>
<widgets:CheckboxCard
Text="Update packages automatically"
SettingName="AutomaticallyUpdatePackages"
/>
<widgets:ComboboxCard
x:Name="ThemeSelector"
Text="Application theme:"
SettingName="PreferredTheme"
ValueChanged="ThemeSelector_ValueChanged"
/>
<widgets:ButtonCard
Text="Import settings from a local file"
ButtonText="Import"
Expand All @@ -115,47 +96,39 @@
/>
</Toolkit:SettingsExpander.Items>
</widgets:SettingsEntry>
<widgets:SettingsEntry
Text="Startup options"
UnderText="WingetUI autostart behaviour, application launch settings"
Icon="launch">
<Toolkit:SettingsExpander.Items>
<widgets:ButtonCard
Text="Manage WingetUI autostart behaviour from the Settings app"
ButtonText="Open"
Click="EditAutostartSettings_Click"
/>
<widgets:CheckboxCard
Text="Update package indexes on launch"
SettingName="DisableUpdateIndexes"
/>
<widgets:CheckboxCard
Text="Enable Scoop cleanup on launch"
SettingName="EnableScoopCleanup"
/>
</Toolkit:SettingsExpander.Items>
</widgets:SettingsEntry>

<!-- User interface -->
<widgets:SettingsEntry
Text="User interface preferences"
UnderText="Action when double-clicking packages, hide successful installations"
Icon="interactive">
<Toolkit:SettingsExpander.Items>
<widgets:ComboboxCard
x:Name="ThemeSelector"
Text="Application theme:"
SettingName="PreferredTheme"
ValueChanged="ThemeSelector_ValueChanged"
/>
<widgets:CheckboxCard
Text="Do not remove successful operations from the list automatically"
SettingName="MaintainSuccessfulInstalls"
/>
</Toolkit:SettingsExpander.Items>
</widgets:SettingsEntry>
<widgets:SettingsEntry
Text="Notification tray options"
UnderText="WingetUI tray application preferences"
Icon="systemtray">
<Toolkit:SettingsExpander.Items>
<widgets:CheckboxCard
Text="Close WingetUI to the notification area"
Text="Show UniGetUI on the system tray"
SettingName="DisableSystemTray"
x:Name="DisableSystemTray"
StateChanged="DisableSystemTray_StateChanged"
/>
</Toolkit:SettingsExpander.Items>
</widgets:SettingsEntry>

<!-- Notifications -->
<widgets:SettingsEntry
x:Name="NotificationSettingsEntry"
Text="Notification preferences"
UnderText="Show notifications on different events"
Icon="megaphone">
<Toolkit:SettingsExpander.Items>
<widgets:CheckboxCard
Text="Enable WingetUI notifications"
SettingName="DisableNotifications"
Expand All @@ -174,6 +147,54 @@
/>
</Toolkit:SettingsExpander.Items>
</widgets:SettingsEntry>

<!-- Startup options -->
<widgets:SettingsEntry
Text="Startup options"
UnderText="WingetUI autostart behaviour, application launch settings"
Icon="launch">
<Toolkit:SettingsExpander.Items>
<widgets:ButtonCard
Text="Manage WingetUI autostart behaviour from the Settings app"
ButtonText="Open"
Click="EditAutostartSettings_Click"
/>
<widgets:CheckboxCard
Text="Update package indexes on launch"
SettingName="DisableUpdateIndexes"
/>
<widgets:CheckboxCard
Text="Enable Scoop cleanup on launch"
SettingName="EnableScoopCleanup"
/>
</Toolkit:SettingsExpander.Items>
</widgets:SettingsEntry>

<!-- Updates Settings -->
<widgets:SettingsEntry
Text="Updates preferences"
UnderText="Change how UniGetUI checks and installs available updates for your packages"
Icon="menu_updates">
<Toolkit:SettingsExpander.Items>
<widgets:CheckboxCard
x:Name="DisableAutoCheckForUpdates"
Text="Check for package updates periodically"
SettingName="DisableAutoCheckforUpdates"
/>
<widgets:ComboboxCard
x:Name="UpdatesCheckIntervalSelector"
Text="Check for updates every:"
SettingName="UpdatesCheckInterval"
ValueChanged="UpdatesCheckIntervalSelector_ValueChanged"
/>
<widgets:CheckboxCard
Text="Install available updates automatically"
SettingName="AutomaticallyUpdatePackages"
/>
</Toolkit:SettingsExpander.Items>
</widgets:SettingsEntry>

<!-- Backup packages -->
<widgets:SettingsEntry
Text="Backup installed packages"
UnderText="Automatically save a list of all your installed packages to easily restore them."
Expand Down Expand Up @@ -230,6 +251,8 @@
/>
</Toolkit:SettingsExpander.Items>
</widgets:SettingsEntry>

<!-- Administrator prefs -->
<widgets:SettingsEntry
x:Name="AdminSettingsExpander"
Text="Administrator privileges preferences"
Expand All @@ -250,6 +273,8 @@
/>
</Toolkit:SettingsExpander.Items>
</widgets:SettingsEntry>

<!-- Experimental -->
<widgets:SettingsEntry
x:Name="ExperimentalSettingsExpander"
Text="Experimental settings and developer options"
Expand Down
6 changes: 5 additions & 1 deletion src/UniGetUI/Interface/Pages/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public SettingsInterface()
}
LanguageSelector.ShowAddedItems();


NotificationSettingsEntry.IsEnabled = DisableSystemTray.Checked;

Dictionary<string, string> updates_dict = new()
{
Expand Down Expand Up @@ -527,6 +527,10 @@ private void EditAutostartSettings_Click(object sender, ButtonCardEventArgs e)
private void DisableSystemTray_StateChanged(object sender, CheckBoxEventArgs e)
{
MainApp.Instance.MainWindow.UpdateSystemTrayStatus();
if (NotificationSettingsEntry is not null)
{
NotificationSettingsEntry.IsEnabled = DisableSystemTray.Checked;
}
}

private void EnablePackageBackupCheckBox_StateChanged(object sender, CheckBoxEventArgs e)
Expand Down

0 comments on commit 43c3a47

Please sign in to comment.