Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Files.App/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -4304,6 +4304,12 @@
<data name="OpenSettings" xml:space="preserve">
<value>Open settings</value>
</data>
<data name="NetworkDiscoveryInfoBarTitle" xml:space="preserve">
<value>Network discovery might be turned off</value>
</data>
<data name="NetworkDiscoveryInfoBarMessage" xml:space="preserve">
<value>Network devices may not appear when network discovery is turned off. Open Windows Settings to enable it.</value>
</data>
<data name="VisualStudioCode" xml:space="preserve">
<value>Visual Studio Code</value>
</data>
Expand Down
17 changes: 16 additions & 1 deletion src/Files.App/ViewModels/ShellViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,13 @@ public EmptyTextType EmptyTextType
set => SetProperty(ref emptyTextType, value);
}

private bool isNetworkDiscoveryInfoBarOpen;
public bool IsNetworkDiscoveryInfoBarOpen
{
get => isNetworkDiscoveryInfoBarOpen;
set => SetProperty(ref isNetworkDiscoveryInfoBarOpen, value);
}

public async Task UpdateFolderThumbnailImageSource()
{
FolderThumbnailImageSource = await NavigationHelpers.GetIconForPathAsync(WorkingDirectory);
Expand Down Expand Up @@ -729,6 +736,7 @@ public void CancelLoadAndClearFiles()
{
Debug.WriteLine("CancelLoadAndClearFiles");
CloseWatcher();
IsNetworkDiscoveryInfoBarOpen = false;
if (IsLoadingItems)
{
IsLoadingCancelled = true;
Expand Down Expand Up @@ -781,7 +789,14 @@ public string? SearchHeaderTitle

public void UpdateEmptyTextType()
{
EmptyTextType = FilesAndFolders.Count == 0 ? (IsSearchResults ? EmptyTextType.NoSearchResultsFound : EmptyTextType.FolderEmpty) : EmptyTextType.None;
var isFolderEmpty = FilesAndFolders.Count == 0;

IsNetworkDiscoveryInfoBarOpen =
isFolderEmpty &&
!IsSearchResults &&
string.Equals(WorkingDirectory, Constants.UserEnvironmentPaths.NetworkFolderPath, StringComparison.OrdinalIgnoreCase);

EmptyTextType = isFolderEmpty ? (IsSearchResults ? EmptyTextType.NoSearchResultsFound : EmptyTextType.FolderEmpty) : EmptyTextType.None;
}

private string? _filesAndFoldersFilter;
Expand Down
7 changes: 1 addition & 6 deletions src/Files.App/Views/Layouts/GridLayoutPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -973,13 +973,9 @@
</local:BaseGroupableLayoutPage.Resources>

<Grid x:Name="RootGrid" ContextFlyout="{x:Bind BaseContextMenuFlyout}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>

<!-- Empty Indicator -->
<uc:FolderEmptyIndicator
Grid.Row="3"
Margin="0,125,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Expand All @@ -997,7 +993,6 @@
<!-- Grouping/Ungrouping -->
<SemanticZoom
x:Name="RootGridZoom"
Grid.Row="1"
CanChangeViews="{x:Bind CollectionViewSource.IsSourceGrouped, Mode=OneWay}"
ViewChangeStarted="SemanticZoom_ViewChangeStarted"
Visibility="{x:Bind FolderSettings.IsLayoutModeChanging, Mode=OneWay, Converter={StaticResource NegatedBoolToVisibilityConverter}}">
Expand Down
35 changes: 26 additions & 9 deletions src/Files.App/Views/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@
PreviewKeyDown="RootGrid_PreviewKeyDown"
SizeChanged="RootGrid_SizeChanged">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition
x:Name="ContentRow"
Expand Down Expand Up @@ -229,18 +230,34 @@
TabIndex="2"
Visibility="{x:Bind ViewModel.ShowToolbar, Mode=OneWay}" />

<InfoBar
x:Name="NetworkDiscoveryInfoBar"
Title="{helpers:ResourceString Name=NetworkDiscoveryInfoBarTitle}"
Grid.Row="1"
Grid.ColumnSpan="3"
Margin="0,0,0,4"
IsClosable="True"
IsIconVisible="True"
IsOpen="{x:Bind SidebarAdaptiveViewModel.PaneHolder.ActivePaneOrColumn.ShellViewModel.IsNetworkDiscoveryInfoBarOpen, Mode=TwoWay}"
Message="{helpers:ResourceString Name=NetworkDiscoveryInfoBarMessage}"
Severity="Warning">
<InfoBar.ActionButton>
<Button Click="OpenNetworkAdvancedSettingsButton_Click" Content="{helpers:ResourceString Name=OpenSettings}" />
</InfoBar.ActionButton>
</InfoBar>

<!-- Page Content -->
<ContentPresenter
x:Name="PageContent"
Grid.Row="1"
Grid.Row="2"
Grid.Column="0"
HorizontalContentAlignment="Stretch"
Content="{x:Bind ViewModel.SelectedTabItem.ContentFrame, Mode=OneWay}" />

<!-- Info Pane Splitter -->
<controls:GridSplitter
x:Name="InfoPaneSizer"
Grid.Row="1"
Grid.Row="2"
Grid.Column="1"
x:Load="{x:Bind ViewModel.ShouldPreviewPaneBeActive, Mode=OneWay}"
ManipulationCompleted="PaneSplitter_ManipulationCompleted"
Expand All @@ -252,7 +269,7 @@
<!-- Info Pane -->
<uc:InfoPane
x:Name="InfoPane"
Grid.Row="1"
Grid.Row="2"
Grid.Column="2"
HorizontalContentAlignment="Stretch"
x:Load="{x:Bind ViewModel.ShouldPreviewPaneBeActive, Mode=OneWay}"
Expand All @@ -262,7 +279,7 @@
<!-- Status Bar -->
<uc:StatusBar
x:Name="StatusBar"
Grid.Row="4"
Grid.Row="5"
Grid.ColumnSpan="3"
x:Load="False"
ShowInfoText="{x:Bind ViewModel.ShowStatusBar, Mode=OneWay}"
Expand All @@ -272,7 +289,7 @@
<uc:ShelfPane
x:Name="ShelfPane"
Grid.Row="0"
Grid.RowSpan="5"
Grid.RowSpan="6"
Grid.Column="3"
Margin="4,0,0,8"
x:Load="{x:Bind ViewModel.ShowShelfPane, Mode=OneWay}"
Expand Down Expand Up @@ -441,9 +458,9 @@
</VisualState>
<VisualState x:Name="InfoPanePositionRight">
<VisualState.Setters>
<Setter Target="InfoPane.(Grid.Row)" Value="1" />
<Setter Target="InfoPane.(Grid.Row)" Value="2" />
<Setter Target="InfoPane.(Grid.Column)" Value="2" />
<Setter Target="InfoPaneSizer.(Grid.Row)" Value="1" />
<Setter Target="InfoPaneSizer.(Grid.Row)" Value="2" />
<Setter Target="InfoPaneSizer.(Grid.Column)" Value="1" />
<Setter Target="InfoPaneSizer.Width" Value="2" />
<Setter Target="InfoPaneSizer.GripperCursor" Value="SizeWestEast" />
Expand All @@ -454,9 +471,9 @@
</VisualState>
<VisualState x:Name="InfoPanePositionBottom">
<VisualState.Setters>
<Setter Target="InfoPane.(Grid.Row)" Value="3" />
<Setter Target="InfoPane.(Grid.Row)" Value="4" />
<Setter Target="InfoPane.(Grid.Column)" Value="0" />
<Setter Target="InfoPaneSizer.(Grid.Row)" Value="2" />
<Setter Target="InfoPaneSizer.(Grid.Row)" Value="3" />
<Setter Target="InfoPaneSizer.(Grid.Column)" Value="0" />
<Setter Target="InfoPaneSizer.Height" Value="2" />
<Setter Target="InfoPaneSizer.GripperCursor" Value="SizeNorthSouth" />
Expand Down
7 changes: 6 additions & 1 deletion src/Files.App/Views/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ private void UpdateNavToolbarProperties()
InnerNavigationToolbar.ViewModel = SidebarAdaptiveViewModel.PaneHolder?.ActivePaneOrColumn.ToolbarViewModel;
}

private async void OpenNetworkAdvancedSettingsButton_Click(object sender, RoutedEventArgs e)
{
await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings:network-advancedsettings"));
}

protected override void OnNavigatedTo(NavigationEventArgs e)
{
_ = ViewModel.OnNavigatedToAsync(e);
Expand Down Expand Up @@ -522,4 +527,4 @@ private async Task AnimateSettingsIconAsync()
AnimatedIcon.SetState(SettingAnimatedIcon, "Normal");
}
}
}
}
Loading