VirtualBox

Changeset 73697 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Aug 15, 2018 3:58:48 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: VirtualBox Manager UI: Integrating Log Viewer toolbar into Main application toolbar.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerDialog.cpp

    r73694 r73697  
    9595{
    9696    /* Create widget: */
    97     UIVMLogViewerWidget *pWidget = new UIVMLogViewerWidget(EmbedTo_Dialog, m_pActionPool, m_comMachine, this);
     97    UIVMLogViewerWidget *pWidget = new UIVMLogViewerWidget(EmbedTo_Dialog, m_pActionPool, true /* show toolbar */, m_comMachine, this);
    9898    if (pWidget)
    9999    {
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp

    r73694 r73697  
    6060UIVMLogViewerWidget::UIVMLogViewerWidget(EmbedTo enmEmbedding,
    6161                                         UIActionPool *pActionPool,
     62                                         bool fShowToolbar /* = true */,
    6263                                         const CMachine &comMachine /* = CMachine() */,
    6364                                         QWidget *pParent /* = 0 */)
     
    6566    , m_enmEmbedding(enmEmbedding)
    6667    , m_pActionPool(pActionPool)
     68    , m_fShowToolbar(fShowToolbar)
    6769    , m_comMachine(comMachine)
    6870    , m_fIsPolished(false)
     
    421423    /* Prepare stuff: */
    422424    prepareActions();
    423     prepareToolBar();
     425    if (m_fShowToolbar)
     426        prepareToolBar();
    424427    prepareWidgets();
    425428    /* Load settings: */
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h

    r73694 r73697  
    6262      * @param  enmEmbedding  Brings the type of widget embedding.
    6363      * @param  pActionPool   Brings the action-pool reference.
     64      * @param  fShowToolbar  Brings whether we should create/show toolbar.
    6465      * @param  comMachine    Brings the machine for which VM Log-Viewer is requested. */
    6566    UIVMLogViewerWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool,
    66                         const CMachine &comMachine = CMachine(), QWidget *pParent = 0);
     67                        bool fShowToolbar = true, const CMachine &comMachine = CMachine(), QWidget *pParent = 0);
    6768    /** Destructs the VM Log-Viewer. */
    6869    ~UIVMLogViewerWidget();
     
    188189    /** Hold sthe action-pool reference. */
    189190    UIActionPool *m_pActionPool;
     191    /** Holds whether we should create/show toolbar. */
     192    const bool    m_fShowToolbar;
    190193    /** Holds the machine instance. */
    191194    CMachine      m_comMachine;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.cpp

    r73694 r73697  
    154154            {
    155155                /* Create the Logviewer pane: */
    156                 m_pPaneLogViewer = new UIVMLogViewerWidget(EmbedTo_Stack, m_pActionPool);
     156                m_pPaneLogViewer = new UIVMLogViewerWidget(EmbedTo_Stack, m_pActionPool, false /* show toolbar */);
    157157                AssertPtrReturnVoid(m_pPaneLogViewer);
    158158                {
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r73694 r73697  
    113113    , m_pMachineMenuAction(0)
    114114    , m_pSnapshotMenuAction(0)
     115    , m_pLogViewerMenuAction(0)
    115116    , m_pManagerVirtualMedia(0)
    116117    , m_pManagerHostNetwork(0)
     
    12201221    prepareMenuMachineClose(actionPool()->action(UIActionIndexST_M_Machine_M_Close)->menu());
    12211222
    1222     /* Prepare Group-menu: */
     1223    /* Prepare 'Group' menu: */
    12231224    prepareMenuGroup(actionPool()->action(UIActionIndexST_M_Group)->menu());
    12241225    m_pGroupMenuAction = menuBar()->addMenu(actionPool()->action(UIActionIndexST_M_Group)->menu());
    12251226
    1226     /* Prepare Machine-menu: */
     1227    /* Prepare 'Machine' menu: */
    12271228    prepareMenuMachine(actionPool()->action(UIActionIndexST_M_Machine)->menu());
    12281229    m_pMachineMenuAction = menuBar()->addMenu(actionPool()->action(UIActionIndexST_M_Machine)->menu());
    12291230
    1230     /* Prepare Snapshot-menu: */
     1231    /* Prepare 'Snapshot' menu: */
    12311232    prepareMenuSnapshot(actionPool()->action(UIActionIndexST_M_Snapshot)->menu());
    12321233    m_pSnapshotMenuAction = menuBar()->addMenu(actionPool()->action(UIActionIndexST_M_Snapshot)->menu());
     1234
     1235    /* Prepare 'Log Viewer' menu: */
     1236    prepareMenuLogViewer(actionPool()->action(UIActionIndex_M_LogViewer)->menu());
     1237    m_pLogViewerMenuAction = menuBar()->addMenu(actionPool()->action(UIActionIndex_M_LogViewer)->menu());
    12331238
    12341239#ifdef VBOX_WS_MAC
     
    12391244#endif
    12401245
    1241     /* Prepare Help-menu: */
     1246    /* Prepare 'Help' menu: */
    12421247    menuBar()->addMenu(actionPool()->action(UIActionIndex_Menu_Help)->menu());
    12431248
     
    16391644}
    16401645
     1646void UIVirtualBoxManager::prepareMenuLogViewer(QMenu *pMenu)
     1647{
     1648    /* We are doing it inside the UIActionPool. */
     1649    Q_UNUSED(pMenu);
     1650
     1651    /* Do not touch if filled already: */
     1652    if (!m_logViewerActions.isEmpty())
     1653        return;
     1654
     1655    /* Remember action list: */
     1656    m_logViewerActions << actionPool()->action(UIActionIndex_M_LogViewer_T_Find)
     1657                 << actionPool()->action(UIActionIndex_M_LogViewer_T_Filter)
     1658                 << actionPool()->action(UIActionIndex_M_LogViewer_T_Bookmark)
     1659                 << actionPool()->action(UIActionIndex_M_LogViewer_T_Settings)
     1660                 << actionPool()->action(UIActionIndex_M_LogViewer_S_Refresh)
     1661                 << actionPool()->action(UIActionIndex_M_LogViewer_S_Save);
     1662}
     1663
    16411664void UIVirtualBoxManager::prepareStatusBar()
    16421665{
     
    19321955    m_pSnapshotMenuAction->setVisible(fSnapshotMenuShown);
    19331956
     1957    /* Determine whether LogViewer actions should be visible: */
     1958    const bool fLogViewerMenuShown = fMachineOrGroupMenuShown && m_pWidget->currentMachineTool() == ToolTypeMachine_LogViewer;
     1959    m_pLogViewerMenuAction->setVisible(fLogViewerMenuShown);
     1960
    19341961    /* Hide action shortcuts: */
    19351962    if (!fMachineMenuShown)
     
    19471974    foreach (UIAction *pAction, m_snapshotActions)
    19481975        pAction->setVisible(fSnapshotMenuShown);
     1976    foreach (UIAction *pAction, m_logViewerActions)
     1977        pAction->setVisible(fLogViewerMenuShown);
    19491978
    19501979    /* Show action shortcuts: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h

    r73676 r73697  
    250250        /** Prepares @a pMenu Snapshot. */
    251251        void prepareMenuSnapshot(QMenu *pMenu);
     252        /** Prepares @a pMenu Log Viewer. */
     253        void prepareMenuLogViewer(QMenu *pMenu);
    252254        /** Prepares status-bar. */
    253255        void prepareStatusBar();
     
    355357    QAction          *m_pSnapshotMenuAction;
    356358
     359    /** Holds the list of Log Viewer menu actions. */
     360    QList<UIAction*>  m_logViewerActions;
     361    /** Holds the Log menu parent action. */
     362    QAction          *m_pLogViewerMenuAction;
     363
    357364    /** Holds the Virtual Media Manager window instance. */
    358365    QIManagerDialog *m_pManagerVirtualMedia;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp

    r73676 r73697  
    404404        m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow));
    405405
    406         /* Add Snapshot actions block: */
     406        /* Separator: */
    407407        m_pToolBar->addSeparator();
     408
     409        /* Add 'Snapshot' actions block: */
    408410        m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Snapshot_S_Take));
    409411        m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Snapshot_S_Delete));
     
    411413        m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Snapshot_T_Properties));
    412414        m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Snapshot_S_Clone));
     415
     416        /* Add 'Log Viewer' actions block: */
     417        m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_LogViewer_S_Save));
     418        m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_LogViewer_T_Find));
     419        m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_LogViewer_T_Filter));
     420        m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_LogViewer_T_Bookmark));
     421        m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_LogViewer_T_Settings));
     422        m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_LogViewer_S_Refresh));
    413423
    414424#ifdef VBOX_WS_MAC
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