VirtualBox

Changeset 8813 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 14, 2008 2:12:46 PM (17 years ago)
Author:
vboxsync
Message:

Added menu item for disabling and enabling logging. (debug menu)

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h

    r8513 r8813  
    185185    void processGlobalSettingChange (const char *publicName, const char *name);
    186186
     187    void dbgPrepareDebugMenu();
    187188    void dbgShowStatistics();
    188189    void dbgShowCommandLine();
     190    void dbgLoggingToggled (bool);
    189191
    190192    void onEnterFullscreen();
     
    233235    QAction *dbgStatisticsAction;
    234236    QAction *dbgCommandLineAction;
     237    QAction *dbgLoggingAction;
    235238#endif
    236239
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp

    r8779 r8813  
    112112    , dbgStatisticsAction (NULL)
    113113    , dbgCommandLineAction (NULL)
     114    , dbgLoggingAction (NULL)
    114115    , dbgMenu (NULL)
    115116#endif
     
    260261
    261262#ifdef VBOX_WITH_DEBUGGER_GUI
     263    /* Debug menu actions */
    262264    if (vboxGlobal().isDebuggerEnabled())
    263265    {
    264266        dbgStatisticsAction = new QAction (this, "dbgStatisticsAction");
    265267        dbgCommandLineAction = new QAction (this, "dbgCommandLineAction");
     268        dbgLoggingAction = new QAction (this, "dbgLoggingAction");
     269        dbgLoggingAction->setToggleAction (true);
     270        dbgLoggingAction->setIconSet (VBoxGlobal::iconSet ("start_16px.png")); /// @todo find the default check boxes.
    266271    }
    267272    else
     
    269274        dbgStatisticsAction = NULL;
    270275        dbgCommandLineAction = NULL;
     276        dbgLoggingAction = NULL;
    271277    }
    272278#endif
     
    378384        dbgStatisticsAction->addTo (dbgMenu);
    379385        dbgCommandLineAction->addTo (dbgMenu);
     386        dbgLoggingAction->addTo (dbgMenu);
    380387        menuBar()->insertItem (QString::null, dbgMenu, dbgMenuId);
    381388        mMainMenu->insertItem (QString::null, dbgMenu, dbgMenuId);
     
    582589
    583590#ifdef VBOX_WITH_DEBUGGER_GUI
     591    if (dbgMenu)
     592        connect (dbgMenu, SIGNAL (aboutToShow()),
     593                 this, SLOT (dbgPrepareDebugMenu()));
    584594    if (dbgStatisticsAction)
    585595        connect (dbgStatisticsAction, SIGNAL (activated()),
     
    588598        connect (dbgCommandLineAction, SIGNAL (activated()),
    589599                 this, SLOT (dbgShowCommandLine()));
     600    if (dbgLoggingAction)
     601        connect (dbgLoggingAction, SIGNAL (toggled (bool)),
     602                 this, SLOT (dbgLoggingToggled (bool)));
    590603#endif
    591604
     
    15511564    if (dbgCommandLineAction)
    15521565        dbgCommandLineAction->setMenuText (tr ("&Command line..."));
     1566    if (dbgLoggingAction)
     1567        dbgLoggingAction->setMenuText (tr ("&Logging..."));
    15531568#endif
    15541569
     
    33633378
    33643379/**
     3380 * Prepare the Debug menu.
     3381 */
     3382void VBoxConsoleWnd::dbgPrepareDebugMenu()
     3383{
     3384    /* The "Logging" item. */
     3385    bool fEnabled = false;
     3386    bool fChecked = false;
     3387    CConsole cconsole = csession.GetConsole();
     3388    if (cconsole.isOk())
     3389    {
     3390        CMachineDebugger cdebugger = cconsole.GetDebugger();
     3391        if (cconsole.isOk())
     3392        {
     3393            fEnabled = true;
     3394            fChecked = cdebugger.GetLogEnabled() != FALSE;
     3395        }
     3396    }
     3397    if (fEnabled != dbgLoggingAction->isEnabled())
     3398        dbgLoggingAction->setEnabled (fEnabled);
     3399    if (fChecked != dbgLoggingAction->isOn())
     3400        dbgLoggingAction->setOn (fChecked);
     3401}
     3402
     3403/**
    33653404 * Called when the Debug->Statistics... menu item is selected.
    33663405 */
     
    33823421        DBGGuiShowCommandLine (dbg_gui);
    33833422#endif
     3423}
     3424
     3425/**
     3426 * Called when the Debug->Logging menu item is selected.
     3427 */
     3428void VBoxConsoleWnd::dbgLoggingToggled (bool aState)
     3429{
     3430    CConsole cconsole = csession.GetConsole();
     3431    if (cconsole.isOk())
     3432    {
     3433        CMachineDebugger cdebugger = cconsole.GetDebugger();
     3434        if (cconsole.isOk())
     3435            cdebugger.SetLogEnabled(aState);
     3436    }
     3437
    33843438}
    33853439
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