VirtualBox

Changeset 88635 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 21, 2021 2:05:26 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8161: A bit of rework for Runtime UI; Save mini-toolbar auto-hide feature status instantly instead of power off sequence.

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

Legend:

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

    r82968 r88635  
    148148#endif /* VBOX_WS_X11 */
    149149    activateWindow();
     150}
     151
     152void UIMachineWindowFullscreen::sltHandleMiniToolBarAutoHideToggled(bool fEnabled)
     153{
     154    /* Save mini-toolbar settings: */
     155    printf("save mini-toolbar auto-hide feature status as: %d\n", (int)fEnabled);
     156    gEDataManager->setAutoHideMiniToolbar(fEnabled, uiCommon().managedVMUuid());
    150157}
    151158#endif /* VBOX_WS_WIN || VBOX_WS_X11 */
     
    282289        connect(m_pMiniToolBar, &UIMiniToolBar::sigNotifyAboutWindowActivationStolen,
    283290                this, &UIMachineWindowFullscreen::sltRevokeWindowActivation, Qt::QueuedConnection);
     291        connect(m_pMiniToolBar, &UIMiniToolBar::sigAutoHideToggled,
     292                this, &UIMachineWindowFullscreen::sltHandleMiniToolBarAutoHideToggled);
    284293    }
    285294}
     
    289298void UIMachineWindowFullscreen::cleanupMiniToolbar()
    290299{
    291     /* Make sure mini-toolbar was created: */
    292     if (!m_pMiniToolBar)
    293         return;
    294 
    295     /* Save mini-toolbar settings: */
    296     gEDataManager->setAutoHideMiniToolbar(m_pMiniToolBar->autoHide(), uiCommon().managedVMUuid());
    297300    /* Delete mini-toolbar: */
    298301    delete m_pMiniToolBar;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h

    r82968 r88635  
    7070    /** Revokes window activation. */
    7171    void sltRevokeWindowActivation();
     72
     73    /** Handles signal about mini-toolbar auto-hide toggled.
     74      * @param  fEnabled  Brings whether auto-hide is enabled. */
     75    void sltHandleMiniToolBarAutoHideToggled(bool fEnabled);
    7276#endif /* VBOX_WS_WIN || VBOX_WS_X11 */
    7377
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp

    r82968 r88635  
    8484    activateWindow();
    8585}
     86
     87void UIMachineWindowSeamless::sltHandleMiniToolBarAutoHideToggled(bool fEnabled)
     88{
     89    /* Save mini-toolbar settings: */
     90    printf("save mini-toolbar auto-hide feature status as: %d\n", (int)fEnabled);
     91    gEDataManager->setAutoHideMiniToolbar(fEnabled, uiCommon().managedVMUuid());
     92}
    8693#endif /* VBOX_WS_WIN || VBOX_WS_X11 */
    8794
     
    147154        connect(m_pMiniToolBar, &UIMiniToolBar::sigNotifyAboutWindowActivationStolen,
    148155                this, &UIMachineWindowSeamless::sltRevokeWindowActivation, Qt::QueuedConnection);
     156        connect(m_pMiniToolBar, &UIMiniToolBar::sigAutoHideToggled,
     157                this, &UIMachineWindowSeamless::sltHandleMiniToolBarAutoHideToggled);
    149158    }
    150159}
     
    154163void UIMachineWindowSeamless::cleanupMiniToolbar()
    155164{
    156     /* Make sure mini-toolbar was created: */
    157     if (!m_pMiniToolBar)
    158         return;
    159 
    160     /* Save mini-toolbar settings: */
    161     gEDataManager->setAutoHideMiniToolbar(m_pMiniToolBar->autoHide(), uiCommon().managedVMUuid());
    162165    /* Delete mini-toolbar: */
    163166    delete m_pMiniToolBar;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h

    r82968 r88635  
    4949    /** Revokes window activation. */
    5050    void sltRevokeWindowActivation();
     51
     52    /** Handles signal about mini-toolbar auto-hide toggled.
     53      * @param  fEnabled  Brings whether auto-hide is enabled. */
     54    void sltHandleMiniToolBarAutoHideToggled(bool fEnabled);
    5155#endif /* VBOX_WS_WIN || VBOX_WS_X11 */
    5256
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp

    r86233 r88635  
    561561    /* Propagate from child: */
    562562    setAutoHide(m_pToolbar->autoHide(), false);
     563    emit sigAutoHideToggled(m_pToolbar->autoHide());
    563564}
    564565
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.h

    r86233 r88635  
    6565    /** Notifies listeners about we stole window activation. */
    6666    void sigNotifyAboutWindowActivationStolen();
     67
     68    /** Notifies listeners about auto-hide toggled.
     69      * @param  fEnabled  Brings whether auto-hide is enabled. */
     70    void sigAutoHideToggled(bool fEnabled);
    6771
    6872public:
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