VirtualBox

Changeset 1757 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Mar 28, 2007 9:53:17 AM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
19925
Message:

FE/Qt: Hard disk details now show Checking.../Inaccessibe when appropriate instead of dummy zero size.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxSelectorWnd.h

    r1371 r1757  
    9595                                  bool aRefreshSnapshots = true,
    9696                                  bool aRefreshDescription = true);
     97
     98    void mediaEnumStarted();
    9799    void mediaEnumFinished (const VBoxMediaList &);
    98100
     
    133135    QPoint normal_pos;
    134136    QSize normal_size;
     137
     138    bool doneInaccessibleWarningOnce : 1;
    135139};
    136140
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp

    r1706 r1757  
    409409    if (!vboxGlobal_inited)
    410410    {
    411         // check that the QApplication instance is created
     411        /* check that a QApplication instance is created */
    412412        if (qApp)
    413413        {
    414414            vboxGlobal_inited = true;
    415415            vboxGlobal_instance.init();
    416             // add our cleanup handler to the list of Qt post routines
     416            /* add our cleanup handler to the list of Qt post routines */
    417417            qAddPostRoutine (vboxGlobalCleanup);
    418418        }
     
    436436    }
    437437
    438     // @note
    439     //  we don't assign gs to our gset member here, because VBoxCallback
    440     //  will update gset as necessary when new settings are successfullly
    441     //  sent to the VirtualBox server by gs.save()
     438    /* We don't assign gs to our gset member here, because VBoxCallback
     439     * will update gset as necessary when new settings are successfullly
     440     * sent to the VirtualBox server by gs.save(). */
    442441
    443442    return true;
     
    612611    Assert (!aPredict || aHD.GetParent().isNull());
    613612
    614 /// @todo (r=dmik) later: we need to keep *all* media (including all hard disk
    615 //  children) in the current media list in order for the following to work.
    616 //    VBoxMedia media;
    617 //    if (!findMedia (CUnknown (aHD), media))
    618 //    {
    619 //        /* media may be new and not alredy in the media list, request refresh */
    620 //        startEnumeratingMedia();
    621 //        if (!findMedia (CUnknown (aHD), media))
    622 //            AssertFailed();
    623 //    }
     613    VBoxMedia media;
     614    if (!findMedia (CUnknown (aHD), media))
     615    {
     616        /* media may be new and not alredy in the media list, request refresh */
     617        startEnumeratingMedia();
     618        if (!findMedia (CUnknown (aHD), media))
     619            AssertFailed();
     620    }
    624621
    625622    CHardDisk root = aHD.GetRoot();
     
    636633    details += ", ";
    637634
    638     /// @todo (r=dmik) prepend the details with the warning/error
     635    /// @todo prepend the details with the warning/error
    639636    //  icon when not accessible
    640637
    641 /// @todo (r=dmik) later: we need to keep *all* media (including all hard disk
    642 //  children) in the current media list in order for the following to work.
    643 //    switch (media.status)
    644 //    {
    645 //        case VBoxMedia::Unknown:
    646 //            details += tr ("<i>Checking...</i>", "hard disk");
    647 //            break;
    648 //        case VBoxMedia::Ok:
     638    switch (media.status)
     639    {
     640        case VBoxMedia::Unknown:
     641            details += tr ("<i>Checking...</i>", "hard disk");
     642            break;
     643        case VBoxMedia::Ok:
    649644            details += formatSize (root.GetSize() * _1M);
    650 //            break;
    651 //        case VBoxMedia::Error:
    652 //        case VBoxMedia::Inaccessible:
    653 //            details += tr ("Inaccessible", "hard disk");
    654 //            break;
    655 //    }
     645            break;
     646        case VBoxMedia::Error:
     647        case VBoxMedia::Inaccessible:
     648            details += tr ("<i>Inaccessible</i>", "hard disk");
     649            break;
     650    }
    656651
    657652    return details;
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxSelectorWnd.cpp

    r1371 r1757  
    374374                 WFlags aFlags)
    375375    : QMainWindow (aParent, aName, aFlags)
     376    , doneInaccessibleWarningOnce (false)
    376377{
    377378    if (aSelf)
     
    580581            this, SLOT (vmSettings (const QString &)));
    581582
    582     /* listen to "media enumeration finished" signals */
     583    /* listen to media enumeration signals */
     584    connect (&vboxGlobal(), SIGNAL (mediaEnumStarted()),
     585             this, SLOT (mediaEnumStarted()));
    583586    connect (&vboxGlobal(), SIGNAL (mediaEnumFinished (const VBoxMediaList &)),
    584587             this, SLOT (mediaEnumFinished (const VBoxMediaList &)));
     
    12161219}
    12171220
    1218 void VBoxSelectorWnd::mediaEnumFinished (const VBoxMediaList &list)
     1221void VBoxSelectorWnd::mediaEnumStarted()
    12191222{
    12201223    /* refresh the current details to pick up hard disk sizes */
    12211224    vmListBoxCurrentChanged (true /* aRefreshDetails */);
     1225}
     1226
     1227void VBoxSelectorWnd::mediaEnumFinished (const VBoxMediaList &list)
     1228{
     1229    /* refresh the current details to pick up hard disk sizes */
     1230    vmListBoxCurrentChanged (true /* aRefreshDetails */);
     1231
     1232    /* we warn about inaccessible media only once (after media emumeration
     1233     * started from main() at startup), to avoid annoying the user */
     1234    if (doneInaccessibleWarningOnce)
     1235        return;
     1236
     1237    doneInaccessibleWarningOnce = true;
    12221238
    12231239    do
     
    12471263    }
    12481264    while (0);
    1249 
    1250     /* we react to the media enumeration event only once (after media
    1251      * emumeration started from main() at startup), and then disconnect
    1252      * to avoid annoying the user */
    1253     disconnect (&vboxGlobal(), SIGNAL (mediaEnumFinished (const VBoxMediaList &)),
    1254                 this, SLOT (mediaEnumFinished (const VBoxMediaList &)));
    12551265}
    12561266
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