VirtualBox

Changeset 90567 in vbox


Ignore:
Timestamp:
Aug 7, 2021 11:50:28 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
146173
Message:

FE/Qt: bugref:10067: Create UINotificationCenter for Runtime UI; Enable it for Normal, Full-screen and Scaled visual states for now.

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

Legend:

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

    r90083 r90567  
    112112    prepareMachineView();
    113113
     114    /* Prepare notification-center: */
     115    prepareNotificationCenter();
     116
    114117    /* Prepare handlers: */
    115118    prepareHandlers();
     
    151154    /* Cleanup visual-state: */
    152155    cleanupVisualState();
     156
     157    /* Cleanup notification-center: */
     158    cleanupNotificationCenter();
    153159
    154160    /* Cleanup machine-view: */
     
    519525}
    520526
     527void UIMachineWindow::prepareNotificationCenter()
     528{
     529    // for now it will be added from within particular visual mode windows ..
     530}
     531
    521532void UIMachineWindow::prepareHandlers()
    522533{
     
    535546    /* Unregister keyboard-handler: */
    536547    machineLogic()->keyboardHandler()->cleanupListener(m_uScreenId);
     548}
     549
     550void UIMachineWindow::cleanupNotificationCenter()
     551{
     552    // for now it will be removed from within particular visual mode windows ..
    537553}
    538554
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h

    r86051 r90567  
    164164    virtual void prepareStatusBar() {}
    165165    virtual void prepareMachineView();
     166    virtual void prepareNotificationCenter();
    166167    virtual void prepareVisualState() {}
    167168    virtual void prepareHandlers();
     
    172173    virtual void cleanupHandlers();
    173174    virtual void cleanupVisualState() {}
     175    virtual void cleanupNotificationCenter();
    174176    virtual void cleanupMachineView();
    175177    virtual void cleanupStatusBar() {}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r90167 r90567  
    4545#include "UIMessageCenter.h"
    4646#include "UIMousePointerShapeData.h"
     47#include "UINotificationCenter.h"
    4748#include "UIPopupCenter.h"
    4849#include "UIWizardFirstRun.h"
     
    526527    cleanupFramebuffers();
    527528    cleanupConsoleEventHandlers();
     529    cleanupNotificationCenter();
    528530    cleanupSession();
    529531}
     
    939941    if (!prepareSession())
    940942        return false;
     943    prepareNotificationCenter();
    941944    prepareConsoleEventHandlers();
    942945    prepareFramebuffers();
     
    10091012    /* True by default: */
    10101013    return true;
     1014}
     1015
     1016void UISession::prepareNotificationCenter()
     1017{
     1018    UINotificationCenter::create();
    10111019}
    10121020
     
    13541362}
    13551363
     1364void UISession::cleanupNotificationCenter()
     1365{
     1366    UINotificationCenter::destroy();
     1367}
     1368
    13561369void UISession::cleanupSession()
    13571370{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r90086 r90567  
    395395    bool prepare();
    396396    bool prepareSession();
     397    void prepareNotificationCenter();
    397398    void prepareConsoleEventHandlers();
    398399    void prepareFramebuffers();
     
    414415    void cleanupFramebuffers();
    415416    void cleanupConsoleEventHandlers();
     417    void cleanupNotificationCenter();
    416418    void cleanupSession();
    417419    void cleanup();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp

    r88649 r90567  
    3232#include "UIMachineWindowFullscreen.h"
    3333#include "UIMachineView.h"
     34#include "UINotificationCenter.h"
    3435#if   defined(VBOX_WS_WIN) || defined(VBOX_WS_X11)
    3536# include "UIMachineDefs.h"
     
    216217
    217218    showMinimized();
     219}
     220
     221void UIMachineWindowFullscreen::prepareNotificationCenter()
     222{
     223    if (gpNotificationCenter && (m_uScreenId == 0))
     224        gpNotificationCenter->setParent(centralWidget());
    218225}
    219226
     
    325332    /* Call to base-class: */
    326333    UIMachineWindow::cleanupVisualState();
     334}
     335
     336void UIMachineWindowFullscreen::cleanupNotificationCenter()
     337{
     338    if (gpNotificationCenter && (gpNotificationCenter->parent() == centralWidget()))
     339        gpNotificationCenter->setParent(0);
    327340}
    328341
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h

    r88635 r90567  
    8888private:
    8989
     90    /** Prepare notification-center routine. */
     91    void prepareNotificationCenter();
    9092    /** Prepare visual-state routine. */
    9193    void prepareVisualState();
     
    101103    /** Cleanup visual-state routine. */
    102104    void cleanupVisualState();
     105    /** Cleanup notification-center routine. */
     106    void cleanupNotificationCenter();
    103107
    104108    /** Updates geometry according to visual-state. */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r88655 r90567  
    3737#include "UIMachineLogic.h"
    3838#include "UIMachineView.h"
     39#include "UINotificationCenter.h"
    3940#include "UIIconPool.h"
    4041#include "UISession.h"
     
    319320}
    320321
     322void UIMachineWindowNormal::prepareNotificationCenter()
     323{
     324    if (gpNotificationCenter && (m_uScreenId == 0))
     325        gpNotificationCenter->setParent(centralWidget());
     326}
     327
    321328void UIMachineWindowNormal::prepareVisualState()
    322329{
     
    422429        UICocoaApplication::instance()->unregisterCallbackForStandardWindowButton(this, StandardWindowButtonType_Zoom);
    423430#endif /* VBOX_WS_MAC */
     431}
     432
     433void UIMachineWindowNormal::cleanupNotificationCenter()
     434{
     435    if (gpNotificationCenter && (gpNotificationCenter->parent() == centralWidget()))
     436        gpNotificationCenter->setParent(0);
    424437}
    425438
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h

    r88651 r90567  
    9898    /** Prepare status-bar routine. */
    9999    void prepareStatusBar();
     100    /** Prepare notification-center routine. */
     101    void prepareNotificationCenter();
    100102    /** Prepare visual-state routine. */
    101103    void prepareVisualState();
     
    105107    /** Cleanup visual-state routine. */
    106108    void cleanupVisualState();
     109    /** Cleanup notification-center routine. */
     110    void cleanupNotificationCenter();
    107111    /** Cleanup session connections routine. */
    108112    void cleanupSessionConnections();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp

    r88651 r90567  
    3333#include "UIMachineWindowScale.h"
    3434#include "UIMachineView.h"
     35#include "UINotificationCenter.h"
    3536#ifdef VBOX_WS_MAC
    3637# include "VBoxUtils.h"
     
    5657    m_pLeftSpacer->changeSize(0, 0, QSizePolicy::Fixed, QSizePolicy::Fixed);
    5758    m_pRightSpacer->changeSize(0, 0, QSizePolicy::Fixed, QSizePolicy::Fixed);
     59}
     60
     61void UIMachineWindowScale::prepareNotificationCenter()
     62{
     63    if (gpNotificationCenter && (m_uScreenId == 0))
     64        gpNotificationCenter->setParent(centralWidget());
    5865}
    5966
     
    139146}
    140147#endif /* VBOX_WS_MAC */
     148
     149void UIMachineWindowScale::cleanupNotificationCenter()
     150{
     151    if (gpNotificationCenter && (gpNotificationCenter->parent() == centralWidget()))
     152        gpNotificationCenter->setParent(0);
     153}
    141154
    142155void UIMachineWindowScale::showInNecessaryMode()
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.h

    r88651 r90567  
    4040    /** Prepare main-layout routine. */
    4141    void prepareMainLayout();
     42    /** Prepare notification-center routine. */
     43    void prepareNotificationCenter();
    4244#ifdef VBOX_WS_MAC
    4345    /** Prepare visual-state routine. */
     
    5153    void cleanupVisualState();
    5254#endif /* VBOX_WS_MAC */
     55    /** Cleanup notification-center routine. */
     56    void cleanupNotificationCenter();
    5357
    5458    /** Updates visibility according to visual-state. */
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