VirtualBox

Changeset 34736 in vbox


Ignore:
Timestamp:
Dec 6, 2010 11:19:30 AM (14 years ago)
Author:
vboxsync
Message:

FE/Qt: Problem-reporter cleanup.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
4 edited

Legend:

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

    r34728 r34736  
    12181218                        CStorageController controller = machine.GetStorageControllerByName (attachment.GetController());
    12191219                        vboxProblem().cannotDetachDevice (this, machine, VBoxDefs::MediumType_HardDisk, aMedium.location(),
    1220                                                           controller.GetBus(), attachment.GetPort(), attachment.GetDevice());
     1220                                                          StorageSlot(controller.GetBus(), attachment.GetPort(), attachment.GetDevice()));
    12211221                        success = false;
    12221222                        break;
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.cpp

    r34543 r34736  
    1818 */
    1919
     20/* Global includes */
     21#include <QDir>
     22#include <QDesktopWidget>
     23#include <QFileInfo>
     24#include <QThread>
     25#ifdef Q_WS_MAC
     26# include <QPushButton>
     27#endif
     28
     29#include <iprt/err.h>
     30#include <iprt/param.h>
     31#include <iprt/path.h>
     32
     33/* Local includes */
    2034#include "VBoxProblemReporter.h"
    21 
    2235#include "VBoxGlobal.h"
    2336#include "VBoxSelectorWnd.h"
     
    2538#include "UIDownloaderUserManual.h"
    2639#include "UIMachine.h"
    27 
    2840#include "VBoxAboutDlg.h"
    29 
    3041#include "QIHotKeyEdit.h"
    31 
    3242#ifdef Q_WS_MAC
    3343# include "VBoxUtils-darwin.h"
    3444#endif
    3545
    36 /* Qt includes */
    37 #include <QDir>
    38 #include <QDesktopWidget>
    39 #include <QFileInfo>
    40 #ifdef Q_WS_MAC
    41 # include <QPushButton>
    42 #endif
    43 
    44 #include <iprt/err.h>
    45 #include <iprt/param.h>
    46 #include <iprt/path.h>
    47 
    4846#if defined (Q_WS_WIN32)
    4947#include <Htmlhelp.h>
    5048#endif
    51 
    52 ////////////////////////////////////////////////////////////////////////////////
    53 // VBoxProblemReporter class
    54 ////////////////////////////////////////////////////////////////////////////////
    55 
    56 /**
    57  *  Returns a reference to the global VirtualBox problem reporter instance.
    58  */
    59 VBoxProblemReporter &VBoxProblemReporter::instance()
    60 {
    61     static VBoxProblemReporter vboxProblem_instance;
    62     return vboxProblem_instance;
    63 }
    64 
    65 bool VBoxProblemReporter::isValid() const
    66 {
    67     return qApp != 0;
    68 }
    69 
    70 // Helpers
    71 /////////////////////////////////////////////////////////////////////////////
    7249
    7350bool VBoxProblemReporter::isAnyWarningShown()
     
    345322}
    346323
    347 // Generic Problem handlers
    348 /////////////////////////////////////////////////////////////////////////////
    349 
    350324bool VBoxProblemReporter::askForOverridingFile (const QString& aPath, QWidget *aParent /* = NULL */) const
    351325{
     
    389363    else
    390364        return true;
    391 }
    392 
    393 void VBoxProblemReporter::cannotDeleteFile (const QString& path, QWidget *aParent /* = NULL */) const
    394 {
    395     message (aParent, Error,
    396              tr ("Failed to remove the file <b>%1</b>.<br /><br />Please try to remove the file yourself and try again.")
    397              .arg (path));
    398365}
    399366
     
    424391}
    425392
    426 // Special Problem handlers
    427 /////////////////////////////////////////////////////////////////////////////
    428 
    429393void VBoxProblemReporter::showBETAWarning()
    430394{
     
    471435             "can properly handle URLs of this type.")
    472436         .arg (aURL));
    473 }
    474 
    475 void VBoxProblemReporter::
    476 cannotCopyFile (const QString &aSrc, const QString &aDst, int aVRC)
    477 {
    478     PCRTSTATUSMSG msg = RTErrGet (aVRC);
    479     Assert (msg);
    480 
    481     QString err = QString ("%1: %2").arg (msg->pszDefine, msg->pszMsgShort);
    482     if (err.endsWith ("."))
    483         err.truncate (err.length() - 1);
    484 
    485     message (mainWindowShown(), VBoxProblemReporter::Error,
    486         tr ("Failed to copy file <b><nobr>%1</nobr></b> to "
    487              "<b><nobr>%2</nobr></b> (%3).")
    488              .arg (aSrc, aDst, err));
    489437}
    490438
     
    531479            "<p>The application will now terminate.</p>"),
    532480        formatErrorInfo (vbox));
    533 }
    534 
    535 void VBoxProblemReporter::cannotSaveGlobalSettings (const CVirtualBox &vbox,
    536                                                     QWidget *parent /* = 0 */)
    537 {
    538     /* preserve the current error info before calling the object again */
    539     COMResult res (vbox);
    540 
    541     message (parent ? parent : mainWindowShown(), Error,
    542              tr ("<p>Failed to save the global VirtualBox settings to "
    543                  "<b><nobr>%1</nobr></b>.</p>")
    544                  .arg (vbox.GetSettingsFilePath()),
    545              formatErrorInfo (res));
    546481}
    547482
     
    903838            0 /* aAutoConfirmId */,
    904839            tr ("Close VM"), tr ("Continue"));
    905 }
    906 
    907 void VBoxProblemReporter::cannotSetSnapshotFolder (const CMachine &aMachine,
    908                                                    const QString &aPath)
    909 {
    910     message (
    911         mainWindowShown(),
    912         Error,
    913         tr ("Failed to change the snapshot folder path of the "
    914             "virtual machine <b>%1<b> to <nobr><b>%2</b></nobr>.")
    915             .arg (aMachine.GetName())
    916             .arg (aPath),
    917         formatErrorInfo (aMachine));
    918840}
    919841
     
    12661188}
    12671189
    1268 int VBoxProblemReporter::confirmDetachAddControllerSlots (QWidget *aParent) const
    1269 {
    1270     return messageOkCancel (aParent, Question,
    1271         tr ("<p>There are hard disks attached to ports of the additional controller. "
    1272             "If you disable the additional controller, all these hard disks "
    1273             "will be automatically detached.</p>"
    1274             "<p>Are you sure you want to "
    1275             "disable the additional controller?</p>"),
    1276         0 /* aAutoConfirmId */,
    1277         tr ("Disable", "hard disk"));
    1278 }
    1279 
    1280 int VBoxProblemReporter::confirmChangeAddControllerSlots (QWidget *aParent) const
    1281 {
    1282     return messageOkCancel (aParent, Question,
    1283         tr ("<p>There are hard disks attached to ports of the additional controller. "
    1284             "If you change the additional controller, all these hard disks "
    1285             "will be automatically detached.</p>"
    1286             "<p>Are you sure you want to "
    1287             "change the additional controller?</p>"),
    1288         0 /* aAutoConfirmId */,
    1289         tr ("Change", "hard disk"));
    1290 }
    1291 
    12921190int VBoxProblemReporter::askAboutHardDiskAttachmentCreation(QWidget *pParent,
    12931191                                                            const QString &strControllerName)
     
    13601258}
    13611259
    1362 void VBoxProblemReporter::cannotAttachDevice (QWidget *aParent, const CMachine &aMachine,
    1363                                               VBoxDefs::MediumType aType, const QString &aLocation,
    1364                                               KStorageBus aBus, LONG aChannel, LONG aDevice)
    1365 {
    1366     QString what (deviceToAccusative (aType));
    1367     if (!aLocation.isNull())
    1368         what += QString (" (<nobr><b>%1</b></nobr>)").arg (aLocation);
    1369 
    1370     message (aParent, Error,
    1371              tr ("Failed to attach the %1 to slot <i>%2</i> of the machine <b>%3</b>.")
    1372                  .arg (what)
    1373                  .arg (vboxGlobal().toString (StorageSlot (aBus, aChannel, aDevice)))
    1374                  .arg (CMachine (aMachine).GetName()),
    1375              formatErrorInfo (aMachine));
    1376 }
    1377 
    1378 void VBoxProblemReporter::cannotDetachDevice (QWidget *aParent, const CMachine &aMachine,
    1379                                               VBoxDefs::MediumType aType, const QString &aLocation,
    1380                                               KStorageBus aBus, LONG aChannel, LONG aDevice)
    1381 {
    1382     QString what (deviceToAccusative (aType));
    1383     if (!aLocation.isNull())
    1384         what += QString (" (<nobr><b>%1</b></nobr>)").arg (aLocation);
    1385 
    1386     message (aParent, Error,
    1387              tr ("Failed to detach the %1 from slot <i>%2</i> of the machine <b>%3</b>.")
    1388                  .arg (what)
    1389                  .arg (vboxGlobal().toString (StorageSlot (aBus, aChannel, aDevice)))
    1390                  .arg (CMachine (aMachine).GetName()),
    1391              formatErrorInfo (aMachine));
     1260void VBoxProblemReporter::cannotAttachDevice(QWidget *pParent, const CMachine &machine,
     1261                                             VBoxDefs::MediumType type, const QString &strLocation, const StorageSlot &storageSlot)
     1262{
     1263    QString strMessage;
     1264    switch (type)
     1265    {
     1266        case VBoxDefs::MediumType_HardDisk:
     1267        {
     1268            strMessage = tr("Failed to attach the hard disk (<nobr><b>%1</b></nobr>) to the slot <i>%2</i> of the machine <b>%3</b>.")
     1269                           .arg(strLocation).arg(vboxGlobal().toString(storageSlot)).arg(CMachine(machine).GetName());
     1270            break;
     1271        }
     1272        case VBoxDefs::MediumType_DVD:
     1273        {
     1274            strMessage = tr("Failed to attach the CD/DVD device (<nobr><b>%1</b></nobr>) to the slot <i>%2</i> of the machine <b>%3</b>.")
     1275                           .arg(strLocation).arg(vboxGlobal().toString(storageSlot)).arg(CMachine(machine).GetName());
     1276            break;
     1277        }
     1278        case VBoxDefs::MediumType_Floppy:
     1279        {
     1280            strMessage = tr("Failed to attach the floppy device (<nobr><b>%1</b></nobr>) to the slot <i>%2</i> of the machine <b>%3</b>.")
     1281                           .arg(strLocation).arg(vboxGlobal().toString(storageSlot)).arg(CMachine(machine).GetName());
     1282            break;
     1283        }
     1284        default:
     1285            break;
     1286    }
     1287    message(pParent ? pParent : mainWindowShown(), Error, strMessage, formatErrorInfo(machine));
     1288}
     1289
     1290void VBoxProblemReporter::cannotDetachDevice(QWidget *pParent, const CMachine &machine,
     1291                                             VBoxDefs::MediumType type, const QString &strLocation, const StorageSlot &storageSlot)
     1292{
     1293    QString strMessage;
     1294    switch (type)
     1295    {
     1296        case VBoxDefs::MediumType_HardDisk:
     1297        {
     1298            strMessage = tr("Failed to detach the hard disk (<nobr><b>%1</b></nobr>) from the slot <i>%2</i> of the machine <b>%3</b>.")
     1299                           .arg(strLocation).arg(vboxGlobal().toString(storageSlot)).arg(CMachine(machine).GetName());
     1300            break;
     1301        }
     1302        case VBoxDefs::MediumType_DVD:
     1303        {
     1304            strMessage = tr("Failed to detach the CD/DVD device (<nobr><b>%1</b></nobr>) from the slot <i>%2</i> of the machine <b>%3</b>.")
     1305                           .arg(strLocation).arg(vboxGlobal().toString(storageSlot)).arg(CMachine(machine).GetName());
     1306            break;
     1307        }
     1308        case VBoxDefs::MediumType_Floppy:
     1309        {
     1310            strMessage = tr("Failed to detach the floppy device (<nobr><b>%1</b></nobr>) from the slot <i>%2</i> of the machine <b>%3</b>.")
     1311                           .arg(strLocation).arg(vboxGlobal().toString(storageSlot)).arg(CMachine(machine).GetName());
     1312            break;
     1313        }
     1314        default:
     1315            break;
     1316    }
     1317    message(pParent ? pParent : mainWindowShown(), Error, strMessage, formatErrorInfo(machine));
    13921318}
    13931319
     
    14511377            .arg (aMedium.location()),
    14521378        formatErrorInfo (aResult));
    1453 }
    1454 
    1455 void VBoxProblemReporter::cannotEjectDrive()
    1456 {
    1457     message (mainWindowShown(), Warning,
    1458              tr ("Failed to eject the disk from the virtual drive. "
    1459                  "The drive may be locked by the guest operating system. "
    1460                  "Please check this and try again."));
    14611379}
    14621380
     
    17521670        0, /* aAutoConfirmId */
    17531671        tr ("Mount", "additions"));
    1754 }
    1755 
    1756 void VBoxProblemReporter::warnAboutTooOldAdditions (QWidget *aParent,
    1757                                                     const QString &aInstalledVer,
    1758                                                     const QString &aExpectedVer)
    1759 {
    1760     message (aParent ? aParent : mainMachineWindowShown(), VBoxProblemReporter::Error,
    1761         tr ("<p>The VirtualBox Guest Additions installed in the Guest OS are too "
    1762             "old: the installed version is %1, the expected version is %2. "
    1763             "Some features that require Guest Additions (mouse integration, "
    1764             "guest display auto-resize) will most likely stop "
    1765             "working properly.</p>"
    1766             "<p>Please update the Guest Additions to the current version by choosing "
    1767             "<b>Install Guest Additions</b> from the <b>Devices</b> "
    1768             "menu.</p>")
    1769              .arg (aInstalledVer).arg (aExpectedVer),
    1770         "warnAboutTooOldAdditions");
    1771 }
    1772 
    1773 void VBoxProblemReporter::warnAboutOldAdditions (QWidget *aParent,
    1774                                                  const QString &aInstalledVer,
    1775                                                  const QString &aExpectedVer)
    1776 {
    1777     message (aParent ? aParent : mainMachineWindowShown(), VBoxProblemReporter::Warning,
    1778         tr ("<p>The VirtualBox Guest Additions installed in the Guest OS are "
    1779             "outdated: the installed version is %1, the expected version is %2. "
    1780             "Some features that require Guest Additions (mouse integration, "
    1781             "guest display auto-resize) may not work as expected.</p>"
    1782             "<p>It is recommended to update the Guest Additions to the current version "
    1783             " by choosing <b>Install Guest Additions</b> from the <b>Devices</b> "
    1784             "menu.</p>")
    1785              .arg (aInstalledVer).arg (aExpectedVer),
    1786         "warnAboutOldAdditions");
    1787 }
    1788 
    1789 void VBoxProblemReporter::warnAboutNewAdditions (QWidget *aParent,
    1790                                                  const QString &aInstalledVer,
    1791                                                  const QString &aExpectedVer)
    1792 {
    1793     message (aParent ? aParent : mainMachineWindowShown(), VBoxProblemReporter::Error,
    1794         tr ("<p>The VirtualBox Guest Additions installed in the Guest OS are "
    1795             "too recent for this version of VirtualBox: the installed version "
    1796             "is %1, the expected version is %2.</p>"
    1797             "<p>Using a newer version of Additions with an older version of "
    1798             "VirtualBox is not supported. Please install the current version "
    1799             "of the Guest Additions by choosing <b>Install Guest Additions</b> "
    1800             "from the <b>Devices</b> menu.</p>")
    1801              .arg (aInstalledVer).arg (aExpectedVer),
    1802         "warnAboutNewAdditions");
    18031672}
    18041673
     
    25682437}
    25692438
    2570 /* static */
    2571 QString VBoxProblemReporter::deviceToAccusative (VBoxDefs::MediumType aType)
    2572 {
    2573     QString type =
    2574         aType == VBoxDefs::MediumType_HardDisk ?
    2575             tr ("hard disk", "failed to attach ...") :
    2576         aType == VBoxDefs::MediumType_DVD ?
    2577             tr ("CD/DVD device", "failed to attach ...") :
    2578         aType == VBoxDefs::MediumType_Floppy ?
    2579             tr ("floppy device", "failed to close ...") :
    2580         QString::null;
    2581 
    2582     Assert (!type.isNull());
    2583     return type;
    2584 }
    2585 
    25862439/**
    25872440 * Formats the given COM result code as a human-readable string.
     
    26412494    return QString ("<qt>%1</qt>").arg (formatted);
    26422495}
    2643 
    2644 /* static */
    2645 QString VBoxProblemReporter::doFormatErrorInfo (const COMErrorInfo &aInfo,
    2646                                                 HRESULT aWrapperRC /* = S_OK */)
    2647 {
    2648     /* Compose complex details string with internal <!--EOM--> delimiter to
    2649      * make it possible to split string into info & details parts which will
    2650      * be used separately in QIMessageBox */
    2651     QString formatted;
    2652 
    2653     if (!aInfo.text().isEmpty())
    2654         formatted += QString ("<p>%1.</p>").arg (vboxGlobal().emphasize (aInfo.text()));
    2655 
    2656     formatted += "<!--EOM--><table bgcolor=#EEEEEE border=0 cellspacing=0 "
    2657                  "cellpadding=0 width=100%>";
    2658 
    2659     bool haveResultCode = false;
    2660 
    2661     if (aInfo.isBasicAvailable())
    2662     {
    2663 #if defined (Q_WS_WIN)
    2664         haveResultCode = aInfo.isFullAvailable();
    2665         bool haveComponent = true;
    2666         bool haveInterfaceID = true;
    2667 #else /* defined (Q_WS_WIN) */
    2668         haveResultCode = true;
    2669         bool haveComponent = aInfo.isFullAvailable();
    2670         bool haveInterfaceID = aInfo.isFullAvailable();
    2671 #endif
    2672 
    2673         if (haveResultCode)
    2674         {
    2675             formatted += QString ("<tr><td>%1</td><td><tt>%2</tt></td></tr>")
    2676                 .arg (tr ("Result&nbsp;Code: ", "error info"))
    2677                 .arg (formatRC (aInfo.resultCode()));
    2678         }
    2679 
    2680         if (haveComponent)
    2681             formatted += QString ("<tr><td>%1</td><td>%2</td></tr>")
    2682                 .arg (tr ("Component: ", "error info"), aInfo.component());
    2683 
    2684         if (haveInterfaceID)
    2685         {
    2686             QString s = aInfo.interfaceID();
    2687             if (!aInfo.interfaceName().isEmpty())
    2688                 s = aInfo.interfaceName() + ' ' + s;
    2689             formatted += QString ("<tr><td>%1</td><td>%2</td></tr>")
    2690                 .arg (tr ("Interface: ", "error info"), s);
    2691         }
    2692 
    2693         if (!aInfo.calleeIID().isNull() && aInfo.calleeIID() != aInfo.interfaceID())
    2694         {
    2695             QString s = aInfo.calleeIID();
    2696             if (!aInfo.calleeName().isEmpty())
    2697                 s = aInfo.calleeName() + ' ' + s;
    2698             formatted += QString ("<tr><td>%1</td><td>%2</td></tr>")
    2699                 .arg (tr ("Callee: ", "error info"), s);
    2700         }
    2701     }
    2702 
    2703     if (FAILED (aWrapperRC) &&
    2704         (!haveResultCode || aWrapperRC != aInfo.resultCode()))
    2705     {
    2706         formatted += QString ("<tr><td>%1</td><td><tt>%2</tt></td></tr>")
    2707             .arg (tr ("Callee&nbsp;RC: ", "error info"))
    2708             .arg (formatRC (aWrapperRC));
    2709     }
    2710 
    2711     formatted += "</table>";
    2712 
    2713     if (aInfo.next())
    2714         formatted = formatted + "<!--EOP-->" + doFormatErrorInfo (*aInfo.next());
    2715 
    2716     return formatted;
    2717 }
    2718 
    2719 // Public slots
    2720 /////////////////////////////////////////////////////////////////////////////
    27212496
    27222497void VBoxProblemReporter::showHelpWebDialog()
     
    28092584}
    28102585
     2586/* Returns a reference to the global VirtualBox problem reporter instance: */
     2587VBoxProblemReporter &VBoxProblemReporter::instance()
     2588{
     2589    static VBoxProblemReporter global_instance;
     2590    return global_instance;
     2591}
     2592
     2593QString VBoxProblemReporter::doFormatErrorInfo (const COMErrorInfo &aInfo,
     2594                                                HRESULT aWrapperRC /* = S_OK */)
     2595{
     2596    /* Compose complex details string with internal <!--EOM--> delimiter to
     2597     * make it possible to split string into info & details parts which will
     2598     * be used separately in QIMessageBox */
     2599    QString formatted;
     2600
     2601    if (!aInfo.text().isEmpty())
     2602        formatted += QString ("<p>%1.</p>").arg (vboxGlobal().emphasize (aInfo.text()));
     2603
     2604    formatted += "<!--EOM--><table bgcolor=#EEEEEE border=0 cellspacing=0 "
     2605                 "cellpadding=0 width=100%>";
     2606
     2607    bool haveResultCode = false;
     2608
     2609    if (aInfo.isBasicAvailable())
     2610    {
     2611#if defined (Q_WS_WIN)
     2612        haveResultCode = aInfo.isFullAvailable();
     2613        bool haveComponent = true;
     2614        bool haveInterfaceID = true;
     2615#else /* defined (Q_WS_WIN) */
     2616        haveResultCode = true;
     2617        bool haveComponent = aInfo.isFullAvailable();
     2618        bool haveInterfaceID = aInfo.isFullAvailable();
     2619#endif
     2620
     2621        if (haveResultCode)
     2622        {
     2623            formatted += QString ("<tr><td>%1</td><td><tt>%2</tt></td></tr>")
     2624                .arg (tr ("Result&nbsp;Code: ", "error info"))
     2625                .arg (formatRC (aInfo.resultCode()));
     2626        }
     2627
     2628        if (haveComponent)
     2629            formatted += QString ("<tr><td>%1</td><td>%2</td></tr>")
     2630                .arg (tr ("Component: ", "error info"), aInfo.component());
     2631
     2632        if (haveInterfaceID)
     2633        {
     2634            QString s = aInfo.interfaceID();
     2635            if (!aInfo.interfaceName().isEmpty())
     2636                s = aInfo.interfaceName() + ' ' + s;
     2637            formatted += QString ("<tr><td>%1</td><td>%2</td></tr>")
     2638                .arg (tr ("Interface: ", "error info"), s);
     2639        }
     2640
     2641        if (!aInfo.calleeIID().isNull() && aInfo.calleeIID() != aInfo.interfaceID())
     2642        {
     2643            QString s = aInfo.calleeIID();
     2644            if (!aInfo.calleeName().isEmpty())
     2645                s = aInfo.calleeName() + ' ' + s;
     2646            formatted += QString ("<tr><td>%1</td><td>%2</td></tr>")
     2647                .arg (tr ("Callee: ", "error info"), s);
     2648        }
     2649    }
     2650
     2651    if (FAILED (aWrapperRC) &&
     2652        (!haveResultCode || aWrapperRC != aInfo.resultCode()))
     2653    {
     2654        formatted += QString ("<tr><td>%1</td><td><tt>%2</tt></td></tr>")
     2655            .arg (tr ("Callee&nbsp;RC: ", "error info"))
     2656            .arg (formatRC (aWrapperRC));
     2657    }
     2658
     2659    formatted += "</table>";
     2660
     2661    if (aInfo.next())
     2662        formatted = formatted + "<!--EOP-->" + doFormatErrorInfo (*aInfo.next());
     2663
     2664    return formatted;
     2665}
     2666
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.h

    r34543 r34736  
    2020#define __VBoxProblemReporter_h__
    2121
     22/* Global includes */
     23#include <QObject>
     24#include <QPointer>
     25
     26/* Local includes */
    2227#include "COMDefs.h"
    2328#include "QIMessageBox.h"
    2429
    25 /* Qt icludes */
    26 #include <QObject>
    27 #include <QPointer>
    28 
     30/* Forward declarations */
    2931class VBoxMedium;
    30 
    31 // VBoxProblemReporter class
    32 ////////////////////////////////////////////////////////////////////////////////
     32struct StorageSlot;
    3333
    3434/**
     
    6767    };
    6868
    69     static VBoxProblemReporter &instance();
    70 
    71     bool isValid() const;
    72 
    73     // helpers
    74 
    7569    bool isAnyWarningShown();
    7670    bool isAlreadyShown(const QString &strGuardBlockName) const;
     
    150144    QWidget* mainMachineWindowShown() const;
    151145
    152     /* Generic problem handlers */
    153146    bool askForOverridingFile (const QString& aPath, QWidget *aParent  = NULL) const;
    154147    bool askForOverridingFiles (const QVector<QString>& aPaths, QWidget *aParent = NULL) const;
     
    156149    bool askForOverridingFilesIfExists (const QVector<QString>& aPaths, QWidget *aParent = NULL) const;
    157150
    158     void cannotDeleteFile (const QString& path, QWidget *aParent = NULL) const;
    159 
    160151    void checkForMountedWrongUSB() const;
    161152
    162     /* Special problem handlers */
    163153    void showBETAWarning();
    164154    void showBEBWarning();
     
    170160
    171161    void cannotOpenURL (const QString &aURL);
    172     void cannotCopyFile (const QString &aSrc, const QString &aDst, int aVRC);
    173162
    174163    void cannotFindLanguage (const QString &aLangID, const QString &aNlsPath);
     
    177166    void cannotInitCOM (HRESULT rc);
    178167    void cannotCreateVirtualBox (const CVirtualBox &vbox);
    179 
    180     void cannotSaveGlobalSettings (const CVirtualBox &vbox,
    181                                    QWidget *parent = 0);
    182168
    183169    void cannotLoadGlobalConfig (const CVirtualBox &vbox, const QString &error);
    184170    void cannotSaveGlobalConfig (const CVirtualBox &vbox);
    185171    void cannotSetSystemProperties (const CSystemProperties &props);
     172
    186173    void cannotAccessUSB (const COMBaseWithEI &aObj);
    187174
     
    216203
    217204    void cannotSendACPIToMachine();
     205
    218206    bool warnAboutVirtNotEnabled64BitsGuest(bool fHWVirtExSupported);
    219207    bool warnAboutVirtNotEnabledGuestRequired(bool fHWVirtExSupported);
    220 
    221     void cannotSetSnapshotFolder (const CMachine &aMachine, const QString &aPath);
    222208
    223209    bool askAboutSnapshotRestoring (const QString &aSnapshotName);
     
    240226    void cannotSwitchScreenInSeamless(quint64 minVRAM);
    241227    int cannotSwitchScreenInFullscreen(quint64 minVRAM);
    242 
    243228    int cannotEnterFullscreenMode();
    244229    int cannotEnterSeamlessMode();
     
    259244                                      const CProgress &aProgress);
    260245
    261     int confirmDetachAddControllerSlots (QWidget *aParent) const;
    262     int confirmChangeAddControllerSlots (QWidget *aParent) const;
    263 
    264246    int askAboutHardDiskAttachmentCreation(QWidget *pParent, const QString &strControllerName);
    265247    int askAboutOpticalAttachmentCreation(QWidget *pParent, const QString &strControllerName);
     
    272254                                      const CMedium &aHD,
    273255                                      const CProgress &aProgress);
    274     void cannotAttachDevice (QWidget *aParent, const CMachine &aMachine,
    275                              VBoxDefs::MediumType aType, const QString &aLocation,
    276                              KStorageBus aBus, LONG aChannel, LONG aDevice);
    277     void cannotDetachDevice (QWidget *aParent, const CMachine &aMachine,
    278                              VBoxDefs::MediumType aType, const QString &aLocation,
    279                              KStorageBus aBus, LONG aChannel, LONG aDevice);
     256    void cannotAttachDevice(QWidget *pParent, const CMachine &machine,
     257                            VBoxDefs::MediumType type, const QString &strLocation, const StorageSlot &storageSlot);
     258    void cannotDetachDevice(QWidget *pParent, const CMachine &machine,
     259                            VBoxDefs::MediumType type, const QString &strLocation, const StorageSlot &storageSlot);
    280260
    281261    int cannotRemountMedium (QWidget *aParent, const CMachine &aMachine, const VBoxMedium &aMedium, bool aMount, bool aRetry);
     
    284264    void cannotCloseMedium (QWidget *aParent, const VBoxMedium &aMedium,
    285265                            const COMResult &aResult);
    286     void cannotEjectDrive();
    287266
    288267    void cannotOpenSession (const CSession &session);
     
    324303    bool confirmDownloadAdditions (const QString &aURL, ulong aSize);
    325304    bool confirmMountAdditions (const QString &aURL, const QString &aSrc);
    326     void warnAboutTooOldAdditions (QWidget *, const QString &, const QString &);
    327     void warnAboutOldAdditions (QWidget *, const QString &, const QString &);
    328     void warnAboutNewAdditions (QWidget *, const QString &, const QString &);
    329305
    330306    bool askAboutUserManualDownload(const QString &strMissedLocation);
     
    395371
    396372    static QString mediumToAccusative (VBoxDefs::MediumType aType, bool aIsHostDrive = false);
    397     static QString deviceToAccusative (VBoxDefs::MediumType aType);
    398373
    399374    static QString formatRC (HRESULT aRC);
     
    434409private:
    435410
     411    static VBoxProblemReporter &instance();
     412
    436413    friend VBoxProblemReporter &vboxProblem();
    437414
     
    443420};
    444421
    445 /**
    446  * Shortcut to the static VBoxProblemReporter::instance() method, for
    447  * convenience.
    448  */
     422/* Shortcut to the static VBoxProblemReporter::instance() method, for convenience. */
    449423inline VBoxProblemReporter &vboxProblem() { return VBoxProblemReporter::instance(); }
    450424
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp

    r34728 r34736  
    833833                if (!m.isOk())
    834834                    vboxProblem().cannotAttachDevice(this, m, VBoxDefs::MediumType_HardDisk,
    835                                                      field("hardDiskLocation").toString(), ctrHdBus, 0, 0);
     835                                                     field("hardDiskLocation").toString(), StorageSlot(ctrHdBus, 0, 0));
    836836            }
    837837
     
    839839            m.AttachDevice(ctrDvdName, 1, 0, KDeviceType_DVD, CMedium());
    840840            if (!m.isOk())
    841                 vboxProblem().cannotAttachDevice(this, m, VBoxDefs::MediumType_DVD, QString(), ctrDvdBus, 1, 0);
     841                vboxProblem().cannotAttachDevice(this, m, VBoxDefs::MediumType_DVD, QString(), StorageSlot(ctrDvdBus, 1, 0));
    842842
    843843            if (m.isOk())
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