VirtualBox

Changeset 26919 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 1, 2010 3:07:03 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4: new core: menubar handling rewritten

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

Legend:

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

    r26820 r26919  
    966966
    967967    /* "Machine" menu actions: */
    968     m_actionsPool[UIActionIndex_Menu_Machine] = new MenuMachineAction(this);
    969968    m_actionsPool[UIActionIndex_Toggle_Fullscreen] = new ToggleFullscreenModeAction(this);
    970969    m_actionsPool[UIActionIndex_Toggle_Seamless] = new ToggleSeamlessModeAction(this);
    971970    m_actionsPool[UIActionIndex_Toggle_GuestAutoresize] = new ToggleGuestAutoresizeAction(this);
    972971    m_actionsPool[UIActionIndex_Simple_AdjustWindow] = new PerformWindowAdjustAction(this);
    973     m_actionsPool[UIActionIndex_Menu_MouseIntegration] = new MenuMouseIntegrationAction(this);
    974972    m_actionsPool[UIActionIndex_Toggle_MouseIntegration] = new ToggleMouseIntegrationAction(this);
    975973    m_actionsPool[UIActionIndex_Simple_TypeCAD] = new PerformTypeCADAction(this);
     
    985983
    986984    /* "Devices" menu actions: */
    987     m_actionsPool[UIActionIndex_Menu_Devices] = new MenuDevicesAction(this);
    988     m_actionsPool[UIActionIndex_Menu_OpticalDevices] = new MenuOpticalDevicesAction(this);
    989     m_actionsPool[UIActionIndex_Menu_FloppyDevices] = new MenuFloppyDevicesAction(this);
    990     m_actionsPool[UIActionIndex_Menu_USBDevices] = new MenuUSBDevicesAction(this);
    991     m_actionsPool[UIActionIndex_Menu_NetworkAdapters] = new MenuNetworkAdaptersAction(this);
    992985    m_actionsPool[UIActionIndex_Simple_NetworkAdaptersDialog] = new ShowNetworkAdaptersDialogAction(this);
    993     m_actionsPool[UIActionIndex_Menu_SharedFolders] = new MenuSharedFoldersAction(this);
    994986    m_actionsPool[UIActionIndex_Simple_SharedFoldersDialog] = new ShowSharedFoldersDialogAction(this);
    995987    m_actionsPool[UIActionIndex_Toggle_VRDP] = new ToggleVRDPAction(this);
     
    998990#ifdef VBOX_WITH_DEBUGGER_GUI
    999991    /* "Debugger" menu actions: */
    1000     m_actionsPool[UIActionIndex_Menu_Debug] = new MenuDebugAction(this);
    1001992    m_actionsPool[UIActionIndex_Simple_Statistics] = new ShowStatisticsAction(this);
    1002993    m_actionsPool[UIActionIndex_Simple_CommandLine] = new ShowCommandLineAction(this);
     
    1005996
    1006997    /* "Help" menu actions: */
    1007     m_actionsPool[UIActionIndex_Menu_Help] = new MenuHelpAction(this);
    1008998    m_actionsPool[UIActionIndex_Simple_Help] = new ShowHelpAction(this);
    1009999    m_actionsPool[UIActionIndex_Simple_Web] = new ShowWebAction(this);
     
    10131003    m_actionsPool[UIActionIndex_Simple_About] = new ShowAboutAction(this);
    10141004
     1005    /* Create all menus */
     1006    createMenus();
     1007
    10151008    /* Test all actions were initialized */
    10161009    for (int i = 0; i < m_actionsPool.size(); ++i)
     
    10291022{
    10301023    return m_actionsPool.at(index);
     1024}
     1025
     1026void UIActionsPool::createMenus()
     1027{
     1028    /* On Mac OS X, all QMenu's are consumed by Qt after they are added to
     1029     * another QMenu or a QMenuBar. This means we have to recreate all QMenus
     1030     * when creating a new QMenuBar. For simplicity we doing this on all
     1031     * platforms right now. */
     1032    if (m_actionsPool[UIActionIndex_Menu_Machine])
     1033        delete m_actionsPool[UIActionIndex_Menu_Machine];
     1034    m_actionsPool[UIActionIndex_Menu_Machine] = new MenuMachineAction(this);
     1035    if (m_actionsPool[UIActionIndex_Menu_MouseIntegration])
     1036        delete m_actionsPool[UIActionIndex_Menu_MouseIntegration];
     1037    m_actionsPool[UIActionIndex_Menu_MouseIntegration] = new MenuMouseIntegrationAction(this);
     1038
     1039    if (m_actionsPool[UIActionIndex_Menu_Devices])
     1040        delete m_actionsPool[UIActionIndex_Menu_Devices];
     1041    m_actionsPool[UIActionIndex_Menu_Devices] = new MenuDevicesAction(this);
     1042    if (m_actionsPool[UIActionIndex_Menu_OpticalDevices])
     1043        delete m_actionsPool[UIActionIndex_Menu_OpticalDevices];
     1044    m_actionsPool[UIActionIndex_Menu_OpticalDevices] = new MenuOpticalDevicesAction(this);
     1045    if (m_actionsPool[UIActionIndex_Menu_FloppyDevices])
     1046        delete m_actionsPool[UIActionIndex_Menu_FloppyDevices];
     1047    m_actionsPool[UIActionIndex_Menu_FloppyDevices] = new MenuFloppyDevicesAction(this);
     1048    if (m_actionsPool[UIActionIndex_Menu_USBDevices])
     1049        delete m_actionsPool[UIActionIndex_Menu_USBDevices];
     1050    m_actionsPool[UIActionIndex_Menu_USBDevices] = new MenuUSBDevicesAction(this);
     1051    if (m_actionsPool[UIActionIndex_Menu_NetworkAdapters])
     1052        delete m_actionsPool[UIActionIndex_Menu_NetworkAdapters];
     1053    m_actionsPool[UIActionIndex_Menu_NetworkAdapters] = new MenuNetworkAdaptersAction(this);
     1054
     1055    if (m_actionsPool[UIActionIndex_Menu_SharedFolders])
     1056        delete m_actionsPool[UIActionIndex_Menu_SharedFolders];
     1057    m_actionsPool[UIActionIndex_Menu_SharedFolders] = new MenuSharedFoldersAction(this);
     1058
     1059    if (m_actionsPool[UIActionIndex_Menu_Debug])
     1060        delete m_actionsPool[UIActionIndex_Menu_Debug];
     1061    m_actionsPool[UIActionIndex_Menu_Debug] = new MenuDebugAction(this);
     1062
     1063    if (m_actionsPool[UIActionIndex_Menu_Help])
     1064        delete m_actionsPool[UIActionIndex_Menu_Help];
     1065    m_actionsPool[UIActionIndex_Menu_Help] = new MenuHelpAction(this);
    10311066}
    10321067
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionsPool.h

    r26820 r26919  
    120120    UIAction* action(UIActionIndex index) const;
    121121
     122    void createMenus();
    122123    bool processHotKey(const QKeySequence &key);
     124
    123125
    124126protected:
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r26898 r26919  
    414414void UIMachineLogic::prepareActionGroups()
    415415{
     416#ifdef Q_WS_MAC
     417    /* On Mac OS X, all QMenu's are consumed by Qt after they are added to
     418     * another QMenu or a QMenuBar. This means we have to recreate all QMenus
     419     * when creating a new QMenuBar. */
     420    uisession()->actionsPool()->createMenus();
     421#endif /* Q_WS_MAC */
     422
    416423    /* Create group for all actions that are enabled only when the VM is running.
    417424     * Note that only actions whose enabled state depends exclusively on the
     
    516523            this, SLOT(sltLoggingToggled(bool)));
    517524#endif
    518 
    519     /* "Help" actions connections: */
    520     connect(actionsPool()->action(UIActionIndex_Simple_Help), SIGNAL(triggered()),
    521             &vboxProblem(), SLOT(showHelpHelpDialog()));
    522     connect(actionsPool()->action(UIActionIndex_Simple_Web), SIGNAL(triggered()),
    523             &vboxProblem(), SLOT(showHelpWebDialog()));
    524     connect(actionsPool()->action(UIActionIndex_Simple_ResetWarnings), SIGNAL(triggered()),
    525             &vboxProblem(), SLOT(resetSuppressedMessages()));
    526     connect(actionsPool()->action(UIActionIndex_Simple_Register), SIGNAL(triggered()),
    527             &vboxGlobal(), SLOT(showRegistrationDialog()));
    528     connect(actionsPool()->action(UIActionIndex_Simple_Update), SIGNAL(triggered()),
    529             &vboxGlobal(), SLOT(showUpdateDialog()));
    530     connect(actionsPool()->action(UIActionIndex_Simple_About), SIGNAL(triggered()),
    531             &vboxProblem(), SLOT(showHelpAboutDialog()));
    532 
    533     connect(&vboxGlobal(), SIGNAL (canShowRegDlg (bool)),
    534             actionsPool()->action(UIActionIndex_Simple_Register), SLOT(setEnabled(bool)));
    535     connect(&vboxGlobal(), SIGNAL (canShowUpdDlg (bool)),
    536             actionsPool()->action(UIActionIndex_Simple_Update), SLOT(setEnabled(bool)));
    537525}
    538526
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp

    r26898 r26919  
    359359}
    360360
    361 void UIMachineWindow::prepareMenuMachine()
    362 {
    363     QMenu *menu = machineLogic()->actionsPool()->action(UIActionIndex_Menu_Machine)->menu();
    364 
    365     menu->clear();
    366 
    367     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Toggle_Fullscreen));
    368     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Toggle_Seamless));
    369     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Toggle_GuestAutoresize));
    370     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_AdjustWindow));
    371     menu->addSeparator();
    372     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Toggle_MouseIntegration));
    373     menu->addSeparator();
    374     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_TypeCAD));
    375 #ifdef Q_WS_X11
    376     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_TypeCABS));
    377 #endif
    378     menu->addSeparator();
    379     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_TakeSnapshot));
    380     menu->addSeparator();
    381     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_InformationDialog));
    382     menu->addSeparator();
    383     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Toggle_Pause));
    384     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_Reset));
    385     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_Shutdown));
    386 #ifndef Q_WS_MAC
    387     menu->addSeparator();
    388 #endif /* Q_WS_MAC */
    389     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_Close));
    390 }
    391 
    392 void UIMachineWindow::prepareMenuDevices()
    393 {
    394     QMenu *menu = machineLogic()->actionsPool()->action(UIActionIndex_Menu_Devices)->menu();
    395 
    396     menu->clear();
    397 
    398     /* Devices submenu */
    399     menu->addMenu(machineLogic()->actionsPool()->action(UIActionIndex_Menu_OpticalDevices)->menu());
    400     menu->addMenu(machineLogic()->actionsPool()->action(UIActionIndex_Menu_FloppyDevices)->menu());
    401     menu->addMenu(machineLogic()->actionsPool()->action(UIActionIndex_Menu_USBDevices)->menu());
    402     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_NetworkAdaptersDialog));
    403     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_SharedFoldersDialog));
    404     menu->addSeparator();
    405     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Toggle_VRDP));
    406     menu->addSeparator();
    407     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_InstallGuestTools));
    408 }
    409 
    410 #ifdef VBOX_WITH_DEBUGGER_GUI
    411 void UIMachineWindow::prepareMenuDebug()
    412 {
    413     QMenu *menu = machineLogic()->actionsPool()->action(UIActionIndex_Menu_Debug)->menu();
    414 
    415     menu->clear();
    416 
    417     /* Debug submenu */
    418     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_Statistics));
    419     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_CommandLine));
    420     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Toggle_Logging));
    421 }
    422 #endif /* VBOX_WITH_DEBUGGER_GUI */
    423 
    424 void UIMachineWindow::prepareMenuHelp()
    425 {
    426     QMenu *menu = machineLogic()->actionsPool()->action(UIActionIndex_Menu_Help)->menu();
    427 
    428     menu->clear();
    429 
    430     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_Help));
    431     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_Web));
    432     menu->addSeparator();
    433     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_ResetWarnings));
    434     menu->addSeparator();
    435 
    436 #ifdef VBOX_WITH_REGISTRATION
    437     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_Register));
    438 #endif
    439 
    440     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_Update));
    441 
    442 #ifndef Q_WS_MAC
    443     menu->addSeparator();
    444 #endif /* Q_WS_MAC */
    445     menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_About));
    446 }
    447 
    448361void UIMachineWindow::prepareMachineViewContainer()
    449362{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h

    r26878 r26919  
    7777    virtual void prepareWindowIcon();
    7878    virtual void prepareConsoleConnections();
    79     virtual void prepareMenuMachine();
    80     virtual void prepareMenuDevices();
    81 #ifdef VBOX_WITH_DEBUGGER_GUI
    82     virtual void prepareMenuDebug();
    83 #endif
    84     virtual void prepareMenuHelp();
    8579    virtual void prepareMachineViewContainer();
    8680    //virtual void loadWindowSettings() {}
     
    8983    //virtual void saveWindowSettings() {}
    9084    //virtual void cleanupMachineViewContainer() {}
    91     //virtual void cleanupMenuHelp() {}
    92 #ifdef VBOX_WITH_DEBUGGER_GUI
    93     //virtual void prepareMenuDebug() {}
    94 #endif
    95     //virtual void prepareMenuDevices() {}
    96     //virtual void prepareMenuMachine() {}
    9785    //virtual void cleanupConsoleConnections() {}
    9886    //virtual void cleanupWindowIcon() {}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r26890 r26919  
    3232#include "UIMachineLogic.h"
    3333#include "UIMachineWindow.h"
     34#include "UIMachineMenuBar.h"
    3435#include "VBoxProblemReporter.h"
    3536
     
    527528    , m_session(sessionReference)
    528529    , m_callback(CConsoleCallback(new UIConsoleCallback(this)))
    529     /* Common varibles: */
     530    /* Common variables: */
     531    , m_pMenuBar(0)
    530532    , m_machineState(KMachineState_Null)
    531533#if defined(Q_WS_WIN)
     
    570572}
    571573
     574UIActionsPool* UISession::actionsPool() const
     575{
     576    return m_pMachine->actionsPool();
     577}
     578
     579QMenuBar* UISession::newMenuBar()
     580{
     581    /* */
     582    QMenuBar *pMenuBar = m_pMenuBar->createMenuBar(this);
     583
     584    /* Get uisession machine: */
     585    CMachine machine = session().GetConsole().GetMachine();
     586
     587    /* Availability settings: */
     588    {
     589        /* USB Stuff: */
     590        CUSBController usbController = machine.GetUSBController();
     591        if (usbController.isNull())
     592        {
     593            /* Hide USB menu if controller is NULL: */
     594            uimachine()->actionsPool()->action(UIActionIndex_Menu_USBDevices)->setVisible(false);
     595        }
     596        else
     597        {
     598            /* Enable/Disable USB menu depending on USB controller: */
     599            uimachine()->actionsPool()->action(UIActionIndex_Menu_USBDevices)->setEnabled(usbController.GetEnabled());
     600        }
     601    }
     602
     603    /* Prepare some initial settings: */
     604    {
     605        /* Initialize CD/FD menus: */
     606        int iDevicesCountCD = 0;
     607        int iDevicesCountFD = 0;
     608        const CMediumAttachmentVector &attachments = machine.GetMediumAttachments();
     609        foreach (const CMediumAttachment &attachment, attachments)
     610        {
     611            if (attachment.GetType() == KDeviceType_DVD)
     612                ++ iDevicesCountCD;
     613            if (attachment.GetType() == KDeviceType_Floppy)
     614                ++ iDevicesCountFD;
     615        }
     616        QAction *pOpticalDevicesMenu = uimachine()->actionsPool()->action(UIActionIndex_Menu_OpticalDevices);
     617        QAction *pFloppyDevicesMenu = uimachine()->actionsPool()->action(UIActionIndex_Menu_FloppyDevices);
     618        pOpticalDevicesMenu->setData(iDevicesCountCD);
     619        pOpticalDevicesMenu->setVisible(iDevicesCountCD);
     620        pFloppyDevicesMenu->setData(iDevicesCountFD);
     621        pFloppyDevicesMenu->setVisible(iDevicesCountFD);
     622    }
     623
     624    return pMenuBar;
     625}
     626
    572627bool UISession::setPause(bool fOn)
    573628{
     
    844899void UISession::loadSessionSettings()
    845900{
     901    m_pMenuBar = new UIMachineMenuBar;
     902
    846903    /* Get uisession machine: */
    847904    CMachine machine = session().GetConsole().GetMachine();
     
    849906    /* Availability settings: */
    850907    {
    851         /* USB Stuff: */
    852         CUSBController usbController = machine.GetUSBController();
    853         if (usbController.isNull())
    854         {
    855             /* Hide USB menu if controller is NULL: */
    856             uimachine()->actionsPool()->action(UIActionIndex_Menu_USBDevices)->setVisible(false);
    857         }
    858         else
    859         {
    860             /* Enable/Disable USB menu depending on USB controller: */
    861             uimachine()->actionsPool()->action(UIActionIndex_Menu_USBDevices)->setEnabled(usbController.GetEnabled());
    862         }
    863 
    864908        /* VRDP Stuff: */
    865909        CVRDPServer vrdpServer = machine.GetVRDPServer();
     
    871915    }
    872916
    873     /* Prepare some initial settings: */
    874     {
    875         /* Initialize CD/FD menus: */
    876         int iDevicesCountCD = 0;
    877         int iDevicesCountFD = 0;
    878         const CMediumAttachmentVector &attachments = machine.GetMediumAttachments();
    879         foreach (const CMediumAttachment &attachment, attachments)
    880         {
    881             if (attachment.GetType() == KDeviceType_DVD)
    882                 ++ iDevicesCountCD;
    883             if (attachment.GetType() == KDeviceType_Floppy)
    884                 ++ iDevicesCountFD;
    885         }
    886         QAction *pOpticalDevicesMenu = uimachine()->actionsPool()->action(UIActionIndex_Menu_OpticalDevices);
    887         QAction *pFloppyDevicesMenu = uimachine()->actionsPool()->action(UIActionIndex_Menu_FloppyDevices);
    888         pOpticalDevicesMenu->setData(iDevicesCountCD);
    889         pOpticalDevicesMenu->setVisible(iDevicesCountCD);
    890         pFloppyDevicesMenu->setData(iDevicesCountFD);
    891         pFloppyDevicesMenu->setVisible(iDevicesCountFD);
    892     }
    893917
    894918    /* Load extra-data settings: */
     
    934958        //machine.SetExtraData(VBoxDefs::GUI_MiniToolBarAutoHide, mMiniToolBar->isAutoHide() ? "on" : "off");
    935959    }
     960
     961    delete m_pMenuBar;
     962    m_pMenuBar = 0;
    936963}
    937964
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r26890 r26919  
    3333/* Local forwards */
    3434class UIMachine;
     35class UIActionsPool;
    3536class UIConsoleCallback;
     37class UIMachineMenuBar;
     38
     39class QMenuBar;
    3640
    3741/* CConsole callback event types: */
     
    7377    CSession& session() { return m_session; }
    7478    KMachineState machineState() const { return m_machineState; }
     79    UIActionsPool* actionsPool() const;
     80    QMenuBar* newMenuBar();
     81
    7582    bool isSaved() const { return machineState() == KMachineState_Saved; }
    7683    bool isTurnedOff() const { return machineState() == KMachineState_PoweredOff ||
     
    171178    const CConsoleCallback m_callback;
    172179
     180    UIMachineMenuBar *m_pMenuBar;
     181
    173182    /* Common variables: */
    174183    KMachineState m_machineState;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp

    r26891 r26919  
    184184            break;
    185185        }
     186#ifdef Q_WS_MAC
     187        case QEvent::Polish:
     188        {
     189            /* Fade back to the normal gamma */
     190//            CGDisplayFade (mFadeToken, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, false);
     191//            CGReleaseDisplayFadeReservation (mFadeToken);
     192            break;
     193        }
     194#endif /* Q_WS_MAC */
    186195        default:
    187196            break;
     
    245254void UIMachineWindowFullscreen::prepareMenu()
    246255{
    247     /* Machine submenu: */
    248     QMenu *pMenuMachine = machineLogic()->actionsPool()->action(UIActionIndex_Menu_Machine)->menu();
    249     prepareMenuMachine();
    250     menuBar()->addMenu(pMenuMachine);
    251 
    252     /* Devices submenu: */
    253     QMenu *pMenuDevices = machineLogic()->actionsPool()->action(UIActionIndex_Menu_Devices)->menu();
    254     prepareMenuDevices();
    255     menuBar()->addMenu(pMenuDevices);
    256 
    257 #ifdef VBOX_WITH_DEBUGGER_GUI
    258     if (vboxGlobal().isDebuggerEnabled())
    259     {
    260         QMenu *pMenuDebug = machineLogic()->actionsPool()->action(UIActionIndex_Menu_Debug)->menu();
    261         prepareMenuDebug();
    262         menuBar()->addMenu(pMenuDebug);
    263     }
    264 #endif
    265 
    266     /* Help submenu: */
    267     QMenu *pMenuHelp = machineLogic()->actionsPool()->action(UIActionIndex_Menu_Help)->menu();
    268     prepareMenuHelp();
    269     menuBar()->addMenu(pMenuHelp);
     256    setMenuBar(uisession()->newMenuBar());
     257    menuBar()->hide();
    270258}
    271259
     
    279267void UIMachineWindowFullscreen::prepareMachineView()
    280268{
    281     CMachine machine = session().GetMachine();
    282 
    283269#ifdef VBOX_WITH_VIDEOHWACCEL
    284270    /* Need to force the QGL framebuffer in case 2D Video Acceleration is supported & enabled: */
    285     bool bAccelerate2DVideo = machine.GetAccelerate2DVideoEnabled() && VBoxGlobal::isAcceleration2DVideoAvailable();
     271    bool bAccelerate2DVideo = session().GetMachine().GetAccelerate2DVideoEnabled() && VBoxGlobal::isAcceleration2DVideoAvailable();
    286272#endif
    287273
     
    318304    centralWidget()->setAutoFillBackground (true);
    319305    setAutoFillBackground (true);
     306
     307#ifdef Q_WS_MAC
     308    /* Fade to black */
     309//    CGAcquireDisplayFadeReservation (kCGMaxDisplayReservationInterval, &mFadeToken);
     310//    CGDisplayFade (mFadeToken, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0.0, 0.0, 0.0, true);
     311#endif
     312
    320313
    321314    /* We have to show the window early, or the position will be wrong on the
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h

    r26889 r26919  
    3535# include <X11/Xlib.h>
    3636#endif
     37
     38#ifdef Q_WS_MAC
     39# include <ApplicationServices/ApplicationServices.h>
     40#endif /* Q_WS_MAC */
    3741
    3842/* Local forwards */
     
    98102    void setPresentationModeEnabled(bool fEnabled);
    99103# endif /* QT_MAC_USE_COCOA */
     104    CGDisplayFadeReservationToken mFadeToken;
    100105#endif /* Q_WS_MAC */
    101106
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r26890 r26919  
    345345void UIMachineWindowNormal::prepareMenu()
    346346{
    347     /* Machine submenu: */
    348     QMenu *pMenuMachine = machineLogic()->actionsPool()->action(UIActionIndex_Menu_Machine)->menu();
    349     prepareMenuMachine();
    350     menuBar()->addMenu(pMenuMachine);
    351 
    352     /* Devices submenu: */
    353     QMenu *pMenuDevices = machineLogic()->actionsPool()->action(UIActionIndex_Menu_Devices)->menu();
    354     prepareMenuDevices();
    355     menuBar()->addMenu(pMenuDevices);
    356 
    357 #ifdef VBOX_WITH_DEBUGGER_GUI
    358     if (vboxGlobal().isDebuggerEnabled())
    359     {
    360         QMenu *pMenuDebug = machineLogic()->actionsPool()->action(UIActionIndex_Menu_Debug)->menu();
    361         prepareMenuDebug();
    362         menuBar()->addMenu(pMenuDebug);
    363     }
    364 #endif
    365 
    366     /* Help submenu: */
    367     QMenu *pMenuHelp = machineLogic()->actionsPool()->action(UIActionIndex_Menu_Help)->menu();
    368     prepareMenuHelp();
    369     menuBar()->addMenu(pMenuHelp);
     347    setMenuBar(uisession()->newMenuBar());
    370348}
    371349
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