VirtualBox

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


Ignore:
Timestamp:
May 26, 2015 2:19:08 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: UIMachineView: Take shortcuts if DnD is not enabled on a per-machine level.

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

Legend:

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

    r55939 r56077  
    182182#ifdef VBOX_WITH_DRAG_AND_DROP
    183183    if (pMachineView->m_pDnDHandler)
     184    {
    184185        delete pMachineView->m_pDnDHandler;
     186        pMachineView->m_pDnDHandler = NULL;
     187    }
    185188#endif
    186189    delete pMachineView;
     
    14171420
    14181421#ifdef VBOX_WITH_DRAG_AND_DROP
     1422bool UIMachineView::dragAndDropIsActive(void) const
     1423{
     1424    return (   m_pDnDHandler
     1425            && machine().GetDnDMode() != KDnDMode_Disabled);
     1426}
     1427
    14191428void UIMachineView::dragEnterEvent(QDragEnterEvent *pEvent)
    14201429{
    14211430    AssertPtrReturnVoid(pEvent);
     1431
     1432    if (!dragAndDropIsActive())
     1433        return;
    14221434
    14231435    /* Get mouse-pointer location. */
     
    14411453    AssertPtrReturnVoid(pEvent);
    14421454
     1455    if (!dragAndDropIsActive())
     1456        return;
     1457
    14431458    /* Get mouse-pointer location. */
    14441459    const QPoint &cpnt = viewportToContents(pEvent->pos());
     
    14611476    AssertPtrReturnVoid(pEvent);
    14621477
     1478    if (!dragAndDropIsActive())
     1479        return;
     1480
    14631481    m_pDnDHandler->dragLeave(screenId());
    14641482
     
    14681486void UIMachineView::dragIsPending(void)
    14691487{
     1488    if (!dragAndDropIsActive())
     1489        return;
     1490
    14701491    /** @todo Add guest->guest DnD functionality here by getting
    14711492     *        the source of guest B (when copying from B to A). */
     
    14761497{
    14771498    AssertPtrReturnVoid(pEvent);
     1499
     1500    if (!dragAndDropIsActive())
     1501        return;
    14781502
    14791503    /* Get mouse-pointer location. */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h

    r55845 r56077  
    259259#ifdef VBOX_WITH_DRAG_AND_DROP
    260260    /**
     261     * Returns @true if drag and drop for this machine is active
     262     * (that is, host->guest, guest->host or bidirectional), @false if not.
     263     */
     264    bool dragAndDropIsActive(void) const;
     265
     266    /**
    261267     * Host -> Guest: Issued when the host cursor enters the guest (VM) window.
    262268     *                The guest will receive the relative cursor coordinates of the
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