Skip to content

Commit a21b8c5

Browse files
committed
v9.0.29552.0
1 parent f1f0452 commit a21b8c5

File tree

18 files changed

+148
-38
lines changed

18 files changed

+148
-38
lines changed

Common/Common.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<Compile Remove="FolderMetadataExt.cs" />
1616
</ItemGroup>
1717
<ItemGroup>
18-
<PackageReference Include="ITHit.FileSystem.Windows" Version="9.0.29527.0" />
19-
<PackageReference Include="ITHit.FileSystem" Version="9.0.29527.0" />
18+
<PackageReference Include="ITHit.FileSystem.Windows" Version="9.0.29552.0" />
19+
<PackageReference Include="ITHit.FileSystem" Version="9.0.29552.0" />
2020
</ItemGroup>
2121
</Project>

Windows/Common/Core/Common.Windows.Core.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.26100.1742" />
2424
</ItemGroup>
2525
<ItemGroup>
26-
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="9.0.29527.0" />
27-
<PackageReference Include="ITHit.FileSystem.Windows" Version="9.0.29527.0" />
26+
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="9.0.29552.0" />
27+
<PackageReference Include="ITHit.FileSystem.Windows" Version="9.0.29552.0" />
2828
<ProjectReference Include="..\..\..\Common\Common.csproj" />
2929
</ItemGroup>
3030
</Project>

Windows/Common/VirtualDrive/Common.Windows.VirtualDrive.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<Compile Remove="IVirtualFolder.cs" />
1414
</ItemGroup>
1515
<ItemGroup>
16-
<PackageReference Include="ITHit.FileSystem.Windows.AppHelper" Version="9.0.29527.0" />
17-
<PackageReference Include="ITHit.FileSystem.Windows" Version="9.0.29527.0" />
16+
<PackageReference Include="ITHit.FileSystem.Windows.AppHelper" Version="9.0.29552.0" />
17+
<PackageReference Include="ITHit.FileSystem.Windows" Version="9.0.29552.0" />
1818
<ProjectReference Include="..\..\..\Common\Common.csproj" />
1919
<ProjectReference Include="..\Core\Common.Windows.Core.csproj" />
2020
</ItemGroup>

Windows/VirtualDrive/App.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ private void CreateTrayIcon()
224224

225225
ServiceProvider.DispatcherQueue.TryEnqueue(() =>
226226
{
227-
Tray trayWindow = new Tray(engine, null);
227+
Tray trayWindow = new Tray(engine, null, null);
228228
Commands commands = new Commands(engine, settings.RemoteStorageRootPath, logFormatter.Log);
229229

230230
//Set header text, mount, unmount, start/stop sync handlers here - as Tray does not access to sample related things

Windows/VirtualDrive/Resources/Styles/Colors.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@
5454
<Color x:Key="AnimatedIconColor">#eaeaea</Color>
5555
<Color x:Key="HistoryItemHoveredColor">#242424</Color>
5656
<Color x:Key="HistoryItemPressedColor">#282828</Color>
57-
<Color x:Key="DisabledButtonTextColor">#C8C8C8</Color>
57+
<Color x:Key="DisabledButtonTextColor">#ffff</Color>
58+
<Color x:Key="DisabledButtonBackgroundColor">#3C3C3C</Color>
5859
<Color x:Key="ButtonBackgroundColor">#242424</Color>
5960
<Color x:Key="TraySubMenuHoverColor">#323130</Color>
6061
<Color x:Key="DialogButtonHoverColor">#dddddd</Color>

Windows/VirtualDrive/VirtualDrive.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@
230230
<PackageReference Include="System.Drawing.Common" Version="9.0.0" />
231231
</ItemGroup>
232232
<ItemGroup>
233-
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="9.0.29527.0" />
234-
<PackageReference Include="ITHit.FileSystem.Windows.WinUI" Version="9.0.29527.0" />
233+
<PackageReference Include="ITHit.FileSystem.Windows.Package" Version="9.0.29552.0" />
234+
<PackageReference Include="ITHit.FileSystem.Windows.WinUI" Version="9.0.29552.0" />
235235
<ProjectReference Include="..\..\Common\Common.csproj" />
236236
<ProjectReference Include="..\Common\VirtualDrive\Common.Windows.VirtualDrive.csproj" />
237237
</ItemGroup>

Windows/VirtualFileSystem/VirtualFileSystem.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ This project does not support ETags, locking, Microsoft Office documents editing
3535
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.0" />
3636
</ItemGroup>
3737
<ItemGroup>
38-
<PackageReference Include="ITHit.FileSystem.Windows.AppHelper" Version="9.0.29527.0" />
38+
<PackageReference Include="ITHit.FileSystem.Windows.AppHelper" Version="9.0.29552.0" />
3939
<ProjectReference Include="..\Common\Core\Common.Windows.Core.csproj" />
4040
</ItemGroup>
4141
<ItemGroup>

Windows/WebDAVDrive/AppSettings.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ public class AppSettings : Settings
3535
/// </summary>
3636
public double ManualLockTimeoutMs { get; set; }
3737

38+
// <summary>
39+
/// Controls the number of events in the tray window.
40+
/// </summary>
41+
public int TrayMaxHistoryItems { get; set; }
42+
3843
/// <summary>
3944
/// Full outgoing synchronization and hydration/dehydration interval in milliseconds.
4045
/// </summary>

Windows/WebDAVDrive/Dialogs/Settings.xaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</StackPanel>
3838
<StackPanel Style="{StaticResource SettingsStackPanelWithTextBox}" Grid.Column="1">
3939
<TextBox x:Name="AutomaticLockTimeout" Style="{StaticResource SettingsTextBoxStyle}" />
40-
<TextBlock x:Name="AutomaticRequiredMessage" x:Uid="AutomaticRequiredMessage" Style="{StaticResource SettingsErrorStyle}" />
40+
<TextBlock x:Name="AutomaticRequiredMessage" x:Uid="RequiredSettingMessage" Style="{StaticResource SettingsErrorStyle}" />
4141
<TextBlock x:Name="AutomaticValidationMessage" x:Uid="AutomaticValidationMessage" Style="{StaticResource SettingsErrorStyle}" />
4242
</StackPanel>
4343
</Grid>
@@ -68,6 +68,22 @@
6868
</StackPanel>
6969
<ToggleSwitch x:Uid="BottomToggle" x:Name="ReadOnlyOnLockedFiles" Grid.Column="1" Style="{StaticResource SettingsToggleStyle}" />
7070
</Grid>
71+
72+
<Grid Style="{StaticResource SettingsGridStyle}">
73+
<Grid.ColumnDefinitions>
74+
<ColumnDefinition Width="*" />
75+
<ColumnDefinition Width="100" />
76+
</Grid.ColumnDefinitions>
77+
<StackPanel Style="{StaticResource SettingsStackPanel}" Grid.Column="0">
78+
<TextBlock x:Uid="TrayMaxHistoryItemsLabel" Style="{StaticResource SettingsTextBlockStyle}" />
79+
<TextBlock x:Uid="TrayMaxHistoryItemsLabelDescription" Style="{StaticResource SettingsDescriptionStyle}" />
80+
</StackPanel>
81+
<StackPanel Style="{StaticResource SettingsStackPanelWithTextBox}" Grid.Column="1">
82+
<TextBox x:Name="TrayMaxHistoryItems" Style="{StaticResource SettingsTextBoxStyle}" />
83+
<TextBlock x:Name="TrayMaxHistoryItemsRequiredMessage" x:Uid="RequiredSettingMessage" Style="{StaticResource SettingsErrorStyle}" />
84+
<TextBlock x:Name="TrayMaxHistoryItemsValidationMessage" x:Uid="TrayMaxHistoryItemsValidationMessage" Style="{StaticResource SettingsErrorStyle}" />
85+
</StackPanel>
86+
</Grid>
7187
</StackPanel>
7288

7389
<!-- Buttons -->

Windows/WebDAVDrive/Dialogs/Settings.xaml.cs

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using ITHit.FileSystem.Windows.WinUI;
12
using ITHit.FileSystem.Windows.WinUI.Dialogs;
23
using Microsoft.UI.Xaml;
34
using WebDAVDrive.Services;
@@ -13,12 +14,14 @@ public sealed partial class Settings : DialogWindow
1314
private readonly ResourceLoader resourceLoader = ResourceLoader.GetForViewIndependentUse();
1415

1516
private readonly VirtualEngine engine;
17+
private readonly Tray parentTrayWindow;
1618

17-
public Settings(VirtualEngine engine) : base()
19+
public Settings(Tray trayWindow) : base()
1820
{
1921
InitializeComponent();
20-
Resize(700, 600);
21-
this.engine = engine;
22+
Resize(700, 700);
23+
engine = (trayWindow.Engine as VirtualEngine)!;
24+
parentTrayWindow = trayWindow;
2225
Title = $"{ServiceProvider.GetService<AppSettings>().ProductName} - {resourceLoader.GetString("SettingsWindow/Title")}";
2326

2427
// Resize and center the window.
@@ -27,6 +30,7 @@ public Settings(VirtualEngine engine) : base()
2730
//Set values from engine
2831
AutomaticLockTimeout.Text = (engine.AutoLockTimeoutMs / 1000).ToString();
2932
ManualLockTimeout.Text = engine.ManualLockTimeoutMs == -1 ? string.Empty : (engine.ManualLockTimeoutMs / 1000).ToString();
33+
TrayMaxHistoryItems.Text = engine.TrayMaxHistoryItems.ToString();
3034
AutoLockEnable.IsOn = engine.AutoLock;
3135
ReadOnlyOnLockedFiles.IsOn = engine.SetLockReadOnly;
3236
}
@@ -39,7 +43,8 @@ private void OnCloseClicked(object sender, RoutedEventArgs e)
3943
private void OnSaveClicked(object sender, RoutedEventArgs e)
4044
{
4145
bool isValidationError = false;
42-
AutomaticRequiredMessage.Visibility = AutomaticValidationMessage.Visibility = ManualValidationMessage.Visibility = Visibility.Collapsed;
46+
AutomaticRequiredMessage.Visibility = AutomaticValidationMessage.Visibility = ManualValidationMessage.Visibility =
47+
TrayMaxHistoryItemsRequiredMessage.Visibility = TrayMaxHistoryItemsValidationMessage.Visibility = Visibility.Collapsed;
4348

4449
//"Automatic lock timeout" field is required and should be a number
4550
if (string.IsNullOrWhiteSpace(AutomaticLockTimeout.Text))
@@ -62,16 +67,39 @@ private void OnSaveClicked(object sender, RoutedEventArgs e)
6267
ManualValidationMessage.Visibility = Visibility.Visible;
6368
}
6469

70+
//"Tray max history items" field is required and should be a 10+ integer number
71+
if (string.IsNullOrWhiteSpace(TrayMaxHistoryItems.Text))
72+
{
73+
isValidationError = true;
74+
TrayMaxHistoryItemsRequiredMessage.Visibility = Visibility.Visible;
75+
TrayMaxHistoryItemsValidationMessage.Visibility = Visibility.Collapsed;
76+
}
77+
else if (!int.TryParse(TrayMaxHistoryItems.Text, out int trayMaxHistoryItems) || trayMaxHistoryItems < 10)
78+
{
79+
isValidationError = true;
80+
TrayMaxHistoryItemsRequiredMessage.Visibility = Visibility.Collapsed;
81+
TrayMaxHistoryItemsValidationMessage.Visibility = Visibility.Visible;
82+
}
83+
6584
if (!isValidationError)
6685
{
6786
UserSettingsService userSettingsService = ServiceProvider.GetService<UserSettingsService>();
87+
int trayMaxHistoryItemsShowing = int.Parse(TrayMaxHistoryItems.Text);
6888
userSettingsService.SaveSettings(engine, new UserSettings
6989
{
7090
AutomaticLockTimeout = double.Parse(AutomaticLockTimeout.Text) * 1000,
7191
ManualLockTimeout = string.IsNullOrWhiteSpace(ManualLockTimeout.Text) ? -1 : (double.Parse(ManualLockTimeout.Text) * 1000),
92+
TrayMaxHistoryItems = trayMaxHistoryItemsShowing,
7293
SetLockReadOnly = ReadOnlyOnLockedFiles.IsOn,
7394
AutoLock = AutoLockEnable.IsOn
74-
});
95+
});
96+
//update property of parent Tray window and clear history on the fly (if user provided smaller setting value)
97+
int? oldValue = parentTrayWindow.TrayMaxHistoryItems;
98+
parentTrayWindow.TrayMaxHistoryItems = trayMaxHistoryItemsShowing;
99+
if (oldValue.HasValue && oldValue.Value > trayMaxHistoryItemsShowing)
100+
{
101+
parentTrayWindow.CleanupHistoryItems();
102+
}
75103

76104
Close();
77105
}

0 commit comments

Comments
 (0)