VirtualBox

Ignore:
Timestamp:
Feb 2, 2007 1:57:12 PM (18 years ago)
Author:
vboxsync
Message:

FE/Qt: Latest fixes to VDM and media enumeration process (better cooperation between media cobmoboxes, modal and modeless VDMs during the enumeration).

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

Legend:

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

    r382 r548  
    245245        return toString (aHD.GetType());
    246246    }
    247    
     247
    248248    QString toString (CEnums::DiskControllerType t, LONG d) const;
    249249
     
    321321
    322322    void startEnumeratingMedia();
    323     bool isInEnumeratingProcess() { return media_enum_thread ? true : false; }
    324 
    325     /** Returns a list of all currently enumerated media (it is empty if the
    326      *  enumeration has been finished or never been started). */
    327     VBoxMediaList currentMediaList() const { return media_list; }
     323
     324    /**
     325     *  Returns a list of all currently registered media. This list is used
     326     *  to globally track the accessiblity state of all media on a dedicated
     327     *  thread. This the list is initially empty (before the first enumeration
     328     *  process is started using #startEnumeratingMedia()).
     329     */
     330    const VBoxMediaList &currentMediaList() const { return media_list; }
     331
     332    /** Returns true if the media enumeration is in progress. */
     333    bool isMediaEnumerationStarted() const { return media_enum_thread != NULL; }
     334
     335    void addMedia (const VBoxMedia &);
     336    void updateMedia (const VBoxMedia &);
     337    void removeMedia (VBoxDefs::DiskType, const QUuid &);
    328338
    329339    /* various helpers */
     
    360370
    361371    /**
    362      *  Emitted during the enumeration process started
    363      *  by #startEnumeratingMedia(). */
    364     void mediaEnumerated (const VBoxMedia &media);
     372     *  Emitted at the beginning of the enumeration process started
     373     *  by #startEnumeratingMedia().
     374     */
     375    void mediaEnumStarted();
     376
     377    /**
     378     *  Emitted when a new media item from the list has updated
     379     *  its accessibility state.
     380     */
     381    void mediaEnumerated (const VBoxMedia &aMedia, int aIndex);
    365382
    366383    /**
     
    368385     *  by #startEnumeratingMedia().
    369386     *  @note #currentMediaList() will return an empty list
    370      *  when this signal is emitted, use the argument instead. */
    371     void mediaEnumerated (const VBoxMediaList &list);
     387     *  when this signal is emitted, use the argument instead.
     388     */
     389    void mediaEnumFinished (const VBoxMediaList &aList);
     390
     391    /** Emitted when a new media is added using #addMedia(). */
     392    void mediaAdded (const VBoxMedia &);
     393
     394    /** Emitted when the media is updated using #updateMedia(). */
     395    void mediaUpdated (const VBoxMedia &);
     396
     397    /** Emitted when the media is removed using #removeMedia(). */
     398    void mediaRemoved (VBoxDefs::DiskType, const QUuid &);
    372399
    373400    /* signals emitted when the VirtualBox callback is called by the server
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxMediaComboBox.h

    r382 r548  
    2727
    2828#include <qcombobox.h>
    29 #include <quuid.h>
    3029
    3130class QListBoxItem;
     
    3736public:
    3837
    39     VBoxMediaComboBox (QWidget *aParent = 0,
    40                        const char *aName = 0, int aType = 0);
     38    VBoxMediaComboBox (QWidget *aParent = 0, const char *aName = 0,
     39                       int aType = 0, bool aUseEmptyItem = false);
    4140    ~VBoxMediaComboBox() {}
    4241
    4342    void  refresh();
    44     void  appendItem (const QString &, const QUuid &, const QString &);
    45     void  replaceItem (int, const QString &, const QString &);
    46     void  removeLastItem();
    47     void  setReadyForRefresh();
    48     void  setRequiredItem (const QUuid &);
    4943    void  setUseEmptyItem (bool);
    5044    void  setBelongsTo (const QUuid &);
    5145    QUuid getId();
    5246    QUuid getBelongsTo();
    53     void setCurrentItem (int);
     47    void  setCurrentItem (const QUuid &);
    5448
    5549protected slots:
    5650
    57     void mediaEnumerated (const VBoxMedia &);
    58     void listEnumerated (const VBoxMediaList &);
     51    void mediaEnumStarted();
     52    void mediaEnumerated (const VBoxMedia &, int);
     53    void mediaEnumFinished (const VBoxMediaList &);
     54    void mediaAdded (const VBoxMedia &);
     55    void mediaUpdated (const VBoxMedia &);
     56    void mediaRemoved (VBoxDefs::DiskType, const QUuid &);
    5957    void processOnItem (QListBoxItem *);
    60     void updateToolTip (int);
     58    void processActivated (int);
    6159
    6260protected:
    6361
    64     void loadCleanContent();
    65     int updateMedia (const QString &, const QUuid &, const QString &,
    66                      VBoxMedia::Status);
     62    void updateToolTip (int);
     63    void setCurrentItem (int);
     64    void processMedia (const VBoxMedia &);
     65    void processHdMedia (const VBoxMedia &);
     66    void processCdMedia (const VBoxMedia &);
     67    void processFdMedia (const VBoxMedia &);
     68    void appendItem (const QString &, const QUuid &,
     69                     const QString &, QPixmap *);
     70    void replaceItem (int, const QString &,
     71                      const QString &, QPixmap *);
     72    void updateShortcut (const QString &, const QUuid &, const QString &,
     73                          VBoxMedia::Status);
    6774
    6875    int         mType;
     
    7279    QUuid       mRequiredId;
    7380    bool        mUseEmptyItem;
    74     bool        mToBeRefreshed;
     81    QPixmap     mPmInacc;
     82    QPixmap     mPmError;
    7583};
    7684
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxSelectorWnd.h

    r382 r548  
    9191    void vmListBoxCurrentChanged (bool aRefreshDetails = true,
    9292                                  bool aRefreshSnapshots = true);
    93     void mediaEnumerated (const VBoxMediaList &list);
     93    void mediaEnumFinished (const VBoxMediaList &);
    9494
    9595    /* VirtualBox callback events we're interested in */
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