From 86389c63a4ea37cca37133f209dd0db164ad6eaa Mon Sep 17 00:00:00 2001 From: Jaex Date: Sat, 20 Feb 2016 15:25:11 +0200 Subject: [PATCH] Using link label that way startup folder can be opened --- ShareX.HelpersLib/Forms/DebugForm.Designer.cs | 27 ++++++ ShareX.HelpersLib/Forms/DebugForm.cs | 5 +- ShareX.HelpersLib/Forms/DebugForm.resx | 94 ++++++++++++++++++- 3 files changed, 120 insertions(+), 6 deletions(-) diff --git a/ShareX.HelpersLib/Forms/DebugForm.Designer.cs b/ShareX.HelpersLib/Forms/DebugForm.Designer.cs index e8ace612f..8e8f0372c 100644 --- a/ShareX.HelpersLib/Forms/DebugForm.Designer.cs +++ b/ShareX.HelpersLib/Forms/DebugForm.Designer.cs @@ -33,6 +33,10 @@ private void InitializeComponent() this.btnCopyAll = new System.Windows.Forms.Button(); this.rtbDebug = new System.Windows.Forms.RichTextBox(); this.btnOpenLogFile = new System.Windows.Forms.Button(); + this.llRunningFrom = new System.Windows.Forms.LinkLabel(); + this.flpRunningFrom = new System.Windows.Forms.FlowLayoutPanel(); + this.lblRunningFrom = new System.Windows.Forms.Label(); + this.flpRunningFrom.SuspendLayout(); this.SuspendLayout(); // // btnLoadedAssemblies @@ -64,15 +68,35 @@ private void InitializeComponent() this.btnOpenLogFile.UseVisualStyleBackColor = true; this.btnOpenLogFile.Click += new System.EventHandler(this.btnOpenLogFile_Click); // + // llRunningFrom + // + resources.ApplyResources(this.llRunningFrom, "llRunningFrom"); + this.llRunningFrom.Name = "llRunningFrom"; + // + // flpRunningFrom + // + resources.ApplyResources(this.flpRunningFrom, "flpRunningFrom"); + this.flpRunningFrom.Controls.Add(this.lblRunningFrom); + this.flpRunningFrom.Controls.Add(this.llRunningFrom); + this.flpRunningFrom.Name = "flpRunningFrom"; + // + // lblRunningFrom + // + resources.ApplyResources(this.lblRunningFrom, "lblRunningFrom"); + this.lblRunningFrom.Name = "lblRunningFrom"; + // // DebugForm // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.flpRunningFrom); this.Controls.Add(this.btnOpenLogFile); this.Controls.Add(this.rtbDebug); this.Controls.Add(this.btnCopyAll); this.Controls.Add(this.btnLoadedAssemblies); this.Name = "DebugForm"; + this.flpRunningFrom.ResumeLayout(false); + this.flpRunningFrom.PerformLayout(); this.ResumeLayout(false); } @@ -83,5 +107,8 @@ private void InitializeComponent() private System.Windows.Forms.Button btnCopyAll; private System.Windows.Forms.RichTextBox rtbDebug; private System.Windows.Forms.Button btnOpenLogFile; + private System.Windows.Forms.LinkLabel llRunningFrom; + private System.Windows.Forms.FlowLayoutPanel flpRunningFrom; + private System.Windows.Forms.Label lblRunningFrom; } } \ No newline at end of file diff --git a/ShareX.HelpersLib/Forms/DebugForm.cs b/ShareX.HelpersLib/Forms/DebugForm.cs index 6612721d4..5f6e12f90 100644 --- a/ShareX.HelpersLib/Forms/DebugForm.cs +++ b/ShareX.HelpersLib/Forms/DebugForm.cs @@ -38,7 +38,6 @@ public partial class DebugForm : BaseForm public DebugForm(Logger logger) { InitializeComponent(); - Text = $"{Application.ExecutablePath} - Debug Log"; Logger = logger; rtbDebug.Text = Logger.ToString(); @@ -46,6 +45,10 @@ public DebugForm(Logger logger) rtbDebug.ScrollToCaret(); rtbDebug.AddContextMenu(); + string startupPath = AppDomain.CurrentDomain.BaseDirectory; + llRunningFrom.Text = startupPath; + llRunningFrom.LinkClicked += (sender, e) => Helpers.OpenFolder(startupPath); + Logger.MessageAdded += logger_MessageAdded; FormClosing += (sender, e) => Logger.MessageAdded -= logger_MessageAdded; } diff --git a/ShareX.HelpersLib/Forms/DebugForm.resx b/ShareX.HelpersLib/Forms/DebugForm.resx index 967a11381..e9fa62e92 100644 --- a/ShareX.HelpersLib/Forms/DebugForm.resx +++ b/ShareX.HelpersLib/Forms/DebugForm.resx @@ -145,7 +145,7 @@ $this - 3 + 4 Bottom, Left @@ -172,7 +172,7 @@ $this - 2 + 3 Top, Bottom, Left, Right @@ -181,7 +181,7 @@ 8, 8 - 744, 496 + 744, 472 0 @@ -202,7 +202,7 @@ $this - 1 + 2 Bottom, Left @@ -232,6 +232,90 @@ $this + 1 + + + True + + + 68, 0 + + + 0, 0, 0, 0 + + + 0, 13 + + + 4 + + + llRunningFrom + + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + flpRunningFrom + + + 1 + + + Bottom, Left, Right + + + True + + + 0, 0 + + + 0, 0, 0, 0 + + + 68, 13 + + + 5 + + + Startup path: + + + lblRunningFrom + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + flpRunningFrom + + + 0 + + + 8, 488 + + + 744, 16 + + + 5 + + + False + + + flpRunningFrom + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + 0 @@ -244,7 +328,7 @@ 760, 541 - 400, 400 + 500, 400 CenterScreen