VirtualBox

Ignore:
Timestamp:
Apr 24, 2015 1:52:33 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
99765
Message:

DnD: Protocol overhaul with versioning added which now can communicate with Main.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r55305 r55422  
    55
    66/*
    7  * Copyright (C) 2006-2014 Oracle Corporation
     7 * Copyright (C) 2006-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    7373# ifdef VBOX_WITH_DRAG_AND_DROP
    7474#  include "CGuest.h"
     75#  include "CDnDTarget.h"
    7576# endif /* VBOX_WITH_DRAG_AND_DROP */
    7677
     
    23942395{
    23952396    error(pParent, MessageType_Error,
    2396           tr("Failed to drop data."),
     2397          tr("Drag and drop operation failed."),
    23972398          formatErrorInfo(guest));
    23982399}
     
    24012402{
    24022403    error(pParent, MessageType_Error,
    2403           tr("Failed to drop data."),
     2404          tr("Failed while dropping data."),
    24042405          formatErrorInfo(progress));
     2406}
     2407
     2408void UIMessageCenter::cannotCancelDrop(const CDnDTarget &dndTarget, QWidget *pParent /* = 0*/) const
     2409{
     2410    error(pParent, MessageType_Error,
     2411          tr("Unable to cancel drag and drop operation."),
     2412          formatErrorInfo(dndTarget));
    24052413}
    24062414#endif /* VBOX_WITH_DRAG_AND_DROP */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r55401 r55422  
    351351    void cannotDropData(const CGuest &guest, QWidget *pParent = 0) const;
    352352    void cannotDropData(const CProgress &progress, QWidget *pParent = 0) const;
     353    void cannotCancelDrop(const CDnDTarget &dndTarget, QWidget *pParent = 0) const;
    353354#endif /* VBOX_WITH_DRAG_AND_DROP */
    354355
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDHandler.cpp

    r52730 r55422  
    55
    66/*
    7  * Copyright (C) 2011-2014 Oracle Corporation
     7 * Copyright (C) 2011-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4343#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
    4444
    45 #undef LOG_GROUP
     45#ifdef LOG_GROUP
     46 #undef LOG_GROUP
     47#endif
    4648#define LOG_GROUP LOG_GROUP_GUEST_DND
    4749#include <VBox/log.h>
    48 
    4950
    5051
     
    127128            && !format.isEmpty())
    128129        {
    129             /* Convert the actual MIME data to a vector (needed
    130              * for the COM wrapper). */
     130            /* Convert the actual MIME data to a vector (needed for the COM wrapper). */
    131131            QVector<uint8_t> dv(d.size());
    132132            memcpy(dv.data(), d.constData(), d.size());
    133133
    134134            CProgress progress = dndTarget.SendData(screenId, format, dv);
    135             if (guest.isOk())
     135
     136            if (progress.isOk())
    136137            {
     138                LogFlowFunc(("Transferring data to guest ...\n"));
     139
    137140                msgCenter().showModalProgressDialog(progress,
    138141                                                    tr("Dropping data ..."), ":/progress_dnd_hg_90px.png",
    139142                                                    pParent);
    140                 if (   !progress.GetCanceled()
     143
     144                LogFlowFunc(("Transfer fCompleted=%RTbool, fCanceled=%RTbool, hr=%Rhrc\n",
     145                             progress.GetCompleted(), progress.GetCanceled(), progress.GetResultCode()));
     146
     147                BOOL fCanceled = progress.GetCanceled();
     148
     149                /* Some error occurred? */
     150                if (   !fCanceled
    141151                    && (   !progress.isOk()
    142152                        ||  progress.GetResultCode() != 0))
     
    145155                    result = KDnDAction_Ignore;
    146156                }
     157                #if 0
     158                else if (fCanceled) /* Operation canceled by user? */
     159                {
     160                    Assert(progress.isOk());
     161                    Assert(progress.GetResultCode() == 0);
     162
     163                    /* Tell the guest. */
     164                    BOOL fVeto = dndTarget.Cancel();
     165                    if (fVeto) /* Cancelling vetoed by the target? Tell the user why. */
     166                        msgCenter().cannotCancelDrop(dndTarget, pParent);
     167                }
     168                #endif
    147169            }
    148170            else
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