mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-20 07:19:18 +01:00
CP-6267: Stop jumping to the Events window when an action has started.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
parent
9da261ad5a
commit
64e14bbc63
@ -143,7 +143,6 @@ namespace XenAdmin.Commands
|
|||||||
}
|
}
|
||||||
|
|
||||||
MainWindowCommandInterface.SelectObjectInTree(_pool);
|
MainWindowCommandInterface.SelectObjectInTree(_pool);
|
||||||
MainWindowCommandInterface.AllowHistorySwitch();
|
|
||||||
|
|
||||||
List<AsyncAction> actions = new List<AsyncAction>();
|
List<AsyncAction> actions = new List<AsyncAction>();
|
||||||
foreach (Host host in _hosts)
|
foreach (Host host in _hosts)
|
||||||
|
@ -86,10 +86,7 @@ namespace XenAdmin.Commands
|
|||||||
dialog.DefaultExt = "xbk";
|
dialog.DefaultExt = "xbk";
|
||||||
|
|
||||||
if (dialog.ShowDialog(Parent) != DialogResult.Cancel)
|
if (dialog.ShowDialog(Parent) != DialogResult.Cancel)
|
||||||
{
|
|
||||||
MainWindowCommandInterface.AllowHistorySwitch();
|
|
||||||
new HostBackupRestoreAction(host, HostBackupRestoreAction.HostBackupRestoreType.backup, dialog.FileName).RunAsync();
|
new HostBackupRestoreAction(host, HostBackupRestoreAction.HostBackupRestoreType.backup, dialog.FileName).RunAsync();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -53,7 +53,6 @@ namespace XenAdmin
|
|||||||
void TrySelectNewObjectInTree(Predicate<object> tagMatch, bool selectNode, bool expandNode, bool ensureNodeVisible);
|
void TrySelectNewObjectInTree(Predicate<object> tagMatch, bool selectNode, bool expandNode, bool ensureNodeVisible);
|
||||||
void TrySelectNewObjectInTree(IXenConnection c, bool selectNode, bool expandNode, bool ensureNodeVisible);
|
void TrySelectNewObjectInTree(IXenConnection c, bool selectNode, bool expandNode, bool ensureNodeVisible);
|
||||||
void Refresh();
|
void Refresh();
|
||||||
void AllowHistorySwitch();
|
|
||||||
void ShowPerXenModelObjectWizard(IXenObject obj, Form wizard);
|
void ShowPerXenModelObjectWizard(IXenObject obj, Form wizard);
|
||||||
void ShowPerConnectionWizard(IXenConnection connection, Form wizard);
|
void ShowPerConnectionWizard(IXenConnection connection, Form wizard);
|
||||||
void ShowForm(Type type);
|
void ShowForm(Type type);
|
||||||
@ -114,11 +113,6 @@ namespace XenAdmin
|
|||||||
_owner.RequestRefreshTreeView();
|
_owner.RequestRefreshTreeView();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AllowHistorySwitch()
|
|
||||||
{
|
|
||||||
_owner.AllowHistorySwitch = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ShowPerXenModelObjectWizard(IXenObject obj, Form wizard)
|
public void ShowPerXenModelObjectWizard(IXenObject obj, Form wizard)
|
||||||
{
|
{
|
||||||
_owner.ShowPerXenModelObjectWizard(obj, wizard);
|
_owner.ShowPerXenModelObjectWizard(obj, wizard);
|
||||||
|
@ -82,7 +82,6 @@ namespace XenAdmin.Commands
|
|||||||
actions.Add(new SetVMOtherConfigAction(vm.Connection, vm, "instant", "true"));
|
actions.Add(new SetVMOtherConfigAction(vm.Connection, vm, "instant", "true"));
|
||||||
actions.Add(new VMToTemplateAction(vm));
|
actions.Add(new VMToTemplateAction(vm));
|
||||||
|
|
||||||
MainWindowCommandInterface.AllowHistorySwitch();
|
|
||||||
MainWindowCommandInterface.CloseActiveWizards(vm);
|
MainWindowCommandInterface.CloseActiveWizards(vm);
|
||||||
|
|
||||||
RunMultipleActions(actions, string.Format(Messages.ACTION_VM_TEMPLATIZING_TITLE, vm.Name),
|
RunMultipleActions(actions, string.Format(Messages.ACTION_VM_TEMPLATIZING_TITLE, vm.Name),
|
||||||
|
@ -71,7 +71,6 @@ namespace XenAdmin.Commands
|
|||||||
|
|
||||||
private AsyncAction GetAction(VM vm, List<VBD> deleteDisks, List<VM> deleteSnapshots)
|
private AsyncAction GetAction(VM vm, List<VBD> deleteDisks, List<VM> deleteSnapshots)
|
||||||
{
|
{
|
||||||
MainWindowCommandInterface.AllowHistorySwitch();
|
|
||||||
return new VMDestroyAction(vm, deleteDisks, deleteSnapshots);
|
return new VMDestroyAction(vm, deleteDisks, deleteSnapshots);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,10 +147,7 @@ namespace XenAdmin.Commands
|
|||||||
// done the right thing and that the bond hasn't been deleted in the meantime. (CA-27436).
|
// done the right thing and that the bond hasn't been deleted in the meantime. (CA-27436).
|
||||||
Bond bond = pif.BondMasterOf;
|
Bond bond = pif.BondMasterOf;
|
||||||
if (bond != null)
|
if (bond != null)
|
||||||
{
|
|
||||||
Program.MainWindow.AllowHistorySwitch = true;
|
|
||||||
new Actions.DestroyBondAction(bond, new_name).RunAsync();
|
new Actions.DestroyBondAction(bond, new_name).RunAsync();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -180,8 +180,6 @@ namespace XenAdmin.Commands
|
|||||||
Directory.SetCurrentDirectory(oldDir);
|
Directory.SetCurrentDirectory(oldDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindowCommandInterface.AllowHistorySwitch();
|
|
||||||
|
|
||||||
new ExportVmAction(connection, host, vm, filename, verify).RunAsync();
|
new ExportVmAction(connection, host, vm, filename, verify).RunAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,7 +126,6 @@ namespace XenAdmin.Commands
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindowCommandInterface.AllowHistorySwitch();
|
|
||||||
MainWindowCommandInterface.CloseActiveWizards(host.Connection);
|
MainWindowCommandInterface.CloseActiveWizards(host.Connection);
|
||||||
var action = new EnableHostAction(host, result == DialogResult.Yes,AddHostToPoolCommand.EnableNtolDialog);
|
var action = new EnableHostAction(host, result == DialogResult.Yes,AddHostToPoolCommand.EnableNtolDialog);
|
||||||
action.Completed += delegate { MainWindowCommandInterface.Refresh(); };
|
action.Completed += delegate { MainWindowCommandInterface.Refresh(); };
|
||||||
|
@ -127,7 +127,6 @@ namespace XenAdmin.Commands
|
|||||||
ThreeButtonDialog.ButtonYes,
|
ThreeButtonDialog.ButtonYes,
|
||||||
ThreeButtonDialog.ButtonNo).ShowDialog(Parent) == DialogResult.Yes)
|
ThreeButtonDialog.ButtonNo).ShowDialog(Parent) == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
MainWindowCommandInterface.AllowHistorySwitch();
|
|
||||||
CreateCdDriveAction createDriveAction = new CreateCdDriveAction(vm, true,NewDiskDialog.ShowMustRebootBoxCD,NewDiskDialog.ShowVBDWarningBox);
|
CreateCdDriveAction createDriveAction = new CreateCdDriveAction(vm, true,NewDiskDialog.ShowMustRebootBoxCD,NewDiskDialog.ShowVBDWarningBox);
|
||||||
new ActionProgressDialog(createDriveAction, ProgressBarStyle.Marquee).ShowDialog(Parent);
|
new ActionProgressDialog(createDriveAction, ProgressBarStyle.Marquee).ShowDialog(Parent);
|
||||||
|
|
||||||
@ -143,7 +142,6 @@ namespace XenAdmin.Commands
|
|||||||
DialogResult dr = new InstallToolsWarningDialog(vm.Connection).ShowDialog(Parent);
|
DialogResult dr = new InstallToolsWarningDialog(vm.Connection).ShowDialog(Parent);
|
||||||
if (dr == DialogResult.Yes)
|
if (dr == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
MainWindowCommandInterface.AllowHistorySwitch();
|
|
||||||
InstallPVToolsAction installToolsAction = new InstallPVToolsAction( vm, XSToolsSRNotFound, Properties.Settings.Default.ShowHiddenVMs);
|
InstallPVToolsAction installToolsAction = new InstallPVToolsAction( vm, XSToolsSRNotFound, Properties.Settings.Default.ShowHiddenVMs);
|
||||||
installToolsAction.Completed += InstallToolsActionCompleted;
|
installToolsAction.Completed += InstallToolsActionCompleted;
|
||||||
|
|
||||||
@ -186,8 +184,6 @@ namespace XenAdmin.Commands
|
|||||||
ThreeButtonDialog.ButtonYes,
|
ThreeButtonDialog.ButtonYes,
|
||||||
ThreeButtonDialog.ButtonNo).ShowDialog(Parent) == DialogResult.Yes)
|
ThreeButtonDialog.ButtonNo).ShowDialog(Parent) == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
MainWindowCommandInterface.AllowHistorySwitch();
|
|
||||||
|
|
||||||
foreach (VM vm in vms)
|
foreach (VM vm in vms)
|
||||||
{
|
{
|
||||||
if (CanExecute(vm) && vm.FindVMCDROM() == null)
|
if (CanExecute(vm) && vm.FindVMCDROM() == null)
|
||||||
@ -208,8 +204,6 @@ namespace XenAdmin.Commands
|
|||||||
|
|
||||||
if (new InstallToolsWarningDialog(null, true, vmConnections).ShowDialog(Parent) == DialogResult.Yes)
|
if (new InstallToolsWarningDialog(null, true, vmConnections).ShowDialog(Parent) == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
MainWindowCommandInterface.AllowHistorySwitch();
|
|
||||||
|
|
||||||
foreach (VM vm in vms)
|
foreach (VM vm in vms)
|
||||||
{
|
{
|
||||||
InstallPVToolsAction installToolsAction = new InstallPVToolsAction(vm, XSToolsSRNotFound, Properties.Settings.Default.ShowHiddenVMs);
|
InstallPVToolsAction installToolsAction = new InstallPVToolsAction(vm, XSToolsSRNotFound, Properties.Settings.Default.ShowHiddenVMs);
|
||||||
|
@ -91,8 +91,6 @@ namespace XenAdmin.Commands
|
|||||||
|
|
||||||
protected override void ExecuteCore(SelectedItemCollection selection)
|
protected override void ExecuteCore(SelectedItemCollection selection)
|
||||||
{
|
{
|
||||||
MainWindowCommandInterface.AllowHistorySwitch();
|
|
||||||
|
|
||||||
List<AsyncAction> actions = new List<AsyncAction>();
|
List<AsyncAction> actions = new List<AsyncAction>();
|
||||||
foreach (Host host in selection.AsXenObjects<Host>(CanExecute))
|
foreach (Host host in selection.AsXenObjects<Host>(CanExecute))
|
||||||
{
|
{
|
||||||
|
@ -72,7 +72,6 @@ namespace XenAdmin.Commands
|
|||||||
|
|
||||||
if (result == DialogResult.OK)
|
if (result == DialogResult.OK)
|
||||||
{
|
{
|
||||||
MainWindowCommandInterface.AllowHistorySwitch();
|
|
||||||
new DestroyHostCrashDumpAction(host).RunAsync();
|
new DestroyHostCrashDumpAction(host).RunAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,6 @@ namespace XenAdmin.Commands
|
|||||||
if (hostdialog.DialogResult != DialogResult.OK)
|
if (hostdialog.DialogResult != DialogResult.OK)
|
||||||
return;
|
return;
|
||||||
host = hostdialog.TheHost;
|
host = hostdialog.TheHost;
|
||||||
MainWindowCommandInterface.AllowHistorySwitch();
|
|
||||||
HostBackupRestoreAction action = new HostBackupRestoreAction(host, HostBackupRestoreAction.HostBackupRestoreType.restore, filepath);
|
HostBackupRestoreAction action = new HostBackupRestoreAction(host, HostBackupRestoreAction.HostBackupRestoreType.restore, filepath);
|
||||||
action.Completed += RestoreAction_Completed;
|
action.Completed += RestoreAction_Completed;
|
||||||
action.RunAsync();
|
action.RunAsync();
|
||||||
@ -136,7 +135,6 @@ namespace XenAdmin.Commands
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MainWindowCommandInterface.AllowHistorySwitch();
|
|
||||||
HostBackupRestoreAction action = new HostBackupRestoreAction(host, HostBackupRestoreAction.HostBackupRestoreType.restore, filepath);
|
HostBackupRestoreAction action = new HostBackupRestoreAction(host, HostBackupRestoreAction.HostBackupRestoreType.restore, filepath);
|
||||||
action.Completed += RestoreAction_Completed;
|
action.Completed += RestoreAction_Completed;
|
||||||
action.RunAsync();
|
action.RunAsync();
|
||||||
|
@ -90,7 +90,6 @@ namespace XenAdmin.Commands
|
|||||||
protected void RunAction(IEnumerable<VM> vms, string title, string startDescription, string endDescription,
|
protected void RunAction(IEnumerable<VM> vms, string title, string startDescription, string endDescription,
|
||||||
Dictionary<VM, List<VBD>> vbdsToEjectDict)
|
Dictionary<VM, List<VBD>> vbdsToEjectDict)
|
||||||
{
|
{
|
||||||
MainWindowCommandInterface.AllowHistorySwitch();
|
|
||||||
var actions = GetActions(vms, title, startDescription, endDescription, vbdsToEjectDict);
|
var actions = GetActions(vms, title, startDescription, endDescription, vbdsToEjectDict);
|
||||||
RunMultipleActions(actions, title, startDescription, endDescription, true);
|
RunMultipleActions(actions, title, startDescription, endDescription, true);
|
||||||
}
|
}
|
||||||
|
@ -115,10 +115,8 @@ namespace XenAdmin.Commands
|
|||||||
|
|
||||||
protected override void ExecuteCore(SelectedItemCollection selection)
|
protected override void ExecuteCore(SelectedItemCollection selection)
|
||||||
{
|
{
|
||||||
|
|
||||||
AssertOperationAllowsExecution();
|
AssertOperationAllowsExecution();
|
||||||
|
|
||||||
Program.MainWindow.AllowHistorySwitch = true;
|
|
||||||
string title = Messages.ACTION_VMS_RESUMING_ON_TITLE;
|
string title = Messages.ACTION_VMS_RESUMING_ON_TITLE;
|
||||||
string startDescription = Messages.ACTION_VM_RESUMING;
|
string startDescription = Messages.ACTION_VM_RESUMING;
|
||||||
string endDescription = Messages.ACTION_VM_RESUMED;
|
string endDescription = Messages.ACTION_VM_RESUMED;
|
||||||
|
@ -69,7 +69,6 @@ namespace XenAdmin.Commands
|
|||||||
|
|
||||||
protected override void ExecuteCore(SelectedItemCollection selection)
|
protected override void ExecuteCore(SelectedItemCollection selection)
|
||||||
{
|
{
|
||||||
MainWindowCommandInterface.AllowHistorySwitch();
|
|
||||||
new HVMBootAction((VM)selection[0].XenObject).RunAsync();
|
new HVMBootAction((VM)selection[0].XenObject).RunAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -605,8 +605,6 @@ namespace XenAdmin.Controls.NetworkingTab
|
|||||||
|
|
||||||
private void DoRemoveNetwork()
|
private void DoRemoveNetwork()
|
||||||
{
|
{
|
||||||
Program.MainWindow.AllowHistorySwitch = true;
|
|
||||||
|
|
||||||
if (SelectedVif != null)
|
if (SelectedVif != null)
|
||||||
{
|
{
|
||||||
VM vm = XenObject as VM;
|
VM vm = XenObject as VM;
|
||||||
|
@ -105,8 +105,6 @@ namespace XenAdmin.Dialogs
|
|||||||
if (!MainWindow.Confirm(connection, Program.MainWindow, Messages.MESSAGEBOX_CONFIRM, Messages.MESSAGEBOX_DELETE_CUSTOM_FIELD, name))
|
if (!MainWindow.Confirm(connection, Program.MainWindow, Messages.MESSAGEBOX_CONFIRM, Messages.MESSAGEBOX_DELETE_CUSTOM_FIELD, name))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Program.MainWindow.AllowHistorySwitch = true;
|
|
||||||
|
|
||||||
int selIdx = lbCustomFields.SelectedIndex;
|
int selIdx = lbCustomFields.SelectedIndex;
|
||||||
|
|
||||||
lbCustomFields.Items.RemoveAt(selIdx);
|
lbCustomFields.Items.RemoveAt(selIdx);
|
||||||
|
@ -320,7 +320,6 @@ namespace XenAdmin.Dialogs
|
|||||||
// Yes, save to the LocalXenObject.
|
// Yes, save to the LocalXenObject.
|
||||||
List<AsyncAction> actions = SaveSettings();
|
List<AsyncAction> actions = SaveSettings();
|
||||||
|
|
||||||
Program.MainWindow.AllowHistorySwitch = true;
|
|
||||||
Program.Invoke(Program.MainWindow.GeneralPage, Program.MainWindow.GeneralPage.EnableDisableEdit);
|
Program.Invoke(Program.MainWindow.GeneralPage, Program.MainWindow.GeneralPage.EnableDisableEdit);
|
||||||
|
|
||||||
// Add a save changes on the beginning of the actions to enact the alterations that were just changes to the xenObjectCopy.
|
// Add a save changes on the beginning of the actions to enact the alterations that were just changes to the xenObjectCopy.
|
||||||
|
@ -100,14 +100,6 @@ namespace XenAdmin
|
|||||||
internal readonly AdPage AdPage = new AdPage();
|
internal readonly AdPage AdPage = new AdPage();
|
||||||
|
|
||||||
private bool IgnoreTabChanges = false;
|
private bool IgnoreTabChanges = false;
|
||||||
public bool AllowHistorySwitch
|
|
||||||
{
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value)
|
|
||||||
navigationPane.SwitchToNotificationsView(NotificationsSubMode.Events);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private bool ToolbarsEnabled;
|
private bool ToolbarsEnabled;
|
||||||
|
|
||||||
private readonly Dictionary<IXenConnection, IList<Form>> activePoolWizards = new Dictionary<IXenConnection, IList<Form>>();
|
private readonly Dictionary<IXenConnection, IList<Form>> activePoolWizards = new Dictionary<IXenConnection, IList<Form>>();
|
||||||
@ -796,7 +788,6 @@ namespace XenAdmin
|
|||||||
{
|
{
|
||||||
Program.MainWindow.closeActiveWizards(host);
|
Program.MainWindow.closeActiveWizards(host);
|
||||||
|
|
||||||
AllowHistorySwitch = true;
|
|
||||||
var action = new DisableHostAction(host);
|
var action = new DisableHostAction(host);
|
||||||
action.Completed += action_Completed;
|
action.Completed += action_Completed;
|
||||||
action.RunAsync();
|
action.RunAsync();
|
||||||
@ -1559,7 +1550,6 @@ namespace XenAdmin
|
|||||||
|
|
||||||
private void DoLicenseAction(Host host, string filePath)
|
private void DoLicenseAction(Host host, string filePath)
|
||||||
{
|
{
|
||||||
AllowHistorySwitch = true;
|
|
||||||
ApplyLicenseAction action = new ApplyLicenseAction(host.Connection, host, filePath);
|
ApplyLicenseAction action = new ApplyLicenseAction(host.Connection, host, filePath);
|
||||||
ActionProgressDialog actionProgress = new ActionProgressDialog(action, ProgressBarStyle.Marquee);
|
ActionProgressDialog actionProgress = new ActionProgressDialog(action, ProgressBarStyle.Marquee);
|
||||||
|
|
||||||
@ -1580,7 +1570,6 @@ namespace XenAdmin
|
|||||||
/// </param>
|
/// </param>
|
||||||
private void TheTabControl_SelectedIndexChanged(object sender, EventArgs e)
|
private void TheTabControl_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
AllowHistorySwitch = false;
|
|
||||||
if (IgnoreTabChanges)
|
if (IgnoreTabChanges)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -2531,7 +2520,6 @@ namespace XenAdmin
|
|||||||
private void navigationPane_TreeNodeBeforeSelected()
|
private void navigationPane_TreeNodeBeforeSelected()
|
||||||
{
|
{
|
||||||
SearchMode = false;
|
SearchMode = false;
|
||||||
AllowHistorySwitch = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void navigationPane_TreeNodeClicked()
|
private void navigationPane_TreeNodeClicked()
|
||||||
@ -2701,8 +2689,6 @@ namespace XenAdmin
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Program.MainWindow.AllowHistorySwitch = true;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -643,7 +643,6 @@ namespace XenAdmin.SettingsPanels
|
|||||||
a.Host = h;
|
a.Host = h;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Program.MainWindow.AllowHistorySwitch = true;
|
|
||||||
actions.Add(a);
|
actions.Add(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,10 +65,6 @@ namespace XenAdminTests
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AllowHistorySwitch()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ShowPerXenModelObjectWizard(IXenObject obj, Form wizard)
|
public void ShowPerXenModelObjectWizard(IXenObject obj, Form wizard)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user