Skip to content

Commit

Permalink
Unofficial keyboard shortcut Ctrl-p to update Trails popup when activ…
Browse files Browse the repository at this point in the history
…ity selection changes
  • Loading branch information
gerhardol committed Jan 24, 2016
1 parent 64a2cb9 commit f609d32
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion UI/Activity/ActivityDetailPageControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ private void LowerSplitContainer_SplitterMoved(object sender, System.Windows.For
}
}

private void popupForm_OnViewSelectedItemsChanged(object sender, EventArgs e)
internal void popupForm_OnViewSelectedItemsChanged(object sender, EventArgs e)
{
this.Activities = CollectionUtils.GetAllContainedItemsOfType<IActivity>(m_view.SelectionProvider.SelectedItems);
}
Expand Down
18 changes: 17 additions & 1 deletion UI/Activity/ResultListControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2097,8 +2097,24 @@ void summaryList_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)

else if (e.KeyCode == Keys.P)
{
//Unofficial
if (e.Modifiers == Keys.Control)
{
Data.Settings.PopupUpdatedBySelection = !Data.Settings.PopupUpdatedBySelection;
if (this.m_page.IsPopup)
{
if (Data.Settings.PopupUpdatedBySelection)
{
m_view.SelectionProvider.SelectedItemsChanged += new EventHandler(m_page.popupForm_OnViewSelectedItemsChanged);
}
else
{
m_view.SelectionProvider.SelectedItemsChanged -= new EventHandler(m_page.popupForm_OnViewSelectedItemsChanged);
}
}
}
//In context menu, not documented, to be removed?
if (e.Modifiers == Keys.Shift)
else if (e.Modifiers == Keys.Shift)
{
this.PerformancePredictorPopup();
}
Expand Down
2 changes: 1 addition & 1 deletion trails.wiki
Submodule trails.wiki updated from 7b3335 to 000f49

0 comments on commit f609d32

Please sign in to comment.