Exemplo n.º 1
0
        protected override AsyncAction CreateAction(out bool cancelled)
        {
            Program.AssertOnEventThread();
            cancelled = false;

            if (!sr.shared)
            {
                return(null);
            }

            if (device_config == null) //no device config, we need to run the New SR wizard
            {
                NewSRWizard wizard = new NewSRWizard(pool.Connection, sr, true);
                wizard.ShowDialog(Program.MainWindow);
                return(wizard.FinalAction);
            }

            Host master = pool.Connection.Resolve(pool.master);

            if (master == null)
            {
                return(null);
            }

            ScannedDeviceInfo deviceInfo = new ScannedDeviceInfo(sr.GetSRType(true), device_config, sr.uuid);

            return(new DrTaskCreateAction(pool.Connection, deviceInfo));
        }
Exemplo n.º 2
0
        private void OpenNewSRWizard()
        {
            SetSelectedIndexWithoutEvent(0);
            ResetControlsAfterSelectedIndexChanged();

            NewSRWizard wizard = new NewSRWizard(Connection);

            wizard.CheckNFSISORadioButton();

            if (wizard.ShowDialog() == DialogResult.OK)
            {
                PopulateComboBox();
            }
        }
Exemplo n.º 3
0
        private void m_comboBoxISOLibraries_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (!m_radioButtonRunOSFixups.Checked)
            {
                m_radioButtonRunOSFixups.Checked = true;
            }

            ValidateSelection();

            if (IsNewISOLibraryItem())
            {
                var wizard = new NewSRWizard(Connection);
                wizard.CheckNFSISORadioButton();
                wizard.ShowDialog();
            }
        }
Exemplo n.º 4
0
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            NewSRWizard wizard = new NewSRWizard(Connection);

            wizard.CheckNFSISORadioButton();

            if (wizard.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }

            // Return if we lost connection
            if (Connection == null || Helpers.GetPoolOfOne(Connection) == null)
            {
                log.Error("Page_InstallationMedia: connection to the server was lost");
                return;
            }

            // There's a chance the cd radio button was disabled because we didnt have any isos to select from, so refresh that bool
            // and the enablement of that button.
            cds = Helpers.CDsExist(Connection);
            CdRadioButton.Enabled = (installed || installCd) && cds;

            // We can get a lot of refresh flickering in the ISO box as all the VDIs are discovered
            // Possibly slightly rude, but were going to have a pretend action here which gives it some breathing space before we look for VDIs
            DelegatedAsyncAction waitAction = new DelegatedAsyncAction(Connection, Messages.SR_REFRESH_ACTION_DESC, Messages.SR_REFRESH_ACTION_DESC, Messages.COMPLETED,
                                                                       delegate
            {
                System.Threading.Thread.Sleep(10000);
            }, true);

            using (var dlg = new ActionProgressDialog(waitAction, System.Windows.Forms.ProgressBarStyle.Marquee))
                dlg.ShowDialog(this);

            // Set the connection on the drop down iso box. This causes a complete refresh rather than a mini one - otherwise we miss out on
            // getting event handlers for the new SR
            CdDropDownBox.connection = Connection;
        }
Exemplo n.º 5
0
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            NewSRWizard wizard = new NewSRWizard(Connection);
            wizard.CheckNFSISORadioButton();

            if (wizard.ShowDialog() == DialogResult.Cancel)
                return;

            // Return if we lost connection
            if (Connection == null || Helpers.GetPoolOfOne(Connection) == null)
            {
                log.Error("Page_InstallationMedia: connection to the server was lost");
                return;
            }

            // There's a chance the cd radio button was disabled because we didnt have any isos to select from, so refresh that bool
            // and the enablement of that button.
            cds = Helpers.CDsExist(Connection);
            CdRadioButton.Enabled = (installed || installCd) && cds;

            // We can get a lot of refresh flickering in the ISO box as all the VDIs are discovered
            // Possibly slightly rude, but were going to have a pretend action here which gives it some breathing space before we look for VDIs
            DelegatedAsyncAction waitAction = new DelegatedAsyncAction(Connection, Messages.SR_REFRESH_ACTION_DESC, Messages.SR_REFRESH_ACTION_DESC, Messages.COMPLETED,
                delegate
                {
                    System.Threading.Thread.Sleep(10000);
                }, true);
            using (var dlg = new ActionProgressDialog(waitAction, System.Windows.Forms.ProgressBarStyle.Marquee))
                dlg.ShowDialog(this);

            // Set the connection on the drop down iso box. This causes a complete refresh rather than a mini one - otherwise we miss out on
            // getting event handlers for the new SR
            CdDropDownBox.connection = Connection;
        }
Exemplo n.º 6
0
        private void OpenNewSRWizard()
        {
            SetSelectedIndexWithoutEvent(0);
            ResetControlsAfterSelectedIndexChanged();

            NewSRWizard wizard = new NewSRWizard(Connection);
			wizard.CheckNFSISORadioButton();

            if (wizard.ShowDialog() == DialogResult.OK)
                PopulateComboBox();
        }