VirtualBox

Ignore:
Timestamp:
May 6, 2019 5:32:54 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:7127: UIMediumEnumerator: Dummies for new media events, all ifdefed with yet undefined VBOX_GUI_WITH_NEW_MEDIA_EVENTS.

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

Legend:

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

    r78299 r78397  
    9393
    9494    /* Prepare Main event handlers: */
     95#ifndef VBOX_GUI_WITH_NEW_MEDIA_EVENTS
    9596    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineDataChange,
    9697            this, &UIMediumEnumerator::sltHandleMachineUpdate);
     
    105106    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineRegistered,
    106107            this, &UIMediumEnumerator::sltHandleMachineRegistration);
     108#else /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */
     109    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigStorageControllerChange,
     110            this, &UIMediumEnumerator::sltHandleStorageControllerChange);
     111    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigStorageDeviceChange,
     112            this, &UIMediumEnumerator::sltHandleStorageDeviceChange);
     113    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMediumChange,
     114            this, &UIMediumEnumerator::sltHandleMediumChange);
     115    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMediumConfigChange,
     116            this, &UIMediumEnumerator::sltHandleMediumConfigChange);
     117    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMediumRegistered,
     118            this, &UIMediumEnumerator::sltHandleMediumRegistered);
     119#endif /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */
    107120
    108121    /* Prepare global thread-pool listener: */
     
    234247}
    235248
     249#ifndef VBOX_GUI_WITH_NEW_MEDIA_EVENTS
     250
    236251void UIMediumEnumerator::sltHandleMachineUpdate(const QUuid &uMachineID)
    237252{
     
    333348}
    334349
     350#else /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */
     351
     352void UIMediumEnumerator::sltHandleStorageControllerChange(const QUuid &uMachineId, const QString &strControllerName)
     353{
     354    //printf("OnStorageControllerChanged: machine-id=%s, controller-name=%s\n",
     355    //       uMachineId.toString().toUtf8().constData(), strControllerName.toUtf8().constData());
     356    LogRel2(("GUI: UIMediumEnumerator: OnStorageControllerChanged event received, Medium ID = {%s}, Controller Name = {%s}\n",
     357             uMachineId.toString().toUtf8().constData(), strControllerName.toUtf8().constData()));
     358}
     359
     360void UIMediumEnumerator::sltHandleStorageDeviceChange(CMediumAttachment comAttachment, bool fRemoved, bool fSilent)
     361{
     362    //printf("OnStorageDeviceChanged: removed=%d, silent=%d\n",
     363    //       fRemoved, fSilent);
     364    LogRel2(("GUI: UIMediumEnumerator: OnStorageDeviceChanged event received, Removed = {%d}, Silent = {%d}\n",
     365             fRemoved, fSilent));
     366
     367    Q_UNUSED(comAttachment);
     368}
     369
     370void UIMediumEnumerator::sltHandleMediumChange(CMediumAttachment comAttachment)
     371{
     372    //printf("OnMediumChanged\n");
     373    LogRel2(("GUI: UIMediumEnumerator: OnMediumChanged event received\n"));
     374
     375    Q_UNUSED(comAttachment);
     376}
     377
     378void UIMediumEnumerator::sltHandleMediumConfigChange(CMedium comMedium)
     379{
     380    //printf("OnMediumConfigChanged\n");
     381    LogRel2(("GUI: UIMediumEnumerator: OnMediumConfigChanged event received\n"));
     382
     383    Q_UNUSED(comMedium);
     384}
     385
     386void UIMediumEnumerator::sltHandleMediumRegistered(const QUuid &uMediumId, KDeviceType enmMediumType, bool fRegistered)
     387{
     388    //printf("OnMediumRegistered: medium-id=%s, medium-type=%d, registered=%d\n",
     389    //       uMediumId.toString().toUtf8().constData(), enmMediumType, fRegistered);
     390    //printf(" Medium to recache: %s\n",
     391    //       uMediumId.toString().toUtf8().constData());
     392    LogRel2(("GUI: UIMediumEnumerator: OnMediumRegistered event received, Medium ID = {%s}, Medium type = {%d}, Registered = {%d}\n",
     393             uMediumId.toString().toUtf8().constData(), enmMediumType, fRegistered));
     394}
     395
     396#endif /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */
     397
    335398void UIMediumEnumerator::sltHandleMediumEnumerationTaskComplete(UITask *pTask)
    336399{
     
    449512    }
    450513}
     514
     515#ifndef VBOX_GUI_WITH_NEW_MEDIA_EVENTS
    451516
    452517void UIMediumEnumerator::calculateCachedUsage(const QUuid &uMachineID,
     
    596661}
    597662
     663#endif /* !VBOX_GUI_WITH_NEW_MEDIA_EVENTS */
     664
    598665
    599666#include "UIMediumEnumerator.moc"
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.h

    r78299 r78397  
    2222#endif
    2323
     24//#define VBOX_GUI_WITH_NEW_MEDIA_EVENTS
     25
    2426/* Qt includes: */
    2527#include <QObject>
     
    3032#include "UILibraryDefs.h"
    3133#include "UIMedium.h"
     34
     35/* COM includes: */
     36#ifdef VBOX_GUI_WITH_NEW_MEDIA_EVENTS
     37# include "CMedium.h"
     38# include "CMediumAttachment.h"
     39#endif
    3240
    3341/* Forward declarations: */
     
    92100private slots:
    93101
     102#ifndef VBOX_GUI_WITH_NEW_MEDIA_EVENTS
    94103    /** Handles machine-data-change and snapshot-change events for a machine with specified @a uMachineID. */
    95104    void sltHandleMachineUpdate(const QUuid &uMachineID);
     
    99108    /** Handles snapshot-deleted events for a machine with specified @a uMachineID and a snapshot with specified @a uSnapshotID. */
    100109    void sltHandleSnapshotDeleted(const QUuid &uMachineID, const QUuid &uSnapshotID);
     110#else /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */
     111    /** Handles signal about storage controller change.
     112      * @param  uMachineId         Brings the ID of machine corresponding controller belongs to.
     113      * @param  strControllerName  Brings the name of controller this event is related to. */
     114    void sltHandleStorageControllerChange(const QUuid &uMachineId, const QString &strControllerName);
     115    /** Handles signal about storage device change.
     116      * @param  comAttachment  Brings corresponding attachment.
     117      * @param  fRemoved       Brings whether medium is removed or added.
     118      * @param  fSilent        Brings whether this change has gone silent for guest. */
     119    void sltHandleStorageDeviceChange(CMediumAttachment comAttachment, bool fRemoved, bool fSilent);
     120    /** Handles signal about storage medium @a comAttachment state change. */
     121    void sltHandleMediumChange(CMediumAttachment comAttachment);
     122    /** Handles signal about storage @a comMedium config change. */
     123    void sltHandleMediumConfigChange(CMedium comMedium);
     124    /** Handles signal about storage medium is (un)registered.
     125      * @param  uMediumId      Brings corresponding medium ID.
     126      * @param  enmMediumType  Brings corresponding medium type.
     127      * @param  fRegistered    Brings whether medium is registered or unregistered. */
     128    void sltHandleMediumRegistered(const QUuid &uMediumId, KDeviceType enmMediumType, bool fRegistered);
     129#endif /* VBOX_GUI_WITH_NEW_MEDIA_EVENTS */
    101130
    102131    /** Handles medium-enumeration @a pTask complete signal. */
     
    112141    void addMediaToMap(const CMediumVector &inputMedia, UIMediumMap &outputMedia);
    113142
     143#ifndef VBOX_GUI_WITH_NEW_MEDIA_EVENTS
    114144    /** Updates usage for machine with specified @a uMachineID on the basis of cached data.
    115145      * @param  previousUIMediumIDs               Brings UIMedium IDs used in cached data.
     
    147177    void recacheFromActualUsage(const CMediumMap &currentCMediums,
    148178                                const QList<QUuid> &currentCMediumIDs);
     179#endif /* !VBOX_GUI_WITH_NEW_MEDIA_EVENTS */
    149180
    150181    /** Holds whether consolidated medium-enumeration process is in progress. */
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