-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from dardizzola/svil-010107
Pre release 1.9.25
- Loading branch information
Showing
81 changed files
with
1,820 additions
and
1,789 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
138 changes: 69 additions & 69 deletions
138
YoutubePlaylistDownloader/About.xaml.cs → LaMuccaRossaVideoDownloader/About.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,69 @@ | ||
namespace LaMuccaRossaVideoDownloader; | ||
|
||
/// <summary> | ||
/// Interaction logic for About.xaml | ||
/// </summary> | ||
public partial class About : UserControl | ||
{ | ||
public About() | ||
{ | ||
InitializeComponent(); | ||
GlobalConsts.HideAboutButton(); | ||
GlobalConsts.ShowHomeButton(); | ||
GlobalConsts.ShowSettingsButton(); | ||
GlobalConsts.ShowHelpButton(); | ||
|
||
AboutRun.Text += GlobalConsts.VERSION; | ||
} | ||
|
||
private async void UpdateButton_Click(object sender, RoutedEventArgs e) | ||
{ | ||
try | ||
{ | ||
using var client = new HttpClient(); | ||
client.DefaultRequestHeaders.CacheControl = new CacheControlHeaderValue() { NoCache = true }; | ||
|
||
string gitHubUrl = String.Format("https://raw.githubusercontent.com/{0}/{1}/{2}/{3}/", | ||
GlobalConsts.APPLICATION_GITHUB_USERNAME, | ||
GlobalConsts.APPLICATION_REPOSITORY_NAME, | ||
GlobalConsts.APPLICATION_REPOSITORY_BRANCH, | ||
GlobalConsts.APPLICATION_REPOSITORY_FOLDER | ||
); | ||
|
||
var response = await client.GetStringAsync(gitHubUrl + "latestVersionWithRevision.txt"); | ||
var latestVersion = Version.Parse(response); | ||
|
||
if (latestVersion > GlobalConsts.VERSION) | ||
{ | ||
var changelog = await client.GetStringAsync(gitHubUrl + "changelog.txt"); | ||
var dialogSettings = new MetroDialogSettings() | ||
{ | ||
AffirmativeButtonText = $"{FindResource("UpdateNow")}", | ||
NegativeButtonText = $"{FindResource("No")}", | ||
FirstAuxiliaryButtonText = $"{FindResource("UpdateWhenIExit")}", | ||
ColorScheme = MetroDialogColorScheme.Theme, | ||
DefaultButtonFocus = MessageDialogResult.Affirmative, | ||
}; | ||
var update = await GlobalConsts.Current.ShowMessageAsync($"{FindResource("NewVersionAvailable")}", $"{FindResource("DoYouWantToUpdate")}\n{changelog}", | ||
MessageDialogStyle.AffirmativeAndNegativeAndSingleAuxiliary, dialogSettings); | ||
if (update == MessageDialogResult.Affirmative) | ||
{ | ||
GlobalConsts.LoadPage(new DownloadUpdate(latestVersion, changelog)); | ||
} | ||
else if (update == MessageDialogResult.FirstAuxiliary) | ||
{ | ||
GlobalConsts.UpdateControl = new DownloadUpdate(latestVersion, changelog, true).UpdateLaterStillDownloading(); | ||
} | ||
} | ||
else | ||
{ | ||
await GlobalConsts.ShowMessage($"{FindResource("NoUpdates")}", $"{FindResource("NoUpdatesAvailable")}"); | ||
} | ||
} | ||
catch (Exception ex) | ||
{ | ||
await GlobalConsts.Log(ex.ToString(), "About UpdateButton_Click"); | ||
await GlobalConsts.ShowMessage($"{FindResource("Error")}", $"{FindResource("CannotUpdate")} {ex.Message}"); | ||
} | ||
} | ||
} | ||
namespace LaMuccaRossaVideoDownloader; | ||
|
||
/// <summary> | ||
/// Interaction logic for About.xaml | ||
/// </summary> | ||
public partial class About : UserControl | ||
{ | ||
public About() | ||
{ | ||
InitializeComponent(); | ||
GlobalConsts.HideAboutButton(); | ||
GlobalConsts.ShowHomeButton(); | ||
GlobalConsts.ShowSettingsButton(); | ||
GlobalConsts.ShowHelpButton(); | ||
|
||
AboutRun.Text += GlobalConsts.VERSION; | ||
} | ||
|
||
private async void UpdateButton_Click(object sender, RoutedEventArgs e) | ||
{ | ||
try | ||
{ | ||
using var client = new HttpClient(); | ||
client.DefaultRequestHeaders.CacheControl = new CacheControlHeaderValue() { NoCache = true }; | ||
|
||
string gitHubUrl = String.Format("https://raw.githubusercontent.com/{0}/{1}/{2}/{3}/", | ||
GlobalConsts.APPLICATION_GITHUB_USERNAME, | ||
GlobalConsts.APPLICATION_REPOSITORY_NAME, | ||
GlobalConsts.APPLICATION_REPOSITORY_BRANCH, | ||
GlobalConsts.APPLICATION_REPOSITORY_FOLDER | ||
); | ||
|
||
var response = await client.GetStringAsync(gitHubUrl + "latestVersionWithRevision.txt"); | ||
var latestVersion = Version.Parse(response); | ||
|
||
if (latestVersion > GlobalConsts.VERSION) | ||
{ | ||
var changelog = await client.GetStringAsync(gitHubUrl + "changelog.txt"); | ||
var dialogSettings = new MetroDialogSettings() | ||
{ | ||
AffirmativeButtonText = $"{FindResource("UpdateNow")}", | ||
NegativeButtonText = $"{FindResource("No")}", | ||
FirstAuxiliaryButtonText = $"{FindResource("UpdateWhenIExit")}", | ||
ColorScheme = MetroDialogColorScheme.Theme, | ||
DefaultButtonFocus = MessageDialogResult.Affirmative, | ||
}; | ||
var update = await GlobalConsts.Current.ShowMessageAsync($"{FindResource("NewVersionAvailable")}", $"{FindResource("DoYouWantToUpdate")}\n{changelog}", | ||
MessageDialogStyle.AffirmativeAndNegativeAndSingleAuxiliary, dialogSettings); | ||
if (update == MessageDialogResult.Affirmative) | ||
{ | ||
GlobalConsts.LoadPage(new DownloadUpdate(latestVersion, changelog)); | ||
} | ||
else if (update == MessageDialogResult.FirstAuxiliary) | ||
{ | ||
GlobalConsts.UpdateControl = new DownloadUpdate(latestVersion, changelog, true).UpdateLaterStillDownloading(); | ||
} | ||
} | ||
else | ||
{ | ||
await GlobalConsts.ShowMessage($"{FindResource("NoUpdates")}", $"{FindResource("NoUpdatesAvailable")}"); | ||
} | ||
} | ||
catch (Exception ex) | ||
{ | ||
await GlobalConsts.Log(ex.ToString(), "About UpdateButton_Click"); | ||
await GlobalConsts.ShowMessage($"{FindResource("Error")}", $"{FindResource("CannotUpdate")} {ex.Message}"); | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 45 additions & 45 deletions
90
YoutubePlaylistDownloader/App.xaml.cs → LaMuccaRossaVideoDownloader/App.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
namespace LaMuccaRossaVideoDownloader; | ||
|
||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
|
||
public App() | ||
{ | ||
DispatcherUnhandledException += App_DispatcherUnhandledException; | ||
} | ||
|
||
protected override void OnStartup(StartupEventArgs e) | ||
{ | ||
base.OnStartup(e); | ||
GlobalConsts.LoadConsts(); | ||
GlobalConsts.CreateTempFolder(); | ||
} | ||
|
||
protected override void OnExit(ExitEventArgs e) | ||
{ | ||
GlobalConsts.SaveConsts(); | ||
if (GlobalConsts.UpdateOnExit && !string.IsNullOrWhiteSpace(GlobalConsts.UpdateSetupLocation) && GlobalConsts.UpdateFinishedDownloading) | ||
{ | ||
Process.Start(GlobalConsts.UpdateSetupLocation); | ||
} | ||
else | ||
{ | ||
GlobalConsts.CleanTempFolder(); | ||
} | ||
base.OnExit(e); | ||
} | ||
|
||
async void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) | ||
{ | ||
await GlobalConsts.ShowMessage((string)FindResource("Error"), (string)FindResource("ErrorMessage")); | ||
await GlobalConsts.Log($"{e.Exception}", "Unhandled exception"); | ||
|
||
// Don't crash at the moment of truth >.< | ||
#if !DEBUG | ||
e.Handled = true; | ||
#endif | ||
} | ||
} | ||
namespace LaMuccaRossaVideoDownloader; | ||
|
||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
|
||
public App() | ||
{ | ||
DispatcherUnhandledException += App_DispatcherUnhandledException; | ||
} | ||
|
||
protected override void OnStartup(StartupEventArgs e) | ||
{ | ||
base.OnStartup(e); | ||
GlobalConsts.LoadConsts(); | ||
GlobalConsts.CreateTempFolder(); | ||
} | ||
|
||
protected override void OnExit(ExitEventArgs e) | ||
{ | ||
GlobalConsts.SaveConsts(); | ||
if (GlobalConsts.UpdateOnExit && !string.IsNullOrWhiteSpace(GlobalConsts.UpdateSetupLocation) && GlobalConsts.UpdateFinishedDownloading) | ||
{ | ||
Process.Start(GlobalConsts.UpdateSetupLocation); | ||
} | ||
else | ||
{ | ||
GlobalConsts.CleanTempFolder(); | ||
} | ||
base.OnExit(e); | ||
} | ||
|
||
async void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) | ||
{ | ||
await GlobalConsts.ShowMessage((string)FindResource("Error"), (string)FindResource("ErrorMessage")); | ||
await GlobalConsts.Log($"{e.Exception}", "Unhandled exception"); | ||
|
||
// Don't crash at the moment of truth >.< | ||
#if !DEBUG | ||
e.Handled = true; | ||
#endif | ||
} | ||
} |
5 changes: 4 additions & 1 deletion
5
...aylistDownloader/ChangelogAllVersions.txt → ...aVideoDownloader/ChangelogAllVersions.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.