VirtualBox

Changeset 92101 in vbox


Ignore:
Timestamp:
Oct 27, 2021 1:00:54 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10067: A bit of cleanup for UIMessageCenter.

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

Legend:

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

    r92089 r92101  
    20022002}
    20032003
    2004 void 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 
    2011 void 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 
    2019 void 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 
    2027 void 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 
    2035 void 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 
    2043 void 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 
    20532004void UIMessageCenter::cannotCreateMachine(const CVirtualBox &vbox, QWidget *pParent /* = 0*/) const
    20542005{
     
    21672118    error(pParent, MessageType_Critical, tr("<p>Cannot create a virtual system description.</p>"),
    21682119          UIErrorString::formatErrorInfo(comAppliance));
    2169 }
    2170 
    2171 void UIMessageCenter::cannotAcquireVirtualSystemDescription(const CAppliance &comAppliance, QWidget *pParent /* = 0 */) const
    2172 {
    2173     error(pParent, MessageType_Critical, tr("<p>Cannot create a virtual system description.</p>"),
    2174           UIErrorString::formatErrorInfo(comAppliance));
    2175 }
    2176 
    2177 void UIMessageCenter::cannotAddVirtualSystemDescriptionValue(const CVirtualSystemDescription &comDescription,
    2178                                                              QWidget *pParent /* = 0 */) const
    2179 {
    2180     error(pParent, MessageType_Critical, tr("<p>Cannot add a virtual system description value.</p>"),
    2181           UIErrorString::formatErrorInfo(comDescription));
    2182 }
    2183 
    2184 void UIMessageCenter::cannotAcquireVirtualSystemDescriptionFormProperty(const CVirtualSystemDescriptionForm &comForm,
    2185                                                                         QWidget *pParent /* = 0 */) const
    2186 {
    2187     error(pParent, MessageType_Critical, tr("<p>Cannot acquire a virtual system description property.</p>"),
    2188           UIErrorString::formatErrorInfo(comForm));
    2189 }
    2190 
    2191 void UIMessageCenter::cannotImportAppliance(CAppliance &appliance, QWidget *pParent /* = 0*/) const
    2192 {
    2193     /* Preserve error-info: */
    2194     QString strErrorInfo = UIErrorString::formatErrorInfo(appliance);
    2195     /* Add the warnings in the case of an early error: */
    2196     QString strWarningInfo;
    2197     foreach(const QString &strWarning, appliance.GetWarnings())
    2198         strWarningInfo += QString("<br />Warning: %1").arg(strWarning);
    2199     if (!strWarningInfo.isEmpty())
    2200         strWarningInfo = "<br />" + strWarningInfo;
    2201     /* Show the error: */
    2202     error(pParent, MessageType_Error,
    2203           tr("Failed to open/interpret appliance <b>%1</b>.")
    2204              .arg(appliance.GetPath()),
    2205           strWarningInfo + strErrorInfo);
    2206 }
    2207 
    2208 void UIMessageCenter::cannotImportAppliance(const CProgress &progress, const QString &strPath, QWidget *pParent /* = 0*/) const
    2209 {
    2210     error(pParent, MessageType_Error,
    2211           tr("Failed to import appliance <b>%1</b>.")
    2212              .arg(strPath),
    2213           UIErrorString::formatErrorInfo(progress));
    2214 }
    2215 
    2216 bool UIMessageCenter::cannotRemoveFiles(const CVFSExplorer &comVFSExplorer, QWidget *pParent /* = 0 */) const
    2217 {
    2218     error(pParent, MessageType_Error,
    2219           tr("Failed to remove file."),
    2220           UIErrorString::formatErrorInfo(comVFSExplorer));
    2221     return false;
    2222 }
    2223 
    2224 bool UIMessageCenter::cannotRemoveFiles(const CProgress &comProgress, QWidget *pParent /* = 0 */) const
    2225 {
    2226     error(pParent, MessageType_Error,
    2227           tr("Failed to remove file."),
    2228           UIErrorString::formatErrorInfo(comProgress));
    2229     return false;
    22302120}
    22312121
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r92089 r92101  
    453453      * @{ */
    454454        /// @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;
    461455        bool confirmHardDisklessMachine(QWidget *pParent = 0) const;
    462456        void cannotCreateMachine(const CVirtualBox &vbox, QWidget *pParent = 0) const;
     
    475469        void cannotCreateAppliance(const CVirtualBox &comVBox, QWidget *pParent = 0) const;
    476470        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 cannotRemoveFiles(const CVFSExplorer &comVFSExplorer, QWidget *pParent = 0) const;
    483         bool cannotRemoveFiles(const CProgress &comProgress, QWidget *pParent = 0) const;
    484471        bool confirmExportMachinesInSaveState(const QStringList &machineNames, QWidget *pParent = 0) const;
    485472        void cannotRunUnattendedGuestInstall(const CUnattended &comUnattendedInstall, QWidget *pParent = 0);
Note: See TracChangeset for help on using the changeset viewer.

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