Skip to content

Commit 742388f

Browse files
committed
Improved Settings Menu
1 parent e2d2882 commit 742388f

12 files changed

+122
-63
lines changed

App.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ namespace Files
1313
/// </summary>
1414
sealed partial class App : Application
1515
{
16+
1617
/// <summary>
1718
/// Initializes the singleton application object. This is the first line of authored code
1819
/// executed, and as such is the logical equivalent of main() or WinMain().

FileLoader.cs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
using Windows.UI.Xaml;
2323
using Windows.UI.Xaml.Media.Imaging;
2424
using Windows.Storage.Search;
25-
using System.Data.SqlClient;
26-
using System.Threading.Tasks;
2725
using Windows.UI.Popups;
2826
using Interact;
2927

@@ -165,6 +163,9 @@ private async void DisplayConsentDialog()
165163

166164
public async void GetItemsAsync(string path)
167165
{
166+
Stopwatch stopwatch = new Stopwatch();
167+
stopwatch.Start();
168+
168169
IsTerminated = false;
169170
PUIP.Path = path;
170171
try
@@ -287,24 +288,19 @@ public async void GetItemsAsync(string path)
287288
NumItemsRead++;
288289
}
289290

290-
//file_index += step;
291-
//fileList = await fileQueryResult.GetFilesAsync(file_index, step);
292-
//if (fileList.Count == 0)
293-
//{
294-
// break;
295-
//}
291+
296292
}
297293

298-
//if (NumOfItems >= 75)
299-
//{
300294
PVIS.isVisible = Visibility.Collapsed;
301-
//}
302-
IsTerminated = true;
295+
IsTerminated = true;
303296
}
304297
catch (UnauthorizedAccessException e)
305298
{
306299
DisplayConsentDialog();
307300
}
301+
stopwatch.Stop();
302+
Debug.WriteLine("Loading of: " + path + " completed in " + stopwatch.ElapsedMilliseconds + " Milliseconds.");
303+
308304
}
309305

310306

Files.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@
123123
<Compile Include="Settings.xaml.cs">
124124
<DependentUpon>Settings.xaml</DependentUpon>
125125
</Compile>
126+
<Compile Include="SettingsPages\About.xaml.cs">
127+
<DependentUpon>About.xaml</DependentUpon>
128+
</Compile>
126129
<Compile Include="SettingsPages\Personalization.xaml.cs">
127130
<DependentUpon>Personalization.xaml</DependentUpon>
128131
</Compile>
@@ -222,6 +225,10 @@
222225
<SubType>Designer</SubType>
223226
<Generator>MSBuild:Compile</Generator>
224227
</Page>
228+
<Page Include="SettingsPages\About.xaml">
229+
<SubType>Designer</SubType>
230+
<Generator>MSBuild:Compile</Generator>
231+
</Page>
225232
<Page Include="SettingsPages\Personalization.xaml">
226233
<SubType>Designer</SubType>
227234
<Generator>MSBuild:Compile</Generator>

GenericFileBrowser.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159

160160
<Grid Padding="50,200,50,0">
161161

162-
<controls:DataGrid FocusVisualPrimaryThickness="0" SelectionMode="Extended" IsDoubleTapEnabled="True" x:FieldModifier="public" x:Name="AllView" Drop="AllView_DropAsync" AutoGenerateColumns="False" CanDrag="False" AllowDrop="True" DragOver="AllView_DragOver" IsRightTapEnabled="True" CanUserReorderColumns="False" IsReadOnly="True" ItemsSource="{x:Bind local2:ItemViewModel.FilesAndFolders}" Margin="0,0,0,0" Padding="0, 0, 0, 0" HorizontalAlignment="Left">
162+
<controls:DataGrid FocusVisualPrimaryThickness="0" SelectionMode="Extended" IsDoubleTapEnabled="True" x:FieldModifier="public" x:Name="AllView" Drop="AllView_DropAsync" AutoGenerateColumns="False" CanDrag="False" AllowDrop="True" DragOver="AllView_DragOver" IsRightTapEnabled="True" CanUserReorderColumns="False" IsReadOnly="True" ItemsSource="{x:Bind local2:ItemViewModel.FilesAndFolders}" Margin="0,0,0,0" Padding="0, 0, 0, 0" HorizontalAlignment="Left">
163163

164164
<controls:DataGrid.Resources>
165165
<MenuFlyout x:Name="HeaderRightClickMenu" x:Key="HeaderRightClickFlyout">

ItemInteractions.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,9 @@
2222
using Files;
2323
using ItemListPresenter;
2424
using Navigation;
25-
using Windows.UI.Xaml.Media.Imaging;
26-
using Windows.Storage.Streams;
27-
using System.ComponentModel;
2825
using System.Diagnostics;
2926
using Windows.ApplicationModel.DataTransfer;
30-
using System.Collections;
3127
using System.Collections.Generic;
32-
using System.Linq;
33-
using Windows.Storage.Search;
3428
using Windows.UI.Popups;
3529
using Windows.UI.Xaml.Media;
3630
using System.Collections.ObjectModel;

NavigationSystem.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,12 @@ public static void Back_Click(object sender, RoutedEventArgs e)
168168
if (History.HistoryList.Count() > 1)
169169
{
170170
ItemViewModel.TextState.isVisible = Visibility.Collapsed;
171-
Debug.WriteLine("\nBefore Removals");
172-
ArrayDiag.DumpArray();
171+
//Debug.WriteLine("\nBefore Removals");
172+
//ArrayDiag.DumpArray();
173173
History.AddToForwardList(History.HistoryList[History.HistoryList.Count() - 1]);
174174
History.HistoryList.RemoveAt(History.HistoryList.Count() - 1);
175-
Debug.WriteLine("\nAfter Removals");
176-
ArrayDiag.DumpArray();
175+
//Debug.WriteLine("\nAfter Removals");
176+
//ArrayDiag.DumpArray();
177177
ItemViewModel.ViewModel = new ItemViewModel(History.HistoryList[History.HistoryList.Count() - 1], false); // To take into account the correct index without interference from the folder being navigated to
178178
ItemViewModel.FilesAndFolders.Clear();
179179
GenericFileBrowser.P.path = History.HistoryList[History.HistoryList.Count() - 1];

Settings.xaml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,24 @@
2222

2323
<Page.Resources>
2424
<AcrylicBrush TintOpacity="80" x:Key="SecondaryPaneBrush" BackgroundSource="HostBackdrop" />
25+
2526
</Page.Resources>
26-
<Grid>
2727

28+
<Grid>
2829
<SplitView IsPaneOpen="True" PaneBackground="{ThemeResource SystemControlAcrylicWindowBrush}" DisplayMode="Inline">
2930
<SplitView.Pane>
30-
<ListView Name="SecondaryPane" ItemClick="ListView_ItemClick" IsItemClickEnabled="True" SelectionChanged="ListView_SelectionChanged" SelectedIndex="0">
31+
<ListView Name="SecondaryPane" IsItemClickEnabled="True" SelectionChanged="ListView_SelectionChanged">
3132
<NavigationViewItemSeparator/>
3233
<NavigationViewItemSeparator/>
3334
<NavigationViewItemSeparator/>
3435
<NavigationViewItemSeparator/>
3536
<NavigationViewItemSeparator/>
36-
<NavigationViewItemHeader Margin="10, -4, 0, 0" Content="Settings"/>
37-
<ListViewItem x:Name="Personalization">
38-
<NavigationViewItem Content="Personalization" />
37+
<NavigationViewItemHeader Margin="5, -4, 0, 0" Content="Settings"/>
38+
<ListViewItem Padding="20,0,0,0" Content="Personalization" x:Name="Personalization">
3939
</ListViewItem>
40-
<ListViewItem x:Name="Preferences">
41-
<NavigationViewItem Content="Preferences" />
40+
<ListViewItem Padding="20,0,0,0" Content="Preferences" x:Name="Preferences">
4241
</ListViewItem>
43-
<ListViewItem x:Name="About">
44-
<NavigationViewItem Content="About" />
42+
<ListViewItem Padding="20,0,0,0" Content="About" x:Name="About">
4543
</ListViewItem>
4644
</ListView>
4745

Settings.xaml.cs

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -40,35 +40,25 @@ public sealed partial class Settings : Page
4040
public Settings()
4141
{
4242
this.InitializeComponent();
43-
SecondaryPane.SelectedIndex = 0;
44-
SettingsContentFrame.Navigate(typeof(Personalization));
45-
}
46-
47-
private void NavigationView_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
48-
{
49-
NavigationViewItem item = args.SelectedItem as NavigationViewItem;
50-
if(item.Name == "Personalization")
51-
{
52-
SettingsContentFrame.Navigate(typeof(Personalization));
53-
}else if(item.Name == "Features")
54-
{
55-
56-
}else if(item.Name == "About")
57-
{
58-
59-
}
60-
}
61-
62-
private void ListView_ItemClick(object sender, ItemClickEventArgs e)
63-
{
64-
43+
SecondaryPane.SelectedIndex = 6;
6544
}
6645

6746
private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
6847
{
6948
foreach(ListViewItem lvi in SecondaryPane.Items)
7049
{
71-
50+
if((e.AddedItems[0] as ListViewItem).Name == "Personalization" && lvi.Name == "Personalization")
51+
{
52+
SettingsContentFrame.Navigate(typeof(Personalization));
53+
}
54+
else if((e.AddedItems[0] as ListViewItem).Name == "Preferences" && lvi.Name == "Preferences")
55+
{
56+
SettingsContentFrame.Navigate(typeof(Preferences));
57+
}
58+
else if ((e.AddedItems[0] as ListViewItem).Name == "About" && lvi.Name == "About")
59+
{
60+
SettingsContentFrame.Navigate(typeof(About));
61+
}
7262
}
7363
}
7464
}

SettingsPages/About.xaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<Page
2+
x:Class="Files.SettingsPages.About"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:local="using:Files.SettingsPages"
6+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
7+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8+
mc:Ignorable="d"
9+
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
10+
11+
<Grid Padding="50,100,50,0">
12+
<StackPanel Orientation="Vertical">
13+
<TextBlock x:Name="Header" Text="About Files" Margin="0,0,0,25" FontFamily="Segoe UI Black" FontWeight="Bold" FontSize="48" HorizontalAlignment="Left" VerticalAlignment="Top" />
14+
<TextBlock Margin="0,0,0,10" FontFamily="Segoe UI" FontSize="24" Text="Product Information"/>
15+
<TextBlock FontSize="18" Text="Edition: Files Home"/>
16+
<TextBlock FontSize="18" Text="Version: 0.4.2 Pre-Release"/>
17+
<ListView IsItemClickEnabled="True" Margin="0,35,0,0" ItemClick="ListView_ItemClick" HorizontalAlignment="Stretch">
18+
<ListViewItem Name="FeedbackForm">
19+
<StackPanel Orientation="Horizontal">
20+
<FontIcon Margin="0,0,25,0" Glyph="&#xED15;"/>
21+
<StackPanel Orientation="Vertical">
22+
<TextBlock Text="Submit Feedback"/>
23+
<TextBlock Text="Fill out a quick form to provide the developers with information" Foreground="Gray"/>
24+
</StackPanel>
25+
</StackPanel>
26+
27+
</ListViewItem>
28+
</ListView>
29+
</StackPanel>
30+
</Grid>
31+
</Page>

SettingsPages/About.xaml.cs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
using Interact;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.IO;
5+
using System.Linq;
6+
using System.Runtime.InteropServices.WindowsRuntime;
7+
using Windows.Foundation;
8+
using Windows.Foundation.Collections;
9+
using Windows.System;
10+
using Windows.UI.Xaml;
11+
using Windows.UI.Xaml.Controls;
12+
using Windows.UI.Xaml.Controls.Primitives;
13+
using Windows.UI.Xaml.Data;
14+
using Windows.UI.Xaml.Input;
15+
using Windows.UI.Xaml.Media;
16+
using Windows.UI.Xaml.Navigation;
17+
18+
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
19+
20+
namespace Files.SettingsPages
21+
{
22+
/// <summary>
23+
/// An empty page that can be used on its own or navigated to within a Frame.
24+
/// </summary>
25+
public sealed partial class About : Page
26+
{
27+
public About()
28+
{
29+
this.InitializeComponent();
30+
}
31+
32+
private async void ListView_ItemClick(object sender, ItemClickEventArgs e)
33+
{
34+
var clicked = e.ClickedItem as ListViewBase;
35+
var trulyclicked = Interaction.FindParent<ListViewItem>(e.ClickedItem as DependencyObject);
36+
if (trulyclicked.Name == "FeedbackForm")
37+
{
38+
await Launcher.LaunchUriAsync(new Uri(@"https://goo.gl/forms/Z4bfKhaJJ6lT3Tcu2"));
39+
}
40+
}
41+
}
42+
}

0 commit comments

Comments
 (0)