VirtualBox

Changeset 87505 in vbox


Ignore:
Timestamp:
Feb 1, 2021 3:14:07 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
142529
Message:

FE/Qt: bugref:9917: A bit of refactoring for Manager's action pool: Move global tool actions onto corresponding place.

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

Legend:

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

    r87416 r87505  
    271271        setStatusTip(QApplication::translate("UIActionPool", "Export one or more VirtualBox virtual machines as an appliance"));
    272272        setToolTip(simplifyText(text()) + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
     273    }
     274};
     275
     276/** Menu action extension, used as 'Global Tools' menu class. */
     277class UIActionMenuManagerToolsGlobal : public UIActionMenu
     278{
     279    Q_OBJECT;
     280
     281public:
     282
     283    /** Constructs action passing @a pParent to the base-class. */
     284    UIActionMenuManagerToolsGlobal(UIActionPool *pParent)
     285        : UIActionMenu(pParent)
     286    {}
     287
     288protected:
     289
     290    /** Returns shortcut extra-data ID. */
     291    virtual QString shortcutExtraDataID() const /* override */
     292    {
     293        return QString("ToolsGlobalMenu");
     294    }
     295
     296    /** Handles translation event. */
     297    virtual void retranslateUi() /* override */
     298    {
     299        setName(QApplication::translate("UIActionPool", "&Global Tools Menu"));
     300    }
     301};
     302
     303/** Simple action extension, used as 'Show Extension Pack Manager' action class. */
     304class UIActionSimpleManagerToolsGlobalShowExtensionPackManager : public UIActionSimple
     305{
     306    Q_OBJECT;
     307
     308public:
     309
     310    /** Constructs action passing @a pParent to the base-class. */
     311    UIActionSimpleManagerToolsGlobalShowExtensionPackManager(UIActionPool *pParent)
     312        : UIActionSimple(pParent,
     313                         ":/extension_pack_manager_24px.png", ":/extension_pack_manager_16px.png",
     314                         ":/extension_pack_manager_disabled_24px.png", ":/extension_pack_manager_disabled_16px.png")
     315    {}
     316
     317protected:
     318
     319    /** Returns shortcut extra-data ID. */
     320    virtual QString shortcutExtraDataID() const /* override */
     321    {
     322        return QString("ToolsGlobalExtensionPackManager");
     323    }
     324
     325    /** Handles translation event. */
     326    virtual void retranslateUi() /* override */
     327    {
     328        setName(QApplication::translate("UIActionPool", "&Extension Pack Manager"));
     329        setStatusTip(QApplication::translate("UIActionPool", "Open the Extension Pack Manager"));
     330    }
     331};
     332
     333/** Simple action extension, used as 'Show Virtual Media Manager' action class. */
     334class UIActionSimpleManagerToolsGlobalShowVirtualMediaManager : public UIActionSimple
     335{
     336    Q_OBJECT;
     337
     338public:
     339
     340    /** Constructs action passing @a pParent to the base-class. */
     341    UIActionSimpleManagerToolsGlobalShowVirtualMediaManager(UIActionPool *pParent)
     342        : UIActionSimple(pParent,
     343                         ":/media_manager_24px.png", ":/media_manager_16px.png",
     344                         ":/media_manager_disabled_24px.png", ":/media_manager_disabled_16px.png")
     345    {}
     346
     347protected:
     348
     349    /** Returns shortcut extra-data ID. */
     350    virtual QString shortcutExtraDataID() const /* override */
     351    {
     352        return QString("ToolsGlobalVirtualMediaManager");
     353    }
     354
     355    /** Handles translation event. */
     356    virtual void retranslateUi() /* override */
     357    {
     358        setName(QApplication::translate("UIActionPool", "&Virtual Media Manager"));
     359        setStatusTip(QApplication::translate("UIActionPool", "Open the Virtual Media Manager"));
     360    }
     361};
     362
     363/** Simple action extension, used as 'Show Network Manager' action class. */
     364class UIActionSimpleManagerToolsGlobalShowHostNetworkManager : public UIActionSimple
     365{
     366    Q_OBJECT;
     367
     368public:
     369
     370    /** Constructs action passing @a pParent to the base-class. */
     371    UIActionSimpleManagerToolsGlobalShowHostNetworkManager(UIActionPool *pParent)
     372        : UIActionSimple(pParent,
     373                         ":/host_iface_manager_24px.png", ":/host_iface_manager_16px.png",
     374                         ":/host_iface_manager_disabled_24px.png", ":/host_iface_manager_disabled_16px.png")
     375    {}
     376
     377protected:
     378
     379    /** Returns shortcut extra-data ID. */
     380    virtual QString shortcutExtraDataID() const /* override */
     381    {
     382        return QString("ToolsGlobalHostNetworkManager");
     383    }
     384
     385    /** Handles translation event. */
     386    virtual void retranslateUi() /* override */
     387    {
     388        setName(QApplication::translate("UIActionPool", "&Network Manager"));
     389        setStatusTip(QApplication::translate("UIActionPool", "Open the Network Manager"));
     390    }
     391};
     392
     393/** Simple action extension, used as 'Show Cloud Profile Manager' action class. */
     394class UIActionSimpleManagerToolsGlobalShowCloudProfileManager : public UIActionSimple
     395{
     396    Q_OBJECT;
     397
     398public:
     399
     400    /** Constructs action passing @a pParent to the base-class. */
     401    UIActionSimpleManagerToolsGlobalShowCloudProfileManager(UIActionPool *pParent)
     402        : UIActionSimple(pParent,
     403                         ":/cloud_profile_manager_24px.png", ":/cloud_profile_manager_16px.png",
     404                         ":/cloud_profile_manager_disabled_24px.png", ":/cloud_profile_manager_disabled_16px.png")
     405    {}
     406
     407protected:
     408
     409    /** Returns shortcut extra-data ID. */
     410    virtual QString shortcutExtraDataID() const /* override */
     411    {
     412        return QString("ToolsGlobalCloudProfileManager");
     413    }
     414
     415    /** Handles translation event. */
     416    virtual void retranslateUi() /* override */
     417    {
     418        setName(QApplication::translate("UIActionPool", "&Cloud Profile Manager"));
     419        setStatusTip(QApplication::translate("UIActionPool", "Open the Cloud Profile Manager"));
     420    }
     421};
     422
     423/** Simple action extension, used as 'Show VM Resource Monitor' action class. */
     424class UIActionSimpleManagerToolsGlobalShowVMResourceMonitor : public UIActionSimple
     425{
     426    Q_OBJECT;
     427
     428public:
     429
     430    /** Constructs action passing @a pParent to the base-class. */
     431    UIActionSimpleManagerToolsGlobalShowVMResourceMonitor(UIActionPool *pParent)
     432        : UIActionSimple(pParent,
     433                         ":/resouces_monitor_24px.png", ":/resouces_monitor_16px.png",
     434                         ":/resouces_monitor_disabled_24px.png", ":/resouces_monitor_disabled_16px.png")
     435    {}
     436
     437protected:
     438
     439    /** Returns shortcut extra-data ID. */
     440    virtual QString shortcutExtraDataID() const /* override */
     441    {
     442        return QString("ToolsGlobalVMResourceMonitor");
     443    }
     444
     445    /** Handles translation event. */
     446    virtual void retranslateUi() /* override */
     447    {
     448        setName(QApplication::translate("UIActionPool", "&VM Resource Monitor"));
     449        setStatusTip(QApplication::translate("UIActionPool", "Open the VM Resource Monitor"));
    273450    }
    274451};
     
    17901967};
    17911968
    1792 /** Menu action extension, used as 'Global Tools' menu class. */
    1793 class UIActionMenuManagerToolsGlobal : public UIActionMenu
    1794 {
    1795     Q_OBJECT;
    1796 
    1797 public:
    1798 
    1799     /** Constructs action passing @a pParent to the base-class. */
    1800     UIActionMenuManagerToolsGlobal(UIActionPool *pParent)
    1801         : UIActionMenu(pParent)
    1802     {}
    1803 
    1804 protected:
    1805 
    1806     /** Returns shortcut extra-data ID. */
    1807     virtual QString shortcutExtraDataID() const /* override */
    1808     {
    1809         return QString("ToolsGlobalMenu");
    1810     }
    1811 
    1812     /** Handles translation event. */
    1813     virtual void retranslateUi() /* override */
    1814     {
    1815         setName(QApplication::translate("UIActionPool", "&Global Tools Menu"));
    1816     }
    1817 };
    1818 
    1819 /** Simple action extension, used as 'Show Extension Pack Manager' action class. */
    1820 class UIActionSimpleManagerToolsGlobalShowExtensionPackManager : public UIActionSimple
    1821 {
    1822     Q_OBJECT;
    1823 
    1824 public:
    1825 
    1826     /** Constructs action passing @a pParent to the base-class. */
    1827     UIActionSimpleManagerToolsGlobalShowExtensionPackManager(UIActionPool *pParent)
    1828         : UIActionSimple(pParent,
    1829                          ":/extension_pack_manager_24px.png", ":/extension_pack_manager_16px.png",
    1830                          ":/extension_pack_manager_disabled_24px.png", ":/extension_pack_manager_disabled_16px.png")
    1831     {}
    1832 
    1833 protected:
    1834 
    1835     /** Returns shortcut extra-data ID. */
    1836     virtual QString shortcutExtraDataID() const /* override */
    1837     {
    1838         return QString("ToolsGlobalExtensionPackManager");
    1839     }
    1840 
    1841     /** Handles translation event. */
    1842     virtual void retranslateUi() /* override */
    1843     {
    1844         setName(QApplication::translate("UIActionPool", "&Extension Pack Manager"));
    1845         setStatusTip(QApplication::translate("UIActionPool", "Open the Extension Pack Manager"));
    1846     }
    1847 };
    1848 
    1849 /** Simple action extension, used as 'Show Virtual Media Manager' action class. */
    1850 class UIActionSimpleManagerToolsGlobalShowVirtualMediaManager : public UIActionSimple
    1851 {
    1852     Q_OBJECT;
    1853 
    1854 public:
    1855 
    1856     /** Constructs action passing @a pParent to the base-class. */
    1857     UIActionSimpleManagerToolsGlobalShowVirtualMediaManager(UIActionPool *pParent)
    1858         : UIActionSimple(pParent,
    1859                          ":/media_manager_24px.png", ":/media_manager_16px.png",
    1860                          ":/media_manager_disabled_24px.png", ":/media_manager_disabled_16px.png")
    1861     {}
    1862 
    1863 protected:
    1864 
    1865     /** Returns shortcut extra-data ID. */
    1866     virtual QString shortcutExtraDataID() const /* override */
    1867     {
    1868         return QString("ToolsGlobalVirtualMediaManager");
    1869     }
    1870 
    1871     /** Handles translation event. */
    1872     virtual void retranslateUi() /* override */
    1873     {
    1874         setName(QApplication::translate("UIActionPool", "&Virtual Media Manager"));
    1875         setStatusTip(QApplication::translate("UIActionPool", "Open the Virtual Media Manager"));
    1876     }
    1877 };
    1878 
    1879 /** Simple action extension, used as 'Show Network Manager' action class. */
    1880 class UIActionSimpleManagerToolsGlobalShowHostNetworkManager : public UIActionSimple
    1881 {
    1882     Q_OBJECT;
    1883 
    1884 public:
    1885 
    1886     /** Constructs action passing @a pParent to the base-class. */
    1887     UIActionSimpleManagerToolsGlobalShowHostNetworkManager(UIActionPool *pParent)
    1888         : UIActionSimple(pParent,
    1889                          ":/host_iface_manager_24px.png", ":/host_iface_manager_16px.png",
    1890                          ":/host_iface_manager_disabled_24px.png", ":/host_iface_manager_disabled_16px.png")
    1891     {}
    1892 
    1893 protected:
    1894 
    1895     /** Returns shortcut extra-data ID. */
    1896     virtual QString shortcutExtraDataID() const /* override */
    1897     {
    1898         return QString("ToolsGlobalHostNetworkManager");
    1899     }
    1900 
    1901     /** Handles translation event. */
    1902     virtual void retranslateUi() /* override */
    1903     {
    1904         setName(QApplication::translate("UIActionPool", "&Network Manager"));
    1905         setStatusTip(QApplication::translate("UIActionPool", "Open the Network Manager"));
    1906     }
    1907 };
    1908 
    1909 /** Simple action extension, used as 'Show Cloud Profile Manager' action class. */
    1910 class UIActionSimpleManagerToolsGlobalShowCloudProfileManager : public UIActionSimple
    1911 {
    1912     Q_OBJECT;
    1913 
    1914 public:
    1915 
    1916     /** Constructs action passing @a pParent to the base-class. */
    1917     UIActionSimpleManagerToolsGlobalShowCloudProfileManager(UIActionPool *pParent)
    1918         : UIActionSimple(pParent,
    1919                          ":/cloud_profile_manager_24px.png", ":/cloud_profile_manager_16px.png",
    1920                          ":/cloud_profile_manager_disabled_24px.png", ":/cloud_profile_manager_disabled_16px.png")
    1921     {}
    1922 
    1923 protected:
    1924 
    1925     /** Returns shortcut extra-data ID. */
    1926     virtual QString shortcutExtraDataID() const /* override */
    1927     {
    1928         return QString("ToolsGlobalCloudProfileManager");
    1929     }
    1930 
    1931     /** Handles translation event. */
    1932     virtual void retranslateUi() /* override */
    1933     {
    1934         setName(QApplication::translate("UIActionPool", "&Cloud Profile Manager"));
    1935         setStatusTip(QApplication::translate("UIActionPool", "Open the Cloud Profile Manager"));
    1936     }
    1937 };
    1938 
    1939 /** Simple action extension, used as 'Show VM Resource Monitor' action class. */
    1940 class UIActionSimpleManagerToolsGlobalShowVMResourceMonitor : public UIActionSimple
    1941 {
    1942     Q_OBJECT;
    1943 
    1944 public:
    1945 
    1946     /** Constructs action passing @a pParent to the base-class. */
    1947     UIActionSimpleManagerToolsGlobalShowVMResourceMonitor(UIActionPool *pParent)
    1948         : UIActionSimple(pParent,
    1949                          ":/resouces_monitor_24px.png", ":/resouces_monitor_16px.png",
    1950                          ":/resouces_monitor_disabled_24px.png", ":/resouces_monitor_disabled_16px.png")
    1951     {}
    1952 
    1953 protected:
    1954 
    1955     /** Returns shortcut extra-data ID. */
    1956     virtual QString shortcutExtraDataID() const /* override */
    1957     {
    1958         return QString("ToolsGlobalVMResourceMonitor");
    1959     }
    1960 
    1961     /** Handles translation event. */
    1962     virtual void retranslateUi() /* override */
    1963     {
    1964         setName(QApplication::translate("UIActionPool", "&VM Resource Monitor"));
    1965         setStatusTip(QApplication::translate("UIActionPool", "Open the VM Resource Monitor"));
    1966     }
    1967 };
    1968 
    19691969
    19701970/** Menu action extension, used as 'Snapshot' menu class. */
     
    35633563    m_pool[UIActionIndexMN_M_File_S_ImportAppliance] = new UIActionSimpleManagerFileShowImportApplianceWizard(this);
    35643564    m_pool[UIActionIndexMN_M_File_S_ExportAppliance] = new UIActionSimpleManagerFileShowExportApplianceWizard(this);
     3565    m_pool[UIActionIndexMN_M_File_M_Tools] = new UIActionMenuManagerToolsGlobal(this);
     3566    m_pool[UIActionIndexMN_M_File_M_Tools_S_ExtensionPackManager] = new UIActionSimpleManagerToolsGlobalShowExtensionPackManager(this);
     3567    m_pool[UIActionIndexMN_M_File_M_Tools_S_VirtualMediaManager] = new UIActionSimpleManagerToolsGlobalShowVirtualMediaManager(this);
     3568    m_pool[UIActionIndexMN_M_File_M_Tools_S_NetworkManager] = new UIActionSimpleManagerToolsGlobalShowHostNetworkManager(this);
     3569    m_pool[UIActionIndexMN_M_File_M_Tools_S_CloudProfileManager] = new UIActionSimpleManagerToolsGlobalShowCloudProfileManager(this);
     3570    m_pool[UIActionIndexMN_M_File_M_Tools_S_VMResourceMonitor] = new UIActionSimpleManagerToolsGlobalShowVMResourceMonitor(this);
    35653571#ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
    35663572    m_pool[UIActionIndexMN_M_File_S_ShowExtraDataManager] = new UIActionSimpleManagerFileShowExtraDataManager(this);
     
    36533659    m_pool[UIActionIndexMN_M_Machine_S_SortParent] = new UIActionSimpleManagerMachinePerformSortParent(this);
    36543660    m_pool[UIActionIndexMN_M_Machine_T_Search] = new UIActionToggleManagerCommonToggleSearch(this);
    3655 
    3656     /* Global Tools actions: */
    3657     m_pool[UIActionIndexMN_M_Tools_M_Global] = new UIActionMenuManagerToolsGlobal(this);
    3658     m_pool[UIActionIndexMN_M_Tools_M_Global_S_ExtensionPackManager] = new UIActionSimpleManagerToolsGlobalShowExtensionPackManager(this);
    3659     m_pool[UIActionIndexMN_M_Tools_M_Global_S_VirtualMediaManager] = new UIActionSimpleManagerToolsGlobalShowVirtualMediaManager(this);
    3660     m_pool[UIActionIndexMN_M_Tools_M_Global_S_HostNetworkManager] = new UIActionSimpleManagerToolsGlobalShowHostNetworkManager(this);
    3661     m_pool[UIActionIndexMN_M_Tools_M_Global_S_CloudProfileManager] = new UIActionSimpleManagerToolsGlobalShowCloudProfileManager(this);
    3662     m_pool[UIActionIndexMN_M_Tools_M_Global_S_VMResourceMonitor] = new UIActionSimpleManagerToolsGlobalShowVMResourceMonitor(this);
    36633661
    36643662    /* Snapshot Pane actions: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.h

    r87354 r87505  
    4343    UIActionIndexMN_M_File_S_ImportAppliance,
    4444    UIActionIndexMN_M_File_S_ExportAppliance,
     45    UIActionIndexMN_M_File_M_Tools,
     46    UIActionIndexMN_M_File_M_Tools_S_ExtensionPackManager,
     47    UIActionIndexMN_M_File_M_Tools_S_VirtualMediaManager,
     48    UIActionIndexMN_M_File_M_Tools_S_NetworkManager,
     49    UIActionIndexMN_M_File_M_Tools_S_CloudProfileManager,
     50    UIActionIndexMN_M_File_M_Tools_S_VMResourceMonitor,
    4551#ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
    4652    UIActionIndexMN_M_File_S_ShowExtraDataManager,
     
    133139    UIActionIndexMN_M_Machine_T_Search,
    134140
    135     /* Global Tools actions: */
    136     UIActionIndexMN_M_Tools_M_Global,
    137     UIActionIndexMN_M_Tools_M_Global_S_ExtensionPackManager,
    138     UIActionIndexMN_M_Tools_M_Global_S_VirtualMediaManager,
    139     UIActionIndexMN_M_Tools_M_Global_S_HostNetworkManager,
    140     UIActionIndexMN_M_Tools_M_Global_S_CloudProfileManager,
    141     UIActionIndexMN_M_Tools_M_Global_S_VMResourceMonitor,
    142 
    143141    /* Snapshot Pane actions: */
    144142    UIActionIndexMN_M_Snapshot,
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