VirtualBox

Changeset 94651 in vbox


Ignore:
Timestamp:
Apr 20, 2022 12:27:23 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
151014
Message:

FE/Qt: bugref:10216. Moving 'Show Log' menu item to Machine menu from debug menu. This makes vm log viewer accessible in vm windows as well (besides manager window).

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp

    r94498 r94651  
    633633        case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Shutdown:                      strResult = "Shutdown"; break;
    634634        case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_PowerOff:                      strResult = "PowerOff"; break;
     635        case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_LogDialog:                     strResult = "LogDialog"; break;
    635636        case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Nothing:                       strResult = "Nothing"; break;
    636637        case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_All:                           strResult = "All"; break;
     
    670671    if (strRuntimeMenuMachineActionType.compare("PowerOff", Qt::CaseInsensitive) == 0)
    671672        return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_PowerOff;
     673    if (strRuntimeMenuMachineActionType.compare("LogDialog", Qt::CaseInsensitive) == 0)
     674        return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_LogDialog;
    672675    if (strRuntimeMenuMachineActionType.compare("Nothing", Qt::CaseInsensitive) == 0)
    673676        return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Nothing;
     
    924927        case UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_CommandLine:           strResult = "CommandLine"; break;
    925928        case UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Logging:               strResult = "Logging"; break;
    926         case UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_LogDialog:             strResult = "LogDialog"; break;
    927929        case UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_GuestControlConsole:   strResult = "GuestControlConsole"; break;
    928930        case UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_All:                   strResult = "All"; break;
     
    946948    if (strRuntimeMenuDebuggerActionType.compare("Logging", Qt::CaseInsensitive) == 0)
    947949        return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Logging;
    948     if (strRuntimeMenuDebuggerActionType.compare("LogDialog", Qt::CaseInsensitive) == 0)
    949         return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_LogDialog;
    950950    if (strRuntimeMenuDebuggerActionType.compare("GuestControlConsole", Qt::CaseInsensitive) == 0)
    951951        return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_GuestControlConsole;
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h

    r94498 r94651  
    576576        RuntimeMenuMachineActionType_Shutdown                      = RT_BIT(9),
    577577        RuntimeMenuMachineActionType_PowerOff                      = RT_BIT(10),
    578         RuntimeMenuMachineActionType_Nothing                       = RT_BIT(11),
     578        RuntimeMenuMachineActionType_LogDialog                     = RT_BIT(11),
     579        RuntimeMenuMachineActionType_Nothing                       = RT_BIT(12),
    579580        RuntimeMenuMachineActionType_All                           = 0xFFFF
    580581    };
     
    665666        RuntimeMenuDebuggerActionType_CommandLine          = RT_BIT(1),
    666667        RuntimeMenuDebuggerActionType_Logging              = RT_BIT(2),
    667         RuntimeMenuDebuggerActionType_LogDialog            = RT_BIT(3),
    668         RuntimeMenuDebuggerActionType_GuestControlConsole  = RT_BIT(4),
     668        RuntimeMenuDebuggerActionType_GuestControlConsole  = RT_BIT(3),
    669669        RuntimeMenuDebuggerActionType_All                  = 0xFFFF
    670670    };
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolRuntime.cpp

    r94014 r94651  
    566566};
    567567
     568/** Simple action extension, used as 'Show Logs' action class. */
     569class UIActionSimpleRuntimeShowLogs : public UIActionSimple
     570{
     571    Q_OBJECT;
     572
     573public:
     574
     575    /** Constructs action passing @a pParent to the base-class. */
     576    UIActionSimpleRuntimeShowLogs(UIActionPool *pParent)
     577        : UIActionSimple(pParent, ":/vm_show_logs_16px.png", ":/vm_show_logs_disabled_16px.png", true)
     578    {}
     579
     580protected:
     581
     582    /** Returns action extra-data ID. */
     583    virtual int extraDataID() const RT_OVERRIDE
     584    {
     585        return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_LogDialog;
     586    }
     587    /** Returns action extra-data key. */
     588    virtual QString extraDataKey() const RT_OVERRIDE
     589    {
     590        return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_LogDialog);
     591    }
     592    /** Returns whether action is allowed. */
     593    virtual bool isAllowed() const RT_OVERRIDE
     594    {
     595        return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_LogDialog);
     596    }
     597
     598    /** Returns shortcut extra-data ID. */
     599    virtual QString shortcutExtraDataID() const RT_OVERRIDE
     600    {
     601        return QString("LogWindow");
     602    }
     603
     604    /** Handles translation event. */
     605    virtual void retranslateUi() RT_OVERRIDE
     606    {
     607        setName(QApplication::translate("UIActionPool", "Show &Log..."));
     608        setStatusTip(QApplication::translate("UIActionPool", "Display the log viewer widget."));
     609    }
     610};
    568611
    569612/** Menu action extension, used as 'View' menu class. */
     
    29032946    {
    29042947        setName(QApplication::translate("UIActionPool", "&Logging", "debug action"));
    2905     }
    2906 };
    2907 
    2908 /** Simple action extension, used as 'Show Logs' action class. */
    2909 class UIActionSimpleRuntimeShowLogs : public UIActionSimple
    2910 {
    2911     Q_OBJECT;
    2912 
    2913 public:
    2914 
    2915     /** Constructs action passing @a pParent to the base-class. */
    2916     UIActionSimpleRuntimeShowLogs(UIActionPool *pParent)
    2917         : UIActionSimple(pParent, true)
    2918     {}
    2919 
    2920 protected:
    2921 
    2922     /** Returns action extra-data ID. */
    2923     virtual int extraDataID() const RT_OVERRIDE
    2924     {
    2925         return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_LogDialog;
    2926     }
    2927     /** Returns action extra-data key. */
    2928     virtual QString extraDataKey() const RT_OVERRIDE
    2929     {
    2930         return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_LogDialog);
    2931     }
    2932     /** Returns whether action is allowed. */
    2933     virtual bool isAllowed() const RT_OVERRIDE
    2934     {
    2935         return actionPool()->toRuntime()->isAllowedInMenuDebug(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_LogDialog);
    2936     }
    2937 
    2938     /** Returns shortcut extra-data ID. */
    2939     virtual QString shortcutExtraDataID() const RT_OVERRIDE
    2940     {
    2941         return QString("LogWindow");
    2942     }
    2943 
    2944     /** Handles translation event. */
    2945     virtual void retranslateUi() RT_OVERRIDE
    2946     {
    2947         setName(QApplication::translate("UIActionPool", "Show &Log...", "debug action"));
    29482948    }
    29492949};
     
    32603260    m_pool[UIActionIndexRT_M_Machine_S_Shutdown] = new UIActionSimpleRuntimePerformShutdown(this);
    32613261    m_pool[UIActionIndexRT_M_Machine_S_PowerOff] = new UIActionSimpleRuntimePerformPowerOff(this);
     3262    m_pool[UIActionIndexRT_M_Machine_S_ShowLogDialog] = new UIActionSimpleRuntimeShowLogs(this);
    32623263
    32633264    /* 'View' actions: */
     
    33293330    m_pool[UIActionIndexRT_M_Debug_S_ShowCommandLine] = new UIActionSimpleRuntimeShowCommandLine(this);
    33303331    m_pool[UIActionIndexRT_M_Debug_T_Logging] = new UIActionToggleRuntimeLogging(this);
    3331     m_pool[UIActionIndexRT_M_Debug_S_ShowLogDialog] = new UIActionSimpleRuntimeShowLogs(this);
    33323332    m_pool[UIActionIndexRT_M_Debug_S_GuestControlConsole] = new UIActionSimpleRuntimeGuestControlConsole(this);
    33333333#endif /* VBOX_WITH_DEBUGGER_GUI */
     
    36823682    /* 'Information Dialog' action: */
    36833683    fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_ShowInformation)) || fSeparator;
     3684    /* 'File Manager' action: */
    36843685    fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_ShowFileManager)) || fSeparator;
     3686    /* 'Log Dialog' action: */
     3687    fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_ShowLogDialog)) || fSeparator;
    36853688
    36863689    /* Separator: */
     
    43614364    /* 'Logging' action: */
    43624365    addAction(pMenu, action(UIActionIndexRT_M_Debug_T_Logging));
    4363     /* 'Log Dialog' action: */
    4364     addAction(pMenu, action(UIActionIndexRT_M_Debug_S_ShowLogDialog));
    43654366    /* 'Guest Control Terminal' action: */
    43664367    addAction(pMenu, action(UIActionIndexRT_M_Debug_S_GuestControlConsole));
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolRuntime.h

    r93990 r94651  
    5151    UIActionIndexRT_M_Machine_S_Shutdown,
    5252    UIActionIndexRT_M_Machine_S_PowerOff,
     53    UIActionIndexRT_M_Machine_S_ShowLogDialog,
    5354
    5455    /* 'View' menu actions: */
     
    120121    UIActionIndexRT_M_Debug_S_ShowCommandLine,
    121122    UIActionIndexRT_M_Debug_T_Logging,
    122     UIActionIndexRT_M_Debug_S_ShowLogDialog,
    123123    UIActionIndexRT_M_Debug_S_GuestControlConsole,
    124124#endif
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r94603 r94651  
    10571057    connect(actionPool()->action(UIActionIndexRT_M_Machine_S_PowerOff), &UIAction::triggered,
    10581058            this, &UIMachineLogic::sltPowerOff, Qt::QueuedConnection);
     1059    connect(actionPool()->action(UIActionIndexRT_M_Machine_S_ShowLogDialog), &UIAction::triggered,
     1060            this, &UIMachineLogic::sltShowLogDialog);
    10591061
    10601062    /* 'View' actions connections: */
     
    11301132    connect(actionPool()->action(UIActionIndexRT_M_Debug_T_Logging), &UIAction::toggled,
    11311133            this, &UIMachineLogic::sltLoggingToggled);
    1132     connect(actionPool()->action(UIActionIndexRT_M_Debug_S_ShowLogDialog), &UIAction::triggered,
    1133             this, &UIMachineLogic::sltShowLogDialog);
    11341134    connect(actionPool()->action(UIActionIndexRT_M_Debug_S_GuestControlConsole), &UIAction::triggered,
    11351135            this, &UIMachineLogic::sltShowGuestControlConsoleDialog);
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMenuBarEditorWindow.cpp

    r94518 r94651  
    12791279        prepareCopiedAction(pMenu, actionPool()->action(UIActionIndexRT_M_Machine_S_Shutdown));
    12801280        prepareCopiedAction(pMenu, actionPool()->action(UIActionIndexRT_M_Machine_S_PowerOff));
     1281        prepareCopiedAction(pMenu, actionPool()->action(UIActionIndexRT_M_Machine_S_ShowLogDialog));
    12811282    }
    12821283}
     
    13581359        prepareCopiedAction(pMenu, actionPool()->action(UIActionIndexRT_M_Debug_S_ShowCommandLine));
    13591360        prepareCopiedAction(pMenu, actionPool()->action(UIActionIndexRT_M_Debug_T_Logging));
    1360         prepareCopiedAction(pMenu, actionPool()->action(UIActionIndexRT_M_Debug_S_ShowLogDialog));
    13611361    }
    13621362}
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