VirtualBox

Changeset 87509 in vbox


Ignore:
Timestamp:
Feb 1, 2021 3:36:59 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9917: A bit of rework for Manager's action pool: Global tool actions should be togglable, not simple.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.cpp

    r87507 r87509  
    283283    /** Constructs action passing @a pParent to the base-class. */
    284284    UIActionMenuManagerToolsGlobal(UIActionPool *pParent)
    285         : UIActionMenu(pParent)
     285        : UIActionMenu(pParent, ":/tools_menu_24px.png") /// @todo replace with 16px icon
    286286    {}
    287287
     
    297297    virtual void retranslateUi() /* override */
    298298    {
    299         setName(QApplication::translate("UIActionPool", "&Global Tools Menu"));
     299        setName(QApplication::translate("UIActionPool", "Tools"));
    300300    }
    301301};
    302302
    303303/** Simple action extension, used as 'Show Welcome Screen' action class. */
    304 class UIActionSimpleManagerToolsGlobalShowWelcomeScreen : public UIActionSimple
    305 {
    306     Q_OBJECT;
    307 
    308 public:
    309 
    310     /** Constructs action passing @a pParent to the base-class. */
    311     UIActionSimpleManagerToolsGlobalShowWelcomeScreen(UIActionPool *pParent)
    312         : UIActionSimple(pParent, ":/welcome_screen_24px.png")
    313     {}
     304class UIActionToggleManagerToolsGlobalShowWelcomeScreen : public UIActionToggle
     305{
     306    Q_OBJECT;
     307
     308public:
     309
     310    /** Constructs action passing @a pParent to the base-class. */
     311    UIActionToggleManagerToolsGlobalShowWelcomeScreen(UIActionPool *pParent)
     312        : UIActionToggle(pParent)
     313    {
     314        setProperty("UIToolType", QVariant::fromValue(UIToolType_Welcome));
     315        /// @todo use icons with check-boxes
     316        setIcon(UIIconPool::iconSetFull(":/welcome_screen_24px.png", ":/welcome_screen_24px.png",
     317                                        ":/welcome_screen_24px.png", ":/welcome_screen_24px.png"));
     318    }
    314319
    315320protected:
     
    330335
    331336/** Simple action extension, used as 'Show Extension Pack Manager' action class. */
    332 class UIActionSimpleManagerToolsGlobalShowExtensionPackManager : public UIActionSimple
    333 {
    334     Q_OBJECT;
    335 
    336 public:
    337 
    338     /** Constructs action passing @a pParent to the base-class. */
    339     UIActionSimpleManagerToolsGlobalShowExtensionPackManager(UIActionPool *pParent)
    340         : UIActionSimple(pParent,
    341                          ":/extension_pack_manager_24px.png", ":/extension_pack_manager_16px.png",
    342                          ":/extension_pack_manager_disabled_24px.png", ":/extension_pack_manager_disabled_16px.png")
    343     {}
     337class UIActionToggleManagerToolsGlobalShowExtensionPackManager : public UIActionToggle
     338{
     339    Q_OBJECT;
     340
     341public:
     342
     343    /** Constructs action passing @a pParent to the base-class. */
     344    UIActionToggleManagerToolsGlobalShowExtensionPackManager(UIActionPool *pParent)
     345        : UIActionToggle(pParent)
     346    {
     347        setProperty("UIToolType", QVariant::fromValue(UIToolType_Extensions));
     348        /// @todo use icons with check-boxes
     349        setIcon(UIIconPool::iconSetFull(":/extension_pack_manager_24px.png", ":/extension_pack_manager_16px.png",
     350                                        ":/extension_pack_manager_disabled_24px.png", ":/extension_pack_manager_disabled_16px.png"));
     351    }
    344352
    345353protected:
     
    360368
    361369/** Simple action extension, used as 'Show Virtual Media Manager' action class. */
    362 class UIActionSimpleManagerToolsGlobalShowVirtualMediaManager : public UIActionSimple
    363 {
    364     Q_OBJECT;
    365 
    366 public:
    367 
    368     /** Constructs action passing @a pParent to the base-class. */
    369     UIActionSimpleManagerToolsGlobalShowVirtualMediaManager(UIActionPool *pParent)
    370         : UIActionSimple(pParent,
    371                          ":/media_manager_24px.png", ":/media_manager_16px.png",
    372                          ":/media_manager_disabled_24px.png", ":/media_manager_disabled_16px.png")
    373     {}
     370class UIActionToggleManagerToolsGlobalShowVirtualMediaManager : public UIActionToggle
     371{
     372    Q_OBJECT;
     373
     374public:
     375
     376    /** Constructs action passing @a pParent to the base-class. */
     377    UIActionToggleManagerToolsGlobalShowVirtualMediaManager(UIActionPool *pParent)
     378        : UIActionToggle(pParent)
     379    {
     380        setProperty("UIToolType", QVariant::fromValue(UIToolType_Media));
     381        /// @todo use icons with check-boxes
     382        setIcon(UIIconPool::iconSetFull(":/media_manager_24px.png", ":/media_manager_16px.png",
     383                                        ":/media_manager_disabled_24px.png", ":/media_manager_disabled_16px.png"));
     384    }
    374385
    375386protected:
     
    390401
    391402/** Simple action extension, used as 'Show Network Manager' action class. */
    392 class UIActionSimpleManagerToolsGlobalShowHostNetworkManager : public UIActionSimple
    393 {
    394     Q_OBJECT;
    395 
    396 public:
    397 
    398     /** Constructs action passing @a pParent to the base-class. */
    399     UIActionSimpleManagerToolsGlobalShowHostNetworkManager(UIActionPool *pParent)
    400         : UIActionSimple(pParent,
    401                          ":/host_iface_manager_24px.png", ":/host_iface_manager_16px.png",
    402                          ":/host_iface_manager_disabled_24px.png", ":/host_iface_manager_disabled_16px.png")
    403     {}
     403class UIActionToggleManagerToolsGlobalShowNetworkManager : public UIActionToggle
     404{
     405    Q_OBJECT;
     406
     407public:
     408
     409    /** Constructs action passing @a pParent to the base-class. */
     410    UIActionToggleManagerToolsGlobalShowNetworkManager(UIActionPool *pParent)
     411        : UIActionToggle(pParent)
     412    {
     413        setProperty("UIToolType", QVariant::fromValue(UIToolType_Network));
     414        /// @todo use icons with check-boxes
     415        setIcon(UIIconPool::iconSetFull(":/host_iface_manager_24px.png", ":/host_iface_manager_16px.png",
     416                                        ":/host_iface_manager_disabled_24px.png", ":/host_iface_manager_disabled_16px.png"));
     417    }
    404418
    405419protected:
     
    420434
    421435/** Simple action extension, used as 'Show Cloud Profile Manager' action class. */
    422 class UIActionSimpleManagerToolsGlobalShowCloudProfileManager : public UIActionSimple
    423 {
    424     Q_OBJECT;
    425 
    426 public:
    427 
    428     /** Constructs action passing @a pParent to the base-class. */
    429     UIActionSimpleManagerToolsGlobalShowCloudProfileManager(UIActionPool *pParent)
    430         : UIActionSimple(pParent,
    431                          ":/cloud_profile_manager_24px.png", ":/cloud_profile_manager_16px.png",
    432                          ":/cloud_profile_manager_disabled_24px.png", ":/cloud_profile_manager_disabled_16px.png")
    433     {}
     436class UIActionToggleManagerToolsGlobalShowCloudProfileManager : public UIActionToggle
     437{
     438    Q_OBJECT;
     439
     440public:
     441
     442    /** Constructs action passing @a pParent to the base-class. */
     443    UIActionToggleManagerToolsGlobalShowCloudProfileManager(UIActionPool *pParent)
     444        : UIActionToggle(pParent)
     445    {
     446        setProperty("UIToolType", QVariant::fromValue(UIToolType_Cloud));
     447        /// @todo use icons with check-boxes
     448        setIcon(UIIconPool::iconSetFull(":/cloud_profile_manager_24px.png", ":/cloud_profile_manager_16px.png",
     449                                        ":/cloud_profile_manager_disabled_24px.png", ":/cloud_profile_manager_disabled_16px.png"));
     450    }
    434451
    435452protected:
     
    450467
    451468/** Simple action extension, used as 'Show VM Resource Monitor' action class. */
    452 class UIActionSimpleManagerToolsGlobalShowVMResourceMonitor : public UIActionSimple
    453 {
    454     Q_OBJECT;
    455 
    456 public:
    457 
    458     /** Constructs action passing @a pParent to the base-class. */
    459     UIActionSimpleManagerToolsGlobalShowVMResourceMonitor(UIActionPool *pParent)
    460         : UIActionSimple(pParent,
    461                          ":/resouces_monitor_24px.png", ":/resouces_monitor_16px.png",
    462                          ":/resouces_monitor_disabled_24px.png", ":/resouces_monitor_disabled_16px.png")
    463     {}
     469class UIActionToggleManagerToolsGlobalShowVMResourceMonitor : public UIActionToggle
     470{
     471    Q_OBJECT;
     472
     473public:
     474
     475    /** Constructs action passing @a pParent to the base-class. */
     476    UIActionToggleManagerToolsGlobalShowVMResourceMonitor(UIActionPool *pParent)
     477        : UIActionToggle(pParent)
     478    {
     479        setProperty("UIToolType", QVariant::fromValue(UIToolType_Resources));
     480        /// @todo use icons with check-boxes
     481        setIcon(UIIconPool::iconSetFull(":/resources_monitor_24px.png", ":/resources_monitor_16px.png",
     482                                        ":/resources_monitor_disabled_24px.png", ":/resources_monitor_disabled_16px.png"));
     483    }
    464484
    465485protected:
     
    35923612    m_pool[UIActionIndexMN_M_File_S_ExportAppliance] = new UIActionSimpleManagerFileShowExportApplianceWizard(this);
    35933613    m_pool[UIActionIndexMN_M_File_M_Tools] = new UIActionMenuManagerToolsGlobal(this);
    3594     m_pool[UIActionIndexMN_M_File_M_Tools_S_WelcomePane] = new UIActionSimpleManagerToolsGlobalShowWelcomeScreen(this);
    3595     m_pool[UIActionIndexMN_M_File_M_Tools_S_ExtensionPackManager] = new UIActionSimpleManagerToolsGlobalShowExtensionPackManager(this);
    3596     m_pool[UIActionIndexMN_M_File_M_Tools_S_VirtualMediaManager] = new UIActionSimpleManagerToolsGlobalShowVirtualMediaManager(this);
    3597     m_pool[UIActionIndexMN_M_File_M_Tools_S_NetworkManager] = new UIActionSimpleManagerToolsGlobalShowHostNetworkManager(this);
    3598     m_pool[UIActionIndexMN_M_File_M_Tools_S_CloudProfileManager] = new UIActionSimpleManagerToolsGlobalShowCloudProfileManager(this);
    3599     m_pool[UIActionIndexMN_M_File_M_Tools_S_VMResourceMonitor] = new UIActionSimpleManagerToolsGlobalShowVMResourceMonitor(this);
     3614    m_pool[UIActionIndexMN_M_File_M_Tools_T_WelcomeScreen] = new UIActionToggleManagerToolsGlobalShowWelcomeScreen(this);
     3615    m_pool[UIActionIndexMN_M_File_M_Tools_T_ExtensionPackManager] = new UIActionToggleManagerToolsGlobalShowExtensionPackManager(this);
     3616    m_pool[UIActionIndexMN_M_File_M_Tools_T_VirtualMediaManager] = new UIActionToggleManagerToolsGlobalShowVirtualMediaManager(this);
     3617    m_pool[UIActionIndexMN_M_File_M_Tools_T_NetworkManager] = new UIActionToggleManagerToolsGlobalShowNetworkManager(this);
     3618    m_pool[UIActionIndexMN_M_File_M_Tools_T_CloudProfileManager] = new UIActionToggleManagerToolsGlobalShowCloudProfileManager(this);
     3619    m_pool[UIActionIndexMN_M_File_M_Tools_T_VMResourceMonitor] = new UIActionToggleManagerToolsGlobalShowVMResourceMonitor(this);
    36003620#ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
    36013621    m_pool[UIActionIndexMN_M_File_S_ShowExtraDataManager] = new UIActionSimpleManagerFileShowExtraDataManager(this);
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.h

    r87507 r87509  
    4444    UIActionIndexMN_M_File_S_ExportAppliance,
    4545    UIActionIndexMN_M_File_M_Tools,
    46     UIActionIndexMN_M_File_M_Tools_S_WelcomePane,
    47     UIActionIndexMN_M_File_M_Tools_S_ExtensionPackManager,
    48     UIActionIndexMN_M_File_M_Tools_S_VirtualMediaManager,
    49     UIActionIndexMN_M_File_M_Tools_S_NetworkManager,
    50     UIActionIndexMN_M_File_M_Tools_S_CloudProfileManager,
    51     UIActionIndexMN_M_File_M_Tools_S_VMResourceMonitor,
     46    UIActionIndexMN_M_File_M_Tools_T_WelcomeScreen,
     47    UIActionIndexMN_M_File_M_Tools_T_ExtensionPackManager,
     48    UIActionIndexMN_M_File_M_Tools_T_VirtualMediaManager,
     49    UIActionIndexMN_M_File_M_Tools_T_NetworkManager,
     50    UIActionIndexMN_M_File_M_Tools_T_CloudProfileManager,
     51    UIActionIndexMN_M_File_M_Tools_T_VMResourceMonitor,
    5252#ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
    5353    UIActionIndexMN_M_File_S_ShowExtraDataManager,
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