Added thumbnail to uploadinfoparser

This commit is contained in:
Jaex 2014-04-25 11:29:47 +03:00
parent 5bb526f0d1
commit 96974186d2
7 changed files with 34 additions and 34 deletions

View file

@ -123,12 +123,6 @@
</Compile>
<Compile Include="DebugTimer.cs" />
<Compile Include="Extensions\ObjectExtensions.cs" />
<Compile Include="Forms\ClipboardFormatForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\ClipboardFormatForm.Designer.cs">
<DependentUpon>ClipboardFormatForm.cs</DependentUpon>
</Compile>
<Compile Include="Forms\HashCheckForm.cs">
<SubType>Form</SubType>
</Compile>
@ -316,9 +310,6 @@
<EmbeddedResource Include="Forms\ClipboardContentViewer.resx">
<DependentUpon>ClipboardContentViewer.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\ClipboardFormatForm.resx">
<DependentUpon>ClipboardFormatForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\ErrorForm.resx">
<DependentUpon>ErrorForm.cs</DependentUpon>
</EmbeddedResource>

View file

@ -293,7 +293,7 @@ private void InitializeComponent()
this.tpPaths.Location = new System.Drawing.Point(4, 22);
this.tpPaths.Name = "tpPaths";
this.tpPaths.Padding = new System.Windows.Forms.Padding(3);
this.tpPaths.Size = new System.Drawing.Size(610, 369);
this.tpPaths.Size = new System.Drawing.Size(610, 370);
this.tpPaths.TabIndex = 1;
this.tpPaths.Text = "Paths";
this.tpPaths.UseVisualStyleBackColor = true;
@ -436,7 +436,7 @@ private void InitializeComponent()
this.tpProxy.Location = new System.Drawing.Point(4, 22);
this.tpProxy.Name = "tpProxy";
this.tpProxy.Padding = new System.Windows.Forms.Padding(5);
this.tpProxy.Size = new System.Drawing.Size(610, 369);
this.tpProxy.Size = new System.Drawing.Size(610, 370);
this.tpProxy.TabIndex = 2;
this.tpProxy.Text = "Proxy";
this.tpProxy.UseVisualStyleBackColor = true;
@ -570,7 +570,7 @@ private void InitializeComponent()
this.tpUpload.Location = new System.Drawing.Point(4, 22);
this.tpUpload.Name = "tpUpload";
this.tpUpload.Padding = new System.Windows.Forms.Padding(3);
this.tpUpload.Size = new System.Drawing.Size(610, 369);
this.tpUpload.Size = new System.Drawing.Size(610, 370);
this.tpUpload.TabIndex = 3;
this.tpUpload.Text = "Upload";
this.tpUpload.UseVisualStyleBackColor = true;
@ -584,7 +584,7 @@ private void InitializeComponent()
this.tcUpload.Location = new System.Drawing.Point(3, 3);
this.tcUpload.Name = "tcUpload";
this.tcUpload.SelectedIndex = 0;
this.tcUpload.Size = new System.Drawing.Size(604, 363);
this.tcUpload.Size = new System.Drawing.Size(604, 364);
this.tcUpload.TabIndex = 3;
//
// tpPerformance
@ -593,7 +593,7 @@ private void InitializeComponent()
this.tpPerformance.Location = new System.Drawing.Point(4, 22);
this.tpPerformance.Name = "tpPerformance";
this.tpPerformance.Padding = new System.Windows.Forms.Padding(3);
this.tpPerformance.Size = new System.Drawing.Size(596, 337);
this.tpPerformance.Size = new System.Drawing.Size(596, 338);
this.tpPerformance.TabIndex = 0;
this.tpPerformance.Text = "Performance";
this.tpPerformance.UseVisualStyleBackColor = true;
@ -674,7 +674,7 @@ private void InitializeComponent()
this.tpUploadResults.Location = new System.Drawing.Point(4, 22);
this.tpUploadResults.Name = "tpUploadResults";
this.tpUploadResults.Padding = new System.Windows.Forms.Padding(3);
this.tpUploadResults.Size = new System.Drawing.Size(596, 337);
this.tpUploadResults.Size = new System.Drawing.Size(596, 338);
this.tpUploadResults.TabIndex = 1;
this.tpUploadResults.Text = "Results";
this.tpUploadResults.UseVisualStyleBackColor = true;
@ -687,7 +687,7 @@ private void InitializeComponent()
this.gbClipboardFormats.Controls.Add(this.lvClipboardFormats);
this.gbClipboardFormats.Location = new System.Drawing.Point(8, 8);
this.gbClipboardFormats.Name = "gbClipboardFormats";
this.gbClipboardFormats.Size = new System.Drawing.Size(576, 168);
this.gbClipboardFormats.Size = new System.Drawing.Size(576, 320);
this.gbClipboardFormats.TabIndex = 2;
this.gbClipboardFormats.TabStop = false;
this.gbClipboardFormats.Text = "Clipboard Formats";
@ -724,13 +724,14 @@ private void InitializeComponent()
//
// lvClipboardFormats
//
this.lvClipboardFormats.AutoFillColumn = true;
this.lvClipboardFormats.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.chDescription,
this.chFormat});
this.lvClipboardFormats.FullRowSelect = true;
this.lvClipboardFormats.Location = new System.Drawing.Point(8, 48);
this.lvClipboardFormats.Name = "lvClipboardFormats";
this.lvClipboardFormats.Size = new System.Drawing.Size(552, 104);
this.lvClipboardFormats.Size = new System.Drawing.Size(560, 264);
this.lvClipboardFormats.TabIndex = 3;
this.lvClipboardFormats.UseCompatibleStateImageBehavior = false;
this.lvClipboardFormats.View = System.Windows.Forms.View.Details;
@ -913,7 +914,7 @@ private void InitializeComponent()
this.tpPrint.Location = new System.Drawing.Point(4, 22);
this.tpPrint.Name = "tpPrint";
this.tpPrint.Padding = new System.Windows.Forms.Padding(3);
this.tpPrint.Size = new System.Drawing.Size(610, 369);
this.tpPrint.Size = new System.Drawing.Size(610, 370);
this.tpPrint.TabIndex = 4;
this.tpPrint.Text = "Print";
this.tpPrint.UseVisualStyleBackColor = true;
@ -945,7 +946,7 @@ private void InitializeComponent()
this.tpProfiles.Location = new System.Drawing.Point(4, 22);
this.tpProfiles.Name = "tpProfiles";
this.tpProfiles.Padding = new System.Windows.Forms.Padding(3);
this.tpProfiles.Size = new System.Drawing.Size(610, 369);
this.tpProfiles.Size = new System.Drawing.Size(610, 370);
this.tpProfiles.TabIndex = 6;
this.tpProfiles.Text = "Profiles";
this.tpProfiles.UseVisualStyleBackColor = true;
@ -957,7 +958,7 @@ private void InitializeComponent()
this.tcProfiles.Location = new System.Drawing.Point(3, 3);
this.tcProfiles.Name = "tcProfiles";
this.tcProfiles.SelectedIndex = 0;
this.tcProfiles.Size = new System.Drawing.Size(604, 363);
this.tcProfiles.Size = new System.Drawing.Size(604, 364);
this.tcProfiles.TabIndex = 0;
//
// tpEncodersCLI
@ -970,7 +971,7 @@ private void InitializeComponent()
this.tpEncodersCLI.Location = new System.Drawing.Point(4, 22);
this.tpEncodersCLI.Name = "tpEncodersCLI";
this.tpEncodersCLI.Padding = new System.Windows.Forms.Padding(3);
this.tpEncodersCLI.Size = new System.Drawing.Size(596, 337);
this.tpEncodersCLI.Size = new System.Drawing.Size(596, 338);
this.tpEncodersCLI.TabIndex = 0;
this.tpEncodersCLI.Text = "CLI Encoders";
this.tpEncodersCLI.UseVisualStyleBackColor = true;
@ -999,7 +1000,7 @@ private void InitializeComponent()
this.lvEncoders.Location = new System.Drawing.Point(8, 40);
this.lvEncoders.MultiSelect = false;
this.lvEncoders.Name = "lvEncoders";
this.lvEncoders.Size = new System.Drawing.Size(576, 288);
this.lvEncoders.Size = new System.Drawing.Size(576, 289);
this.lvEncoders.TabIndex = 4;
this.lvEncoders.UseCompatibleStateImageBehavior = false;
this.lvEncoders.View = System.Windows.Forms.View.Details;

View file

@ -1,4 +1,4 @@
namespace HelpersLib
namespace ShareX
{
partial class ClipboardFormatForm
{
@ -39,7 +39,7 @@ private void InitializeComponent()
//
// txtFormat
//
this.txtFormat.Location = new System.Drawing.Point(88, 36);
this.txtFormat.Location = new System.Drawing.Point(88, 40);
this.txtFormat.Name = "txtFormat";
this.txtFormat.Size = new System.Drawing.Size(304, 20);
this.txtFormat.TabIndex = 3;
@ -73,13 +73,12 @@ private void InitializeComponent()
//
this.lblExample.Location = new System.Drawing.Point(88, 60);
this.lblExample.Name = "lblExample";
this.lblExample.Size = new System.Drawing.Size(302, 52);
this.lblExample.Size = new System.Drawing.Size(302, 68);
this.lblExample.TabIndex = 4;
//
// btnCancel
//
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnCancel.Location = new System.Drawing.Point(316, 120);
this.btnCancel.Location = new System.Drawing.Point(312, 136);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(80, 23);
this.btnCancel.TabIndex = 6;
@ -89,8 +88,7 @@ private void InitializeComponent()
//
// btnOK
//
this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnOK.Location = new System.Drawing.Point(228, 120);
this.btnOK.Location = new System.Drawing.Point(224, 136);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(80, 23);
this.btnOK.TabIndex = 5;
@ -102,7 +100,7 @@ private void InitializeComponent()
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(404, 153);
this.ClientSize = new System.Drawing.Size(400, 168);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.Controls.Add(this.lblExample);
@ -113,7 +111,6 @@ private void InitializeComponent()
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(420, 192);
this.Name = "ClipboardFormatForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Clipboard content format";

View file

@ -23,10 +23,11 @@ You should have received a copy of the GNU General Public License
#endregion License Information (GPL v3)
using HelpersLib;
using System;
using System.Windows.Forms;
namespace HelpersLib
namespace ShareX
{
public partial class ClipboardFormatForm : Form
{
@ -45,7 +46,7 @@ public ClipboardFormatForm(ClipboardFormat cbf)
txtDescription.Text = cbf.Description ?? "";
txtFormat.Text = cbf.Format ?? "";
cmsFormatPattern = NameParser.CreateCodesMenu(txtFormat);
lblExample.Text = "Supported variables: $result, $url, $shorturl, $thumbnailurl, $deletionurl, $filepath, $filename, $filenamenoext, $folderpath, $foldername, $uploadtime and other variables such as %y-%mo-%d etc.";
lblExample.Text = "Supported variables: $result, $url, $shorturl, $thumbnailurl, $deletionurl, $filepath, $filename, $filenamenoext, $thumbnailfilename, $thumbnailfilenamenoext, $folderpath, $foldername, $uploadtime and other variables such as %y-%mo-%d etc.";
}
private void btnOK_Click(object sender, EventArgs e)

View file

@ -94,6 +94,12 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Forms\ClipboardFormatForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\ClipboardFormatForm.Designer.cs">
<DependentUpon>ClipboardFormatForm.cs</DependentUpon>
</Compile>
<Compile Include="Forms\EncoderProgramForm.cs">
<SubType>Form</SubType>
</Compile>
@ -244,6 +250,9 @@
<EmbeddedResource Include="Forms\AutoCaptureForm.resx">
<DependentUpon>AutoCaptureForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\ClipboardFormatForm.resx">
<DependentUpon>ClipboardFormatForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\EncoderProgramForm.resx">
<DependentUpon>EncoderProgramForm.cs</DependentUpon>
</EmbeddedResource>

View file

@ -63,10 +63,11 @@ public string Parse(TaskInfo info, string pattern)
pattern = pattern.Replace("$filenamenoext", !string.IsNullOrEmpty(info.FileName) ? Path.GetFileNameWithoutExtension(info.FileName) : "");
pattern = pattern.Replace("$filename", info.FileName ?? "");
pattern = pattern.Replace("$filepath", info.FilePath ?? "");
pattern = pattern.Replace("$folderpath", !string.IsNullOrEmpty(info.FilePath) ? Path.GetDirectoryName(info.FilePath) : "");
pattern = pattern.Replace("$foldername", !string.IsNullOrEmpty(info.FilePath) ? Path.GetFileName(Path.GetDirectoryName(info.FilePath)) : "");
pattern = pattern.Replace("$thumbnailfilenamenoext", !string.IsNullOrEmpty(info.ThumbnailFilePath) ? Path.GetFileNameWithoutExtension(info.ThumbnailFilePath) : "");
pattern = pattern.Replace("$thumbnailfilename", !string.IsNullOrEmpty(info.ThumbnailFilePath) ? Path.GetFileName(info.ThumbnailFilePath) : "");
pattern = pattern.Replace("$uploadtime", ((int)info.UploadDuration.TotalMilliseconds).ToString());
}