mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-25 14:27:26 +01:00
Merge pull request #202 from GaborApatiNagy/CA-143826
CA-143826: When in Notifications view, the context should be empty
This commit is contained in:
commit
1a36ea0531
@ -109,6 +109,9 @@ namespace XenAdmin.Commands
|
||||
/// </summary>
|
||||
public event EventHandler SelectionChanged;
|
||||
|
||||
public abstract void SaveAndClearSelection();
|
||||
public abstract void RestoreSavedSelection();
|
||||
|
||||
#region IDisposable Members
|
||||
|
||||
/// <summary>
|
||||
|
@ -42,6 +42,7 @@ namespace XenAdmin.Commands
|
||||
internal class SelectionManager : SelectionBroadcaster
|
||||
{
|
||||
private SelectedItemCollection _selection = new SelectedItemCollection();
|
||||
private SelectedItemCollection savedSelection = new SelectedItemCollection();
|
||||
|
||||
/// <summary>
|
||||
/// Sets the main selection for XenCenter.
|
||||
@ -86,5 +87,20 @@ namespace XenAdmin.Commands
|
||||
{
|
||||
SetSelection(Selection);
|
||||
}
|
||||
|
||||
public override void SaveAndClearSelection()
|
||||
{
|
||||
savedSelection = new SelectedItemCollection(_selection);
|
||||
SetSelection(new SelectedItemCollection());
|
||||
}
|
||||
|
||||
public override void RestoreSavedSelection()
|
||||
{
|
||||
if (savedSelection != null)
|
||||
{
|
||||
SetSelection(new SelectedItemCollection(savedSelection));
|
||||
savedSelection = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -278,11 +278,15 @@ namespace XenAdmin.Controls.MainWindowControls
|
||||
{
|
||||
if (currentMode == NavigationMode.Notifications)
|
||||
{
|
||||
SelectionManager.SaveAndClearSelection();
|
||||
|
||||
//restore the last selected view
|
||||
SwitchToNotificationsView(lastNotificationsMode);
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectionManager.RestoreSavedSelection();
|
||||
|
||||
//show the navigationView first and then hide the notificationsView
|
||||
//to avoid instantaneous appearance of empty panels
|
||||
navigationView.Visible = true;
|
||||
|
Loading…
Reference in New Issue
Block a user