Changeset 55509 in vbox for trunk/src/VBox
- Timestamp:
- Apr 29, 2015 9:16:18 AM (10 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r55504 r55509 1681 1681 } 1682 1682 1683 void UIMessageCenter::cannotAddDiskEncryptionPassword(const CAppliance &appliance, QWidget *pParent /* = 0 */) 1684 { 1685 error(pParent, MessageType_Error, 1686 tr("Bad password or authentication failure."), 1687 formatErrorInfo(appliance)); 1688 } 1689 1683 1690 void UIMessageCenter::showRuntimeError(const CConsole &console, bool fFatal, const QString &strErrorId, const QString &strErrorMsg) const 1684 1691 { … … 2086 2093 { 2087 2094 error(0, MessageType_Error, 2088 tr(" Unable to enter password!"),2095 tr("Bad password or authentication failure."), 2089 2096 formatErrorInfo(console)); 2090 2097 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r55422 r55509 280 280 void cannotExportAppliance(const CProgress &progress, const QString &strPath, QWidget *pParent = 0) const; 281 281 void cannotFindSnapshotByName(const CMachine &machine, const QString &strMachine, QWidget *pParent = 0) const; 282 void cannotAddDiskEncryptionPassword(const CAppliance &appliance, QWidget *pParent = 0); 282 283 283 284 /* API: Runtime UI warnings: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.cpp
r52816 r55509 32 32 # include "UIWizardExportAppPageBasic4.h" 33 33 # include "UIWizardExportAppPageExpert.h" 34 # include "UIAddDiskEncryptionPasswordDialog.h" 34 35 # include "UIMessageCenter.h" 35 36 … … 132 133 bool UIWizardExportApp::exportVMs(CAppliance &appliance) 133 134 { 135 /* Get the map of the password IDs: */ 136 EncryptedMediumMap encryptedMediums; 137 foreach (const QString &strPasswordId, appliance.GetPasswordIds()) 138 foreach (const QString &strMediumId, appliance.GetMediumIdsForPasswordId(strPasswordId)) 139 encryptedMediums.insert(strPasswordId, strMediumId); 140 141 /* Ask for the disk encryption passwords if necessary: */ 142 if (!encryptedMediums.isEmpty()) 143 { 144 /* Create corresponding dialog: */ 145 QPointer<UIAddDiskEncryptionPasswordDialog> pDlg = 146 new UIAddDiskEncryptionPasswordDialog(this, 147 window()->windowTitle(), 148 encryptedMediums); 149 150 /* Execute the dialog: */ 151 if (pDlg->exec() == QDialog::Accepted) 152 { 153 /* Acquire the passwords provided: */ 154 const EncryptionPasswordMap encryptionPasswords = pDlg->encryptionPasswords(); 155 156 /* Delete the dialog: */ 157 delete pDlg; 158 159 /* Make sure the passwords were really provided: */ 160 AssertReturn(!encryptionPasswords.isEmpty(), false); 161 162 /* Provide appliance with passwords if possible: */ 163 appliance.AddPasswords(encryptionPasswords.keys().toVector(), 164 encryptionPasswords.values().toVector()); 165 if (!appliance.isOk()) 166 { 167 /* Warn the user about failure: */ 168 msgCenter().cannotAddDiskEncryptionPassword(appliance); 169 170 return false; 171 } 172 } 173 else 174 { 175 /* Any modal dialog can be destroyed in own event-loop 176 * as a part of application termination procedure.. 177 * We have to check if the dialog still valid. */ 178 if (pDlg) 179 { 180 /* Delete the dialog: */ 181 delete pDlg; 182 } 183 184 return false; 185 } 186 } 187 134 188 /* Write the appliance: */ 135 189 QVector<KExportOptions> options;
Note:
See TracChangeset
for help on using the changeset viewer.