Skip to content

Commit

Permalink
調整UI使之不跑版
Browse files Browse the repository at this point in the history
  • Loading branch information
jim60105 committed Feb 22, 2022
1 parent 307dd79 commit 6f22fcf
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 108 deletions.
1 change: 1 addition & 0 deletions ExternalProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ where File.Exists(path)
Log.Information("Found ffmpeg.exe at {FFmpegPath}", FFmpegPath);

#if false
#warning Disable this "Force download again" debug section!
Log.Debug("Force download again!");
YtdlpPath = FFmpegPath = null;
Ytdlp_Status = FFmpeg_Status = DependencyStatus.NotExist;
Expand Down
127 changes: 47 additions & 80 deletions Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 2 additions & 23 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ public Form1()

private void Form1_Shown(object? sender, EventArgs e)
{
// https://stackoverflow.com/a/31690719
// "However, be aware that adding new links to the Links collection will automatically set the TabStop property to true again."
linkLabel5.TabStop = false;

textBox_outputDirectory.Text = Settings.Default.Directory;
checkBox_logVerbose.Checked = Settings.Default.LogVerbose;
checkBox_logVerbose_CheckedChanged(new(), new());
Expand Down Expand Up @@ -237,19 +233,15 @@ private void checkBox_logVerbose_CheckedChanged(object sender, EventArgs e)
Settings.Default.Save();
}

#region Link
private static void VisitLink(LinkLabel linkLabel, string url)
private void richTextBox_LinkClicked(object sender, LinkClickedEventArgs e)
{
try
{
// Change the color of the link text by setting LinkVisited
// to true.
linkLabel.LinkVisited = true;
//Call the Process.Start method to open the default browser
//with a URL:
Process process = new();
process.StartInfo.UseShellExecute = true;
process.StartInfo.FileName = url;
process.StartInfo.FileName = e.LinkText;
process.Start();
}
catch (Exception)
Expand All @@ -258,19 +250,6 @@ private static void VisitLink(LinkLabel linkLabel, string url)
}
}

private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
=> VisitLink(linkLabel1, "https://github.com/GyanD/codexffmpeg/releases/tag/5.0");

private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
=> VisitLink(linkLabel2, "https://github.com/FFmpeg/FFmpeg/commit/390d6853d0");

private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
=> VisitLink(linkLabel3, "https://github.com/yt-dlp/yt-dlp/releases/latest");

private void linkLabel5_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
=> VisitLink(linkLabel5, "https://github.com/jim60105/YoutubeSegmentDownloader");
#endregion

private void button_folder_Click(object sender, EventArgs e)
{
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
Expand Down
Loading

0 comments on commit 6f22fcf

Please sign in to comment.