Changeset 55093 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Apr 2, 2015 3:50:21 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 99388
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r55015 r55093 2440 2440 if (!encryptedMediums.isEmpty()) 2441 2441 { 2442 /* Create corresponding dialog: */2442 /* Create the dialog for acquiring encryption passwords: */ 2443 2443 QWidget *pDlgParent = windowManager().realParentWindow(activeMachineWindow()); 2444 2444 QPointer<UIAddDiskEncryptionPasswordDialog> pDlg = … … 2446 2446 machineName(), 2447 2447 encryptedMediums); 2448 /* Execute it and acquire the result: */2448 /* Execute the dialog: */ 2449 2449 if (pDlg->exec() == QDialog::Accepted) 2450 { 2451 /* Acquire the passwords provided: */ 2450 2452 encryptionPasswords = pDlg->encryptionPasswords(); 2451 /* Delete dialog if still valid: */ 2452 if (pDlg)2453 2454 /* Delete the dialog: */ 2453 2455 delete pDlg; 2454 } 2455 2456 /* Add the disk encryption passwords if necessary: */ 2457 if (!encryptionPasswords.isEmpty()) 2458 { 2459 foreach (const QString &strKey, encryptionPasswords.keys()) 2456 2457 /* Make sure the passwords were really provided: */ 2458 AssertReturnVoid(!encryptionPasswords.isEmpty()); 2459 2460 /* Apply the disk encryption passwords: */ 2461 foreach (const QString &strKey, encryptionPasswords.keys()) 2462 { 2463 console().AddDiskEncryptionPassword(strKey, encryptionPasswords.value(strKey), false); 2464 if (!console().isOk()) 2465 msgCenter().cannotAddDiskEncryptionPassword(console()); 2466 } 2467 } 2468 else 2460 2469 { 2461 console().AddDiskEncryptionPassword(strKey, encryptionPasswords.value(strKey), false); 2462 if (!console().isOk()) 2463 msgCenter().cannotAddDiskEncryptionPassword(console()); 2470 /* Any modal dialog can be destroyed in own event-loop 2471 * as a part of VM power-off procedure which closes GUI. 2472 * So we have to check if the dialog still valid.. */ 2473 2474 /* If dialog still valid: */ 2475 if (pDlg) 2476 { 2477 /* Delete the dialog: */ 2478 delete pDlg; 2479 2480 /* Propose the user to close VM: */ 2481 QMetaObject::invokeMethod(this, "sltClose", Qt::QueuedConnection); 2482 } 2464 2483 } 2465 2484 }
Note:
See TracChangeset
for help on using the changeset viewer.