mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-03 02:36:50 +13:00
Merge pull request #3647 from Jaex/master
fixes #3604: Added option to automatically select last completed task in main window
This commit is contained in:
commit
cb788fcdca
3 changed files with 27 additions and 4 deletions
|
@ -67,10 +67,7 @@ public int SelectedIndex
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
foreach (ListViewItem lvi in SelectedItems)
|
UnselectAll();
|
||||||
{
|
|
||||||
lvi.Selected = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (value > -1)
|
if (value > -1)
|
||||||
{
|
{
|
||||||
|
@ -144,6 +141,24 @@ public void SelectLast()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SelectSingle(ListViewItem lvi)
|
||||||
|
{
|
||||||
|
UnselectAll();
|
||||||
|
|
||||||
|
if (lvi != null)
|
||||||
|
{
|
||||||
|
lvi.Selected = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnselectAll()
|
||||||
|
{
|
||||||
|
foreach (ListViewItem lvi in SelectedItems)
|
||||||
|
{
|
||||||
|
lvi.Selected = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnKeyDown(KeyEventArgs e)
|
protected override void OnKeyDown(KeyEventArgs e)
|
||||||
{
|
{
|
||||||
if (MultiSelect && e.Control && e.KeyCode == Keys.A)
|
if (MultiSelect && e.Control && e.KeyCode == Keys.A)
|
||||||
|
|
|
@ -183,6 +183,9 @@ public ApplicationConfig()
|
||||||
[Category("Application"), DefaultValue(true), Description("Save settings after task completed but only if there is no other active tasks. This setting will be handy for situations where setting save fails when Windows shutdown and not let ShareX to save in time.")]
|
[Category("Application"), DefaultValue(true), Description("Save settings after task completed but only if there is no other active tasks. This setting will be handy for situations where setting save fails when Windows shutdown and not let ShareX to save in time.")]
|
||||||
public bool SaveSettingsAfterTaskCompleted { get; set; }
|
public bool SaveSettingsAfterTaskCompleted { get; set; }
|
||||||
|
|
||||||
|
[Category("Application"), DefaultValue(false), Description("In main window when task is completed automatically select it.")]
|
||||||
|
public bool AutoSelectLastCompletedTask { get; set; }
|
||||||
|
|
||||||
[Category("Hotkey"), DefaultValue(false), Description("Disables hotkeys.")]
|
[Category("Hotkey"), DefaultValue(false), Description("Disables hotkeys.")]
|
||||||
public bool DisableHotkeys { get; set; }
|
public bool DisableHotkeys { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -441,6 +441,11 @@ private static void task_TaskCompleted(WorkerTask task)
|
||||||
if (lvi != null)
|
if (lvi != null)
|
||||||
{
|
{
|
||||||
lvi.EnsureVisible();
|
lvi.EnsureVisible();
|
||||||
|
|
||||||
|
if (Program.Settings.AutoSelectLastCompletedTask)
|
||||||
|
{
|
||||||
|
ListViewControl.SelectSingle(lvi);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue