This repository was archived by the owner on Feb 17, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
XenAdmin/Wizards/NewVMWizard Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -274,11 +274,9 @@ private void UpdateEnablement(bool pageLoad = false)
274274 DisksGridView . Enabled = DisksRadioButton . Checked ;
275275 DisklessVMRadioButton . Enabled = Template . IsHVM ( ) && SelectedInstallMethod == InstallMethod . Network ;
276276
277- bool isDefaultTemplate = Template . DefaultTemplate ( ) ;
278- bool isSnapshot = Template . is_a_snapshot ;
279- bool createOnSameSr = false ;
277+ CloneCheckBox . Enabled = false ;
280278
281- if ( ! isDefaultTemplate )
279+ if ( ! Template . DefaultTemplate ( ) )
282280 {
283281 foreach ( DiskGridRowItem row in DisksGridView . Rows )
284282 {
@@ -288,15 +286,19 @@ private void UpdateEnablement(bool pageLoad = false)
288286
289287 if ( row . SourceSR . Equals ( dest ) )
290288 {
291- createOnSameSr = true ;
289+ CloneCheckBox . Enabled = true ;
290+
291+ if ( pageLoad )
292+ CloneCheckBox . Checked = true ;
293+
292294 break ;
293295 }
294296 }
295297 }
296298 }
297299
298- CloneCheckBox . Enabled = createOnSameSr && ! isSnapshot ;
299- CloneCheckBox . Checked = createOnSameSr && ( isSnapshot || pageLoad ) ;
300+ if ( ! CloneCheckBox . Enabled )
301+ CloneCheckBox . Checked = false ;
300302
301303 OnPageUpdated ( ) ;
302304 }
You can’t perform that action at this time.
0 commit comments