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:
Konstantina Chremmou 2013-10-08 11:03:29 +01:00
parent 9da261ad5a
commit 64e14bbc63
21 changed files with 0 additions and 57 deletions

View File

@ -143,7 +143,6 @@ namespace XenAdmin.Commands
}
MainWindowCommandInterface.SelectObjectInTree(_pool);
MainWindowCommandInterface.AllowHistorySwitch();
List<AsyncAction> actions = new List<AsyncAction>();
foreach (Host host in _hosts)

View File

@ -86,11 +86,8 @@ namespace XenAdmin.Commands
dialog.DefaultExt = "xbk";
if (dialog.ShowDialog(Parent) != DialogResult.Cancel)
{
MainWindowCommandInterface.AllowHistorySwitch();
new HostBackupRestoreAction(host, HostBackupRestoreAction.HostBackupRestoreType.backup, dialog.FileName).RunAsync();
}
}
else
{
new HostBackupRestoreAction(host, HostBackupRestoreAction.HostBackupRestoreType.backup, _filename).RunAsync();

View File

@ -53,7 +53,6 @@ namespace XenAdmin
void TrySelectNewObjectInTree(Predicate<object> tagMatch, bool selectNode, bool expandNode, bool ensureNodeVisible);
void TrySelectNewObjectInTree(IXenConnection c, bool selectNode, bool expandNode, bool ensureNodeVisible);
void Refresh();
void AllowHistorySwitch();
void ShowPerXenModelObjectWizard(IXenObject obj, Form wizard);
void ShowPerConnectionWizard(IXenConnection connection, Form wizard);
void ShowForm(Type type);
@ -114,11 +113,6 @@ namespace XenAdmin
_owner.RequestRefreshTreeView();
}
public void AllowHistorySwitch()
{
_owner.AllowHistorySwitch = true;
}
public void ShowPerXenModelObjectWizard(IXenObject obj, Form wizard)
{
_owner.ShowPerXenModelObjectWizard(obj, wizard);

View File

@ -82,7 +82,6 @@ namespace XenAdmin.Commands
actions.Add(new SetVMOtherConfigAction(vm.Connection, vm, "instant", "true"));
actions.Add(new VMToTemplateAction(vm));
MainWindowCommandInterface.AllowHistorySwitch();
MainWindowCommandInterface.CloseActiveWizards(vm);
RunMultipleActions(actions, string.Format(Messages.ACTION_VM_TEMPLATIZING_TITLE, vm.Name),

View File

@ -71,7 +71,6 @@ namespace XenAdmin.Commands
private AsyncAction GetAction(VM vm, List<VBD> deleteDisks, List<VM> deleteSnapshots)
{
MainWindowCommandInterface.AllowHistorySwitch();
return new VMDestroyAction(vm, deleteDisks, deleteSnapshots);
}

View File

@ -147,10 +147,7 @@ namespace XenAdmin.Commands
// done the right thing and that the bond hasn't been deleted in the meantime. (CA-27436).
Bond bond = pif.BondMasterOf;
if (bond != null)
{
Program.MainWindow.AllowHistorySwitch = true;
new Actions.DestroyBondAction(bond, new_name).RunAsync();
}
}
}
}

View File

@ -180,8 +180,6 @@ namespace XenAdmin.Commands
Directory.SetCurrentDirectory(oldDir);
}
MainWindowCommandInterface.AllowHistorySwitch();
new ExportVmAction(connection, host, vm, filename, verify).RunAsync();
}

View File

@ -126,7 +126,6 @@ namespace XenAdmin.Commands
}
}
MainWindowCommandInterface.AllowHistorySwitch();
MainWindowCommandInterface.CloseActiveWizards(host.Connection);
var action = new EnableHostAction(host, result == DialogResult.Yes,AddHostToPoolCommand.EnableNtolDialog);
action.Completed += delegate { MainWindowCommandInterface.Refresh(); };

View File

@ -127,7 +127,6 @@ namespace XenAdmin.Commands
ThreeButtonDialog.ButtonYes,
ThreeButtonDialog.ButtonNo).ShowDialog(Parent) == DialogResult.Yes)
{
MainWindowCommandInterface.AllowHistorySwitch();
CreateCdDriveAction createDriveAction = new CreateCdDriveAction(vm, true,NewDiskDialog.ShowMustRebootBoxCD,NewDiskDialog.ShowVBDWarningBox);
new ActionProgressDialog(createDriveAction, ProgressBarStyle.Marquee).ShowDialog(Parent);
@ -143,7 +142,6 @@ namespace XenAdmin.Commands
DialogResult dr = new InstallToolsWarningDialog(vm.Connection).ShowDialog(Parent);
if (dr == DialogResult.Yes)
{
MainWindowCommandInterface.AllowHistorySwitch();
InstallPVToolsAction installToolsAction = new InstallPVToolsAction( vm, XSToolsSRNotFound, Properties.Settings.Default.ShowHiddenVMs);
installToolsAction.Completed += InstallToolsActionCompleted;
@ -186,8 +184,6 @@ namespace XenAdmin.Commands
ThreeButtonDialog.ButtonYes,
ThreeButtonDialog.ButtonNo).ShowDialog(Parent) == DialogResult.Yes)
{
MainWindowCommandInterface.AllowHistorySwitch();
foreach (VM vm in vms)
{
if (CanExecute(vm) && vm.FindVMCDROM() == null)
@ -208,8 +204,6 @@ namespace XenAdmin.Commands
if (new InstallToolsWarningDialog(null, true, vmConnections).ShowDialog(Parent) == DialogResult.Yes)
{
MainWindowCommandInterface.AllowHistorySwitch();
foreach (VM vm in vms)
{
InstallPVToolsAction installToolsAction = new InstallPVToolsAction(vm, XSToolsSRNotFound, Properties.Settings.Default.ShowHiddenVMs);

View File

@ -91,8 +91,6 @@ namespace XenAdmin.Commands
protected override void ExecuteCore(SelectedItemCollection selection)
{
MainWindowCommandInterface.AllowHistorySwitch();
List<AsyncAction> actions = new List<AsyncAction>();
foreach (Host host in selection.AsXenObjects<Host>(CanExecute))
{

View File

@ -72,7 +72,6 @@ namespace XenAdmin.Commands
if (result == DialogResult.OK)
{
MainWindowCommandInterface.AllowHistorySwitch();
new DestroyHostCrashDumpAction(host).RunAsync();
}
}

View File

@ -127,7 +127,6 @@ namespace XenAdmin.Commands
if (hostdialog.DialogResult != DialogResult.OK)
return;
host = hostdialog.TheHost;
MainWindowCommandInterface.AllowHistorySwitch();
HostBackupRestoreAction action = new HostBackupRestoreAction(host, HostBackupRestoreAction.HostBackupRestoreType.restore, filepath);
action.Completed += RestoreAction_Completed;
action.RunAsync();
@ -136,7 +135,6 @@ namespace XenAdmin.Commands
}
else
{
MainWindowCommandInterface.AllowHistorySwitch();
HostBackupRestoreAction action = new HostBackupRestoreAction(host, HostBackupRestoreAction.HostBackupRestoreType.restore, filepath);
action.Completed += RestoreAction_Completed;
action.RunAsync();

View File

@ -90,7 +90,6 @@ namespace XenAdmin.Commands
protected void RunAction(IEnumerable<VM> vms, string title, string startDescription, string endDescription,
Dictionary<VM, List<VBD>> vbdsToEjectDict)
{
MainWindowCommandInterface.AllowHistorySwitch();
var actions = GetActions(vms, title, startDescription, endDescription, vbdsToEjectDict);
RunMultipleActions(actions, title, startDescription, endDescription, true);
}

View File

@ -115,10 +115,8 @@ namespace XenAdmin.Commands
protected override void ExecuteCore(SelectedItemCollection selection)
{
AssertOperationAllowsExecution();
Program.MainWindow.AllowHistorySwitch = true;
string title = Messages.ACTION_VMS_RESUMING_ON_TITLE;
string startDescription = Messages.ACTION_VM_RESUMING;
string endDescription = Messages.ACTION_VM_RESUMED;

View File

@ -69,7 +69,6 @@ namespace XenAdmin.Commands
protected override void ExecuteCore(SelectedItemCollection selection)
{
MainWindowCommandInterface.AllowHistorySwitch();
new HVMBootAction((VM)selection[0].XenObject).RunAsync();
}

View File

@ -605,8 +605,6 @@ namespace XenAdmin.Controls.NetworkingTab
private void DoRemoveNetwork()
{
Program.MainWindow.AllowHistorySwitch = true;
if (SelectedVif != null)
{
VM vm = XenObject as VM;

View File

@ -105,8 +105,6 @@ namespace XenAdmin.Dialogs
if (!MainWindow.Confirm(connection, Program.MainWindow, Messages.MESSAGEBOX_CONFIRM, Messages.MESSAGEBOX_DELETE_CUSTOM_FIELD, name))
return;
Program.MainWindow.AllowHistorySwitch = true;
int selIdx = lbCustomFields.SelectedIndex;
lbCustomFields.Items.RemoveAt(selIdx);

View File

@ -320,7 +320,6 @@ namespace XenAdmin.Dialogs
// Yes, save to the LocalXenObject.
List<AsyncAction> actions = SaveSettings();
Program.MainWindow.AllowHistorySwitch = true;
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.

View File

@ -100,14 +100,6 @@ namespace XenAdmin
internal readonly AdPage AdPage = new AdPage();
private bool IgnoreTabChanges = false;
public bool AllowHistorySwitch
{
set
{
if (value)
navigationPane.SwitchToNotificationsView(NotificationsSubMode.Events);
}
}
private bool ToolbarsEnabled;
private readonly Dictionary<IXenConnection, IList<Form>> activePoolWizards = new Dictionary<IXenConnection, IList<Form>>();
@ -796,7 +788,6 @@ namespace XenAdmin
{
Program.MainWindow.closeActiveWizards(host);
AllowHistorySwitch = true;
var action = new DisableHostAction(host);
action.Completed += action_Completed;
action.RunAsync();
@ -1559,7 +1550,6 @@ namespace XenAdmin
private void DoLicenseAction(Host host, string filePath)
{
AllowHistorySwitch = true;
ApplyLicenseAction action = new ApplyLicenseAction(host.Connection, host, filePath);
ActionProgressDialog actionProgress = new ActionProgressDialog(action, ProgressBarStyle.Marquee);
@ -1580,7 +1570,6 @@ namespace XenAdmin
/// </param>
private void TheTabControl_SelectedIndexChanged(object sender, EventArgs e)
{
AllowHistorySwitch = false;
if (IgnoreTabChanges)
return;
@ -2531,7 +2520,6 @@ namespace XenAdmin
private void navigationPane_TreeNodeBeforeSelected()
{
SearchMode = false;
AllowHistorySwitch = false;
}
private void navigationPane_TreeNodeClicked()
@ -2701,8 +2689,6 @@ namespace XenAdmin
return false;
}
Program.MainWindow.AllowHistorySwitch = true;
return true;
}

View File

@ -643,7 +643,6 @@ namespace XenAdmin.SettingsPanels
a.Host = h;
break;
}
Program.MainWindow.AllowHistorySwitch = true;
actions.Add(a);
}

View File

@ -65,10 +65,6 @@ namespace XenAdminTests
{
}
public void AllowHistorySwitch()
{
}
public void ShowPerXenModelObjectWizard(IXenObject obj, Form wizard)
{