File tree Expand file tree Collapse file tree 3 files changed +12
-40
lines changed Expand file tree Collapse file tree 3 files changed +12
-40
lines changed Original file line number Diff line number Diff line change @@ -68,37 +68,9 @@ public App()
68
68
AppCenter . Start ( "682666d1-51d3-4e4a-93d0-d028d43baaa0" , typeof ( Analytics ) , typeof ( Crashes ) ) ;
69
69
70
70
AppSettings = new SettingsViewModel ( ) ;
71
- SetPropertiesFromLocalSettings ( ) ;
72
71
PopulatePinnedSidebarItems ( ) ;
73
72
DetectWSLDistros ( ) ;
74
- }
75
73
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 ;
102
74
}
103
75
104
76
private async void CoreWindow_KeyDown ( CoreWindow sender , KeyEventArgs args )
@@ -249,15 +221,6 @@ private async void DetectWSLDistros()
249
221
// WSL Not Supported/Enabled
250
222
AppSettings . AreLinuxFilesSupported = false ;
251
223
}
252
- }
253
-
254
- private void SetPropertiesFromLocalSettings ( )
255
- {
256
-
257
-
258
-
259
-
260
-
261
224
}
262
225
263
226
public static List < string > LinesToRemoveFromFile = new List < string > ( ) ;
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ namespace Files.Filesystem
19
19
public class DrivesManager
20
20
{
21
21
public ObservableCollection < DriveItem > Drives { get ; } = new ObservableCollection < DriveItem > ( ) ;
22
-
22
+ public bool ShowUserConsentOnInit { get ; set ; } = false ;
23
23
private DeviceWatcher _deviceWatcher ;
24
24
25
25
public DrivesManager ( )
@@ -31,8 +31,7 @@ public DrivesManager()
31
31
}
32
32
catch ( AggregateException e )
33
33
{
34
- Console . WriteLine ( e ) ;
35
- new Dialogs . ConsentDialog ( ) . ShowAsync ( ) ;
34
+ ShowUserConsentOnInit = true ;
36
35
}
37
36
38
37
_deviceWatcher = DeviceInformation . CreateWatcher ( StorageDevice . GetDeviceSelector ( ) ) ;
Original file line number Diff line number Diff line change @@ -72,6 +72,16 @@ public ProHome()
72
72
Application . Current . Resources [ "NavigationViewExpandedPaneBackground" ] = Application . Current . Resources [ "BackgroundAcrylicBrush" ] ;
73
73
}
74
74
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 ) ;
75
85
}
76
86
77
87
string NavParams = null ;
You can’t perform that action at this time.
0 commit comments