Removed property MenuShortcuts in favour of MenuShortcutsEnabled.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2018-10-01 17:01:59 +01:00 committed by Mihaela Stoica
parent edea57ebf3
commit 968701cf8e
6 changed files with 15 additions and 18 deletions

View File

@ -312,7 +312,7 @@ namespace XenAdmin.ConsoleView
void rdpClient_Leave(object sender, EventArgs e)
{
Program.MainWindow.MenuShortcuts = true;
Program.MainWindow.MenuShortcutsEnabled = true;
InterceptKeys.releaseKeys();
pressedScans = new Set<int>();
}
@ -342,7 +342,7 @@ namespace XenAdmin.ConsoleView
public void Activate()
{
Program.MainWindow.MenuShortcuts = false;
Program.MainWindow.MenuShortcutsEnabled = false;
if (rdpControl != null)
{
if (!rdpControl.Focused)

View File

@ -904,12 +904,12 @@ namespace XenAdmin.ConsoleView
public void DisableMenuShortcuts()
{
Program.MainWindow.MenuShortcuts = false;
Program.MainWindow.MenuShortcutsEnabled = false;
}
public void EnableMenuShortcuts()
{
Program.MainWindow.MenuShortcuts = true;
Program.MainWindow.MenuShortcutsEnabled = true;
}
protected override void OnGotFocus(EventArgs e)

View File

@ -1321,12 +1321,12 @@ namespace XenAdmin.ConsoleView
public static void DisableMenuShortcuts()
{
Program.MainWindow.MenuShortcuts = false;
Program.MainWindow.MenuShortcutsEnabled = false;
}
public static void EnableMenuShortcuts()
{
Program.MainWindow.MenuShortcuts = true;
Program.MainWindow.MenuShortcutsEnabled = true;
}
private Set<Keys> pressedKeys = new Set<Keys>();

View File

@ -64,7 +64,7 @@ namespace XenAdmin
void RemoveConnection(IXenConnection connection);
void PutSelectedNodeIntoEditMode();
void SwitchToTab(MainWindow.Tab tab);
bool MenuShortcutsEnabled { get;}
bool MenuShortcutsEnabled { get; set; }
Form Form { get; }
}
}

View File

@ -1306,16 +1306,17 @@ namespace XenAdmin
this.Close();
}
private bool _menuShortcuts = true;
public bool MenuShortcuts
private bool _menuShortcutsEnabled = true;
public bool MenuShortcutsEnabled
{
get { return _menuShortcutsEnabled; }
set
{
if (value != _menuShortcuts)
if (value != _menuShortcutsEnabled)
{
//if the VNC Console is active (the user is typing into it etc) all of the shortcuts for XenCenter are disabled
//IMPORTANT! add any shortcuts you want to pass to the VNC console into this if, else statement
_menuShortcuts = value;
_menuShortcutsEnabled = value;
// update the selection so menu items can enable/disable keyboard shortcuts as appropriate.
SelectionManager.RefreshSelection();
@ -1684,7 +1685,7 @@ namespace XenAdmin
exportSettingsToolStripMenuItem.Enabled = ConnectionsManager.XenConnectionsCopy.Count > 0;
this.MenuShortcuts = true;
MenuShortcutsEnabled = true;
startOnHostToolStripMenuItem.Available = startOnHostToolStripMenuItem.Enabled;
resumeOnToolStripMenuItem.Available = resumeOnToolStripMenuItem.Enabled;
@ -2472,11 +2473,6 @@ namespace XenAdmin
TrySelectNewNode(c, selectNode, expandNode, ensureNodeVisible);
}
public bool MenuShortcutsEnabled
{
get { return _menuShortcuts; }
}
#endregion
#region Help
@ -2600,7 +2596,7 @@ namespace XenAdmin
public void MainWindow_HelpRequested(object sender, HelpEventArgs hlpevent)
{
// CA-28064. MessageBox hack to kill the hlpevent it passes to MainWindows.
if (Program.MainWindow.ContainsFocus && _menuShortcuts)
if (Program.MainWindow.ContainsFocus && MenuShortcutsEnabled)
LaunchHelp();
}

View File

@ -138,6 +138,7 @@ namespace XenAdminTests
public bool MenuShortcutsEnabled
{
get { return true; }
set { }
}
public void TrySelectNewObjectInTree(IXenConnection c, bool selectNode, bool expandNode, bool ensureNodeVisible)