- Timestamp:
- Oct 26, 2021 5:02:00 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r91359 r92089 2214 2214 } 2215 2215 2216 bool UIMessageCenter::cannotCheckFiles(const CAppliance &comAppliance, QWidget *pParent /* = 0 */) const2217 {2218 error(pParent, MessageType_Error,2219 tr("Failed to check files."),2220 UIErrorString::formatErrorInfo(comAppliance));2221 return false;2222 }2223 2224 bool UIMessageCenter::cannotCheckFiles(const CVFSExplorer &comVFSExplorer, QWidget *pParent /* = 0 */) const2225 {2226 error(pParent, MessageType_Error,2227 tr("Failed to check files."),2228 UIErrorString::formatErrorInfo(comVFSExplorer));2229 return false;2230 }2231 2232 bool UIMessageCenter::cannotCheckFiles(const CProgress &comProgress, QWidget *pParent /* = 0 */) const2233 {2234 error(pParent, MessageType_Error,2235 tr("Failed to check files."),2236 UIErrorString::formatErrorInfo(comProgress));2237 return false;2238 }2239 2240 2216 bool UIMessageCenter::cannotRemoveFiles(const CVFSExplorer &comVFSExplorer, QWidget *pParent /* = 0 */) const 2241 2217 { … … 2266 2242 0 /* auto-confirm id */, 2267 2243 tr("Continue")); 2268 }2269 2270 bool UIMessageCenter::cannotExportAppliance(const CAppliance &comAppliance, QWidget *pParent /* = 0 */) const2271 {2272 error(pParent, MessageType_Error,2273 tr("Failed to prepare the export of the appliance <b>%1</b>.")2274 .arg(CAppliance(comAppliance).GetPath()),2275 UIErrorString::formatErrorInfo(comAppliance));2276 return false;2277 }2278 2279 void UIMessageCenter::cannotExportAppliance(const CMachine &machine, const QString &strPath, QWidget *pParent /* = 0 */) const2280 {2281 error(pParent, MessageType_Error,2282 tr("Failed to prepare the export of the appliance <b>%1</b>.")2283 .arg(strPath),2284 UIErrorString::formatErrorInfo(machine));2285 }2286 2287 bool UIMessageCenter::cannotExportAppliance(const CProgress &comProgress, const QString &strPath, QWidget *pParent /* = 0 */) const2288 {2289 error(pParent, MessageType_Error,2290 tr("Failed to export appliance <b>%1</b>.")2291 .arg(strPath),2292 UIErrorString::formatErrorInfo(comProgress));2293 return false;2294 }2295 2296 bool UIMessageCenter::cannotAddDiskEncryptionPassword(const CAppliance &comAppliance, QWidget *pParent /* = 0 */)2297 {2298 error(pParent, MessageType_Error,2299 tr("Bad password or authentication failure."),2300 UIErrorString::formatErrorInfo(comAppliance));2301 return false;2302 2244 } 2303 2245 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r91219 r92089 480 480 void cannotImportAppliance(CAppliance &appliance, QWidget *pParent = 0) const; 481 481 void cannotImportAppliance(const CProgress &progress, const QString &strPath, QWidget *pParent = 0) const; 482 bool cannotCheckFiles(const CAppliance &comAppliance, QWidget *pParent = 0) const;483 bool cannotCheckFiles(const CVFSExplorer &comVFSExplorer, QWidget *pParent = 0) const;484 bool cannotCheckFiles(const CProgress &comProgress, QWidget *pParent = 0) const;485 482 bool cannotRemoveFiles(const CVFSExplorer &comVFSExplorer, QWidget *pParent = 0) const; 486 483 bool cannotRemoveFiles(const CProgress &comProgress, QWidget *pParent = 0) const; 487 484 bool confirmExportMachinesInSaveState(const QStringList &machineNames, QWidget *pParent = 0) const; 488 bool cannotExportAppliance(const CAppliance &comAppliance, QWidget *pParent = 0) const;489 void cannotExportAppliance(const CMachine &machine, const QString &strPath, QWidget *pParent = 0) const;490 bool cannotExportAppliance(const CProgress &comProgress, const QString &strPath, QWidget *pParent = 0) const;491 bool cannotAddDiskEncryptionPassword(const CAppliance &comAppliance, QWidget *pParent = 0);492 485 void cannotRunUnattendedGuestInstall(const CUnattended &comUnattendedInstall, QWidget *pParent = 0); 493 486 bool confirmOverridingFile(const QString &strPath, QWidget *pParent = 0) const; -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r92086 r92089 631 631 /* static */ 632 632 void UINotificationMessage::cannotAcquireVirtualSystemDescriptionFormParameter(const CVirtualSystemDescriptionForm &comVsdForm, 633 UINotificationCenter *pParent )633 UINotificationCenter *pParent /* = 0 */) 634 634 { 635 635 createMessage( … … 725 725 /* static */ 726 726 void UINotificationMessage::cannotChangeVirtualSystemDescriptionParameter(const CVirtualSystemDescription &comVsd, 727 UINotificationCenter *pParent )727 UINotificationCenter *pParent /* = 0 */) 728 728 { 729 729 createMessage( … … 797 797 798 798 /* static */ 799 void UINotificationMessage::cannotCreateAppliance(const CVirtualBox &comVBox, 800 UINotificationCenter *pParent /* = 0 */) 801 { 802 createMessage( 803 QApplication::translate("UIMessageCenter", "Can't create appliance ..."), 804 QApplication::translate("UIMessageCenter", "Failed to create appliance.") + 805 UIErrorString::formatErrorInfo(comVBox), 806 QString(), QString(), pParent); 807 } 808 809 /* static */ 810 void UINotificationMessage::cannotFindMachineById(const CVirtualBox &comVBox, 811 const QUuid &uMachineId, 812 UINotificationCenter *pParent /* = 0 */) 813 { 814 createMessage( 815 QApplication::translate("UIMessageCenter", "Can't find machine ..."), 816 QApplication::translate("UIMessageCenter", "Failed to find the machine with following ID: <nobr><b>%1</b></nobr>.") 817 .arg(uMachineId.toString()) + 818 UIErrorString::formatErrorInfo(comVBox), 819 QString(), QString(), pParent); 820 } 821 822 /* static */ 799 823 void UINotificationMessage::cannotOpenKnownMedium(const CVirtualBox &comVBox, const QUuid &uMediumId) 800 824 { … … 826 850 827 851 /* static */ 852 void UINotificationMessage::cannotCreateVfsExplorer(const CAppliance &comAppliance, UINotificationCenter *pParent /* = 0 */) 853 { 854 createMessage( 855 QApplication::translate("UIMessageCenter", "Can't create VFS explorer ..."), 856 QApplication::translate("UIMessageCenter", "Failed to create VFS explorer to check files.") + 857 UIErrorString::formatErrorInfo(comAppliance), 858 QString(), QString(), pParent); 859 } 860 861 /* static */ 862 void UINotificationMessage::cannotAddDiskEncryptionPassword(const CAppliance &comAppliance, UINotificationCenter *pParent /* = 0 */) 863 { 864 createMessage( 865 QApplication::translate("UIMessageCenter", "Bad password ..."), 866 QApplication::translate("UIMessageCenter", "Bad password or authentication failure.") + 867 UIErrorString::formatErrorInfo(comAppliance), 868 QString(), QString(), pParent); 869 } 870 871 /* static */ 828 872 void UINotificationMessage::cannotOpenExtPack(const CExtPackManager &comExtPackManager, const QString &strFilename) 829 873 { … … 985 1029 QApplication::translate("UIMessageCenter", "Can't remove machine ..."), 986 1030 QApplication::translate("UIMessageCenter", "Failed to remove the virtual machine <b>%1</b>.") 1031 .arg(CMachine(comMachine).GetName()) + 1032 UIErrorString::formatErrorInfo(comMachine), 1033 QString(), QString(), pParent); 1034 } 1035 1036 /* static */ 1037 void UINotificationMessage::cannotExportMachine(const CMachine &comMachine, UINotificationCenter *pParent /* = 0 */) 1038 { 1039 createMessage( 1040 QApplication::translate("UIMessageCenter", "Can't export machine ..."), 1041 QApplication::translate("UIMessageCenter", "Failed to export virtual machine <b>%1</b>.") 987 1042 .arg(CMachine(comMachine).GetName()) + 988 1043 UIErrorString::formatErrorInfo(comMachine), -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r92086 r92089 266 266 * @param comVsdForm Brings the object parameter get acquired from. */ 267 267 static void cannotAcquireVirtualSystemDescriptionFormParameter(const CVirtualSystemDescriptionForm &comVsdForm, 268 UINotificationCenter *pParent );268 UINotificationCenter *pParent = 0); 269 269 270 270 /** Notifies about inability to change IMedium parameter. … … 298 298 * @param comVsd Brings the object parameter being changed for. */ 299 299 static void cannotChangeVirtualSystemDescriptionParameter(const CVirtualSystemDescription &comVsd, 300 UINotificationCenter *pParent );300 UINotificationCenter *pParent = 0); 301 301 302 302 /** Notifies about inability to enumerate host USB devices. … … 321 321 /** @name COM VirtualBox Manager warnings. 322 322 * @{ */ 323 /** Notifies about inability to create appliance. 324 * @param comVBox Brings common VBox object trying to create appliance. */ 325 static void cannotCreateAppliance(const CVirtualBox &comVBox, UINotificationCenter *pParent = 0); 326 /** Notifies about inability to find machine by ID. 327 * @param comVBox Brings common VBox object trying to find machine. 328 * @param uMachineId Brings the machine ID. */ 329 static void cannotFindMachineById(const CVirtualBox &comVBox, 330 const QUuid &uMachineId, 331 UINotificationCenter *pParent = 0); 323 332 /** Notifies about inability to open known medium. 324 333 * @param comVBox Brings common VBox object trying to open medium. … … 332 341 * @param comVBox Brings common VBox object trying to open machine. */ 333 342 static void cannotGetExtensionPackManager(const CVirtualBox &comVBox); 343 344 /** Notifies about inability to create VFS explorer. 345 * @param comAppliance Brings appliance trying to create VFS explorer. */ 346 static void cannotCreateVfsExplorer(const CAppliance &comAppliance, UINotificationCenter *pParent = 0); 347 /** Notifies about inability to add disk scryption password. 348 * @param comAppliance Brings appliance trying to add disk scryption password. */ 349 static void cannotAddDiskEncryptionPassword(const CAppliance &comAppliance, UINotificationCenter *pParent = 0); 334 350 335 351 /** Notifies about inability to open extension pack. … … 395 411 * @param comMachine Brings machine being removed. */ 396 412 static void cannotRemoveMachine(const CMachine &comMachine, UINotificationCenter *pParent = 0); 413 /** Notifies about inability to export appliance. 414 * @param comMachine Brings machine trying to export appliance. */ 415 static void cannotExportMachine(const CMachine &comMachine, UINotificationCenter *pParent = 0); 397 416 398 417 /** Notifies about inability to find snapshot by ID. -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.cpp
r92024 r92089 144 144 CVFSExplorer comExplorer = comAppliance.CreateVFSExplorer(uri(false /* fWithFile */)); 145 145 if (!comAppliance.isOk()) 146 return msgCenter().cannotCheckFiles(comAppliance, this); 146 { 147 UINotificationMessage::cannotCreateVfsExplorer(comAppliance, notificationCenter()); 148 return false; 149 } 147 150 148 151 /* Update VFS explorer: */ … … 287 290 if (!comAppliance.isOk()) 288 291 { 289 msgCenter().cannotAddDiskEncryptionPassword(comAppliance);292 UINotificationMessage::cannotAddDiskEncryptionPassword(comAppliance, notificationCenter()); 290 293 return false; 291 294 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp
r91707 r92089 40 40 #include "UIIconPool.h" 41 41 #include "UIMessageCenter.h" 42 #include "UINotificationCenter.h" 42 43 #include "UIToolBox.h" 43 44 #include "UIVirtualBoxEventHandler.h" … … 604 605 fResult = comForm.isOk(); 605 606 if (!fResult) 606 msgCenter().cannotAcquireVirtualSystemDescriptionFormProperty(comForm);607 UINotificationMessage::cannotAcquireVirtualSystemDescriptionFormParameter(comForm, wizard()->notificationCenter()); 607 608 } 608 609 … … 790 791 /* Create appliance: */ 791 792 CAppliance comAppliance; 792 refreshLocalStuff(comAppliance, wizard() ->machineIDs(), wizard()->uri());793 refreshLocalStuff(comAppliance, wizard(), wizard()->machineIDs(), wizard()->uri()); 793 794 wizard()->setLocalAppliance(comAppliance); 794 795 } … … 805 806 comDescription, 806 807 comForm, 808 wizard(), 807 809 m_comCloudProfile, 808 810 wizard()->machineIDs(), -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageFormat.cpp
r91707 r92089 34 34 #include "UIEmptyFilePathSelector.h" 35 35 #include "UIIconPool.h" 36 #include "UI MessageCenter.h"36 #include "UINotificationCenter.h" 37 37 #include "UIVirtualBoxEventHandler.h" 38 38 #include "UIVirtualBoxManager.h" … … 325 325 326 326 void UIWizardExportAppFormat::refreshLocalStuff(CAppliance &comLocalAppliance, 327 UIWizardExportApp *pWizard, 327 328 const QList<QUuid> &machineIDs, 328 329 const QString &strUri) … … 335 336 CAppliance comAppliance = comVBox.CreateAppliance(); 336 337 if (!comVBox.isOk()) 337 { 338 msgCenter().cannotCreateAppliance(comVBox); 339 return; 340 } 338 return UINotificationMessage::cannotCreateAppliance(comVBox, pWizard->notificationCenter()); 341 339 342 340 /* Remember appliance: */ … … 350 348 CMachine comMachine = comVBox.FindMachine(uMachineId.toString()); 351 349 if (!comVBox.isOk()) 352 return msgCenter().cannotFindMachineById(comVBox, uMachineId);350 return UINotificationMessage::cannotFindMachineById(comVBox, uMachineId, pWizard->notificationCenter()); 353 351 /* Add the export description to our appliance object: */ 354 352 CVirtualSystemDescription comVsd = comMachine.ExportTo(comLocalAppliance, strUri); 355 353 if (!comMachine.isOk()) 356 return msgCenter().cannotExportAppliance(comMachine, comLocalAppliance.GetPath());354 return UINotificationMessage::cannotExportMachine(comMachine, pWizard->notificationCenter()); 357 355 /* Add some additional fields the user may change: */ 358 356 comVsd.AddDescription(KVirtualSystemDescriptionType_Product, "", ""); … … 478 476 CVirtualSystemDescription &comCloudVsd, 479 477 CVirtualSystemDescriptionForm &comCloudVsdExportForm, 478 UIWizardExportApp *pWizard, 480 479 const CCloudProfile &comCloudProfile, 481 480 const QList<QUuid> &machineIDs, … … 502 501 CMachine comMachine = comVBox.FindMachine(uMachineId.toString()); 503 502 if (!comVBox.isOk()) 504 { 505 msgCenter().cannotFindMachineById(comVBox, uMachineId); 506 return; 507 } 503 return UINotificationMessage::cannotFindMachineById(comVBox, uMachineId, pWizard->notificationCenter()); 508 504 509 505 /* Create appliance: */ 510 506 CAppliance comAppliance = comVBox.CreateAppliance(); 511 507 if (!comVBox.isOk()) 512 { 513 msgCenter().cannotCreateAppliance(comVBox); 514 return; 515 } 508 return UINotificationMessage::cannotCreateAppliance(comVBox, pWizard->notificationCenter()); 516 509 517 510 /* Remember appliance: */ … … 521 514 CVirtualSystemDescription comVsd = comMachine.ExportTo(comCloudAppliance, strUri); 522 515 if (!comMachine.isOk()) 523 { 524 msgCenter().cannotExportAppliance(comMachine, comCloudAppliance.GetPath()); 525 return; 526 } 516 return UINotificationMessage::cannotExportMachine(comMachine, pWizard->notificationCenter()); 527 517 528 518 /* Remember description: */ … … 541 531 } 542 532 if (!comCloudVsd.isOk()) 543 { 544 msgCenter().cannotAddVirtualSystemDescriptionValue(comCloudVsd); 545 return; 546 } 533 return UINotificationMessage::cannotChangeVirtualSystemDescriptionParameter(comCloudVsd, pWizard->notificationCenter()); 547 534 548 535 /* Create Cloud Client: */ … … 1156 1143 /* Create appliance: */ 1157 1144 CAppliance comAppliance; 1158 refreshLocalStuff(comAppliance, wizard() ->machineIDs(), wizard()->uri());1145 refreshLocalStuff(comAppliance, wizard(), wizard()->machineIDs(), wizard()->uri()); 1159 1146 wizard()->setLocalAppliance(comAppliance); 1160 1147 } … … 1171 1158 comDescription, 1172 1159 comForm, 1160 wizard(), 1173 1161 m_comCloudProfile, 1174 1162 wizard()->machineIDs(), -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageFormat.h
r91707 r92089 99 99 /** Refresh local stuff. */ 100 100 void refreshLocalStuff(CAppliance &comLocalAppliance, 101 UIWizardExportApp *pWizard, 101 102 const QList<QUuid> &machineIDs, 102 103 const QString &strUri); … … 119 120 CVirtualSystemDescription &comCloudVsd, 120 121 CVirtualSystemDescriptionForm &comCloudVsdExportForm, 122 UIWizardExportApp *pWizard, 121 123 const CCloudProfile &comCloudProfile, 122 124 const QList<QUuid> &machineIDs, -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageSettings.cpp
r91707 r92089 26 26 #include "UICommon.h" 27 27 #include "UIFormEditorWidget.h" 28 #include "UI MessageCenter.h"28 #include "UINotificationCenter.h" 29 29 #include "UIWizardExportApp.h" 30 30 #include "UIWizardExportAppPageSettings.h" … … 223 223 fResult = comForm.isOk(); 224 224 if (!fResult) 225 msgCenter().cannotAcquireVirtualSystemDescriptionFormProperty(comForm);225 UINotificationMessage::cannotAcquireVirtualSystemDescriptionFormParameter(comForm, wizard()->notificationCenter()); 226 226 } 227 227
Note:
See TracChangeset
for help on using the changeset viewer.