VirtualBox

Changeset 80543 in vbox for trunk/src


Ignore:
Timestamp:
Sep 2, 2019 9:34:46 AM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9510: Updating Clipboard and DnD modes.

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

Legend:

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

    r79365 r80543  
    2727#include "COMEnums.h"
    2828#include "CCanShowWindowEvent.h"
     29#include "CClipboardModeChangedEvent.h"
    2930#include "CCursorPositionChangedEvent.h"
     31#include "CDnDModeChangedEvent.h"
    3032#include "CEvent.h"
    3133#include "CEventSource.h"
     
    523525            break;
    524526        }
    525 
     527        case KVBoxEventType_OnClipboardModeChanged:
     528        {
     529            CClipboardModeChangedEvent comEventSpecific(pEvent);
     530            emit sigClipboardModeChange(comEventSpecific.GetClipboardMode());
     531            break;
     532        }
     533        case KVBoxEventType_OnDnDModeChanged:
     534        {
     535            CDnDModeChangedEvent comEventSpecific(pEvent);
     536            emit sigDnDModeChange(comEventSpecific.GetDndMode());
     537            break;
     538        }
    526539        default: break;
    527540    }
     
    534547
    535548#include "UIMainEventListener.moc"
    536 
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.h

    r80044 r80543  
    167167        /** Notifies about audio adapter state change. */
    168168        void sigAudioAdapterChange();
     169        /** Notifies about the clipboard mode change. */
     170        void sigClipboardModeChange(KClipboardMode enmClipboardMode);
     171        /** Notifies about the drag and drop mode change. */
     172        void sigDnDModeChange(KDnDMode enmDnDMode);
    169173    /** @} */
    170174
     
    216220
    217221#endif /* !FEQT_INCLUDED_SRC_globals_UIMainEventListener_h */
    218 
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r79365 r80543  
    800800    emit sigAudioAdapterChange();
    801801
     802}
     803
     804void UISession::sltClipboardModeChange(KClipboardMode enmMode)
     805{
     806    emit sigClipboardModeChange(enmMode);
     807}
     808
     809void UISession::sltDnDModeChange(KDnDMode enmMode)
     810{
     811    emit sigDnDModeChange(enmMode);
    802812}
    803813
     
    11891199    connect(gConsoleEvents, SIGNAL(sigAudioAdapterChange()),
    11901200            this, SLOT(sltAudioAdapterChange()));
     1201
     1202    connect(gConsoleEvents, SIGNAL(sigClipboardModeChange(KClipboardMode)),
     1203            this, SLOT(sltClipboardModeChange(KClipboardMode)));
     1204
     1205    connect(gConsoleEvents, SIGNAL(sigDnDModeChange(KDnDMode)),
     1206            this, SLOT(sltDnDModeChange(KDnDMode)));
    11911207}
    11921208
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r77841 r80543  
    336336    void sigGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
    337337    void sigAudioAdapterChange();
     338    void sigClipboardModeChange(KClipboardMode enmMode);
     339    void sigDnDModeChange(KDnDMode enmMode);
    338340
    339341    /** Notifies about host-screen count change. */
     
    388390    /** Handles audio adapter change. */
    389391    void sltAudioAdapterChange();
     392    /** Handles clip board mode change. */
     393    void sltClipboardModeChange(KClipboardMode enmMode);
     394    /** Handles drag and drop mode change. */
     395    void sltDnDModeChange(KDnDMode enmMode);
    390396
    391397    /* Handlers: Display reconfiguration stuff: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.cpp

    r80525 r80543  
    8080
    8181    UIRuntimeInfoWidget(QWidget *pParent, const CMachine &machine, const CConsole &console);
    82     void guestMonitorChange(ulong uScreenId);
    83     void guestAdditionStateChange();
    84     void VRDEChange();
     82    void updateScreenInfo(int iScreenId = -1);
     83    void updateGAsVersion();
     84    void updateVRDE();
     85    void updateClipboardMode(KClipboardMode enmMode = KClipboardMode_Max);
     86    void updateDnDMode(KDnDMode enmMode = KDnDMode_Max);
    8587
    8688protected:
     
    9799
    98100    void createInfoRows();
    99     void updateScreenInfo(int iScreenId = -1);
    100101    void updateUpTime();
    101     void updateGAsVersion();
    102     void updateVRDE();
     102
     103
    103104    /** Searches the table for the @p item of enmLine and replaces its text. if not found inserts a new
    104105      * row to the end of the table. Assumes only one line of the @p enmLine exists. */
     
    234235{
    235236    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    236 
     237    setAlternatingRowColors(true);
    237238    m_iFontHeight = QFontMetrics(font()).height();
    238239
     
    266267    computeMinimumWidth();
    267268}
    268 
    269 void UIRuntimeInfoWidget::guestMonitorChange(ulong uScreenId)
    270 {
    271     updateScreenInfo(uScreenId);
    272 }
    273 
    274 void UIRuntimeInfoWidget::guestAdditionStateChange()
    275 {
    276     updateGAsVersion();
    277 }
    278 
    279 void UIRuntimeInfoWidget::VRDEChange()
    280 {
    281     updateVRDE();
    282 }
    283 
    284269
    285270void UIRuntimeInfoWidget::retranslateUi()
     
    423408void UIRuntimeInfoWidget::updateVRDE()
    424409{
    425     /* VRDE information: */
    426410    int iVRDEPort = m_console.GetVRDEServerInfo().GetPort();
    427411    QString strVRDEInfo = (iVRDEPort == 0 || iVRDEPort == -1) ?
    428412        m_strNotAvailable : QString("%1").arg(iVRDEPort);
    429413   updateInfoRow(InfoRow_RemoteDesktop, QString("%1:").arg(m_strRemoteDesktopLabel), strVRDEInfo);
     414}
     415
     416void UIRuntimeInfoWidget::updateClipboardMode(KClipboardMode enmMode /* = KClipboardMode_Max */)
     417{
     418    if (enmMode == KClipboardMode_Max)
     419        updateInfoRow(InfoRow_ClipboardMode, QString("%1:").arg(m_strClipboardModeLabel),
     420                      gpConverter->toString(m_machine.GetClipboardMode()));
     421    else
     422        updateInfoRow(InfoRow_ClipboardMode, QString("%1:").arg(m_strClipboardModeLabel),
     423                      gpConverter->toString(enmMode));
     424}
     425
     426void UIRuntimeInfoWidget::updateDnDMode(KDnDMode enmMode /* = KDnDMode_Max */)
     427{
     428    if (enmMode == KDnDMode_Max)
     429        updateInfoRow(InfoRow_DnDMode, QString("%1:").arg(m_strDragAndDropLabel),
     430                  gpConverter->toString(m_machine.GetDnDMode()));
     431    else
     432        updateInfoRow(InfoRow_DnDMode, QString("%1:").arg(m_strDragAndDropLabel),
     433                      gpConverter->toString(enmMode));
    430434}
    431435
     
    452456    updateUpTime();
    453457
    454     /* Determine clipboard mode: */
    455     QString strClipboardMode = gpConverter->toString(m_machine.GetClipboardMode());
    456     /* Determine Drag&Drop mode: */
    457     QString strDnDMode = gpConverter->toString(m_machine.GetDnDMode());
    458458
    459459    /* Determine virtualization attributes: */
     
    496496        strOSType = uiCommon().vmGuestOSTypeDescription(strOSType);
    497497
    498 
    499     insertInfoRow(InfoRow_ClipboardMode, QString("%1:").arg(m_strClipboardModeLabel), strClipboardMode);
    500     insertInfoRow(InfoRow_DnDMode, QString("%1:").arg(m_strDragAndDropLabel), strDnDMode);
     498    updateClipboardMode();
     499    updateDnDMode();
    501500    insertInfoRow(InfoRow_ExecutionEngine, QString("%1:").arg(m_strExcutionEngineLabel), strExecutionEngine);
    502501    insertInfoRow(InfoRow_NestedPaging, QString("%1:").arg(m_strNestedPagingLabel), strNestedPaging);
     
    506505    insertInfoRow(InfoRow_GuestOSType, QString("%1:").arg(m_strGuestOSTypeLabel), strOSType);
    507506    updateVRDE();
    508 
    509507
    510508    resizeColumnToContents(0);
     
    11191117    connect(pSession, &UISession::sigGuestMonitorChange, this, &UIInformationRuntime::sltGuestMonitorChange);
    11201118    connect(pSession, &UISession::sigVRDEChange, this, &UIInformationRuntime::sltVRDEChange);
     1119    connect(pSession, &UISession::sigClipboardModeChange, this, &UIInformationRuntime::sltClipboardChange);
     1120    connect(pSession, &UISession::sigDnDModeChange, this, &UIInformationRuntime::sltDnDModeChange);
    11211121
    11221122    prepareMetrics();
     
    13711371{
    13721372    if (m_pRuntimeInfoWidget)
    1373         m_pRuntimeInfoWidget->guestAdditionStateChange();
     1373        m_pRuntimeInfoWidget->updateGAsVersion();
    13741374    bool fGuestAdditionsAvailable = guestAdditionsAvailable(6 /* minimum major version */);
    13751375    if (m_fGuestAdditionsAvailable == fGuestAdditionsAvailable)
     
    13841384    Q_UNUSED(screenGeo);
    13851385    if (m_pRuntimeInfoWidget)
    1386         m_pRuntimeInfoWidget->guestMonitorChange(uScreenId);
     1386        m_pRuntimeInfoWidget->updateScreenInfo(uScreenId);
    13871387}
    13881388
     
    13901390{
    13911391    if (m_pRuntimeInfoWidget)
    1392         m_pRuntimeInfoWidget->VRDEChange();
     1392        m_pRuntimeInfoWidget->updateVRDE();
     1393}
     1394
     1395void UIInformationRuntime::sltClipboardChange(KClipboardMode enmMode)
     1396{
     1397    if (m_pRuntimeInfoWidget)
     1398        m_pRuntimeInfoWidget->updateClipboardMode(enmMode);
     1399}
     1400
     1401void UIInformationRuntime::sltDnDModeChange(KDnDMode enmMode)
     1402{
     1403    if (m_pRuntimeInfoWidget)
     1404        m_pRuntimeInfoWidget->updateDnDMode(enmMode);
    13931405}
    13941406
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.h

    r80525 r80543  
    157157    void sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo);
    158158    void sltVRDEChange();
     159    void sltClipboardChange(KClipboardMode enmMode);
     160    void sltDnDModeChange(KDnDMode enmMode);
    159161
    160162private:
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