VirtualBox

Changeset 34740 in vbox for trunk/src


Ignore:
Timestamp:
Dec 6, 2010 11:56:28 AM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
68545
Message:

FE/Qt: Add errors processing for settings save procedure (problem-reporter updated for inter-thread cases).

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

Legend:

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

    r34523 r34740  
    39373937
    39383938    if (remind)
    3939     {
    3940         class RemindEvent : public VBoxAsyncEvent
    3941         {
    3942             ulong mRealBPP;
    3943         public:
    3944             RemindEvent (ulong aRealBPP)
    3945                 : VBoxAsyncEvent(0), mRealBPP (aRealBPP) {}
    3946             void handle()
    3947             {
    3948                 vboxProblem().remindAboutWrongColorDepth (mRealBPP, 32);
    3949             }
    3950         };
    3951         (new RemindEvent (size.bitsPerPixel()))->post();
    3952     }
     3939        vboxProblem().remindAboutWrongColorDepth(size.bitsPerPixel(), 32);
    39533940}
    39543941
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/COMDefs.h

    r33540 r34740  
    840840/////////////////////////////////////////////////////////////////////////////
    841841
    842 /* include the generated header containing concrete wrapper definitions */
     842/* Include the generated header containing wrapper definitions: */
    843843#include "COMWrappers.h"
    844844
     845/* Declare metatypes for particular wrappers: */
     846Q_DECLARE_METATYPE(CProgress);
     847Q_DECLARE_METATYPE(CHost);
     848Q_DECLARE_METATYPE(CMachine);
     849Q_DECLARE_METATYPE(CConsole);
     850Q_DECLARE_METATYPE(CHostNetworkInterface);
     851
    845852/** @} */
    846853
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxDefs.h

    r34519 r34740  
    7272    enum
    7373    {
    74           AsyncEventType = QEvent::User + 100
    75         , ResizeEventType
     74          ResizeEventType = QEvent::User + 101
    7675        , RepaintEventType
    7776        , SetRegionEventType
     
    171170};
    172171
     172Q_DECLARE_METATYPE(VBoxDefs::MediumType);
     173
    173174#define MAC_LEOPARD_STYLE defined(Q_WS_MAC) && (QT_VERSION >= 0x040300)
    174175
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r34681 r34740  
    45374537    switch (e->type())
    45384538    {
    4539         case VBoxDefs::AsyncEventType:
    4540         {
    4541             VBoxAsyncEvent *ev = (VBoxAsyncEvent *) e;
    4542             ev->handle();
    4543             return true;
    4544         }
    4545 
    45464539        case VBoxDefs::MediaEnumEventType:
    45474540        {
     
    52805273 */
    52815274
    5282 VBoxAsyncEvent::VBoxAsyncEvent(uint uDelay)
    5283     : QEvent((QEvent::Type)VBoxDefs::AsyncEventType)
    5284     , m_uDelay(uDelay)
    5285 {
    5286 }
    5287 
    5288 void VBoxAsyncEvent::post()
    5289 {
    5290     UIAsyncEventPoster::post(this);
    5291 }
    5292 
    5293 uint VBoxAsyncEvent::delay() const
    5294 {
    5295     return m_uDelay;
    5296 }
    5297 
    5298 UIAsyncEventPoster* UIAsyncEventPoster::m_spInstance = 0;
    5299 
    5300 void UIAsyncEventPoster::post(VBoxAsyncEvent *pAsyncEvent)
    5301 {
    5302     if (!m_spInstance)
    5303         new UIAsyncEventPoster(pAsyncEvent);
    5304 }
    5305 
    5306 UIAsyncEventPoster::UIAsyncEventPoster(VBoxAsyncEvent *pAsyncEvent)
    5307     : m_pAsyncEvent(pAsyncEvent)
    5308 {
    5309     m_spInstance = this;
    5310     QTimer::singleShot(m_pAsyncEvent->delay(), this, SLOT(sltPostAsyncEvent()));
    5311 }
    5312 
    5313 UIAsyncEventPoster::~UIAsyncEventPoster()
    5314 {
    5315     m_spInstance = 0;
    5316 }
    5317 
    5318 void UIAsyncEventPoster::sltPostAsyncEvent()
    5319 {
    5320     if (m_pAsyncEvent)
    5321         QApplication::postEvent(&vboxGlobal(), m_pAsyncEvent);
    5322     m_pAsyncEvent = 0;
    5323     deleteLater();
    5324 }
    5325 
    53265275/**
    53275276 *  USB Popup Menu class methods
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r34567 r34740  
    863863////////////////////////////////////////////////////////////////////////////////
    864864
    865 /* Generic asynchronous event.
    866  * This abstract class is intended to provide a convenient way
    867  * to execute code on the main GUI thread asynchronously to the calling party.
    868  * This is done by putting necessary actions to the handle() function
    869  * in a subclass and then posting an instance of the subclass using post().
    870  * The instance must be allocated on the heap and will be automatically deleted after processing. */
    871 class VBoxAsyncEvent : public QEvent
    872 {
    873 public:
    874 
    875     /* VBoxAsyncEvent constructor: */
    876     VBoxAsyncEvent(uint uDelay = 0);
    877 
    878     /* Worker function. Gets executed on the GUI thread when
    879      * the posted event is processed by the main event loop. */
    880     virtual void handle() = 0;
    881 
    882     /* Posts this event to the main event loop. The caller loses ownership of
    883      * this object after this method returns and must not delete the object. */
    884     void post();
    885 
    886     /* Returns delay for this event: */
    887     uint delay() const;
    888 
    889 private:
    890 
    891     uint m_uDelay;
    892 };
    893 
    894 /* Asynchronous event poster.
    895  * This class is used to post async event into VBoxGlobal event handler
    896  * taking into account delay set during async event creation procedure. */
    897 class UIAsyncEventPoster : public QObject
    898 {
    899     Q_OBJECT;
    900 
    901 public:
    902 
    903     /* Async event poster creator: */
    904     static void post(VBoxAsyncEvent *pAsyncEvent);
    905 
    906 protected:
    907 
    908     /* Constructor/destructor: */
    909     UIAsyncEventPoster(VBoxAsyncEvent *pAsyncEvent);
    910     ~UIAsyncEventPoster();
    911 
    912 private slots:
    913 
    914     /* Async event poster: */
    915     void sltPostAsyncEvent();
    916 
    917 private:
    918 
    919     static UIAsyncEventPoster *m_spInstance;
    920     VBoxAsyncEvent *m_pAsyncEvent;
    921 };
    922 
    923865/**
    924866 *  USB Popup Menu class.
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.cpp

    r34736 r34740  
    12581258}
    12591259
    1260 void 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 
    12901260void VBoxProblemReporter::cannotDetachDevice(QWidget *pParent, const CMachine &machine,
    12911261                                             VBoxDefs::MediumType type, const QString &strLocation, const StorageSlot &storageSlot)
     
    14371407}
    14381408
    1439 void VBoxProblemReporter::cannotCreateHostInterface (
    1440     const CHost &host, QWidget *parent)
    1441 {
    1442     message (parent ? parent : mainWindowShown(), Error,
    1443         tr ("Failed to create the host-only network interface."),
    1444         formatErrorInfo (host));
    1445 }
    1446 
    1447 void VBoxProblemReporter::cannotCreateHostInterface (
    1448     const CProgress &progress, QWidget *parent)
    1449 {
    1450     message (parent ? parent : mainWindowShown(), Error,
    1451         tr ("Failed to create the host-only network interface."),
    1452         formatErrorInfo (progress.GetErrorInfo()));
    1453 }
    1454 
    1455 void VBoxProblemReporter::cannotRemoveHostInterface (
    1456     const CHost &host, const CHostNetworkInterface &iface, QWidget *parent)
    1457 {
    1458     message (parent ? parent : mainWindowShown(), Error,
    1459         tr ("Failed to remove the host network interface <b>%1</b>.")
    1460             .arg (iface.GetName()),
    1461         formatErrorInfo (host));
    1462 }
    1463 
    1464 void VBoxProblemReporter::cannotRemoveHostInterface (
    1465     const CProgress &progress, const CHostNetworkInterface &iface, QWidget *parent)
    1466 {
    1467     message (parent ? parent : mainWindowShown(), Error,
    1468         tr ("Failed to remove the host network interface <b>%1</b>.")
    1469             .arg (iface.GetName()),
    1470         formatErrorInfo (progress.GetErrorInfo()));
    1471 }
    1472 
    14731409void VBoxProblemReporter::cannotAttachUSBDevice (const CConsole &console,
    14741410                                                 const QString &device)
     
    15211457            .arg (console.GetMachine().GetName()),
    15221458        formatErrorInfo (error));
    1523 }
    1524 
    1525 void VBoxProblemReporter::cannotCreateSharedFolder (QWidget        *aParent,
    1526                                                     const CMachine &aMachine,
    1527                                                     const QString  &aName,
    1528                                                     const QString  &aPath)
    1529 {
    1530     /* preserve the current error info before calling the object again */
    1531     COMResult res (aMachine);
    1532 
    1533     message (aParent, Error,
    1534              tr ("Failed to create the shared folder <b>%1</b> "
    1535                  "(pointing to <nobr><b>%2</b></nobr>) "
    1536                  "for the virtual machine <b>%3</b>.")
    1537                  .arg (aName)
    1538                  .arg (aPath)
    1539                  .arg (aMachine.GetName()),
    1540              formatErrorInfo (res));
    1541 }
    1542 
    1543 void VBoxProblemReporter::cannotRemoveSharedFolder (QWidget        *aParent,
    1544                                                     const CMachine &aMachine,
    1545                                                     const QString  &aName,
    1546                                                     const QString  &aPath)
    1547 {
    1548     /* preserve the current error info before calling the object again */
    1549     COMResult res (aMachine);
    1550 
    1551     message (aParent, Error,
    1552              tr ("Failed to remove the shared folder <b>%1</b> "
    1553                  "(pointing to <nobr><b>%2</b></nobr>) "
    1554                  "from the virtual machine <b>%3</b>.")
    1555                  .arg (aName)
    1556                  .arg (aPath)
    1557                  .arg (aMachine.GetName()),
    1558              formatErrorInfo (res));
    1559 }
    1560 
    1561 void VBoxProblemReporter::cannotCreateSharedFolder (QWidget        *aParent,
    1562                                                     const CConsole &aConsole,
    1563                                                     const QString  &aName,
    1564                                                     const QString  &aPath)
    1565 {
    1566     /* preserve the current error info before calling the object again */
    1567     COMResult res (aConsole);
    1568 
    1569     message (aParent, Error,
    1570              tr ("Failed to create the shared folder <b>%1</b> "
    1571                  "(pointing to <nobr><b>%2</b></nobr>) "
    1572                  "for the virtual machine <b>%3</b>.")
    1573                  .arg (aName)
    1574                  .arg (aPath)
    1575                  .arg (aConsole.GetMachine().GetName()),
    1576              formatErrorInfo (res));
    1577 }
    1578 
    1579 void VBoxProblemReporter::cannotRemoveSharedFolder (QWidget        *aParent,
    1580                                                     const CConsole &aConsole,
    1581                                                     const QString  &aName,
    1582                                                     const QString  &aPath)
    1583 {
    1584     /* preserve the current error info before calling the object again */
    1585     COMResult res (aConsole);
    1586 
    1587     message (aParent, Error,
    1588              tr ("<p>Failed to remove the shared folder <b>%1</b> "
    1589                  "(pointing to <nobr><b>%2</b></nobr>) "
    1590                  "from the virtual machine <b>%3</b>.</p>"
    1591                  "<p>Please close all programs in the guest OS that "
    1592                  "may be using this shared folder and try again.</p>")
    1593                  .arg (aName)
    1594                  .arg (aPath)
    1595                  .arg (aConsole.GetMachine().GetName()),
    1596              formatErrorInfo (res));
    15971459}
    15981460
     
    20451907}
    20461908
    2047 void VBoxProblemReporter::remindAboutWrongColorDepth (ulong aRealBPP,
    2048                                                       ulong aWantedBPP)
    2049 {
    2050     const char *kName = "remindAboutWrongColorDepth";
    2051 
    2052     /* Close the previous (outdated) window if any. We use kName as
    2053      * aAutoConfirmId which is also used as the widget name by default. */
    2054     {
    2055         QWidget *outdated = VBoxGlobal::findWidget (NULL, kName, "QIMessageBox");
    2056         if (outdated)
    2057             outdated->close();
    2058     }
    2059 
    2060     int rc = message (mainMachineWindowShown(), Info,
    2061         tr ("<p>The virtual machine window is optimized to work in "
    2062             "<b>%1&nbsp;bit</b> color mode but the "
    2063             "virtual display is currently set to <b>%2&nbsp;bit</b>.</p>"
    2064             "<p>Please open the display properties dialog of the guest OS and "
    2065             "select a <b>%3&nbsp;bit</b> color mode, if it is available, for "
    2066             "best possible performance of the virtual video subsystem.</p>"
    2067             "<p><b>Note</b>. Some operating systems, like OS/2, may actually "
    2068             "work in 32&nbsp;bit mode but report it as 24&nbsp;bit "
    2069             "(16 million colors). You may try to select a different color "
    2070             "mode to see if this message disappears or you can simply "
    2071             "disable the message now if you are sure the required color "
    2072             "mode (%4&nbsp;bit) is not available in the guest OS.</p>")
    2073             .arg (aWantedBPP).arg (aRealBPP).arg (aWantedBPP).arg (aWantedBPP),
    2074         kName);
    2075     NOREF(rc);
    2076 }
    2077 
    20781909/**
    20791910 *  Returns @c true if the user has selected to power off the machine.
     
    24952326}
    24962327
     2328void VBoxProblemReporter::cannotCreateHostInterface(const CHost &host, QWidget *pParent /* = 0 */)
     2329{
     2330    if (thread() == QThread::currentThread())
     2331        sltCannotCreateHostInterface(host, pParent);
     2332    else
     2333        emit sigCannotCreateHostInterface(host, pParent);
     2334}
     2335
     2336void VBoxProblemReporter::cannotCreateHostInterface(const CProgress &progress, QWidget *pParent /* = 0 */)
     2337{
     2338    if (thread() == QThread::currentThread())
     2339        sltCannotCreateHostInterface(progress, pParent);
     2340    else
     2341        emit sigCannotCreateHostInterface(progress, pParent);
     2342}
     2343
     2344void VBoxProblemReporter::cannotRemoveHostInterface(const CHost &host, const CHostNetworkInterface &iface,
     2345                                                    QWidget *pParent /* = 0 */)
     2346{
     2347    if (thread() == QThread::currentThread())
     2348        sltCannotRemoveHostInterface(host, iface ,pParent);
     2349    else
     2350        emit sigCannotRemoveHostInterface(host, iface, pParent);
     2351}
     2352
     2353void VBoxProblemReporter::cannotRemoveHostInterface(const CProgress &progress, const CHostNetworkInterface &iface,
     2354                                                    QWidget *pParent /* = 0 */)
     2355{
     2356    if (thread() == QThread::currentThread())
     2357        sltCannotRemoveHostInterface(progress, iface, pParent);
     2358    else
     2359        emit sigCannotRemoveHostInterface(progress, iface, pParent);
     2360}
     2361
     2362void VBoxProblemReporter::cannotAttachDevice(const CMachine &machine, VBoxDefs::MediumType type,
     2363                                             const QString &strLocation, const StorageSlot &storageSlot,
     2364                                             QWidget *pParent /* = 0 */)
     2365{
     2366    if (thread() == QThread::currentThread())
     2367        sltCannotAttachDevice(machine, type, strLocation, storageSlot, pParent);
     2368    else
     2369        emit sigCannotAttachDevice(machine, type, strLocation, storageSlot, pParent);
     2370}
     2371
     2372void VBoxProblemReporter::cannotCreateSharedFolder(const CMachine &machine, const QString &strName,
     2373                                                   const QString &strPath, QWidget *pParent /* = 0 */)
     2374{
     2375    if (thread() == QThread::currentThread())
     2376        sltCannotCreateSharedFolder(machine, strName, strPath, pParent);
     2377    else
     2378        emit sigCannotCreateSharedFolder(machine, strName, strPath, pParent);
     2379}
     2380
     2381void VBoxProblemReporter::cannotRemoveSharedFolder(const CMachine &machine, const QString &strName,
     2382                                                   const QString &strPath, QWidget *pParent /* = 0 */)
     2383{
     2384    if (thread() == QThread::currentThread())
     2385        sltCannotRemoveSharedFolder(machine, strName, strPath, pParent);
     2386    else
     2387        emit sigCannotRemoveSharedFolder(machine, strName, strPath, pParent);
     2388}
     2389
     2390void VBoxProblemReporter::cannotCreateSharedFolder(const CConsole &console, const QString &strName,
     2391                                                   const QString &strPath, QWidget *pParent /* = 0 */)
     2392{
     2393    if (thread() == QThread::currentThread())
     2394        sltCannotCreateSharedFolder(console, strName, strPath, pParent);
     2395    else
     2396        emit sigCannotCreateSharedFolder(console, strName, strPath, pParent);
     2397}
     2398
     2399void VBoxProblemReporter::cannotRemoveSharedFolder(const CConsole &console, const QString &strName,
     2400                                                   const QString &strPath, QWidget *pParent /* = 0 */)
     2401{
     2402    if (thread() == QThread::currentThread())
     2403        sltCannotRemoveSharedFolder(console, strName, strPath, pParent);
     2404    else
     2405        emit sigCannotRemoveSharedFolder(console, strName, strPath, pParent);
     2406}
     2407
     2408void VBoxProblemReporter::remindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP)
     2409{
     2410    emit sigRemindAboutWrongColorDepth(uRealBPP, uWantedBPP);
     2411}
     2412
    24972413void VBoxProblemReporter::showHelpWebDialog()
    24982414{
     
    25842500}
    25852501
     2502void VBoxProblemReporter::sltCannotCreateHostInterface(const CHost &host, QWidget *pParent)
     2503{
     2504    message(pParent ? pParent : mainWindowShown(), Error,
     2505            tr("Failed to create the host-only network interface."),
     2506            formatErrorInfo(host));
     2507}
     2508
     2509void VBoxProblemReporter::sltCannotCreateHostInterface(const CProgress &progress, QWidget *pParent)
     2510{
     2511    message(pParent ? pParent : mainWindowShown(), Error,
     2512            tr("Failed to create the host-only network interface."),
     2513            formatErrorInfo(progress.GetErrorInfo()));
     2514}
     2515
     2516void VBoxProblemReporter::sltCannotRemoveHostInterface(const CHost &host, const CHostNetworkInterface &iface, QWidget *pParent)
     2517{
     2518    message(pParent ? pParent : mainWindowShown(), Error,
     2519            tr("Failed to remove the host network interface <b>%1</b>.")
     2520               .arg(iface.GetName()),
     2521            formatErrorInfo(host));
     2522}
     2523
     2524void VBoxProblemReporter::sltCannotRemoveHostInterface(const CProgress &progress, const CHostNetworkInterface &iface, QWidget *pParent)
     2525{
     2526    message(pParent ? pParent : mainWindowShown(), Error,
     2527            tr("Failed to remove the host network interface <b>%1</b>.")
     2528               .arg(iface.GetName()),
     2529            formatErrorInfo(progress.GetErrorInfo()));
     2530}
     2531
     2532void VBoxProblemReporter::sltCannotAttachDevice(const CMachine &machine, VBoxDefs::MediumType type,
     2533                                                const QString &strLocation, const StorageSlot &storageSlot,
     2534                                                QWidget *pParent)
     2535{
     2536    QString strMessage;
     2537    switch (type)
     2538    {
     2539        case VBoxDefs::MediumType_HardDisk:
     2540        {
     2541            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>.")
     2542                           .arg(strLocation).arg(vboxGlobal().toString(storageSlot)).arg(CMachine(machine).GetName());
     2543            break;
     2544        }
     2545        case VBoxDefs::MediumType_DVD:
     2546        {
     2547            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>.")
     2548                           .arg(strLocation).arg(vboxGlobal().toString(storageSlot)).arg(CMachine(machine).GetName());
     2549            break;
     2550        }
     2551        case VBoxDefs::MediumType_Floppy:
     2552        {
     2553            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>.")
     2554                           .arg(strLocation).arg(vboxGlobal().toString(storageSlot)).arg(CMachine(machine).GetName());
     2555            break;
     2556        }
     2557        default:
     2558            break;
     2559    }
     2560    message(pParent ? pParent : mainWindowShown(), Error, strMessage, formatErrorInfo(machine));
     2561}
     2562
     2563void VBoxProblemReporter::sltCannotCreateSharedFolder(const CMachine &machine, const QString &strName,
     2564                                                      const QString &strPath, QWidget *pParent)
     2565{
     2566    message(pParent ? pParent : mainMachineWindowShown(), Error,
     2567            tr("Failed to create the shared folder <b>%1</b> "
     2568               "(pointing to <nobr><b>%2</b></nobr>) "
     2569               "for the virtual machine <b>%3</b>.")
     2570               .arg(strName)
     2571               .arg(strPath)
     2572               .arg(CMachine(machine).GetName()),
     2573            formatErrorInfo(machine));
     2574}
     2575
     2576void VBoxProblemReporter::sltCannotRemoveSharedFolder(const CMachine &machine, const QString &strName,
     2577                                                      const QString &strPath, QWidget *pParent)
     2578{
     2579    message(pParent ? pParent : mainMachineWindowShown(), Error,
     2580            tr("Failed to remove the shared folder <b>%1</b> "
     2581               "(pointing to <nobr><b>%2</b></nobr>) "
     2582               "from the virtual machine <b>%3</b>.")
     2583               .arg(strName)
     2584               .arg(strPath)
     2585               .arg(CMachine(machine).GetName()),
     2586            formatErrorInfo(machine));
     2587}
     2588
     2589void VBoxProblemReporter::sltCannotCreateSharedFolder(const CConsole &console, const QString &strName,
     2590                                                      const QString &strPath, QWidget *pParent)
     2591{
     2592    message(pParent ? pParent : mainMachineWindowShown(), Error,
     2593            tr("Failed to create the shared folder <b>%1</b> "
     2594               "(pointing to <nobr><b>%2</b></nobr>) "
     2595               "for the virtual machine <b>%3</b>.")
     2596               .arg(strName)
     2597               .arg(strPath)
     2598               .arg(CConsole(console).GetMachine().GetName()),
     2599            formatErrorInfo(console));
     2600}
     2601
     2602void VBoxProblemReporter::sltCannotRemoveSharedFolder(const CConsole &console, const QString &strName,
     2603                                                      const QString &strPath, QWidget *pParent)
     2604{
     2605    message(pParent ? pParent : mainMachineWindowShown(), Error,
     2606            tr("<p>Failed to remove the shared folder <b>%1</b> "
     2607               "(pointing to <nobr><b>%2</b></nobr>) "
     2608               "from the virtual machine <b>%3</b>.</p>"
     2609               "<p>Please close all programs in the guest OS that "
     2610               "may be using this shared folder and try again.</p>")
     2611               .arg(strName)
     2612               .arg(strPath)
     2613               .arg(CConsole(console).GetMachine().GetName()),
     2614            formatErrorInfo(console));
     2615}
     2616
     2617void VBoxProblemReporter::sltRemindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP)
     2618{
     2619    const char *kName = "remindAboutWrongColorDepth";
     2620
     2621    /* Close the previous (outdated) window if any. We use kName as
     2622     * aAutoConfirmId which is also used as the widget name by default. */
     2623    {
     2624        QWidget *outdated = VBoxGlobal::findWidget(NULL, kName, "QIMessageBox");
     2625        if (outdated)
     2626            outdated->close();
     2627    }
     2628
     2629    message(mainMachineWindowShown(), Info,
     2630            tr("<p>The virtual machine window is optimized to work in "
     2631               "<b>%1&nbsp;bit</b> color mode but the "
     2632               "virtual display is currently set to <b>%2&nbsp;bit</b>.</p>"
     2633               "<p>Please open the display properties dialog of the guest OS and "
     2634               "select a <b>%3&nbsp;bit</b> color mode, if it is available, for "
     2635               "best possible performance of the virtual video subsystem.</p>"
     2636               "<p><b>Note</b>. Some operating systems, like OS/2, may actually "
     2637               "work in 32&nbsp;bit mode but report it as 24&nbsp;bit "
     2638               "(16 million colors). You may try to select a different color "
     2639               "mode to see if this message disappears or you can simply "
     2640               "disable the message now if you are sure the required color "
     2641               "mode (%4&nbsp;bit) is not available in the guest OS.</p>")
     2642               .arg(uWantedBPP).arg(uRealBPP).arg(uWantedBPP).arg(uWantedBPP),
     2643            kName);
     2644}
     2645
     2646VBoxProblemReporter::VBoxProblemReporter()
     2647{
     2648    /* Register required objects as meta-types: */
     2649    qRegisterMetaType<CProgress>();
     2650    qRegisterMetaType<CHost>();
     2651    qRegisterMetaType<CMachine>();
     2652    qRegisterMetaType<CConsole>();
     2653    qRegisterMetaType<CHostNetworkInterface>();
     2654    qRegisterMetaType<VBoxDefs::MediumType>();
     2655    qRegisterMetaType<StorageSlot>();
     2656
     2657    /* Prepare required connections: */
     2658    connect(this, SIGNAL(sigCannotCreateHostInterface(const CHost&, QWidget*)),
     2659            this, SLOT(sltCannotCreateHostInterface(const CHost&, QWidget*)),
     2660            Qt::BlockingQueuedConnection);
     2661    connect(this, SIGNAL(sigCannotCreateHostInterface(const CProgress&, QWidget*)),
     2662            this, SLOT(sltCannotCreateHostInterface(const CProgress&, QWidget*)),
     2663            Qt::BlockingQueuedConnection);
     2664    connect(this, SIGNAL(sigCannotRemoveHostInterface(const CHost&, const CHostNetworkInterface&, QWidget*)),
     2665            this, SLOT(sltCannotRemoveHostInterface(const CHost&, const CHostNetworkInterface&, QWidget*)),
     2666            Qt::BlockingQueuedConnection);
     2667    connect(this, SIGNAL(sigCannotRemoveHostInterface(const CProgress&, const CHostNetworkInterface&, QWidget*)),
     2668            this, SLOT(sltCannotRemoveHostInterface(const CProgress&, const CHostNetworkInterface&, QWidget*)),
     2669            Qt::BlockingQueuedConnection);
     2670    connect(this, SIGNAL(sigCannotAttachDevice(const CMachine&, VBoxDefs::MediumType, const QString&, const StorageSlot&, QWidget*)),
     2671            this, SLOT(sltCannotAttachDevice(const CMachine&, VBoxDefs::MediumType, const QString&, const StorageSlot&, QWidget*)),
     2672            Qt::BlockingQueuedConnection);
     2673    connect(this, SIGNAL(sigCannotCreateSharedFolder(const CMachine&, const QString&, const QString&, QWidget*)),
     2674            this, SLOT(sltCannotCreateSharedFolder(const CMachine&, const QString&, const QString&, QWidget*)),
     2675            Qt::BlockingQueuedConnection);
     2676    connect(this, SIGNAL(sigCannotRemoveSharedFolder(const CMachine&, const QString&, const QString&, QWidget*)),
     2677            this, SLOT(sltCannotRemoveSharedFolder(const CMachine&, const QString&, const QString&, QWidget*)),
     2678            Qt::BlockingQueuedConnection);
     2679    connect(this, SIGNAL(sigCannotCreateSharedFolder(const CConsole&, const QString&, const QString&, QWidget*)),
     2680            this, SLOT(sltCannotCreateSharedFolder(const CConsole&, const QString&, const QString&, QWidget*)),
     2681            Qt::BlockingQueuedConnection);
     2682    connect(this, SIGNAL(sigCannotRemoveSharedFolder(const CConsole&, const QString&, const QString&, QWidget*)),
     2683            this, SLOT(sltCannotRemoveSharedFolder(const CConsole&, const QString&, const QString&, QWidget*)),
     2684            Qt::BlockingQueuedConnection);
     2685    connect(this, SIGNAL(sigRemindAboutWrongColorDepth(ulong, ulong)),
     2686            this, SLOT(sltRemindAboutWrongColorDepth(ulong, ulong)), Qt::QueuedConnection);
     2687}
     2688
    25862689/* Returns a reference to the global VirtualBox problem reporter instance: */
    25872690VBoxProblemReporter &VBoxProblemReporter::instance()
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.h

    r34736 r34740  
    254254                                      const CMedium &aHD,
    255255                                      const CProgress &aProgress);
    256     void cannotAttachDevice(QWidget *pParent, const CMachine &machine,
    257                             VBoxDefs::MediumType type, const QString &strLocation, const StorageSlot &storageSlot);
    258256    void cannotDetachDevice(QWidget *pParent, const CMachine &machine,
    259257                            VBoxDefs::MediumType type, const QString &strLocation, const StorageSlot &storageSlot);
     
    272270
    273271    int confirmDeletingHostInterface (const QString &aName, QWidget *aParent = 0);
    274     void cannotCreateHostInterface (const CHost &aHost, QWidget *aParent = 0);
    275     void cannotCreateHostInterface (const CProgress &aProgress, QWidget *aParent = 0);
    276     void cannotRemoveHostInterface (const CHost &aHost,
    277                                     const CHostNetworkInterface &aIface,
    278                                     QWidget *aParent = 0);
    279     void cannotRemoveHostInterface (const CProgress &aProgress,
    280                                     const CHostNetworkInterface &aIface,
    281                                     QWidget *aParent = 0);
    282272
    283273    void cannotAttachUSBDevice (const CConsole &console, const QString &device);
     
    288278                                const CVirtualBoxErrorInfo &error);
    289279
    290     void cannotCreateSharedFolder (QWidget *, const CMachine &,
    291                                    const QString &, const QString &);
    292     void cannotRemoveSharedFolder (QWidget *, const CMachine &,
    293                                    const QString &, const QString &);
    294     void cannotCreateSharedFolder (QWidget *, const CConsole &,
    295                                    const QString &, const QString &);
    296     void cannotRemoveSharedFolder (QWidget *, const CConsole &,
    297                                    const QString &, const QString &);
    298 
    299280    void remindAboutGuestAdditionsAreNotActive(QWidget *pParent);
    300281    int cannotFindGuestAdditions (const QString &aSrc1, const QString &aSrc2);
     
    335316    bool confirmGoingSeamless (const QString &aHotKey);
    336317
    337     void remindAboutWrongColorDepth (ulong aRealBPP, ulong aWantedBPP);
    338 
    339318    bool remindAboutGuruMeditation (const CConsole &aConsole,
    340319                                    const QString &aLogFolder);
     
    394373    }
    395374
     375    /* Stuff supporting interthreading: */
     376    void cannotCreateHostInterface(const CHost &host, QWidget *pParent = 0);
     377    void cannotCreateHostInterface(const CProgress &progress, QWidget *pParent = 0);
     378    void cannotRemoveHostInterface(const CHost &host, const CHostNetworkInterface &iface, QWidget *pParent = 0);
     379    void cannotRemoveHostInterface(const CProgress &progress, const CHostNetworkInterface &iface, QWidget *pParent = 0);
     380    void cannotAttachDevice(const CMachine &machine, VBoxDefs::MediumType type,
     381                            const QString &strLocation, const StorageSlot &storageSlot, QWidget *pParent = 0);
     382    void cannotCreateSharedFolder(const CMachine &machine, const QString &strName,
     383                                  const QString &strPath, QWidget *pParent = 0);
     384    void cannotRemoveSharedFolder(const CMachine &machine, const QString &strName,
     385                                  const QString &strPath, QWidget *pParent = 0);
     386    void cannotCreateSharedFolder(const CConsole &console, const QString &strName,
     387                                  const QString &strPath, QWidget *pParent = 0);
     388    void cannotRemoveSharedFolder(const CConsole &console, const QString &strName,
     389                                  const QString &strPath, QWidget *pParent = 0);
     390    void remindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP);
     391
    396392signals:
    397393
    398394    void sigDownloaderUserManualCreated();
    399395    void sigToCloseAllWarnings();
     396
     397    /* Stuff supporting interthreading: */
     398    void sigCannotCreateHostInterface(const CHost &host, QWidget *pParent);
     399    void sigCannotCreateHostInterface(const CProgress &progress, QWidget *pParent);
     400    void sigCannotRemoveHostInterface(const CHost &host, const CHostNetworkInterface &iface, QWidget *pParent);
     401    void sigCannotRemoveHostInterface(const CProgress &progress, const CHostNetworkInterface &iface, QWidget *pParent);
     402    void sigCannotAttachDevice(const CMachine &machine, VBoxDefs::MediumType type,
     403                               const QString &strLocation, const StorageSlot &storageSlot, QWidget *pParent);
     404    void sigCannotCreateSharedFolder(const CMachine &machine, const QString &strName,
     405                                     const QString &strPath, QWidget *pParent);
     406    void sigCannotRemoveSharedFolder(const CMachine &machine, const QString &strName,
     407                                     const QString &strPath, QWidget *pParent);
     408    void sigCannotCreateSharedFolder(const CConsole &console, const QString &strName,
     409                                     const QString &strPath, QWidget *pParent);
     410    void sigCannotRemoveSharedFolder(const CConsole &console, const QString &strName,
     411                                     const QString &strPath, QWidget *pParent);
     412    void sigRemindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP);
    400413
    401414public slots:
     
    407420    void sltShowUserManual(const QString &strLocation);
    408421
     422private slots:
     423
     424    /* Stuff supporting interthreading: */
     425    void sltCannotCreateHostInterface(const CHost &host, QWidget *pParent);
     426    void sltCannotCreateHostInterface(const CProgress &progress, QWidget *pParent);
     427    void sltCannotRemoveHostInterface(const CHost &host, const CHostNetworkInterface &iface, QWidget *pParent);
     428    void sltCannotRemoveHostInterface(const CProgress &progress, const CHostNetworkInterface &iface, QWidget *pParent);
     429    void sltCannotAttachDevice(const CMachine &machine, VBoxDefs::MediumType type,
     430                               const QString &strLocation, const StorageSlot &storageSlot, QWidget *pParent);
     431    void sltCannotCreateSharedFolder(const CMachine &machine, const QString &strName,
     432                                     const QString &strPath, QWidget *pParent);
     433    void sltCannotRemoveSharedFolder(const CMachine &machine, const QString &strName,
     434                                     const QString &strPath, QWidget *pParent);
     435    void sltCannotCreateSharedFolder(const CConsole &console, const QString &strName,
     436                                     const QString &strPath, QWidget *pParent);
     437    void sltCannotRemoveSharedFolder(const CConsole &console, const QString &strName,
     438                                     const QString &strPath, QWidget *pParent);
     439    void sltRemindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP);
     440
    409441private:
     442
     443    VBoxProblemReporter();
    410444
    411445    static VBoxProblemReporter &instance();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBufferQImage.cpp

    r32981 r34740  
    186186
    187187    if (bRemind)
    188     {
    189         class RemindEvent : public VBoxAsyncEvent
    190         {
    191             ulong mRealBPP;
    192         public:
    193             RemindEvent (ulong aRealBPP)
    194                 : VBoxAsyncEvent(0), mRealBPP (aRealBPP) {}
    195             void handle()
    196             {
    197                 vboxProblem().remindAboutWrongColorDepth (mRealBPP, 32);
    198             }
    199         };
    200         (new RemindEvent (pEvent->bitsPerPixel()))->post();
    201     }
     188        vboxProblem().remindAboutWrongColorDepth(pEvent->bitsPerPixel(), 32);
    202189}
    203190
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBufferQuartz2D.cpp

    r31318 r34740  
    413413
    414414//    if (remind)
    415 //    {
    416 //        class RemindEvent : public VBoxAsyncEvent
    417 //        {
    418 //            ulong mRealBPP;
    419 //        public:
    420 //            RemindEvent (ulong aRealBPP)
    421 //                : mRealBPP (aRealBPP) {}
    422 //            void handle()
    423 //            {
    424 //                vboxProblem().remindAboutWrongColorDepth (mRealBPP, 32);
    425 //            }
    426 //        };
    427 //        (new RemindEvent (aEvent->bitsPerPixel()))->post();
    428 //    }
     415//        vboxProblem().remindAboutWrongColorDepth(aEvent->bitsPerPixel(), 32);
    429416}
    430417
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp

    r34735 r34740  
    262262            if (!m_fConditionDone)
    263263                m_condition.wakeAll();
     264            if (pPage->failed())
     265                break;
    264266        }
    265267        /* Notify listeners about all pages were processed: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.cpp

    r34234 r34740  
    7171}
    7272
     73/* Page 'failed' stuff: */
     74bool UISettingsPage::failed() const
     75{
     76    return m_fFailed;
     77}
     78
     79/* Page 'failed' stuff: */
     80void UISettingsPage::setFailed(bool fFailed)
     81{
     82    m_fFailed = fFailed;
     83}
     84
    7385/* Settings page constructor, hidden: */
    7486UISettingsPage::UISettingsPage(UISettingsPageType type, QWidget *pParent)
     
    7789    , m_cId(-1)
    7890    , m_fProcessed(false)
     91    , m_fFailed(false)
    7992    , m_pFirstWidget(0)
    8093{
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.h

    r33631 r34740  
    9999    void setProcessed(bool fProcessed);
    100100
     101    /* Page 'failed' stuff: */
     102    bool failed() const;
     103    void setFailed(bool fFailed);
     104
    101105protected:
    102106
     
    108112    int m_cId;
    109113    bool m_fProcessed;
     114    bool m_fFailed;
    110115    QWidget *m_pFirstWidget;
    111116};
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetwork.cpp

    r34562 r34740  
    334334    const CHostNetworkInterfaceVector &interfaces = host.GetNetworkInterfaces();
    335335    /* Remove all the old interfaces first: */
    336     for (int iNetworkIndex = 0; iNetworkIndex < interfaces.size(); ++iNetworkIndex)
     336    for (int iNetworkIndex = 0; iNetworkIndex < interfaces.size() && !failed(); ++iNetworkIndex)
    337337    {
    338338        /* Get iterated interface: */
     
    350350            {
    351351                progress.WaitForCompletion(-1);
    352                 // TODO: Fix problem reporter!
    353                 //vboxProblem().showModalProgressDialog(progress, tr("Performing", "creating/removing host-only network"), "", this);
    354352                if (progress.GetResultCode() != 0)
    355                     // TODO: Fix problem reporter!
    356                     //vboxProblem().cannotRemoveHostInterface(progress, iface, this);
    357                     AssertMsgFailed(("Failed to remove Host-only Network Adapter, result code is %d!\n", progress.GetResultCode()));
     353                {
     354                    /* Mark the page as failed: */
     355                    setFailed(true);
     356                    /* Show error message: */
     357                    vboxProblem().cannotRemoveHostInterface(progress, iface);
     358                }
    358359            }
    359360            else
    360                 // TODO: Fix problem reporter!
    361                 //vboxProblem().cannotRemoveHostInterface(host, iface, this);
    362                 AssertMsgFailed(("Failed to remove Host-only Network Adapter!\n"));
     361            {
     362                /* Mark the page as failed: */
     363                setFailed(true);
     364                /* Show error message: */
     365                vboxProblem().cannotRemoveHostInterface(host, iface);
     366            }
    363367        }
    364368    }
    365369    /* Add all the new interfaces finally: */
    366     for (int iNetworkIndex = 0; iNetworkIndex < m_cache.m_items.size(); ++iNetworkIndex)
     370    for (int iNetworkIndex = 0; iNetworkIndex < m_cache.m_items.size() && !failed(); ++iNetworkIndex)
    367371    {
    368372        /* Get iterated data: */
     
    373377        if (host.isOk())
    374378        {
    375             // TODO: Fix problem reporter!
    376             //vboxProblem().showModalProgressDialog(progress, tr("Performing", "creating/removing host-only network"), "", this);
    377379            progress.WaitForCompletion(-1);
    378380            if (progress.GetResultCode() == 0)
     
    423425            }
    424426            else
    425                 // TODO: Fix problem reporter!
    426                 //vboxProblem().cannotCreateHostInterface(progress, this);
    427                 AssertMsgFailed(("Failed to create Host-only Network Adapter, result code is %d!\n", progress.GetResultCode()));
     427            {
     428                /* Mark the page as failed: */
     429                setFailed(true);
     430                /* Show error message: */
     431                vboxProblem().cannotCreateHostInterface(progress);
     432            }
    428433        }
    429434        else
    430             // TODO: Fix problem reporter!
    431             //vboxProblem().cannotCreateHostInterface(host, this);
    432             AssertMsgFailed(("Failed to create Host-only Network Adapter!\n"));
     435        {
     436            /* Mark the page as failed: */
     437            setFailed(true);
     438            /* Show error message: */
     439            vboxProblem().cannotCreateHostInterface(host);
     440        }
    433441    }
    434442
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSF.cpp

    r33882 r34740  
    356356void UIMachineSettingsSF::saveFromCacheToMachine(CMachine &machine)
    357357{
    358     /* Save machine items from internal cache: */
    359     /* Check if items were changed: */
     358    /* Check if items were NOT changed: */
    360359    if (!mIsListViewChanged)
    361360        return;
     
    363362    /* Delete all machine folders first: */
    364363    const CSharedFolderVector &folders = machine.GetSharedFolders();
    365     for (int iFolderIndex = 0; iFolderIndex < folders.size(); ++iFolderIndex)
     364    for (int iFolderIndex = 0; iFolderIndex < folders.size() && !failed(); ++iFolderIndex)
    366365    {
    367366        const CSharedFolder &folder = folders[iFolderIndex];
     
    371370        if (!machine.isOk())
    372371        {
    373             // TODO: Fix problem reporter!
    374             //vboxProblem().cannotRemoveSharedFolder(this, machine, strFolderName, strFolderPath);
     372            /* Mark the page as failed: */
     373            setFailed(true);
     374            /* Show error message: */
     375            vboxProblem().cannotRemoveSharedFolder(machine, strFolderName, strFolderPath);
    375376        }
    376377    }
    377378
    378379    /* Save all new machine folders: */
    379     for (int iFolderIndex = 0; iFolderIndex < m_cache.m_items.size(); ++iFolderIndex)
     380    for (int iFolderIndex = 0; iFolderIndex < m_cache.m_items.size() && !failed(); ++iFolderIndex)
    380381    {
    381382        const UISharedFolderData &data = m_cache.m_items[iFolderIndex];
     
    385386            if (!machine.isOk())
    386387            {
    387                 // TODO: Fix problem reporter!
    388                 //vboxProblem().cannotCreateSharedFolder(this, machine, data.m_strName, data.m_strHostPath);
     388                /* Mark the page as failed: */
     389                setFailed(true);
     390                /* Show error message: */
     391                vboxProblem().cannotCreateSharedFolder(machine, data.m_strName, data.m_strHostPath);
    389392            }
    390393        }
     
    394397void UIMachineSettingsSF::saveFromCacheToConsole(CConsole &console)
    395398{
    396     /* Save console items from internal cache: */
    397     /* Check if items were changed: */
     399    /* Check if items were NOT changed: */
    398400    if (!mIsListViewChanged)
    399401        return;
     
    401403    /* Delete all console folders first: */
    402404    const CSharedFolderVector &folders = console.GetSharedFolders();
    403     for (int iFolderIndex = 0; iFolderIndex < folders.size(); ++iFolderIndex)
     405    for (int iFolderIndex = 0; iFolderIndex < folders.size() && !failed(); ++iFolderIndex)
    404406    {
    405407        const CSharedFolder &folder = folders[iFolderIndex];
     
    409411        if (!console.isOk())
    410412        {
    411             // TODO: Fix problem reporter!
    412             //vboxProblem().cannotRemoveSharedFolder(this, console, strFolderName, strFolderPath);
     413            /* Mark the page as failed: */
     414            setFailed(true);
     415            /* Show error message: */
     416            vboxProblem().cannotRemoveSharedFolder(console, strFolderName, strFolderPath);
    413417        }
    414418    }
    415419
    416420    /* Save all new console folders: */
    417     for (int iFolderIndex = 0; iFolderIndex < m_cache.m_items.size(); ++iFolderIndex)
     421    for (int iFolderIndex = 0; iFolderIndex < m_cache.m_items.size() && !failed(); ++iFolderIndex)
    418422    {
    419423        const UISharedFolderData &data = m_cache.m_items[iFolderIndex];
     
    423427            if (!console.isOk())
    424428            {
    425                 // TODO: Fix problem reporter!
    426                 //vboxProblem().cannotCreateSharedFolder(this, console, data.m_strName, data.m_strHostPath);
     429                /* Mark the page as failed: */
     430                setFailed(true);
     431                /* Show error message: */
     432                vboxProblem().cannotCreateSharedFolder(console, data.m_strName, data.m_strHostPath);
    427433            }
    428434        }
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp

    r34343 r34740  
    19221922    }
    19231923    /* Save created controllers: */
    1924     for (int iControllerIndex = 0; iControllerIndex < m_cache.m_items.size(); ++iControllerIndex)
     1924    for (int iControllerIndex = 0; iControllerIndex < m_cache.m_items.size() && !failed(); ++iControllerIndex)
    19251925    {
    19261926        const UIStorageControllerData &controllerData = m_cache.m_items[iControllerIndex];
     
    19301930        int cMaxUsedPort = -1;
    19311931        /* Save created attachments: */
    1932         for (int iAttachmentIndex = 0; iAttachmentIndex < controllerData.m_items.size(); ++iAttachmentIndex)
     1932        for (int iAttachmentIndex = 0; iAttachmentIndex < controllerData.m_items.size() && !failed(); ++iAttachmentIndex)
    19331933        {
    19341934            const UIStorageAttachmentData &attachmentData = controllerData.m_items[iAttachmentIndex];
     
    19481948            else
    19491949            {
    1950                 // TODO: Fix problem reporter!
    1951                 //vboxProblem().cannotAttachDevice(this, m_machine, VBoxDefs::MediumType_HardDisk, vboxMedium.location(),
    1952                 //                                 controllerData.m_controllerBus, attachmentData.m_iAttachmentPort, attachmentData.m_iAttachmentDevice);
     1950                /* Mark the page as failed: */
     1951                setFailed(true);
     1952                /* Show error message: */
     1953                vboxProblem().cannotAttachDevice(m_machine, VBoxDefs::MediumType_HardDisk, vboxMedium.location(),
     1954                                                 StorageSlot(controllerData.m_controllerBus,
     1955                                                             attachmentData.m_iAttachmentPort,
     1956                                                             attachmentData.m_iAttachmentDevice));
    19531957            }
    19541958        }
    1955         if (controllerData.m_controllerBus == KStorageBus_SATA)
     1959        if (!failed() && controllerData.m_controllerBus == KStorageBus_SATA)
    19561960        {
    19571961            ULONG uSataPortsCount = cMaxUsedPort + 1;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzd.h

    r29942 r34740  
    126126};
    127127
    128 Q_DECLARE_METATYPE(CMachine);
    129 
    130128#endif // __UIFirstRunWzd_h__
    131129
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp

    r34736 r34740  
    832832                m.AttachDevice(ctrHdName, 0, 0, KDeviceType_HardDisk, medium);
    833833                if (!m.isOk())
    834                     vboxProblem().cannotAttachDevice(this, m, VBoxDefs::MediumType_HardDisk,
    835                                                      field("hardDiskLocation").toString(), StorageSlot(ctrHdBus, 0, 0));
     834                    vboxProblem().cannotAttachDevice(m, VBoxDefs::MediumType_HardDisk, field("hardDiskLocation").toString(),
     835                                                     StorageSlot(ctrHdBus, 0, 0), this);
    836836            }
    837837
     
    839839            m.AttachDevice(ctrDvdName, 1, 0, KDeviceType_DVD, CMedium());
    840840            if (!m.isOk())
    841                 vboxProblem().cannotAttachDevice(this, m, VBoxDefs::MediumType_DVD, QString(), StorageSlot(ctrDvdBus, 1, 0));
     841                vboxProblem().cannotAttachDevice(m, VBoxDefs::MediumType_DVD, QString(), StorageSlot(ctrDvdBus, 1, 0), this);
    842842
    843843            if (m.isOk())
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.h

    r33668 r34740  
    200200};
    201201
    202 Q_DECLARE_METATYPE(CMachine);
    203 
    204202#endif // __UINewVMWzd_h__
    205203
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