VirtualBox

Changeset 91219 in vbox


Ignore:
Timestamp:
Sep 13, 2021 12:06:36 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
146874
Message:

FE/Qt: bugref:10067: A bit of refactoring for UIMessageCenter wizards related stuff.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/globals
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r91216 r91219  
    14141414}
    14151415
    1416 void UIMessageCenter::cannotAcquireHardDiskLocation(const CMedium &comMedium, QWidget *pParent /* = 0 */) const
    1417 {
    1418     /* Show the error: */
    1419     error(pParent, MessageType_Error,
    1420           tr("Failed to acquire hard disk location."), UIErrorString::formatErrorInfo(comMedium));
    1421 }
    1422 
    1423 void UIMessageCenter::cannotDeleteHardDiskStorage(const CMedium &medium, const QString &strLocation, QWidget *pParent /* = 0*/) const
    1424 {
    1425     error(pParent, MessageType_Error,
    1426           tr("Failed to delete the storage unit of the hard disk <b>%1</b>.")
    1427              .arg(strLocation),
    1428           UIErrorString::formatErrorInfo(medium));
    1429 }
    1430 
    1431 void UIMessageCenter::cannotDeleteHardDiskStorage(const CProgress &progress, const QString &strLocation, QWidget *pParent /* = 0*/) const
    1432 {
    1433     error(pParent, MessageType_Error,
    1434           tr("Failed to delete the storage unit of the hard disk <b>%1</b>.")
    1435              .arg(strLocation),
    1436           UIErrorString::formatErrorInfo(progress));
    1437 }
    1438 
    1439 void UIMessageCenter::cannotTakeSnapshot(const CMachine &machine, const QString &strMachineName, QWidget *pParent /* = 0*/) const
    1440 {
    1441     error(pParent, MessageType_Error,
    1442           tr("Failed to create a snapshot of the virtual machine <b>%1</b>.")
    1443              .arg(strMachineName),
    1444           UIErrorString::formatErrorInfo(machine));
    1445 }
    1446 
    1447 void UIMessageCenter::cannotTakeSnapshot(const CProgress &progress, const QString &strMachineName, QWidget *pParent /* = 0*/) const
    1448 {
    1449     error(pParent, MessageType_Error,
    1450           tr("Failed to create a snapshot of the virtual machine <b>%1</b>.")
    1451              .arg(strMachineName),
    1452           UIErrorString::formatErrorInfo(progress));
    1453 }
    1454 
    1455 void UIMessageCenter::cannotFindSnapshotByName(const CMachine &comMachine,
    1456                                                const QString &strName,
    1457                                                QWidget *pParent /* = 0 */) const
    1458 {
    1459     error(pParent, MessageType_Error,
    1460           tr("Can't find snapshot named <b>%1</b>.")
    1461              .arg(strName),
    1462           UIErrorString::formatErrorInfo(comMachine));
    1463 }
    1464 
    14651416void UIMessageCenter::cannotAcquireCloudProviderManager(const CVirtualBox &comVBox, QWidget *pParent /* = 0 */) const
    14661417{
     
    20512002}
    20522003
     2004void UIMessageCenter::cannotAcquireHardDiskLocation(const CMedium &comMedium, QWidget *pParent /* = 0 */) const
     2005{
     2006    /* Show the error: */
     2007    error(pParent, MessageType_Error,
     2008          tr("Failed to acquire hard disk location."), UIErrorString::formatErrorInfo(comMedium));
     2009}
     2010
     2011void UIMessageCenter::cannotDeleteHardDiskStorage(const CMedium &medium, const QString &strLocation, QWidget *pParent /* = 0*/) const
     2012{
     2013    error(pParent, MessageType_Error,
     2014          tr("Failed to delete the storage unit of the hard disk <b>%1</b>.")
     2015             .arg(strLocation),
     2016          UIErrorString::formatErrorInfo(medium));
     2017}
     2018
     2019void UIMessageCenter::cannotDeleteHardDiskStorage(const CProgress &progress, const QString &strLocation, QWidget *pParent /* = 0*/) const
     2020{
     2021    error(pParent, MessageType_Error,
     2022          tr("Failed to delete the storage unit of the hard disk <b>%1</b>.")
     2023             .arg(strLocation),
     2024          UIErrorString::formatErrorInfo(progress));
     2025}
     2026
     2027void UIMessageCenter::cannotTakeSnapshot(const CMachine &machine, const QString &strMachineName, QWidget *pParent /* = 0*/) const
     2028{
     2029    error(pParent, MessageType_Error,
     2030          tr("Failed to create a snapshot of the virtual machine <b>%1</b>.")
     2031             .arg(strMachineName),
     2032          UIErrorString::formatErrorInfo(machine));
     2033}
     2034
     2035void UIMessageCenter::cannotTakeSnapshot(const CProgress &progress, const QString &strMachineName, QWidget *pParent /* = 0*/) const
     2036{
     2037    error(pParent, MessageType_Error,
     2038          tr("Failed to create a snapshot of the virtual machine <b>%1</b>.")
     2039             .arg(strMachineName),
     2040          UIErrorString::formatErrorInfo(progress));
     2041}
     2042
     2043void UIMessageCenter::cannotFindSnapshotByName(const CMachine &comMachine,
     2044                                               const QString &strName,
     2045                                               QWidget *pParent /* = 0 */) const
     2046{
     2047    error(pParent, MessageType_Error,
     2048          tr("Can't find snapshot named <b>%1</b>.")
     2049             .arg(strName),
     2050          UIErrorString::formatErrorInfo(comMachine));
     2051}
     2052
    20532053void UIMessageCenter::cannotCreateMachine(const CVirtualBox &vbox, QWidget *pParent /* = 0*/) const
    20542054{
     
    23382338                              QString() /* cancel button text */,
    23392339                              false /* ok button by default? */);
    2340     else
    2341         return true;
    2342 }
    2343 
    2344 bool UIMessageCenter::confirmOverridingFileIfExists(const QString &strPath, QWidget *pParent /* = 0*/) const
    2345 {
    2346     QFileInfo fi(strPath);
    2347     if (fi.exists())
    2348         return confirmOverridingFile(strPath, pParent);
    2349     else
    2350         return true;
    2351 }
    2352 
    2353 bool UIMessageCenter::confirmOverridingFilesIfExists(const QVector<QString> &strPaths, QWidget *pParent /* = 0*/) const
    2354 {
    2355     QVector<QString> existingFiles;
    2356     foreach(const QString &file, strPaths)
    2357     {
    2358         QFileInfo fi(file);
    2359         if (fi.exists())
    2360             existingFiles << fi.absoluteFilePath();
    2361     }
    2362     /* If it is only one file use the single question versions above: */
    2363     if (existingFiles.size() == 1)
    2364         return confirmOverridingFileIfExists(existingFiles.at(0), pParent);
    2365     else if (existingFiles.size() > 1)
    2366         return confirmOverridingFiles(existingFiles, pParent);
    23672340    else
    23682341        return true;
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r91216 r91219  
    375375    /** @} */
    376376
    377     /** @name VirtualBox Manager / New VM wizard warnings.
    378       * @{ */
    379         void cannotAcquireHardDiskLocation(const CMedium &comMedium, QWidget *pParent = 0) const;
    380         void cannotDeleteHardDiskStorage(const CMedium &medium, const QString &strLocation, QWidget *pParent = 0) const;
    381         void cannotDeleteHardDiskStorage(const CProgress &progress, const QString &strLocation, QWidget *pParent = 0) const;
    382     /** @} */
    383 
    384     /** @name VirtualBox Manager / Clone VM wizard warnings.
    385       * @{ */
    386         void cannotTakeSnapshot(const CMachine &machine, const QString &strMachineName, QWidget *pParent = 0) const;
    387         void cannotTakeSnapshot(const CProgress &progress, const QString &strMachineName, QWidget *pParent = 0) const;
    388         void cannotFindSnapshotByName(const CMachine &comMachine, const QString &strName, QWidget *pParent = 0) const;
    389     /** @} */
    390 
    391377    /** @name VirtualBox Manager / Cloud networking warnings.
    392378      * @{ */
     
    464450    /** @} */
    465451
    466     /* API: Wizards warnings: */
    467     bool confirmHardDisklessMachine(QWidget *pParent = 0) const;
    468     void cannotCreateMachine(const CVirtualBox &vbox, QWidget *pParent = 0) const;
    469     void cannotRegisterMachine(const CVirtualBox &vbox, const QString &strMachineName, QWidget *pParent = 0) const;
    470     void cannotOverwriteHardDiskStorage(const QString &strLocation, QWidget *pParent = 0) const;
    471     void cannotCreateHardDiskStorage(const CVirtualBox &vbox, const QString &strLocation,QWidget *pParent = 0) const;
    472     void cannotCreateHardDiskStorage(const CMedium &medium, const QString &strLocation, QWidget *pParent = 0) const;
    473     void cannotCreateHardDiskStorage(const CProgress &progress, const QString &strLocation, QWidget *pParent = 0) const;
    474     void cannotCreateHardDiskStorageInFAT(const QString &strLocation, QWidget *pParent = 0) const;
    475     void cannotCreateMediumStorage(const CVirtualBox &comVBox, const QString &strLocation, QWidget *pParent = 0) const;
    476     void cannotCreateMediumStorage(const CMedium &comMedium, const QString &strLocation, QWidget *pParent = 0) const;
    477     void cannotCreateMediumStorage(const CProgress &comProgress, const QString &strLocation, QWidget *pParent = 0) const;
    478     void cannotRemoveMachineFolder(const QString &strFolderName, QWidget *pParent = 0) const;
    479     void cannotRewriteMachineFolder(const QString &strFolderName, QWidget *pParent = 0) const;
    480     void cannotCreateMachineFolder(const QString &strFolderName, QWidget *pParent = 0) const;
    481     void cannotCreateAppliance(const CVirtualBox &comVBox, QWidget *pParent = 0) const;
    482     void cannotCreateVirtualSystemDescription(const CAppliance &comAppliance, QWidget *pParent = 0) const;
    483     void cannotAcquireVirtualSystemDescription(const CAppliance &comAppliance, QWidget *pParent = 0) const;
    484     void cannotAddVirtualSystemDescriptionValue(const CVirtualSystemDescription &comDescription, QWidget *pParent = 0) const;
    485     void cannotAcquireVirtualSystemDescriptionFormProperty(const CVirtualSystemDescriptionForm &comForm, QWidget *pParent = 0) const;
    486     void cannotImportAppliance(CAppliance &appliance, QWidget *pParent = 0) const;
    487     void cannotImportAppliance(const CProgress &progress, const QString &strPath, QWidget *pParent = 0) const;
    488     bool cannotCheckFiles(const CAppliance &comAppliance, QWidget *pParent = 0) const;
    489     bool cannotCheckFiles(const CVFSExplorer &comVFSExplorer, QWidget *pParent = 0) const;
    490     bool cannotCheckFiles(const CProgress &comProgress, QWidget *pParent = 0) const;
    491     bool cannotRemoveFiles(const CVFSExplorer &comVFSExplorer, QWidget *pParent = 0) const;
    492     bool cannotRemoveFiles(const CProgress &comProgress, QWidget *pParent = 0) const;
    493     bool confirmExportMachinesInSaveState(const QStringList &machineNames, QWidget *pParent = 0) const;
    494     bool cannotExportAppliance(const CAppliance &comAppliance, QWidget *pParent = 0) const;
    495     void cannotExportAppliance(const CMachine &machine, const QString &strPath, QWidget *pParent = 0) const;
    496     bool cannotExportAppliance(const CProgress &comProgress, const QString &strPath, QWidget *pParent = 0) const;
    497     bool cannotAddDiskEncryptionPassword(const CAppliance &comAppliance, QWidget *pParent = 0);
    498     void cannotRunUnattendedGuestInstall(const CUnattended &comUnattendedInstall, QWidget *pParent = 0);
    499 
    500     /* API: File-dialog warnings: */
    501     bool confirmOverridingFile(const QString &strPath, QWidget *pParent = 0) const;
    502     bool confirmOverridingFiles(const QVector<QString> &strPaths, QWidget *pParent = 0) const;
    503     bool confirmOverridingFileIfExists(const QString &strPath, QWidget *pParent = 0) const;
    504     bool confirmOverridingFilesIfExists(const QVector<QString> &strPaths, QWidget *pParent = 0) const;
     452    /** @name VirtualBox Manager / Wizard warnings.
     453      * @{ */
     454        /// @todo move to notification-center after wizards get theirs.. :)
     455        void cannotAcquireHardDiskLocation(const CMedium &comMedium, QWidget *pParent = 0) const;
     456        void cannotDeleteHardDiskStorage(const CMedium &medium, const QString &strLocation, QWidget *pParent = 0) const;
     457        void cannotDeleteHardDiskStorage(const CProgress &progress, const QString &strLocation, QWidget *pParent = 0) const;
     458        void cannotTakeSnapshot(const CMachine &machine, const QString &strMachineName, QWidget *pParent = 0) const;
     459        void cannotTakeSnapshot(const CProgress &progress, const QString &strMachineName, QWidget *pParent = 0) const;
     460        void cannotFindSnapshotByName(const CMachine &comMachine, const QString &strName, QWidget *pParent = 0) const;
     461        bool confirmHardDisklessMachine(QWidget *pParent = 0) const;
     462        void cannotCreateMachine(const CVirtualBox &vbox, QWidget *pParent = 0) const;
     463        void cannotRegisterMachine(const CVirtualBox &vbox, const QString &strMachineName, QWidget *pParent = 0) const;
     464        void cannotOverwriteHardDiskStorage(const QString &strLocation, QWidget *pParent = 0) const;
     465        void cannotCreateHardDiskStorage(const CVirtualBox &vbox, const QString &strLocation,QWidget *pParent = 0) const;
     466        void cannotCreateHardDiskStorage(const CMedium &medium, const QString &strLocation, QWidget *pParent = 0) const;
     467        void cannotCreateHardDiskStorage(const CProgress &progress, const QString &strLocation, QWidget *pParent = 0) const;
     468        void cannotCreateHardDiskStorageInFAT(const QString &strLocation, QWidget *pParent = 0) const;
     469        void cannotCreateMediumStorage(const CVirtualBox &comVBox, const QString &strLocation, QWidget *pParent = 0) const;
     470        void cannotCreateMediumStorage(const CMedium &comMedium, const QString &strLocation, QWidget *pParent = 0) const;
     471        void cannotCreateMediumStorage(const CProgress &comProgress, const QString &strLocation, QWidget *pParent = 0) const;
     472        void cannotRemoveMachineFolder(const QString &strFolderName, QWidget *pParent = 0) const;
     473        void cannotRewriteMachineFolder(const QString &strFolderName, QWidget *pParent = 0) const;
     474        void cannotCreateMachineFolder(const QString &strFolderName, QWidget *pParent = 0) const;
     475        void cannotCreateAppliance(const CVirtualBox &comVBox, QWidget *pParent = 0) const;
     476        void cannotCreateVirtualSystemDescription(const CAppliance &comAppliance, QWidget *pParent = 0) const;
     477        void cannotAcquireVirtualSystemDescription(const CAppliance &comAppliance, QWidget *pParent = 0) const;
     478        void cannotAddVirtualSystemDescriptionValue(const CVirtualSystemDescription &comDescription, QWidget *pParent = 0) const;
     479        void cannotAcquireVirtualSystemDescriptionFormProperty(const CVirtualSystemDescriptionForm &comForm, QWidget *pParent = 0) const;
     480        void cannotImportAppliance(CAppliance &appliance, QWidget *pParent = 0) const;
     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        bool cannotRemoveFiles(const CVFSExplorer &comVFSExplorer, QWidget *pParent = 0) const;
     486        bool cannotRemoveFiles(const CProgress &comProgress, QWidget *pParent = 0) const;
     487        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        void cannotRunUnattendedGuestInstall(const CUnattended &comUnattendedInstall, QWidget *pParent = 0);
     493        bool confirmOverridingFile(const QString &strPath, QWidget *pParent = 0) const;
     494        bool confirmOverridingFiles(const QVector<QString> &strPaths, QWidget *pParent = 0) const;
     495    /** @} */
    505496
    506497public slots:
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette