Skip to content

Commit db47363

Browse files
authored
v0.7.5 (#539)
1 parent dc69440 commit db47363

File tree

71 files changed

+956
-5527
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+956
-5527
lines changed

Files.Package/Package.appxmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" xmlns:desktop4="http://schemas.microsoft.com/appx/manifest/desktop/windows10/4" xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10" xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5" IgnorableNamespaces="uap uap5 mp rescap desktop4 desktop">
3-
<Identity Name="49306atecsolution.FilesUWP" Publisher="CN=53EC4384-7F5B-4CF6-8C23-513FFE9D1AB7" Version="0.7.4.0" />
3+
<Identity Name="49306atecsolution.FilesUWP" Publisher="CN=53EC4384-7F5B-4CF6-8C23-513FFE9D1AB7" Version="0.7.5.0" />
44
<Properties>
55
<DisplayName>Files UWP - Preview</DisplayName>
66
<PublisherDisplayName>Yair A</PublisherDisplayName>

Files/App.xaml.cs

Lines changed: 20 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ public static IShellPage CurrentInstance
4444
}
4545
}
4646
}
47-
public static Dialogs.ExceptionDialog exceptionDialog { get; set; }
48-
public static Dialogs.ConsentDialog consentDialog { get; set; }
49-
public static Dialogs.PropertiesDialog propertiesDialog { get; set; }
50-
public static Dialogs.LayoutDialog layoutDialog { get; set; }
51-
public static Dialogs.AddItemDialog addItemDialog { get; set; }
47+
public static Dialogs.ExceptionDialog ExceptionDialogDisplay { get; set; }
48+
public static Dialogs.ConsentDialog ConsentDialogDisplay { get; set; }
49+
public static Dialogs.PropertiesDialog PropertiesDialogDisplay { get; set; }
50+
public static Dialogs.LayoutDialog LayoutDialogDisplay { get; set; }
51+
public static Dialogs.AddItemDialog AddItemDialogDisplay { get; set; }
5252
public static ObservableCollection<INavigationControlItem> sideBarItems = new ObservableCollection<INavigationControlItem>();
5353
public static ObservableCollection<LocationItem> locationItems = new ObservableCollection<LocationItem>();
5454
public static ObservableCollection<WSLDistroItem> linuxDistroItems = new ObservableCollection<WSLDistroItem>();
@@ -68,11 +68,11 @@ public App()
6868

6969
RegisterUncaughtExceptionLogger();
7070

71-
consentDialog = new Dialogs.ConsentDialog();
72-
propertiesDialog = new Dialogs.PropertiesDialog();
73-
layoutDialog = new Dialogs.LayoutDialog();
74-
addItemDialog = new Dialogs.AddItemDialog();
75-
exceptionDialog = new Dialogs.ExceptionDialog();
71+
ConsentDialogDisplay = new Dialogs.ConsentDialog();
72+
PropertiesDialogDisplay = new Dialogs.PropertiesDialog();
73+
LayoutDialogDisplay = new Dialogs.LayoutDialog();
74+
AddItemDialogDisplay = new Dialogs.AddItemDialog();
75+
ExceptionDialogDisplay = new Dialogs.ExceptionDialog();
7676
// this.UnhandledException += App_UnhandledException;
7777
Clipboard.ContentChanged += Clipboard_ContentChanged;
7878
Clipboard_ContentChanged(null, null);
@@ -129,54 +129,27 @@ public static void Clipboard_ContentChanged(object sender, object e)
129129
DataPackageView packageView = Clipboard.GetContent();
130130
if (packageView.Contains(StandardDataFormats.StorageItems) && App.CurrentInstance.CurrentPageType != typeof(YourHome))
131131
{
132-
App.PS.isEnabled = true;
132+
App.PS.IsEnabled = true;
133133
}
134134
else
135135
{
136-
App.PS.isEnabled = false;
136+
App.PS.IsEnabled = false;
137137
}
138138
}
139139
else
140140
{
141-
App.PS.isEnabled = false;
141+
App.PS.IsEnabled = false;
142142
}
143143
}
144144
catch (Exception)
145145
{
146-
App.PS.isEnabled = false;
146+
App.PS.IsEnabled = false;
147147
}
148148

149149
}
150150

151-
public static Windows.UI.Xaml.UnhandledExceptionEventArgs exceptionInfo { get; set; }
152-
public static string exceptionStackTrace { get; set; }
153-
154-
private async void App_UnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
155-
{
156-
e.Handled = true;
157-
exceptionInfo = e;
158-
exceptionStackTrace = e.Exception.StackTrace;
159-
await exceptionDialog.ShowAsync(ContentDialogPlacement.Popup);
160-
}
161-
162-
public static IReadOnlyList<ContentDialog> FindDisplayedContentDialogs<T>()
163-
{
164-
var popupElements = VisualTreeHelper.GetOpenPopupsForXamlRoot(Window.Current.Content.XamlRoot);
165-
List<ContentDialog> dialogs = new List<ContentDialog>();
166-
List<ContentDialog> openDialogs = new List<ContentDialog>();
167-
Interaction.FindChildren<ContentDialog>(dialogs, Window.Current.Content.XamlRoot.Content as DependencyObject);
168-
foreach (var dialog in dialogs)
169-
{
170-
var popups = new List<Popup>();
171-
Interaction.FindChildren<Popup>(popups, dialog);
172-
if (popups.First().IsOpen && popups.First() is T)
173-
{
174-
openDialogs.Add(dialog);
175-
}
176-
}
177-
return openDialogs;
178-
}
179-
151+
public static Windows.UI.Xaml.UnhandledExceptionEventArgs ExceptionInfo { get; set; }
152+
public static string ExceptionStackTrace { get; set; }
180153
public static PasteState PS { get; set; } = new PasteState();
181154
public static List<string> pathsToDeleteAfterPaste = new List<string>();
182155

@@ -194,8 +167,8 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
194167
{
195168
var dialog = new ContentDialog()
196169
{
197-
Title = "What's new in v0.7.4",
198-
Content = "• Fixed a crash when opening the preferences page in settings.",
170+
Title = "What's new in v0.7.5",
171+
Content = "• Fixed a crash that would sometimes occur when right clicking on a file or folder.\n• Fixed an issue where the status bar wouldn't hide on the new tab page.\n• Fixed an issue where clicking on the quick access item for home wouldn't navigate to the home page.\n• Fixed a bug that prevented users from right clicking on the navigation bar.",
199172
PrimaryButtonText = "Lets go!"
200173
};
201174

@@ -206,11 +179,10 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
206179

207180
bool canEnablePrelaunch = Windows.Foundation.Metadata.ApiInformation.IsMethodPresent("Windows.ApplicationModel.Core.CoreApplication", "EnablePrelaunch");
208181

209-
Frame rootFrame = Window.Current.Content as Frame;
210182

211183
// Do not repeat app initialization when the Window already has content,
212184
// just ensure that the window is active
213-
if (rootFrame == null)
185+
if (!(Window.Current.Content is Frame rootFrame))
214186
{
215187
// Create a Frame to act as the navigation context and navigate to the first page
216188
rootFrame = new Frame();
@@ -255,8 +227,7 @@ protected override void OnActivated(IActivatedEventArgs args)
255227
Logger.Info("App activated");
256228

257229
// Window management
258-
Frame rootFrame = Window.Current.Content as Frame;
259-
if (rootFrame == null)
230+
if (!(Window.Current.Content is Frame rootFrame))
260231
{
261232
rootFrame = new Frame();
262233
Window.Current.Content = rootFrame;

Files/Assets/FilesDrive.png

-1.93 MB
Binary file not shown.

Files/Assets/FilesHome.png

-628 KB
Loading

Files/BaseLayout.cs

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Files.Filesystem;
22
using Files.Interacts;
3+
using Files.View_Models;
34
using Files.Views.Pages;
45
using System;
56
using System.Collections.Generic;
@@ -50,7 +51,14 @@ public List<ListedItem> SelectedItems
5051
{
5152
get
5253
{
53-
return _SelectedItems;
54+
if(_SelectedItems == null)
55+
{
56+
return new List<ListedItem>();
57+
}
58+
else
59+
{
60+
return _SelectedItems;
61+
}
5462
}
5563
internal set
5664
{
@@ -116,15 +124,15 @@ private void AppSettings_LayoutModeChangeRequested(object sender, EventArgs e)
116124
if (App.CurrentInstance.ContentPage != null)
117125
{
118126
App.CurrentInstance.ViewModel.CancelLoadAndClearFiles();
119-
App.CurrentInstance.ViewModel.isLoadingItems = true;
120-
App.CurrentInstance.ViewModel.isLoadingItems = false;
127+
App.CurrentInstance.ViewModel.IsLoadingItems = true;
128+
App.CurrentInstance.ViewModel.IsLoadingItems = false;
121129
if (App.AppSettings.LayoutMode == 0)
122130
{
123-
App.CurrentInstance.ContentFrame.Navigate(typeof(GenericFileBrowser), App.CurrentInstance.ViewModel.Universal.WorkingDirectory, null);
131+
App.CurrentInstance.ContentFrame.Navigate(typeof(GenericFileBrowser), App.CurrentInstance.ViewModel.WorkingDirectory, null);
124132
}
125133
else
126134
{
127-
App.CurrentInstance.ContentFrame.Navigate(typeof(PhotoAlbum), App.CurrentInstance.ViewModel.Universal.WorkingDirectory, null);
135+
App.CurrentInstance.ContentFrame.Navigate(typeof(PhotoAlbum), App.CurrentInstance.ViewModel.WorkingDirectory, null);
128136
}
129137
}
130138

@@ -135,7 +143,7 @@ private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
135143
{
136144
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
137145
}
138-
private bool isStale = false;
146+
139147
protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
140148
{
141149
base.OnNavigatedTo(eventArgs);
@@ -151,10 +159,10 @@ protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
151159
}
152160
App.CurrentInstance.NavigationToolbar.CanRefresh = true;
153161
IsItemSelected = false;
154-
AssociatedViewModel.EmptyTextState.isVisible = Visibility.Collapsed;
155-
App.CurrentInstance.ViewModel.Universal.WorkingDirectory = parameters;
162+
AssociatedViewModel.EmptyTextState.IsVisible = Visibility.Collapsed;
163+
App.CurrentInstance.ViewModel.WorkingDirectory = parameters;
156164

157-
if (App.CurrentInstance.ViewModel.Universal.WorkingDirectory == Path.GetPathRoot(App.CurrentInstance.ViewModel.Universal.WorkingDirectory))
165+
if (App.CurrentInstance.ViewModel.WorkingDirectory == Path.GetPathRoot(App.CurrentInstance.ViewModel.WorkingDirectory))
158166
{
159167
App.CurrentInstance.NavigationToolbar.CanNavigateToParent = false;
160168
}
@@ -163,7 +171,7 @@ protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
163171
App.CurrentInstance.NavigationToolbar.CanNavigateToParent = true;
164172
}
165173

166-
App.CurrentInstance.ViewModel.AddItemsToCollectionAsync(App.CurrentInstance.ViewModel.Universal.WorkingDirectory);
174+
App.CurrentInstance.ViewModel.AddItemsToCollectionAsync(App.CurrentInstance.ViewModel.WorkingDirectory);
167175
App.Clipboard_ContentChanged(null, null);
168176

169177
App.CurrentInstance.NavigationToolbar.PathControlDisplayText = parameters;
@@ -191,7 +199,7 @@ public void RightClickContextMenu_Opening(object sender, object e)
191199
var selectedFileSystemItems = (App.CurrentInstance.ContentPage as BaseLayout).SelectedItems;
192200

193201
// Find selected items that are not folders
194-
if (selectedFileSystemItems.Cast<ListedItem>().Any(x => x.FileType != "Folder"))
202+
if (selectedFileSystemItems.Cast<ListedItem>().Any(x => x.PrimaryItemAttribute != StorageItemTypes.Folder))
195203
{
196204
UnloadMenuFlyoutItemByName("SidebarPinItem");
197205
UnloadMenuFlyoutItemByName("OpenInNewTab");
@@ -201,12 +209,12 @@ public void RightClickContextMenu_Opening(object sender, object e)
201209
{
202210
var selectedDataItem = selectedFileSystemItems[0] as ListedItem;
203211

204-
if (selectedDataItem.DotFileExtension.Equals(".zip", StringComparison.OrdinalIgnoreCase))
212+
if (selectedDataItem.FileExtension.Equals(".zip", StringComparison.OrdinalIgnoreCase))
205213
{
206214
UnloadMenuFlyoutItemByName("OpenItem");
207215
this.FindName("UnzipItem");
208216
}
209-
else if (!selectedDataItem.DotFileExtension.Equals(".zip", StringComparison.OrdinalIgnoreCase))
217+
else if (!selectedDataItem.FileExtension.Equals(".zip", StringComparison.OrdinalIgnoreCase))
210218
{
211219
this.FindName("OpenItem");
212220
UnloadMenuFlyoutItemByName("UnzipItem");

Files/Dialogs/AddItemDialog.xaml.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ public AddItemDialog()
2323
public void AddItemsToList()
2424
{
2525
AddItemsList.Clear();
26-
AddItemsList.Add(new AddListItem { Header = "Folder", SubHeader = "Creates an empty folder", Icon = "\xE838", isEnabled = true });
27-
AddItemsList.Add(new AddListItem { Header = "Text Document", SubHeader = "Creates a simple text file", Icon = "\xE8A5", isEnabled = true });
28-
AddItemsList.Add(new AddListItem { Header = "Bitmap Image", SubHeader = "Creates an empty bitmap image file", Icon = "\xEB9F", isEnabled = true });
26+
AddItemsList.Add(new AddListItem { Header = "Folder", SubHeader = "Creates an empty folder", Icon = "\xE838", IsItemEnabled = true });
27+
AddItemsList.Add(new AddListItem { Header = "Text Document", SubHeader = "Creates a simple text file", Icon = "\xE8A5", IsItemEnabled = true });
28+
AddItemsList.Add(new AddListItem { Header = "Bitmap Image", SubHeader = "Creates an empty bitmap image file", Icon = "\xEB9F", IsItemEnabled = true });
2929

3030
}
3131

3232
private void ListView_ItemClick(object sender, ItemClickEventArgs e)
3333
{
34-
App.addItemDialog.Hide();
34+
App.AddItemDialogDisplay.Hide();
3535
switch((e.ClickedItem as AddListItem).Header)
3636
{
3737
case "Folder":
@@ -52,7 +52,7 @@ public static async void CreateFile(AddItemType fileType)
5252
string currentPath = null;
5353
if (TabInstance.ContentPage != null)
5454
{
55-
currentPath = TabInstance.ViewModel.Universal.WorkingDirectory;
55+
currentPath = TabInstance.ViewModel.WorkingDirectory;
5656
}
5757
StorageFolder folderToCreateItem = await StorageFolder.GetFolderFromPathAsync(currentPath);
5858
RenameDialog renameDialog = new RenameDialog();
@@ -71,7 +71,7 @@ public static async void CreateFile(AddItemType fileType)
7171
{
7272
folder = await folderToCreateItem.CreateFolderAsync("New Folder", CreationCollisionOption.GenerateUniqueName);
7373
}
74-
TabInstance.ViewModel.AddFileOrFolder(new ListedItem(folder.FolderRelativeId) { FileName = folder.DisplayName, FileDateReal = DateTimeOffset.Now, EmptyImgVis = Visibility.Collapsed, FolderImg = Visibility.Visible, FileIconVis = Visibility.Collapsed, FileType = "Folder", FileImg = null, FilePath = folder.Path });
74+
TabInstance.ViewModel.AddFileOrFolder(new ListedItem(folder.FolderRelativeId) { ItemName = folder.DisplayName, ItemDateModifiedReal = DateTimeOffset.Now, LoadUnknownTypeGlyph = false, LoadFolderGlyph = true, LoadFileIcon = false, ItemType = "Folder", FileImage = null, ItemPath = folder.Path });
7575
}
7676
else if (fileType == AddItemType.TextDocument)
7777
{
@@ -84,7 +84,7 @@ public static async void CreateFile(AddItemType fileType)
8484
{
8585
item = await folderToCreateItem.CreateFileAsync("New Text Document" + ".txt", CreationCollisionOption.GenerateUniqueName);
8686
}
87-
TabInstance.ViewModel.AddFileOrFolder(new ListedItem(item.FolderRelativeId) { FileName = item.DisplayName, FileDateReal = DateTimeOffset.Now, EmptyImgVis = Visibility.Visible, FolderImg = Visibility.Collapsed, FileIconVis = Visibility.Collapsed, FileType = item.DisplayType, FileImg = null, FilePath = item.Path, DotFileExtension = item.FileType });
87+
TabInstance.ViewModel.AddFileOrFolder(new ListedItem(item.FolderRelativeId) { ItemName = item.DisplayName, ItemDateModifiedReal = DateTimeOffset.Now, LoadUnknownTypeGlyph = true, LoadFolderGlyph = false, LoadFileIcon = false, ItemType = item.DisplayType, FileImage = null, ItemPath = item.Path, FileExtension = item.FileType });
8888
}
8989
else if (fileType == AddItemType.BitmapImage)
9090
{
@@ -97,7 +97,7 @@ public static async void CreateFile(AddItemType fileType)
9797
{
9898
item = await folderToCreateItem.CreateFileAsync("New Bitmap Image" + ".bmp", CreationCollisionOption.GenerateUniqueName);
9999
}
100-
TabInstance.ViewModel.AddFileOrFolder(new ListedItem(item.FolderRelativeId) { FileName = item.DisplayName, FileDateReal = DateTimeOffset.Now, EmptyImgVis = Visibility.Visible, FolderImg = Visibility.Collapsed, FileIconVis = Visibility.Collapsed, FileType = item.DisplayType, FileImg = null, FilePath = item.Path, DotFileExtension = item.FileType });
100+
TabInstance.ViewModel.AddFileOrFolder(new ListedItem(item.FolderRelativeId) { ItemName = item.DisplayName, ItemDateModifiedReal = DateTimeOffset.Now, LoadUnknownTypeGlyph = true, LoadFolderGlyph = false, LoadFileIcon = false, ItemType = item.DisplayType, FileImage = null, ItemPath = item.Path, FileExtension = item.FileType });
101101
}
102102
}
103103
}
@@ -115,6 +115,6 @@ public class AddListItem
115115
public string Header { get; set; }
116116
public string SubHeader { get; set; }
117117
public string Icon { get; set; }
118-
public bool isEnabled { get; set; }
118+
public bool IsItemEnabled { get; set; }
119119
}
120120
}

Files/Dialogs/ConfirmDeleteDialog.xaml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,25 @@
1313
mc:Ignorable="d">
1414

1515
<Grid>
16-
<TextBlock
17-
x:Uid="ConfirmDeleteDialogHeader"
18-
Text="Are you sure you want to delete the selected item(s)?"
19-
TextWrapping="WrapWholeWords" />
16+
<Grid.RowDefinitions>
17+
<RowDefinition />
18+
<RowDefinition />
19+
</Grid.RowDefinitions>
20+
<StackPanel Grid.Row="0" Spacing="10">
21+
<TextBlock
22+
x:Uid="ConfirmDeleteDialogHeader"
23+
Text="Are you sure you want to delete the selected item(s)?"
24+
TextWrapping="WrapWholeWords" />
2025

21-
<CheckBox
22-
x:Name="chkPermanentlyDelete"
23-
x:Uid="ConfirmDeleteDialogPermanentlyDeleteCheckBox"
24-
Content="Permanently delete"
25-
IsChecked="{x:Bind local1:App.InteractionViewModel.PermanentlyDelete, Mode=TwoWay}" />
26+
<CheckBox
27+
x:Name="chkPermanentlyDelete"
28+
x:Uid="ConfirmDeleteDialogPermanentlyDeleteCheckBox"
29+
Content="Permanently delete"
30+
IsChecked="{x:Bind local1:App.InteractionViewModel.PermanentlyDelete, Mode=TwoWay}" />
31+
</StackPanel>
2632

2733
<StackPanel
34+
Grid.Row="1"
2835
HorizontalAlignment="Right"
2936
VerticalAlignment="Bottom"
3037
Orientation="Horizontal"
@@ -37,11 +44,12 @@
3744
Content="Cancel" />
3845

3946
<Button
40-
x:Name="btnDelete" TabIndex="0"
47+
x:Name="btnDelete"
4148
x:Uid="ConfirmDeleteDialogDeleteButton"
4249
Background="{ThemeResource SystemAccentColor}"
4350
Click="btnDelete_Click"
44-
Content="Delete" />
51+
Content="Delete"
52+
TabIndex="0" />
4553

4654
</StackPanel>
4755

0 commit comments

Comments
 (0)