Skip to content

Commit

Permalink
v1.62
Browse files Browse the repository at this point in the history
More bug fixes
  • Loading branch information
murrty1 authored Feb 5, 2018
1 parent 07788f3 commit 003f6b1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
8 changes: 7 additions & 1 deletion Forms/frmAbout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace youtube_dl_gui {
public partial class frmAbout : Form {
Thread checkUpdates;

public frmAbout() {
InitializeComponent();
Expand All @@ -22,15 +23,20 @@ private void frmAbout_Shown(object sender, EventArgs e) {
}

private void llbCheckForUpdates_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) {
Thread checkUpdates = new Thread(() => {
checkUpdates = new Thread(() => {
decimal cV = Updater.getCloudVersion();
if (Updater.isUpdateAvailable(cV)) {
if (MessageBox.Show("An update is available.\nNew verison: " + cV.ToString() + " | Your version: " + Properties.Settings.Default.currentVersion.ToString() + "\n\nWould you like to update?", "youtube-dl-gui", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) {
Updater.createUpdaterStub(cV);
Updater.runUpdater();
}
}
else {
MessageBox.Show("No update is available at this time.");
}
this.Invoke((MethodInvoker)(() => checkUpdates.Abort()));
});
checkUpdates.Start();
}
private void pbIcon_Click(object sender, EventArgs e) {
Process.Start("https://github.com/murrty/youtube-dl-gui/");
Expand Down
9 changes: 6 additions & 3 deletions Forms/frmMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ public partial class frmMain : Form {

#region Variables
bool hasUpdated = false;
//bool networkAvailable = true;
string ytdl = "";

Thread checkUpdates;
#endregion

#region Form
Expand All @@ -35,16 +36,18 @@ private void frmMain_Load(object sender, EventArgs e) {
if (File.Exists(System.Windows.Forms.Application.StartupPath + @"\ydgu.bat"))
hasUpdated = true;

if (!Settings.Default.updateCheck) {
Thread checkUpdates = new Thread(() => {
if (Settings.Default.updateCheck) {
checkUpdates = new Thread(() => {
decimal cV = Updater.getCloudVersion();
if (Updater.isUpdateAvailable(cV)) {
if (MessageBox.Show("An update is available.\nNew verison: " + cV.ToString() + " | Your version: " + Properties.Settings.Default.currentVersion.ToString() + "\n\nWould you like to update?", "youtube-dl-gui", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) {
Updater.createUpdaterStub(cV);
Updater.runUpdater();
}
}
this.Invoke((MethodInvoker)(() => checkUpdates.Abort()));
});
checkUpdates.Start();
}

if (String.IsNullOrWhiteSpace(Settings.Default.DownloadDir)) {
Expand Down

0 comments on commit 003f6b1

Please sign in to comment.