f637c18e22
- Closed captions fixes - Merged to YoutubeExplode instead of MyToolkit for video sources - Video playback fixes - Internal links support - Subscription button fixed - Comments threads fixes and improvements (highlighting author's and user's names) - General bug fixes
53 lines
1.8 KiB
C#
53 lines
1.8 KiB
C#
using FoxTube.Controls;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Runtime.InteropServices.WindowsRuntime;
|
|
using Windows.Foundation;
|
|
using Windows.Foundation.Collections;
|
|
using Windows.Storage;
|
|
using Windows.Storage.Pickers;
|
|
using Windows.System;
|
|
using Windows.UI.Xaml;
|
|
using Windows.UI.Xaml.Controls;
|
|
|
|
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
|
|
#pragma warning disable CS0252 // Possible unintended reference comparison; left hand side needs cast
|
|
|
|
namespace FoxTube.Pages
|
|
{
|
|
/// <summary>
|
|
/// An empty page that can be used on its own or navigated to within a Frame.
|
|
/// </summary>
|
|
public sealed partial class Downloads : Page
|
|
{
|
|
ApplicationDataContainer settings = ApplicationData.Current.LocalSettings;
|
|
public Downloads()
|
|
{
|
|
this.InitializeComponent();
|
|
path.Text = settings.Values["defaultDownload"] as string;
|
|
}
|
|
|
|
private async void changePath_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
FolderPicker picker = new FolderPicker()
|
|
{
|
|
SuggestedStartLocation = PickerLocationId.Downloads,
|
|
ViewMode = PickerViewMode.Thumbnail
|
|
};
|
|
picker.FileTypeFilter.Add(".shit"); //Because overwise it trhows an exception
|
|
|
|
StorageFolder p = await picker.PickSingleFolderAsync();
|
|
if (p != null)
|
|
settings.Values["defaultDownload"] = p.Path;
|
|
path.Text = settings.Values["defaultDownload"] as string;
|
|
}
|
|
|
|
private async void openFolder_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
await Launcher.LaunchFolderAsync( await StorageFolder.GetFolderFromPathAsync(settings.Values["defaultDownload"] as string));
|
|
}
|
|
}
|
|
}
|