Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
688bed9
Merge pull request #1 from files-community/master
jaigak Jul 27, 2020
d7eb104
Merge pull request #6 from files-community/master
jaigak Aug 6, 2020
26e0034
Show a notification when an thrown exception is not handles
jaigak Aug 6, 2020
2beeb66
Some changes
jaigak Aug 6, 2020
21c4896
Don't change on suspend
jaigak Aug 6, 2020
9897804
Use the stable version
jaigak Aug 6, 2020
0166371
Added buttons for actions
jaigak Aug 7, 2020
d7dc6ed
Merge branch 'exception' of https://github.com/JUV-Studios/files-uwp …
jaigak Aug 7, 2020
5e38481
Fix tag issue
jaigak Aug 7, 2020
8ffb677
Some changes
jaigak Aug 7, 2020
1a2ba99
Disable error notifications for now
jaigak Aug 7, 2020
fe95649
Fixed issues, added localisation/localization.
jaigak Aug 7, 2020
8d32f54
Remove log location button
jaigak Aug 8, 2020
fde7613
Try to save and restore tabs
jaigak Aug 8, 2020
6c09714
Some fixed
jaigak Aug 8, 2020
db070b2
Remove tab saving feature
jaigak Aug 17, 2020
c334afe
Fixes
jaigak Aug 17, 2020
3905f10
Restore package manifest
jaigak Aug 17, 2020
c8e209a
Merge branch 'master' into exception
jaigak Aug 17, 2020
052d19f
Fix translation
jaigak Aug 17, 2020
fa1d2d1
Add Windows.System to AboutPage.xaml.cs
jaigak Aug 17, 2020
99b4730
Translate version in about page
jaigak Aug 17, 2020
d4c4435
Modify issue templates
jaigak Aug 17, 2020
22b4cea
Update bug_report.md
jaigak Aug 17, 2020
c09ca60
Update critical-high-priority-bug-report.md
jaigak Aug 17, 2020
feec9a1
Update App.xaml.cs
jaigak Aug 19, 2020
21cd442
Merge branch 'master' into exception
jaigak Aug 19, 2020
099d43a
Remove restore tab notification
jaigak Aug 20, 2020
3c3c1ce
Update Files/Views/MainPage.xaml.cs
jaigak Aug 21, 2020
22bca12
Update Files/Views/MainPage.xaml.cs
jaigak Aug 21, 2020
13503a8
Update .github/ISSUE_TEMPLATE/bug_report.md
jaigak Aug 22, 2020
096e9e3
Update .github/ISSUE_TEMPLATE/critical-high-priority-bug-report.md
jaigak Aug 23, 2020
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
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here. Does this problem occur again after restarting the app?

**Log file**
Please post the log file here so that we can understand your problem better. You can access it from Settings->About->Open log location.
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/critical-high-priority-bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here. For instance, are you building from source or using a precompiled build/snapshot?

**Log file**
Please post the log file here so that we can understand your problem better. You can access it from Settings->About->Open log location.
2 changes: 1 addition & 1 deletion Files.Package/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@
<uap:Capability Name="removableStorage" />
<Capability Name="internetClient"/>
</Capabilities>
</Package>
</Package>
65 changes: 57 additions & 8 deletions Files/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,19 @@
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media.Animation;
using Windows.UI.Xaml.Navigation;
using System.Threading.Tasks;
using Microsoft.Toolkit.Uwp.Notifications;
using Windows.UI.Notifications;
using System.Linq;
using Newtonsoft.Json;
using Files.Common;

namespace Files
{
sealed partial class App : Application
{
private static IShellPage currentInstance;
private static bool ShowErrorNotification = false;

public static IShellPage CurrentInstance
{
Expand All @@ -47,7 +54,6 @@ public static IShellPage CurrentInstance
}
}
}

public static SettingsViewModel AppSettings { get; set; }
public static InteractionViewModel InteractionViewModel { get; set; }
public static JumpListManager JumpList { get; } = new JumpListManager();
Expand Down Expand Up @@ -241,6 +247,7 @@ private void CoreWindow_Activated(CoreWindow sender, WindowActivatedEventArgs ar
if (args.WindowActivationState == CoreWindowActivationState.CodeActivated ||
args.WindowActivationState == CoreWindowActivationState.PointerActivated)
{
ShowErrorNotification = true;
ApplicationData.Current.LocalSettings.Values["INSTANCE_ACTIVE"] = Process.GetCurrentProcess().Id;
}
}
Expand Down Expand Up @@ -403,16 +410,58 @@ private void OnSuspending(object sender, SuspendingEventArgs e)
}

// Occurs when an exception is not handled on the UI thread.
private static void OnUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
{
Logger.Error(e.Exception, e.Message);
}
private static void OnUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e) => AppUnhandledException(e.Exception);

// Occurs when an exception is not handled on a background thread.
// ie. A task is fired and forgotten Task.Run(() => {...})
private static void OnUnobservedException(object sender, UnobservedTaskExceptionEventArgs e)
private static void OnUnobservedException(object sender, UnobservedTaskExceptionEventArgs e) => AppUnhandledException(e.Exception);

private static void AppUnhandledException(Exception ex)
{
Logger.Error(e.Exception, e.Exception.Message);
Logger.Error(ex, ex.Message);
if (ShowErrorNotification)
{
var toastContent = new ToastContent()
{
Visual = new ToastVisual()
{
BindingGeneric = new ToastBindingGeneric()
{
Children =
{
new AdaptiveText()
{
Text = ResourceController.GetTranslation("ExceptionNotificationHeader")
},
new AdaptiveText()
{
Text = ResourceController.GetTranslation("ExceptionNotificationBody")
}
},
AppLogoOverride = new ToastGenericAppLogo()
{
Source = "ms-appx:///Assets/error.png"
}
}
},
Actions = new ToastActionsCustom()
{
Buttons =
{
new ToastButton(ResourceController.GetTranslation("ExceptionNotificationReportButton"), "report")
{
ActivationType = ToastActivationType.Foreground
}
}
}
};

// Create the toast notification
var toastNotif = new ToastNotification(toastContent.GetXml());

// And send the notification
ToastNotificationManager.CreateToastNotifier().Show(toastNotif);
}
}

public static async void CloseApp()
Expand All @@ -429,4 +478,4 @@ public class WSLDistroItem : INavigationControlItem
public NavigationControlItemType ItemType => NavigationControlItemType.LinuxDistro;
public Uri Logo { get; set; }
}
}
}
Binary file added Files/Assets/error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions Files/Files.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="Assets\error.png" />
<Content Include="Assets\Files UWP Beta Icon.png" />
<Content Include="Assets\Files UWP Icon.png" />
<Content Include="Assets\FilesHome.png" />
Expand Down Expand Up @@ -600,6 +601,9 @@
<PackageReference Include="Microsoft.Toolkit.Uwp.DeveloperTools">
<Version>6.1.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications">
<Version>6.1.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.Toolkit.Uwp.UI">
<Version>6.1.1</Version>
</PackageReference>
Expand Down
29 changes: 18 additions & 11 deletions Files/Filesystem/DriveItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,27 @@ public DriveItem(StorageFolder root, DriveType type)
return await root.Properties.RetrievePropertiesAsync(new[] { "System.FreeSpace", "System.Capacity" });
}).Result;

try
if (properties.ContainsKey("System.Capacity") && properties.ContainsKey("System.FreeSpace"))
{
MaxSpace = ByteSize.FromBytes((ulong)properties["System.Capacity"]);
FreeSpace = ByteSize.FromBytes((ulong)properties["System.FreeSpace"]);

SpaceUsed = MaxSpace - FreeSpace;
SpaceText = string.Format(
ResourceController.GetTranslation("DriveFreeSpaceAndCapacity"),
FreeSpace.ToBinaryString().ConvertSizeAbbreviation(),
MaxSpace.ToBinaryString().ConvertSizeAbbreviation());
try
{
MaxSpace = ByteSize.FromBytes((ulong)properties["System.Capacity"]);
FreeSpace = ByteSize.FromBytes((ulong)properties["System.FreeSpace"]);

SpaceUsed = MaxSpace - FreeSpace;
SpaceText = string.Format(
ResourceController.GetTranslation("DriveFreeSpaceAndCapacity"),
FreeSpace.ToBinaryString().ConvertSizeAbbreviation(),
MaxSpace.ToBinaryString().ConvertSizeAbbreviation());
}
catch (NullReferenceException)
{
SpaceText = ResourceController.GetTranslation("DriveCapacityUnknown");
}
}
catch (NullReferenceException)
else
{
SpaceText = "Unknown";
SpaceText = ResourceController.GetTranslation("DriveCapacityUnknown");
}
}

Expand Down
24 changes: 24 additions & 0 deletions Files/MultilingualResources/Files.de-DE.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1111,6 +1111,26 @@
<source>Show a horizontal tab strip on the title bar</source>
<target state="new">Show a horizontal tab strip on the title bar</target>
</trans-unit>
<trans-unit id="DriveCapacityUnknown" translate="yes" xml:space="preserve">
<source>Unknown</source>
<target state="new">Unknown</target>
</trans-unit>
<trans-unit id="ExceptionNotificationAccessLogFileButton" translate="yes" xml:space="preserve">
<source>Open log location</source>
<target state="new">Open log location</target>
</trans-unit>
<trans-unit id="ExceptionNotificationBody" translate="yes" xml:space="preserve">
<source>Files ran into a problem that the developers didn't prepare for yet.</source>
<target state="new">Files ran into a problem that the developers didn't prepare for yet.</target>
</trans-unit>
<trans-unit id="ExceptionNotificationHeader" translate="yes" xml:space="preserve">
<source>Something went wrong!</source>
<target state="new">Something went wrong!</target>
</trans-unit>
<trans-unit id="ExceptionNotificationReportButton" translate="yes" xml:space="preserve">
<source>Report this issue</source>
<target state="new">Report this issue</target>
</trans-unit>
<trans-unit id="SettingsAboutContributors.Text" translate="yes" xml:space="preserve">
<source>Contributors</source>
<target state="new">Contributors</target>
Expand Down Expand Up @@ -1139,6 +1159,10 @@
<source>Invalid item</source>
<target state="new">Invalid item</target>
</trans-unit>
<trans-unit id="SettingsAboutVersionTitle" translate="yes" xml:space="preserve">
<source>Version:</source>
<target state="new">Version:</target>
</trans-unit>
<trans-unit id="ShareDialogFailMessage" translate="yes" xml:space="preserve">
<source>There's nothing to share right now</source>
<target state="new">There's nothing to share right now</target>
Expand Down
24 changes: 24 additions & 0 deletions Files/MultilingualResources/Files.es-ES.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1126,6 +1126,30 @@
<source>Invalid item</source>
<target state="new">Invalid item</target>
</trans-unit>
<trans-unit id="DriveCapacityUnknown" translate="yes" xml:space="preserve">
<source>Unknown</source>
<target state="new">Unknown</target>
</trans-unit>
<trans-unit id="ExceptionNotificationAccessLogFileButton" translate="yes" xml:space="preserve">
<source>Open log location</source>
<target state="new">Open log location</target>
</trans-unit>
<trans-unit id="ExceptionNotificationBody" translate="yes" xml:space="preserve">
<source>Files ran into a problem that the developers didn't prepare for yet.</source>
<target state="new">Files ran into a problem that the developers didn't prepare for yet.</target>
</trans-unit>
<trans-unit id="ExceptionNotificationHeader" translate="yes" xml:space="preserve">
<source>Something went wrong!</source>
<target state="new">Something went wrong!</target>
</trans-unit>
<trans-unit id="ExceptionNotificationReportButton" translate="yes" xml:space="preserve">
<source>Report this issue</source>
<target state="new">Report this issue</target>
</trans-unit>
<trans-unit id="SettingsAboutVersionTitle" translate="yes" xml:space="preserve">
<source>Version:</source>
<target state="new">Version:</target>
</trans-unit>
<trans-unit id="ShareDialogFailMessage" translate="yes" xml:space="preserve">
<source>There's nothing to share right now</source>
<target state="new">There's nothing to share right now</target>
Expand Down
24 changes: 24 additions & 0 deletions Files/MultilingualResources/Files.fr-FR.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,26 @@
<source>Show a horizontal tab strip on the title bar</source>
<target state="new">Show a horizontal tab strip on the title bar</target>
</trans-unit>
<trans-unit id="DriveCapacityUnknown" translate="yes" xml:space="preserve">
<source>Unknown</source>
<target state="new">Unknown</target>
</trans-unit>
<trans-unit id="ExceptionNotificationAccessLogFileButton" translate="yes" xml:space="preserve">
<source>Open log location</source>
<target state="new">Open log location</target>
</trans-unit>
<trans-unit id="ExceptionNotificationBody" translate="yes" xml:space="preserve">
<source>Files ran into a problem that the developers didn't prepare for yet.</source>
<target state="new">Files ran into a problem that the developers didn't prepare for yet.</target>
</trans-unit>
<trans-unit id="ExceptionNotificationHeader" translate="yes" xml:space="preserve">
<source>Something went wrong!</source>
<target state="new">Something went wrong!</target>
</trans-unit>
<trans-unit id="ExceptionNotificationReportButton" translate="yes" xml:space="preserve">
<source>Report this issue</source>
<target state="new">Report this issue</target>
</trans-unit>
<trans-unit id="SettingsAboutContributors.Text" translate="yes" xml:space="preserve">
<source>Contributors</source>
<target state="new">Contributors</target>
Expand Down Expand Up @@ -1132,6 +1152,10 @@
<source>Invalid item</source>
<target state="new">Invalid item</target>
</trans-unit>
<trans-unit id="SettingsAboutVersionTitle" translate="yes" xml:space="preserve">
<source>Version:</source>
<target state="new">Version:</target>
</trans-unit>
<trans-unit id="ShareDialogFailMessage" translate="yes" xml:space="preserve">
<source>There's nothing to share right now</source>
<target state="new">There's nothing to share right now</target>
Expand Down
24 changes: 24 additions & 0 deletions Files/MultilingualResources/Files.he-IL.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,26 @@
<source>Show a horizontal tab strip on the title bar</source>
<target state="new">Show a horizontal tab strip on the title bar</target>
</trans-unit>
<trans-unit id="DriveCapacityUnknown" translate="yes" xml:space="preserve">
<source>Unknown</source>
<target state="new">Unknown</target>
</trans-unit>
<trans-unit id="ExceptionNotificationAccessLogFileButton" translate="yes" xml:space="preserve">
<source>Open log location</source>
<target state="new">Open log location</target>
</trans-unit>
<trans-unit id="ExceptionNotificationBody" translate="yes" xml:space="preserve">
<source>Files ran into a problem that the developers didn't prepare for yet.</source>
<target state="new">Files ran into a problem that the developers didn't prepare for yet.</target>
</trans-unit>
<trans-unit id="ExceptionNotificationHeader" translate="yes" xml:space="preserve">
<source>Something went wrong!</source>
<target state="new">Something went wrong!</target>
</trans-unit>
<trans-unit id="ExceptionNotificationReportButton" translate="yes" xml:space="preserve">
<source>Report this issue</source>
<target state="new">Report this issue</target>
</trans-unit>
<trans-unit id="SettingsAboutContributors.Text" translate="yes" xml:space="preserve">
<source>Contributors</source>
<target state="needs-review-translation" state-qualifier="tm-suggestion">‏‏תורמים</target>
Expand Down Expand Up @@ -1128,6 +1148,10 @@
<source>Invalid item</source>
<target state="new">Invalid item</target>
</trans-unit>
<trans-unit id="SettingsAboutVersionTitle" translate="yes" xml:space="preserve">
<source>Version:</source>
<target state="new">Version:</target>
</trans-unit>
<trans-unit id="ShareDialogFailMessage" translate="yes" xml:space="preserve">
<source>There's nothing to share right now</source>
<target state="new">There's nothing to share right now</target>
Expand Down
24 changes: 24 additions & 0 deletions Files/MultilingualResources/Files.hi-IN.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,26 @@
<source>Show a horizontal tab strip on the title bar</source>
<target state="new">Show a horizontal tab strip on the title bar</target>
</trans-unit>
<trans-unit id="DriveCapacityUnknown" translate="yes" xml:space="preserve">
<source>Unknown</source>
<target state="new">Unknown</target>
</trans-unit>
<trans-unit id="ExceptionNotificationAccessLogFileButton" translate="yes" xml:space="preserve">
<source>Open log location</source>
<target state="new">Open log location</target>
</trans-unit>
<trans-unit id="ExceptionNotificationBody" translate="yes" xml:space="preserve">
<source>Files ran into a problem that the developers didn't prepare for yet.</source>
<target state="new">Files ran into a problem that the developers didn't prepare for yet.</target>
</trans-unit>
<trans-unit id="ExceptionNotificationHeader" translate="yes" xml:space="preserve">
<source>Something went wrong!</source>
<target state="new">Something went wrong!</target>
</trans-unit>
<trans-unit id="ExceptionNotificationReportButton" translate="yes" xml:space="preserve">
<source>Report this issue</source>
<target state="new">Report this issue</target>
</trans-unit>
<trans-unit id="SettingsAboutContributors.Text" translate="yes" xml:space="preserve">
<source>Contributors</source>
<target state="new">Contributors</target>
Expand Down Expand Up @@ -1129,6 +1149,10 @@
<source>Invalid item</source>
<target state="new">Invalid item</target>
</trans-unit>
<trans-unit id="SettingsAboutVersionTitle" translate="yes" xml:space="preserve">
<source>Version:</source>
<target state="new">Version:</target>
</trans-unit>
<trans-unit id="ShareDialogFailMessage" translate="yes" xml:space="preserve">
<source>There's nothing to share right now</source>
<target state="new">There's nothing to share right now</target>
Expand Down
24 changes: 24 additions & 0 deletions Files/MultilingualResources/Files.it-IT.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,30 @@
<source>Invalid item</source>
<target state="translated">Elemento non valido</target>
</trans-unit>
<trans-unit id="DriveCapacityUnknown" translate="yes" xml:space="preserve">
<source>Unknown</source>
<target state="new">Unknown</target>
</trans-unit>
<trans-unit id="ExceptionNotificationAccessLogFileButton" translate="yes" xml:space="preserve">
<source>Open log location</source>
<target state="new">Open log location</target>
</trans-unit>
<trans-unit id="ExceptionNotificationBody" translate="yes" xml:space="preserve">
<source>Files ran into a problem that the developers didn't prepare for yet.</source>
<target state="new">Files ran into a problem that the developers didn't prepare for yet.</target>
</trans-unit>
<trans-unit id="ExceptionNotificationHeader" translate="yes" xml:space="preserve">
<source>Something went wrong!</source>
<target state="new">Something went wrong!</target>
</trans-unit>
<trans-unit id="ExceptionNotificationReportButton" translate="yes" xml:space="preserve">
<source>Report this issue</source>
<target state="new">Report this issue</target>
</trans-unit>
<trans-unit id="SettingsAboutVersionTitle" translate="yes" xml:space="preserve">
<source>Version:</source>
<target state="new">Version:</target>
</trans-unit>
<trans-unit id="ShareDialogFailMessage" translate="yes" xml:space="preserve">
<source>There's nothing to share right now</source>
<target state="new">There's nothing to share right now</target>
Expand Down
Loading