Skip to content

Commit

Permalink
Nitpicks
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonaza committed Mar 31, 2021
1 parent 2e0afa6 commit ebb8476
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Skedaddler/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,33 +253,35 @@ private bool isValidURI(string uriParam)
&& (uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps);
}

private bool updateBlock = false;

private void openURLDialog()
{
if (!isValidURI(Properties.Settings.Default.ArrivalUpdateURL))
return;

Thread t = new Thread(() => openURLDialogImpl());
Thread t = new Thread(() => openURLDialogImpl(Properties.Settings.Default.ArrivalUpdateURL));
t.Start();
}
private void openURLDialogImpl()
private void openURLDialogImpl(object urlObjectParam)
{
string urlParam = (string)urlObjectParam;

string caption = "Open URL";
string message = "Open following URL in the default browser?\n\n" + Properties.Settings.Default.ArrivalUpdateURL;
string message = "Open the following URL in the default browser?\n\n" + urlParam;
DialogResult result = MessageBox.Show(message, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);

if (result == DialogResult.Yes)
{
var psi = new System.Diagnostics.ProcessStartInfo
{
FileName = Properties.Settings.Default.ArrivalUpdateURL,
FileName = urlParam,
UseShellExecute = true
};
System.Diagnostics.Process.Start(psi);
}
}

private bool updateBlock = false;

public void updateTimeRemaining()
{
// Dirty hack to prevent this method being called again when the code below is doing initValues() call.
Expand Down

0 comments on commit ebb8476

Please sign in to comment.