VirtualBox

Changeset 83040 in vbox


Ignore:
Timestamp:
Feb 10, 2020 5:08:22 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Chooser pane: No dragging for cloud groups and items.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItem.cpp

    r82968 r83040  
    495495        return;
    496496
    497     /* Initialize dragging: */
    498     QDrag *pDrag = new QDrag(pEvent->widget());
    499     model()->setCurrentDragObject(pDrag);
    500     pDrag->setPixmap(toPixmap());
    501     pDrag->setMimeData(createMimeData());
    502     pDrag->exec(Qt::MoveAction | Qt::CopyAction, Qt::MoveAction);
     497    /* Initialize dragging for local VMs only: */
     498    if (!m_pNode->hasAtLeastOneCloudNode())
     499    {
     500        QDrag *pDrag = new QDrag(pEvent->widget());
     501        model()->setCurrentDragObject(pDrag);
     502        pDrag->setPixmap(toPixmap());
     503        pDrag->setMimeData(createMimeData());
     504        pDrag->exec(Qt::MoveAction | Qt::CopyAction, Qt::MoveAction);
     505    }
    503506}
    504507
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNode.h

    r82968 r83040  
    9797    virtual void updateAllNodes(const QUuid &uId) = 0;
    9898
     99    /** Returns whether this node is a cloud node itself
     100      * or contains at least one cloud VM node child. */
     101    virtual bool hasAtLeastOneCloudNode() const = 0;
     102
    99103    /** Returns node position. */
    100104    int position();
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeGlobal.cpp

    r82968 r83040  
    109109}
    110110
     111bool UIChooserNodeGlobal::hasAtLeastOneCloudNode() const
     112{
     113    return false;
     114}
     115
    111116int UIChooserNodeGlobal::positionOf(UIChooserNode *pNode)
    112117{
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeGlobal.h

    r82968 r83040  
    7777    virtual void updateAllNodes(const QUuid &uId) /* override */;
    7878
     79    /** Returns whether this node is a cloud node itself
     80      * or contains at least one cloud VM node child. */
     81    virtual bool hasAtLeastOneCloudNode() const /* override */;
     82
    7983    /** Returns position of specified node inside this one. */
    8084    virtual int positionOf(UIChooserNode *pNode) /* override */;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeGroup.cpp

    r82968 r83040  
    163163    foreach (UIChooserNode *pNode, nodes())
    164164        pNode->updateAllNodes(uId);
     165}
     166
     167bool UIChooserNodeGroup::hasAtLeastOneCloudNode() const
     168{
     169    foreach (UIChooserNode *pNode, m_nodesGroup)
     170        if (pNode->hasAtLeastOneCloudNode())
     171            return true;
     172
     173    foreach (UIChooserNode *pNode, m_nodesMachine)
     174        if (pNode->hasAtLeastOneCloudNode())
     175            return true;
     176
     177    return false;
    165178}
    166179
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeGroup.h

    r82968 r83040  
    7979    virtual void updateAllNodes(const QUuid &uId) /* override */;
    8080
     81    /** Returns whether this node is a cloud node itself
     82      * or contains at least one cloud VM node child. */
     83    virtual bool hasAtLeastOneCloudNode() const /* override */;
     84
    8185    /** Returns position of specified node inside this one. */
    8286    virtual int positionOf(UIChooserNode *pNode) /* override */;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeMachine.cpp

    r83000 r83040  
    161161}
    162162
     163bool UIChooserNodeMachine::hasAtLeastOneCloudNode() const
     164{
     165    return cache()->itemType() != UIVirtualMachineItem::ItemType_Local;
     166}
     167
    163168int UIChooserNodeMachine::positionOf(UIChooserNode *pNode)
    164169{
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeMachine.h

    r83000 r83040  
    9595    virtual void updateAllNodes(const QUuid &uId) /* override */;
    9696
     97    /** Returns whether this node is a cloud node itself
     98      * or contains at least one cloud VM node child. */
     99    virtual bool hasAtLeastOneCloudNode() const /* override */;
     100
    97101    /** Returns position of specified node inside this one. */
    98102    virtual int positionOf(UIChooserNode *pNode) /* override */;
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