mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
fixed #256: Name parser %yy for 2 digits year
This commit is contained in:
parent
5aa266b12a
commit
79f631a15c
5 changed files with 19 additions and 9 deletions
|
@ -35,13 +35,20 @@ namespace HelpersLib
|
|||
{
|
||||
public class ReplCodeMenuEntry : CodeMenuEntry
|
||||
{
|
||||
public ReplCodeMenuEntry(string value, string description) : base(value, description) { }
|
||||
public ReplCodeMenuEntry(string value, string description)
|
||||
: base(value, description)
|
||||
{
|
||||
}
|
||||
|
||||
public override String ToPrefixString() { return '%' + _value; }
|
||||
public override String ToPrefixString()
|
||||
{
|
||||
return '%' + _value;
|
||||
}
|
||||
|
||||
public static readonly ReplCodeMenuEntry t = new ReplCodeMenuEntry("t", "Title of active window");
|
||||
public static readonly ReplCodeMenuEntry pn = new ReplCodeMenuEntry("pn", "Process name of active window");
|
||||
public static readonly ReplCodeMenuEntry y = new ReplCodeMenuEntry("y", "Current year");
|
||||
public static readonly ReplCodeMenuEntry yy = new ReplCodeMenuEntry("yy", "Current year (2 digits)");
|
||||
public static readonly ReplCodeMenuEntry mo = new ReplCodeMenuEntry("mo", "Current month");
|
||||
public static readonly ReplCodeMenuEntry mon = new ReplCodeMenuEntry("mon", "Current month name (Local language)");
|
||||
public static readonly ReplCodeMenuEntry mon2 = new ReplCodeMenuEntry("mon2", "Current month name (English)");
|
||||
|
@ -137,6 +144,7 @@ public string Parse(string pattern)
|
|||
|
||||
sb.Replace(ReplCodeMenuEntry.mon2.ToPrefixString(), CultureInfo.InvariantCulture.DateTimeFormat.GetMonthName(dt.Month))
|
||||
.Replace(ReplCodeMenuEntry.mon.ToPrefixString(), CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(dt.Month))
|
||||
.Replace(ReplCodeMenuEntry.yy.ToPrefixString(), dt.ToString("yy"))
|
||||
.Replace(ReplCodeMenuEntry.y.ToPrefixString(), dt.Year.ToString())
|
||||
.Replace(ReplCodeMenuEntry.mo.ToPrefixString(), Helpers.AddZeroes(dt.Month))
|
||||
.Replace(ReplCodeMenuEntry.d.ToPrefixString(), Helpers.AddZeroes(dt.Day));
|
||||
|
|
4
ShareX/Forms/MainForm.Designer.cs
generated
4
ShareX/Forms/MainForm.Designer.cs
generated
|
@ -892,18 +892,20 @@ private void InitializeComponent()
|
|||
this.pbLogo.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.pbLogo.BackColor = System.Drawing.Color.White;
|
||||
this.pbLogo.Location = new System.Drawing.Point(0, 0);
|
||||
this.pbLogo.Name = "pbLogo";
|
||||
this.pbLogo.Size = new System.Drawing.Size(320, 280);
|
||||
this.pbLogo.TabIndex = 2;
|
||||
this.pbLogo.TabStop = false;
|
||||
this.pbLogo.MouseUp += new System.Windows.Forms.MouseEventHandler(this.lblDragAndDropTip_MouseUp);
|
||||
//
|
||||
// lblDragAndDropTip
|
||||
//
|
||||
this.lblDragAndDropTip.BackColor = System.Drawing.Color.White;
|
||||
this.lblDragAndDropTip.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.lblDragAndDropTip.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
|
||||
this.lblDragAndDropTip.ForeColor = System.Drawing.Color.Gainsboro;
|
||||
this.lblDragAndDropTip.ForeColor = System.Drawing.Color.DimGray;
|
||||
this.lblDragAndDropTip.Location = new System.Drawing.Point(0, 280);
|
||||
this.lblDragAndDropTip.Name = "lblDragAndDropTip";
|
||||
this.lblDragAndDropTip.Padding = new System.Windows.Forms.Padding(10, 0, 10, 0);
|
||||
|
|
|
@ -135,7 +135,7 @@ private void InitControls()
|
|||
il.Images.Add(Resources.navigation_000_button);
|
||||
lvUploads.SmallImageList = il;
|
||||
|
||||
pbLogo.LoadImage(ColorMatrixManager.Alpha(0.3f, 0f).Apply(ShareXResources.Logo));
|
||||
pbLogo.LoadImage(ShareXResources.Logo);
|
||||
|
||||
TaskManager.ListViewControl = lvUploads;
|
||||
uim = new UploadInfoManager(lvUploads);
|
||||
|
@ -975,7 +975,7 @@ private void lblDragAndDropTip_MouseUp(object sender, MouseEventArgs e)
|
|||
if (e.Button == MouseButtons.Right)
|
||||
{
|
||||
UpdateControls();
|
||||
cmsTaskInfo.Show(lblDragAndDropTip, e.X + 1, e.Y + 1);
|
||||
cmsTaskInfo.Show((Control)sender, e.X + 1, e.Y + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -810,9 +810,9 @@ public UploadResult UploadFile(Stream stream, string fileName)
|
|||
ShareURLType = Program.UploadersConfig.DropboxURLType
|
||||
};
|
||||
break;
|
||||
case FileDestination.OneDrive:
|
||||
/*case FileDestination.OneDrive:
|
||||
fileUploader = new OneDrive(Program.UploadersConfig.OneDriveOAuth2Info);
|
||||
break;
|
||||
break;*/
|
||||
case FileDestination.Copy:
|
||||
fileUploader = new Copy(Program.UploadersConfig.CopyOAuthInfo, Program.UploadersConfig.CopyAccountInfo)
|
||||
{
|
||||
|
|
|
@ -80,8 +80,8 @@ public enum FileDestination
|
|||
Dropbox,
|
||||
[Description("FTP")]
|
||||
FTP,
|
||||
[Description("OneDrive")]
|
||||
OneDrive,
|
||||
//[Description("OneDrive")]
|
||||
//OneDrive,
|
||||
[Description("Copy")]
|
||||
Copy,
|
||||
[Description("Google Drive")]
|
||||
|
|
Loading…
Reference in a new issue