Skip to content

Commit 4a60063

Browse files
author
Yair Aichenbaum
committed
Merge branch 'v07.1-changes' of https://github.com/duke7553/files-uwp into v07.1-changes
2 parents a53981a + 7a7d70b commit 4a60063

File tree

3 files changed

+12
-40
lines changed

3 files changed

+12
-40
lines changed

Files/App.xaml.cs

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -68,37 +68,9 @@ public App()
6868
AppCenter.Start("682666d1-51d3-4e4a-93d0-d028d43baaa0", typeof(Analytics), typeof(Crashes));
6969

7070
AppSettings = new SettingsViewModel();
71-
SetPropertiesFromLocalSettings();
7271
PopulatePinnedSidebarItems();
7372
DetectWSLDistros();
74-
}
7573

76-
public void CloseOpenPopups()
77-
{
78-
var popups = VisualTreeHelper.GetOpenPopups(Window.Current);
79-
foreach (var popup in popups)
80-
{
81-
if(popup.Child is ContentDialog)
82-
{
83-
(popup.Child as ContentDialog).Hide();
84-
}
85-
}
86-
}
87-
88-
public Popup GetOpenPopupByDialog(ContentDialog dialog)
89-
{
90-
var popups = VisualTreeHelper.GetOpenPopups(Window.Current);
91-
foreach (var popup in popups)
92-
{
93-
if (popup.Child is ContentDialog)
94-
{
95-
if((popup.Child as ContentDialog) == dialog)
96-
{
97-
return popup;
98-
}
99-
}
100-
}
101-
return null;
10274
}
10375

10476
private async void CoreWindow_KeyDown(CoreWindow sender, KeyEventArgs args)
@@ -249,15 +221,6 @@ private async void DetectWSLDistros()
249221
// WSL Not Supported/Enabled
250222
AppSettings.AreLinuxFilesSupported = false;
251223
}
252-
}
253-
254-
private void SetPropertiesFromLocalSettings()
255-
{
256-
257-
258-
259-
260-
261224
}
262225

263226
public static List<string> LinesToRemoveFromFile = new List<string>();

Files/Filesystem/Drives.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace Files.Filesystem
1919
public class DrivesManager
2020
{
2121
public ObservableCollection<DriveItem> Drives { get; } = new ObservableCollection<DriveItem>();
22-
22+
public bool ShowUserConsentOnInit { get; set; } = false;
2323
private DeviceWatcher _deviceWatcher;
2424

2525
public DrivesManager()
@@ -31,8 +31,7 @@ public DrivesManager()
3131
}
3232
catch (AggregateException e)
3333
{
34-
Console.WriteLine(e);
35-
new Dialogs.ConsentDialog().ShowAsync();
34+
ShowUserConsentOnInit = true;
3635
}
3736

3837
_deviceWatcher = DeviceInformation.CreateWatcher(StorageDevice.GetDeviceSelector());

Files/ProHome.xaml.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ public ProHome()
7272
Application.Current.Resources["NavigationViewExpandedPaneBackground"] = Application.Current.Resources["BackgroundAcrylicBrush"];
7373
}
7474

75+
if (App.AppSettings.DrivesManager.ShowUserConsentOnInit)
76+
{
77+
App.AppSettings.DrivesManager.ShowUserConsentOnInit = false;
78+
DisplayFilesystemConsentDialog();
79+
}
80+
}
81+
82+
private async void DisplayFilesystemConsentDialog()
83+
{
84+
await App.consentDialog.ShowAsync(ContentDialogPlacement.Popup);
7585
}
7686

7787
string NavParams = null;

0 commit comments

Comments
 (0)