mirror of
https://github.com/ShareX/ShareX.git
synced 2024-06-23 08:40:39 +12:00
Fix hotkey description problem
This commit is contained in:
parent
c6dfd947eb
commit
3f8dae05c6
|
@ -211,7 +211,7 @@ private void UpdateMainFormTip()
|
|||
|
||||
foreach (HotkeySettings hotkey in Program.HotkeysConfig.Hotkeys.Where(x => x.HotkeyInfo.IsValidHotkey))
|
||||
{
|
||||
sb.AppendFormat("{0} | {1}\r\n", hotkey.HotkeyInfo, hotkey.TaskSettings.Description);
|
||||
sb.AppendFormat("{0} | {1}\r\n", hotkey.HotkeyInfo, hotkey.TaskSettings);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -220,7 +220,7 @@ private void UpdateMainFormTip()
|
|||
|
||||
private ToolStripMenuItem WorkflowMenuItem(HotkeySettings hotkeySetting)
|
||||
{
|
||||
ToolStripMenuItem tsmi = new ToolStripMenuItem(hotkeySetting.TaskSettings.Description.Replace("&", "&&"));
|
||||
ToolStripMenuItem tsmi = new ToolStripMenuItem(hotkeySetting.TaskSettings.ToString().Replace("&", "&&"));
|
||||
if (hotkeySetting.HotkeyInfo.IsValidHotkey)
|
||||
{
|
||||
tsmi.ShortcutKeyDisplayString = " " + hotkeySetting.HotkeyInfo;
|
||||
|
@ -711,7 +711,7 @@ private bool CheckCLIWorkflow(CLICommand command)
|
|||
{
|
||||
if (hotkeySetting.TaskSettings.Job != HotkeyType.None)
|
||||
{
|
||||
if (command.Parameter == hotkeySetting.TaskSettings.Description)
|
||||
if (command.Parameter == hotkeySetting.TaskSettings.ToString())
|
||||
{
|
||||
ExecuteJob(hotkeySetting.TaskSettings);
|
||||
return true;
|
||||
|
|
|
@ -61,11 +61,7 @@ public TaskSettingsForm(TaskSettings hotkeySetting, bool isDefault = false)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!TaskSettings.IsDefaultDescription)
|
||||
{
|
||||
tbDescription.Text = TaskSettings.Description;
|
||||
}
|
||||
|
||||
tbDescription.Text = TaskSettings.Description ?? string.Empty;
|
||||
cbUseDefaultAfterCaptureSettings.Checked = TaskSettings.UseDefaultAfterCaptureJob;
|
||||
cbUseDefaultAfterUploadSettings.Checked = TaskSettings.UseDefaultAfterUploadJob;
|
||||
cbUseDefaultDestinationSettings.Checked = TaskSettings.UseDefaultDestinations;
|
||||
|
@ -83,7 +79,6 @@ public TaskSettingsForm(TaskSettings hotkeySetting, bool isDefault = false)
|
|||
AddEnumItemsContextMenu<HotkeyType>(x =>
|
||||
{
|
||||
TaskSettings.Job = x;
|
||||
//tbDescription.Text = TaskSettings.Job.GetLocalizedDescription();
|
||||
UpdateWindowTitle();
|
||||
}, cmsTask);
|
||||
AddMultiEnumItemsContextMenu<AfterCaptureTasks>(x => TaskSettings.AfterCaptureJob = TaskSettings.AfterCaptureJob.Swap(x), cmsAfterCapture);
|
||||
|
|
|
@ -50,7 +50,7 @@ public override string ToString()
|
|||
{
|
||||
if (HotkeyInfo != null && TaskSettings != null)
|
||||
{
|
||||
return string.Format("Hotkey: {0}{1}, Job: {2}", HotkeyInfo, ", Description: " + TaskSettings.Description, TaskSettings.Job);
|
||||
return string.Format("Hotkey: {0}, Description: {1}, Job: {2}", HotkeyInfo, TaskSettings, TaskSettings.Job);
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
|
|
|
@ -40,27 +40,7 @@ namespace ShareX
|
|||
{
|
||||
public class TaskSettings
|
||||
{
|
||||
private string description = string.Empty;
|
||||
|
||||
public string Description
|
||||
{
|
||||
get
|
||||
{
|
||||
return !string.IsNullOrEmpty(description) ? description : Job.GetLocalizedDescription();
|
||||
}
|
||||
set
|
||||
{
|
||||
description = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsDefaultDescription
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.IsNullOrEmpty(description);
|
||||
}
|
||||
}
|
||||
public string Description = string.Empty;
|
||||
|
||||
public HotkeyType Job = HotkeyType.None;
|
||||
|
||||
|
@ -128,7 +108,7 @@ public TaskSettingsCapture TaskSettingsCaptureReference
|
|||
|
||||
public override string ToString()
|
||||
{
|
||||
return Description;
|
||||
return !string.IsNullOrEmpty(Description) ? Description : Job.GetLocalizedDescription();
|
||||
}
|
||||
|
||||
public bool IsUsingDefaultSettings
|
||||
|
|
Loading…
Reference in a new issue