Skip to content

Commit

Permalink
Link in about box, {SameFolder}, drag&drop,
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekmotyl committed Dec 19, 2019
1 parent 9a4cbe5 commit b6752b0
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 14 deletions.
14 changes: 14 additions & 0 deletions src/SimpleVideoCutter/AboutBox.Designer.cs

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

5 changes: 5 additions & 0 deletions src/SimpleVideoCutter/AboutBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,10 @@ public string AssemblyCompany
}
}
#endregion

private void linkLabelGithub_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start(linkLabelGithub.Text);
}
}
}
3 changes: 2 additions & 1 deletion src/SimpleVideoCutter/FormSettings.Designer.cs

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

3 changes: 0 additions & 3 deletions src/SimpleVideoCutter/FormSettings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@
<metadata name="folderBrowserDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>186, 17</value>
</metadata>
<data name="textBoxOutputFilePattern.ToolTip" xml:space="preserve">
<value>Pattern that defines how filenames of created files will be computed.
Static parts are allowed as well as these pseudo-variable
Expand Down
13 changes: 8 additions & 5 deletions src/SimpleVideoCutter/MainForm.Designer.cs

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

34 changes: 34 additions & 0 deletions src/SimpleVideoCutter/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ private void OpenFile()
private string ReplaceStandardDirectoryPatterns(string str)
{
return str
.Replace("{SameFolder}", fileBeingPlayed)
.Replace("{UserVideos}", Environment.GetFolderPath(Environment.SpecialFolder.MyVideos))
.Replace("{UserDocuments}", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments))
.Replace("{MyComputer}", Environment.GetFolderPath(Environment.SpecialFolder.MyComputer));
Expand Down Expand Up @@ -806,5 +807,38 @@ private void toolStripTimeline_ItemClicked(object sender, ToolStripItemClickedEv
videoCutterTimeline1.GoToCurrentPosition();
}
}

private string GetPathOfSingleDraggedFile(IDataObject data)
{
if (!data.GetDataPresent(DataFormats.FileDrop))
return null;

string[] files = (string[])data.GetData(DataFormats.FileDrop);

if (files.Length != 1)
return null;

var file = files[0];
var ext = System.IO.Path.GetExtension(file);
if (VideoCutterSettings.Instance.VideoFilesExtensions.Contains(ext.ToLower()))
return file;

return null;
}

private void MainForm_DragOver(object sender, DragEventArgs e)
{
if (GetPathOfSingleDraggedFile(e.Data)!=null)
e.Effect = DragDropEffects.Copy;
}

private void MainForm_DragDrop(object sender, DragEventArgs e)
{
var file = GetPathOfSingleDraggedFile(e.Data);
if (file != null)
{
OpenFile(file);
}
}
}
}
6 changes: 3 additions & 3 deletions src/SimpleVideoCutter/MainForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@
<metadata name="toolStripTimeline.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1027, 17</value>
</metadata>
<metadata name="toolStripPlayback.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>881, 17</value>
</metadata>
<metadata name="toolStripFile.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>764, 17</value>
</metadata>
Expand Down Expand Up @@ -164,9 +167,6 @@
RU5ErkJggg==
</value>
</data>
<metadata name="toolStripPlayback.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>881, 17</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAQEAAAAEAIAAoQgAAFgAAACgAAABAAAAAgAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Expand Down
4 changes: 2 additions & 2 deletions src/SimpleVideoCutter/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.10.0.0")]
[assembly: AssemblyFileVersion("0.10.0.0")]
[assembly: AssemblyVersion("0.11.0.0")]
[assembly: AssemblyFileVersion("0.11.0.0")]

0 comments on commit b6752b0

Please sign in to comment.