VirtualBox

Changeset 30542 in vbox


Ignore:
Timestamp:
Jun 30, 2010 9:53:06 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt: 5078: Separate UI Mouse-Handler for running VM: Better place for mouse-handler (and other handlers in future) registering procedure.

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

Legend:

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

    r30408 r30542  
    554554}
    555555
     556void UIMachineLogic::prepareHandlers()
     557{
     558    /* Create mouse-handler: */
     559    setMouseHandler(UIMouseHandler::create(this, visualStateType()));
     560}
     561
    556562#ifdef Q_WS_MAC
    557563void UIMachineLogic::prepareDock()
     
    647653}
    648654#endif /* Q_WS_MAC */
     655
     656void UIMachineLogic::cleanupHandlers()
     657{
     658    /* Cleanup mouse-handler: */
     659    UIMouseHandler::destroy(mouseHandler());
     660}
    649661
    650662void UIMachineLogic::sltMachineStateChanged()
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r30408 r30542  
    115115    virtual void prepareActionConnections();
    116116    virtual void prepareActionGroups();
     117    virtual void prepareHandlers();
    117118#ifdef Q_WS_MAC
    118119    virtual void prepareDock();
     
    125126    virtual void cleanupDock();
    126127#endif /* Q_WS_MAC */
     128    virtual void cleanupHandlers();
    127129    //virtual void cleanupActionGroups() {}
    128130    //virtual void cleanupActionConnections() {}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r30409 r30542  
    556556    NOREF(ok);
    557557#endif
    558 
    559     /* Register mouse-handler: */
    560     machineLogic()->mouseHandler()->addMachineView(screenId(), this);
    561558}
    562559
     
    615612void UIMachineView::cleanupCommon()
    616613{
    617     /* Unregister mouse-handler: */
    618     machineLogic()->mouseHandler()->delMachineView(screenId());
    619 
    620614#ifdef Q_WS_PM
    621615    bool ok = VBoxHlpUninstallKbdHook(0, winId(), UM_PREACCEL_CHAR);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp

    r30213 r30542  
    3535#include "UISession.h"
    3636#include "UIActionsPool.h"
     37#include "UIMouseHandler.h"
    3738#include "UIMachineLogic.h"
    3839#include "UIMachineWindow.h"
     
    458459}
    459460
     461void UIMachineWindow::prepareHandlers()
     462{
     463    /* Register machine-view in mouse-handler: */
     464    machineLogic()->mouseHandler()->addMachineView(m_uScreenId, this->machineView());
     465}
     466
     467void UIMachineWindow::cleanupHandlers()
     468{
     469    /* Unregister machine-view from mouse-handler: */
     470    machineLogic()->mouseHandler()->delMachineView(m_uScreenId);
     471}
     472
    460473void UIMachineWindow::updateAppearanceOf(int iElement)
    461474{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h

    r30213 r30542  
    8080    virtual void prepareMachineViewContainer();
    8181    //virtual void loadWindowSettings() {}
     82    virtual void prepareHandlers();
    8283
    8384    /* Cleanup helpers: */
     85    virtual void cleanupHandlers();
    8486    //virtual void saveWindowSettings() {}
    8587    //virtual void cleanupMachineViewContainer() {}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp

    r30408 r30542  
    5555    /* Cleanup machine window(s): */
    5656    cleanupMachineWindows();
     57
     58    /* Cleanup handlers: */
     59    cleanupHandlers();
    5760
    5861    /* Cleanup action related stuff */
     
    133136    prepareActionConnections();
    134137
     138    /* Prepare handlers: */
     139    prepareHandlers();
     140
    135141    /* Prepare machine window: */
    136142    prepareMachineWindows();
     
    194200    /* Update the multi screen layout: */
    195201    m_pScreenLayout->update();
    196 
    197     /* Create mouse-handler: */
    198     UIMouseHandler *pMouseHandler = UIMouseHandler::create(this, visualStateType());
    199     setMouseHandler(pMouseHandler);
    200202
    201203    /* Create machine window(s): */
     
    230232    foreach (UIMachineWindow *pMachineWindow, machineWindows())
    231233        UIMachineWindow::destroy(pMachineWindow);
    232 
    233     /* Cleanup mouse-handler: */
    234     UIMouseHandler::destroy(mouseHandler());
    235234
    236235#ifdef Q_WS_MAC
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp

    r30347 r30542  
    6464    prepareMachineView();
    6565
     66    /* Prepare handlers: */
     67    prepareHandlers();
     68
    6669    /* Prepare mini tool-bar: */
    6770    prepareMiniToolBar();
     
    9699    /* Save window settings: */
    97100    saveWindowSettings();
     101
     102    /* Prepare handlers: */
     103    cleanupHandlers();
    98104
    99105    /* Cleanup machine view: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp

    r30408 r30542  
    5050    /* Cleanup machine window(s): */
    5151    cleanupMachineWindow();
     52
     53    /* Cleanup handlers: */
     54    cleanupHandlers();
    5255}
    5356
     
    6770    /* Prepare action connections: */
    6871    prepareActionConnections();
     72
     73    /* Prepare handlers: */
     74    prepareHandlers();
    6975
    7076    /* Prepare normal machine window: */
     
    143149#endif /* Q_WS_MAC */
    144150
    145     /* Create mouse-handler: */
    146     UIMouseHandler *pMouseHandler = UIMouseHandler::create(this, visualStateType());
    147     setMouseHandler(pMouseHandler);
    148 
    149151    /* Get monitors count: */
    150152    ulong uMonitorCount = session().GetMachine().GetMonitorCount();
     
    169171    foreach (UIMachineWindow *pMachineWindow, machineWindows())
    170172        UIMachineWindow::destroy(pMachineWindow);
    171 
    172     /* Cleanup mouse-handler: */
    173     UIMouseHandler::destroy(mouseHandler());
    174173}
    175174
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r30408 r30542  
    8080    prepareMachineView();
    8181
     82    /* Prepare handlers: */
     83    prepareHandlers();
     84
    8285    /* Load normal window settings: */
    8386    loadWindowSettings();
     
    9497    /* Save normal window settings: */
    9598    saveWindowSettings();
     99
     100    /* Prepare handlers: */
     101    cleanupHandlers();
    96102
    97103    /* Cleanup normal machine view: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp

    r30408 r30542  
    5353    /* Cleanup machine window(s): */
    5454    cleanupMachineWindows();
     55
     56    /* Cleanup handlers: */
     57    cleanupHandlers();
    5558
    5659    /* Cleanup actions groups: */
     
    125128    prepareActionConnections();
    126129
     130    /* Prepare handlers: */
     131    prepareHandlers();
     132
    127133    /* Prepare normal machine window: */
    128134    prepareMachineWindows();
     
    185191    m_pScreenLayout->update();
    186192
    187     /* Create machine mouse-handler: */
    188     UIMouseHandler *pMouseHandler = UIMouseHandler::create(this, visualStateType());
    189     setMouseHandler(pMouseHandler);
    190 
    191193    /* Create machine window(s): */
    192194    for (int cScreenId = 0; cScreenId < m_pScreenLayout->guestScreenCount(); ++cScreenId)
     
    211213    foreach (UIMachineWindow *pMachineWindow, machineWindows())
    212214        UIMachineWindow::destroy(pMachineWindow);
    213 
    214     /* Cleanup mouse-handler: */
    215     UIMouseHandler::destroy(mouseHandler());
    216215}
    217216
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp

    r30347 r30542  
    7575    prepareMachineView();
    7676
     77    /* Prepare handlers: */
     78    prepareHandlers();
     79
    7780    /* Prepare mini tool-bar: */
    7881#ifndef Q_WS_MAC
     
    99102    /* Save window settings: */
    100103    saveWindowSettings();
     104
     105    /* Prepare handlers: */
     106    cleanupHandlers();
    101107
    102108    /* Cleanup machine view: */
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