VirtualBox

Ignore:
Timestamp:
Aug 16, 2018 4:00:08 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: UIActionPool* and UIMediumManager classes: Move Medium Manager to action-pool rails which means it is configurable via shortcut-pool now.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h

    r73715 r73717  
    409409    /** Pointer to menu update-handler for this class. */
    410410    typedef void (UIActionPool::*PTFActionPool)();
     411    /** Pointer to menu update-handler for Selector sub-class. */
     412    typedef void (UIActionPoolSelector::*PTFActionPoolSelector)();
    411413    /** Pointer to menu update-handler for Runtime sub-class. */
    412414    typedef void (UIActionPoolRuntime::*PTFActionPoolRuntime)();
     
    415417    {
    416418        PTFActionPool ptf;
     419        PTFActionPoolSelector ptfs;
    417420        PTFActionPoolRuntime ptfr;
    418421    };
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolSelector.cpp

    r73694 r73717  
    2323# include "UIActionPoolSelector.h"
    2424# include "UIExtraDataDefs.h"
     25# include "UIIconPool.h"
    2526# include "UIShortcutPool.h"
    2627# include "UIDefs.h"
     
    17651766        setStatusTip(QApplication::translate("UIActionPool", "Clone selected virtual machine"));
    17661767        setToolTip(tr("Clone Virtual Machine (%1)").arg(shortcut().toString()));
     1768    }
     1769};
     1770
     1771
     1772/** Menu action extension, used as 'Medium' menu class. */
     1773class UIActionMenuSelectorMedium : public UIActionMenu
     1774{
     1775    Q_OBJECT;
     1776
     1777public:
     1778
     1779    /** Constructs action passing @a pParent to the base-class. */
     1780    UIActionMenuSelectorMedium(UIActionPool *pParent)
     1781        : UIActionMenu(pParent)
     1782    {}
     1783
     1784protected:
     1785
     1786    /** Returns shortcut extra-data ID. */
     1787    virtual QString shortcutExtraDataID() const /* override */
     1788    {
     1789        return QString("MediumMenu");
     1790    }
     1791
     1792    /** Handles translation event. */
     1793    virtual void retranslateUi() /* override */
     1794    {
     1795        setName(QApplication::translate("UIActionPool", "&Medium"));
     1796        setStatusTip(QApplication::translate("UIActionPool", "Open the medium menu"));
     1797    }
     1798};
     1799
     1800/** Simple action extension, used as 'Perform Add' action class. */
     1801class UIActionMenuSelectorMediumPerformAdd : public UIActionSimple
     1802{
     1803    Q_OBJECT;
     1804
     1805public:
     1806
     1807    /** Constructs action passing @a pParent to the base-class. */
     1808    UIActionMenuSelectorMediumPerformAdd(UIActionPool *pParent)
     1809        : UIActionSimple(pParent)
     1810    {
     1811        setIcon(0, UIIconPool::iconSetFull(":/hd_add_22px.png",          ":/hd_add_16px.png",
     1812                                           ":/hd_add_disabled_22px.png", ":/hd_add_disabled_16px.png"));
     1813        setIcon(1, UIIconPool::iconSetFull(":/cd_add_22px.png",          ":/cd_add_16px.png",
     1814                                           ":/cd_add_disabled_22px.png", ":/cd_add_disabled_16px.png"));
     1815        setIcon(2, UIIconPool::iconSetFull(":/fd_add_22px.png",          ":/fd_add_16px.png",
     1816                                           ":/fd_add_disabled_22px.png", ":/fd_add_disabled_16px.png"));
     1817    }
     1818
     1819protected:
     1820
     1821    /** Returns shortcut extra-data ID. */
     1822    virtual QString shortcutExtraDataID() const /* override */
     1823    {
     1824        return QString("AddMedium");
     1825    }
     1826
     1827    /** Returns default shortcut. */
     1828    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     1829    {
     1830        return QKeySequence("Ctrl+Shift+A");
     1831    }
     1832
     1833    /** Handles translation event. */
     1834    virtual void retranslateUi() /* override */
     1835    {
     1836        setName(QApplication::translate("UIActionPool", "&Add..."));
     1837        setStatusTip(QApplication::translate("UIActionPool", "Add a Disk Image File"));
     1838        setToolTip(tr("Add a Disk Image File (%1)").arg(shortcut().toString()));
     1839    }
     1840};
     1841
     1842/** Simple action extension, used as 'Perform Copy' action class. */
     1843class UIActionMenuSelectorMediumPerformCopy : public UIActionSimple
     1844{
     1845    Q_OBJECT;
     1846
     1847public:
     1848
     1849    /** Constructs action passing @a pParent to the base-class. */
     1850    UIActionMenuSelectorMediumPerformCopy(UIActionPool *pParent)
     1851        : UIActionSimple(pParent)
     1852    {
     1853        setIcon(0, UIIconPool::iconSetFull(":/hd_copy_22px.png",          ":/hd_copy_16px.png",
     1854                                           ":/hd_copy_disabled_22px.png", ":/hd_copy_disabled_16px.png"));
     1855        setIcon(1, UIIconPool::iconSetFull(":/cd_copy_22px.png",          ":/cd_copy_16px.png",
     1856                                           ":/cd_copy_disabled_22px.png", ":/cd_copy_disabled_16px.png"));
     1857        setIcon(2, UIIconPool::iconSetFull(":/fd_copy_22px.png",          ":/fd_copy_16px.png",
     1858                                           ":/fd_copy_disabled_22px.png", ":/fd_copy_disabled_16px.png"));
     1859    }
     1860
     1861protected:
     1862
     1863    /** Returns shortcut extra-data ID. */
     1864    virtual QString shortcutExtraDataID() const /* override */
     1865    {
     1866        return QString("CopyMedium");
     1867    }
     1868
     1869    /** Returns default shortcut. */
     1870    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     1871    {
     1872        return QKeySequence("Ctrl+Shift+C");
     1873    }
     1874
     1875    /** Handles translation event. */
     1876    virtual void retranslateUi() /* override */
     1877    {
     1878        setName(QApplication::translate("UIActionPool", "&Copy..."));
     1879        setStatusTip(QApplication::translate("UIActionPool", "Copy selected disk image file"));
     1880        setToolTip(tr("Copy Disk Image File (%1)").arg(shortcut().toString()));
     1881    }
     1882};
     1883
     1884/** Simple action extension, used as 'Perform Move' action class. */
     1885class UIActionMenuSelectorMediumPerformMove : public UIActionSimple
     1886{
     1887    Q_OBJECT;
     1888
     1889public:
     1890
     1891    /** Constructs action passing @a pParent to the base-class. */
     1892    UIActionMenuSelectorMediumPerformMove(UIActionPool *pParent)
     1893        : UIActionSimple(pParent)
     1894    {
     1895        setIcon(0, UIIconPool::iconSetFull(":/hd_move_22px.png",          ":/hd_move_16px.png",
     1896                                           ":/hd_move_disabled_22px.png", ":/hd_move_disabled_16px.png"));
     1897        setIcon(1, UIIconPool::iconSetFull(":/cd_move_22px.png",          ":/cd_move_16px.png",
     1898                                           ":/cd_move_disabled_22px.png", ":/cd_move_disabled_16px.png"));
     1899        setIcon(2, UIIconPool::iconSetFull(":/fd_move_22px.png",          ":/fd_move_16px.png",
     1900                                           ":/fd_move_disabled_22px.png", ":/fd_move_disabled_16px.png"));
     1901    }
     1902
     1903protected:
     1904
     1905    /** Returns shortcut extra-data ID. */
     1906    virtual QString shortcutExtraDataID() const /* override */
     1907    {
     1908        return QString("MoveMedium");
     1909    }
     1910
     1911    /** Returns default shortcut. */
     1912    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     1913    {
     1914        return QKeySequence("Ctrl+Shift+M");
     1915    }
     1916
     1917    /** Handles translation event. */
     1918    virtual void retranslateUi() /* override */
     1919    {
     1920        setName(QApplication::translate("UIActionPool", "&Move..."));
     1921        setStatusTip(QApplication::translate("UIActionPool", "Move selected disk image file"));
     1922        setToolTip(tr("Move Disk Image File (%1)").arg(shortcut().toString()));
     1923    }
     1924};
     1925
     1926/** Simple action extension, used as 'Perform Remove' action class. */
     1927class UIActionMenuSelectorMediumPerformRemove : public UIActionSimple
     1928{
     1929    Q_OBJECT;
     1930
     1931public:
     1932
     1933    /** Constructs action passing @a pParent to the base-class. */
     1934    UIActionMenuSelectorMediumPerformRemove(UIActionPool *pParent)
     1935        : UIActionSimple(pParent)
     1936    {
     1937        setIcon(0, UIIconPool::iconSetFull(":/hd_remove_22px.png",          ":/hd_remove_16px.png",
     1938                                           ":/hd_remove_disabled_22px.png", ":/hd_remove_disabled_16px.png"));
     1939        setIcon(1, UIIconPool::iconSetFull(":/cd_remove_22px.png",          ":/cd_remove_16px.png",
     1940                                           ":/cd_remove_disabled_22px.png", ":/cd_remove_disabled_16px.png"));
     1941        setIcon(2, UIIconPool::iconSetFull(":/fd_remove_22px.png",          ":/fd_remove_16px.png",
     1942                                           ":/fd_remove_disabled_22px.png", ":/fd_remove_disabled_16px.png"));
     1943    }
     1944
     1945protected:
     1946
     1947    /** Returns shortcut extra-data ID. */
     1948    virtual QString shortcutExtraDataID() const /* override */
     1949    {
     1950        return QString("RemoveMedium");
     1951    }
     1952
     1953    /** Returns default shortcut. */
     1954    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     1955    {
     1956        return QKeySequence("Ctrl+Shift+R");
     1957    }
     1958
     1959    /** Handles translation event. */
     1960    virtual void retranslateUi() /* override */
     1961    {
     1962        setName(QApplication::translate("UIActionPool", "&Remove..."));
     1963        setStatusTip(QApplication::translate("UIActionPool", "Remove selected disk image file"));
     1964        setToolTip(tr("Remove Disk Image File (%1)").arg(shortcut().toString()));
     1965    }
     1966};
     1967
     1968/** Simple action extension, used as 'Perform Release' action class. */
     1969class UIActionMenuSelectorMediumPerformRelease : public UIActionSimple
     1970{
     1971    Q_OBJECT;
     1972
     1973public:
     1974
     1975    /** Constructs action passing @a pParent to the base-class. */
     1976    UIActionMenuSelectorMediumPerformRelease(UIActionPool *pParent)
     1977        : UIActionSimple(pParent)
     1978    {
     1979        setIcon(0, UIIconPool::iconSetFull(":/hd_release_22px.png",          ":/hd_release_16px.png",
     1980                                           ":/hd_release_disabled_22px.png", ":/hd_release_disabled_16px.png"));
     1981        setIcon(1, UIIconPool::iconSetFull(":/cd_release_22px.png",          ":/cd_release_16px.png",
     1982                                           ":/cd_release_disabled_22px.png", ":/cd_release_disabled_16px.png"));
     1983        setIcon(2, UIIconPool::iconSetFull(":/fd_release_22px.png",          ":/fd_release_16px.png",
     1984                                           ":/fd_release_disabled_22px.png", ":/fd_release_disabled_16px.png"));
     1985    }
     1986
     1987protected:
     1988
     1989    /** Returns shortcut extra-data ID. */
     1990    virtual QString shortcutExtraDataID() const /* override */
     1991    {
     1992        return QString("ReleaseMedium");
     1993    }
     1994
     1995    /** Returns default shortcut. */
     1996    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     1997    {
     1998        return QKeySequence("Ctrl+Shift+L");
     1999    }
     2000
     2001    /** Handles translation event. */
     2002    virtual void retranslateUi() /* override */
     2003    {
     2004        setName(QApplication::translate("UIActionPool", "Re&lease..."));
     2005        setStatusTip(QApplication::translate("UIActionPool", "Release selected disk image file"));
     2006        setToolTip(tr("Release Disk Image File (%1)").arg(shortcut().toString()));
     2007    }
     2008};
     2009
     2010/** Toggle action extension, used as 'Toggle Medium Properties' action class. */
     2011class UIActionMenuSelectorMediumToggleProperties : public UIActionToggle
     2012{
     2013    Q_OBJECT;
     2014
     2015public:
     2016
     2017    /** Constructs action passing @a pParent to the base-class. */
     2018    UIActionMenuSelectorMediumToggleProperties(UIActionPool *pParent)
     2019        : UIActionToggle(pParent)
     2020    {
     2021        setIcon(0, UIIconPool::iconSetFull(":/hd_modify_22px.png",          ":/hd_modify_16px.png",
     2022                                           ":/hd_modify_disabled_22px.png", ":/hd_modify_disabled_16px.png"));
     2023        setIcon(1, UIIconPool::iconSetFull(":/cd_modify_22px.png",          ":/cd_modify_16px.png",
     2024                                           ":/cd_modify_disabled_22px.png", ":/cd_modify_disabled_16px.png"));
     2025        setIcon(2, UIIconPool::iconSetFull(":/fd_modify_22px.png",          ":/fd_modify_16px.png",
     2026                                           ":/fd_modify_disabled_22px.png", ":/fd_modify_disabled_16px.png"));
     2027    }
     2028
     2029protected:
     2030
     2031    /** Returns shortcut extra-data ID. */
     2032    virtual QString shortcutExtraDataID() const /* override */
     2033    {
     2034        return QString("ToggleMediumProperties");
     2035    }
     2036
     2037    /** Returns default shortcut. */
     2038    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     2039    {
     2040        return QKeySequence("Ctrl+Space");
     2041    }
     2042
     2043    /** Handles translation event. */
     2044    virtual void retranslateUi() /* override */
     2045    {
     2046        setName(QApplication::translate("UIActionPool", "&Properties"));
     2047        setStatusTip(QApplication::translate("UIActionPool", "Open pane with selected disk image file properties"));
     2048        setToolTip(tr("Open Disk Image File Properties (%1)").arg(shortcut().toString()));
     2049    }
     2050};
     2051
     2052/** Simple action extension, used as 'Perform Refresh' action class. */
     2053class UIActionMenuSelectorMediumPerformRefresh : public UIActionSimple
     2054{
     2055    Q_OBJECT;
     2056
     2057public:
     2058
     2059    /** Constructs action passing @a pParent to the base-class. */
     2060    UIActionMenuSelectorMediumPerformRefresh(UIActionPool *pParent)
     2061        : UIActionSimple(pParent,
     2062                         ":/refresh_22px.png",          ":/refresh_16px.png",
     2063                         ":/refresh_disabled_22px.png", ":/refresh_disabled_16px.png")
     2064    {}
     2065
     2066protected:
     2067
     2068    /** Returns shortcut extra-data ID. */
     2069    virtual QString shortcutExtraDataID() const /* override */
     2070    {
     2071        return QString("RefreshMediums");
     2072    }
     2073
     2074    /** Returns default shortcut. */
     2075    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     2076    {
     2077        return QKeySequence("Ctrl+Shift+F");
     2078    }
     2079
     2080    /** Handles translation event. */
     2081    virtual void retranslateUi() /* override */
     2082    {
     2083        setName(QApplication::translate("UIActionPool", "Re&fresh..."));
     2084        setStatusTip(QApplication::translate("UIActionPool", "Refresh the list of disk image files"));
     2085        setToolTip(tr("Refresh Disk Image Files (%1)").arg(shortcut().toString()));
    17672086    }
    17682087};
     
    18632182    m_pool[UIActionIndexST_M_Snapshot_S_Clone] = new UIActionMenuSelectorSnapshotPerformClone(this);
    18642183
     2184    /* Virtual Medium Manager actions: */
     2185    m_pool[UIActionIndexST_M_Medium] = new UIActionMenuSelectorMedium(this);
     2186    m_pool[UIActionIndexST_M_Medium_S_Add] = new UIActionMenuSelectorMediumPerformAdd(this);
     2187    m_pool[UIActionIndexST_M_Medium_S_Copy] = new UIActionMenuSelectorMediumPerformCopy(this);
     2188    m_pool[UIActionIndexST_M_Medium_S_Move] = new UIActionMenuSelectorMediumPerformMove(this);
     2189    m_pool[UIActionIndexST_M_Medium_S_Remove] = new UIActionMenuSelectorMediumPerformRemove(this);
     2190    m_pool[UIActionIndexST_M_Medium_S_Release] = new UIActionMenuSelectorMediumPerformRelease(this);
     2191    m_pool[UIActionIndexST_M_Medium_T_Details] = new UIActionMenuSelectorMediumToggleProperties(this);
     2192    m_pool[UIActionIndexST_M_Medium_S_Refresh] = new UIActionMenuSelectorMediumPerformRefresh(this);
     2193
     2194    /* Prepare update-handlers for known menus: */
     2195    m_menuUpdateHandlers[UIActionIndexST_M_Medium].ptfs = &UIActionPoolSelector::updateMenuMedium;
     2196
    18652197    /* Call to base-class: */
    18662198    UIActionPool::preparePool();
     
    18842216    /* 'Log Viewer' menu: */
    18852217    updateMenuLogViewer();
     2218
     2219    /* 'Virtual Media Manager' menu: */
     2220    updateMenuMedium();
     2221}
     2222
     2223void UIActionPoolSelector::updateMenuMedium()
     2224{
     2225    /* Get corresponding menu: */
     2226    UIMenu *pMenu = action(UIActionIndexST_M_Medium)->menu();
     2227    AssertPtrReturnVoid(pMenu);
     2228    /* Clear contents: */
     2229    pMenu->clear();
     2230
     2231    /* Separator? */
     2232    bool fSeparator = false;
     2233
     2234    /* 'Add' action: */
     2235    fSeparator = addAction(pMenu, action(UIActionIndexST_M_Medium_S_Add)) || fSeparator;
     2236    /* 'Copy' action: */
     2237    fSeparator = addAction(pMenu, action(UIActionIndexST_M_Medium_S_Copy)) || fSeparator;
     2238    /* 'Move' action: */
     2239    fSeparator = addAction(pMenu, action(UIActionIndexST_M_Medium_S_Move)) || fSeparator;
     2240    /* 'Remove' action: */
     2241    fSeparator = addAction(pMenu, action(UIActionIndexST_M_Medium_S_Remove)) || fSeparator;
     2242
     2243    /* Separator? */
     2244    if (fSeparator)
     2245    {
     2246        pMenu->addSeparator();
     2247        fSeparator = false;
     2248    }
     2249
     2250    /* 'Release' action: */
     2251    fSeparator = addAction(pMenu, action(UIActionIndexST_M_Medium_S_Release)) || fSeparator;
     2252    /* 'Properties' action: */
     2253    fSeparator = addAction(pMenu, action(UIActionIndexST_M_Medium_T_Details)) || fSeparator;
     2254
     2255    /* Separator? */
     2256    if (fSeparator)
     2257    {
     2258        pMenu->addSeparator();
     2259        fSeparator = false;
     2260    }
     2261
     2262    /* 'Refresh' action: */
     2263    fSeparator = addAction(pMenu, action(UIActionIndexST_M_Medium_S_Refresh)) || fSeparator;;
     2264
     2265    /* Mark menu as valid: */
     2266    m_invalidations.remove(UIActionIndexST_M_Medium);
    18862267}
    18872268
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolSelector.h

    r73671 r73717  
    116116    UIActionIndexST_M_Snapshot_S_Clone,
    117117
     118    /* Virtual Media Manager actions: */
     119    UIActionIndexST_M_Medium,
     120    UIActionIndexST_M_Medium_S_Add,
     121    UIActionIndexST_M_Medium_S_Copy,
     122    UIActionIndexST_M_Medium_S_Move,
     123    UIActionIndexST_M_Medium_S_Remove,
     124    UIActionIndexST_M_Medium_S_Release,
     125    UIActionIndexST_M_Medium_T_Details,
     126    UIActionIndexST_M_Medium_S_Refresh,
     127
    118128    /* Maximum index: */
    119129    UIActionIndexST_Max
     
    142152    virtual void updateMenus() /* override */;
    143153
     154    /** Updates 'Medium' menu. */
     155    void updateMenuMedium();
     156
    144157    /** Updates shortcuts. */
    145158    virtual void updateShortcuts() /* override */;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneGlobal.cpp

    r73637 r73717  
    111111            {
    112112                /* Create Virtual Media Manager: */
    113                 m_pPaneMedia = new UIMediumManagerWidget(EmbedTo_Stack);
     113                m_pPaneMedia = new UIMediumManagerWidget(EmbedTo_Stack, m_pActionPool);
    114114                AssertPtrReturnVoid(m_pPaneMedia);
    115115                {
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r73697 r73717  
    397397    if (!m_pManagerVirtualMedia)
    398398    {
    399         UIMediumManagerFactory().prepare(m_pManagerVirtualMedia, this);
     399        UIMediumManagerFactory(m_pActionPool).prepare(m_pManagerVirtualMedia, this);
    400400        connect(m_pManagerVirtualMedia, &QIManagerDialog::sigClose,
    401401                this, &UIVirtualBoxManager::sltCloseVirtualMediumManagerWindow);
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp

    r72696 r73717  
    3636# include "QITabWidget.h"
    3737# include "VBoxGlobal.h"
     38# include "UIActionPoolSelector.h"
    3839# include "UIExtraDataManager.h"
    3940# include "UIMediumDetailsWidget.h"
     
    148149*********************************************************************************************************************************/
    149150
    150 UIMediumManagerWidget::UIMediumManagerWidget(EmbedTo enmEmbedding, QWidget *pParent /* = 0 */)
     151UIMediumManagerWidget::UIMediumManagerWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool, QWidget *pParent /* = 0 */)
    151152    : QIWithRetranslateUI<QWidget>(pParent)
    152153    , m_enmEmbedding(enmEmbedding)
     154    , m_pActionPool(pActionPool)
    153155    , m_fPreventChangeCurrentItem(false)
    154156    , m_pTabWidget(0)
     
    163165    , m_pToolBar(0)
    164166    , m_pContextMenu(0)
    165     , m_pMenu(0)
    166     , m_pActionAdd(0), m_pActionCopy(0), m_pActionMove(0), m_pActionRemove(0)
    167     , m_pActionRelease(0), m_pActionDetails(0)
    168     , m_pActionRefresh(0)
    169167    , m_pProgressBar(0)
    170168{
     
    173171}
    174172
     173QMenu *UIMediumManagerWidget::menu() const
     174{
     175    return m_pActionPool->action(UIActionIndexST_M_Medium)->menu();
     176}
     177
    175178void UIMediumManagerWidget::setProgressBar(UIEnumerationProgressBar *pProgressBar)
    176179{
     
    184187void UIMediumManagerWidget::retranslateUi()
    185188{
    186     /* Translate menu: */
    187     if (m_pMenu)
    188         m_pMenu->setTitle(UIMediumManager::tr("&Medium"));
    189 
    190     /* Translate actions: */
    191     if (m_pActionAdd)
    192     {
    193         m_pActionAdd->setText(UIMediumManager::tr("&Add..."));
    194         m_pActionAdd->setToolTip(UIMediumManager::tr("Add a Disk Image File"));
    195         m_pActionAdd->setStatusTip(UIMediumManager::tr("Add a disk image file"));
    196     }
    197     if (m_pActionCopy)
    198     {
    199         m_pActionCopy->setText(UIMediumManager::tr("&Copy..."));
    200         m_pActionCopy->setToolTip(UIMediumManager::tr("Copy Disk Image File (%1)").arg(m_pActionCopy->shortcut().toString()));
    201         m_pActionCopy->setStatusTip(UIMediumManager::tr("Copy selected disk image file"));
    202     }
    203     if (m_pActionMove)
    204     {
    205         m_pActionMove->setText(UIMediumManager::tr("&Move..."));
    206         m_pActionMove->setToolTip(UIMediumManager::tr("Move Disk Image File (%1)").arg(m_pActionMove->shortcut().toString()));
    207         m_pActionMove->setStatusTip(UIMediumManager::tr("Move selected disk image file"));
    208     }
    209     if (m_pActionRemove)
    210     {
    211         m_pActionRemove->setText(UIMediumManager::tr("&Remove..."));
    212         m_pActionRemove->setToolTip(UIMediumManager::tr("Remove Disk Image File (%1)").arg(m_pActionRemove->shortcut().toString()));
    213         m_pActionRemove->setStatusTip(UIMediumManager::tr("Remove selected disk image file"));
    214     }
    215     if (m_pActionRelease)
    216     {
    217         m_pActionRelease->setText(UIMediumManager::tr("Re&lease..."));
    218         m_pActionRelease->setToolTip(UIMediumManager::tr("Release Disk Image File (%1)").arg(m_pActionRelease->shortcut().toString()));
    219         m_pActionRelease->setStatusTip(UIMediumManager::tr("Release selected disk image file by detaching it from machines"));
    220     }
    221     if (m_pActionDetails)
    222     {
    223         m_pActionDetails->setText(UIMediumManager::tr("&Properties..."));
    224         m_pActionDetails->setToolTip(UIMediumManager::tr("Open Disk Image File Properties (%1)").arg(m_pActionDetails->shortcut().toString()));
    225         m_pActionDetails->setStatusTip(UIMediumManager::tr("Open pane with selected disk image file properties"));
    226     }
    227     if (m_pActionRefresh)
    228     {
    229         m_pActionRefresh->setText(UIMediumManager::tr("Re&fresh"));
    230         m_pActionRefresh->setToolTip(UIMediumManager::tr("Refresh Disk Image Files (%1)").arg(m_pActionRefresh->shortcut().toString()));
    231         m_pActionRefresh->setStatusTip(UIMediumManager::tr("Refresh the list of disk image files"));
    232     }
    233 
    234189    /* Translate toolbar: */
    235190#ifdef VBOX_WS_MAC
     
    467422{
    468423    /* Disable 'refresh' action: */
    469     if (m_pActionRefresh)
    470         m_pActionRefresh->setEnabled(false);
     424    if (m_pActionPool->action(UIActionIndexST_M_Medium_S_Refresh))
     425        m_pActionPool->action(UIActionIndexST_M_Medium_S_Refresh)->setEnabled(false);
    471426
    472427    /* Disable details-widget: */
     
    536491
    537492    /* Enable 'refresh' action: */
    538     if (m_pActionRefresh)
    539         m_pActionRefresh->setEnabled(true);
     493    if (m_pActionPool->action(UIActionIndexST_M_Medium_S_Refresh))
     494        m_pActionPool->action(UIActionIndexST_M_Medium_S_Refresh)->setEnabled(true);
    540495
    541496    /* Re-fetch all current medium-items: */
     
    759714void UIMediumManagerWidget::prepareActions()
    760715{
    761     /* Create 'Add' action: */
    762     m_pActionAdd = new QAction(this);
    763     AssertPtrReturnVoid(m_pActionAdd);
    764     {
    765         /* Configure add-action: */
    766         m_pActionAdd->setShortcut(QKeySequence("Ctrl+A"));
    767         connect(m_pActionAdd, &QAction::triggered, this, &UIMediumManagerWidget::sltAddMedium);
    768     }
    769     /* Create 'Copy' action: */
    770     m_pActionCopy = new QAction(this);
    771     AssertPtrReturnVoid(m_pActionCopy);
    772     {
    773         /* Configure copy-action: */
    774         m_pActionCopy->setShortcut(QKeySequence("Ctrl+C"));
    775         connect(m_pActionCopy, &QAction::triggered, this, &UIMediumManagerWidget::sltCopyMedium);
    776     }
    777 
    778     /* Create 'Move' action: */
    779     m_pActionMove = new QAction(this);
    780     AssertPtrReturnVoid(m_pActionMove);
    781     {
    782         /* Configure move-action: */
    783         m_pActionMove->setShortcut(QKeySequence("Ctrl+M"));
    784         connect(m_pActionMove, &QAction::triggered, this, &UIMediumManagerWidget::sltMoveMedium);
    785     }
    786 
    787     /* Create 'Remove' action: */
    788     m_pActionRemove  = new QAction(this);
    789     AssertPtrReturnVoid(m_pActionRemove);
    790     {
    791         /* Configure remove-action: */
    792         m_pActionRemove->setShortcut(QKeySequence("Ctrl+R"));
    793         connect(m_pActionRemove, &QAction::triggered, this, &UIMediumManagerWidget::sltRemoveMedium);
    794     }
    795 
    796     /* Create 'Release' action: */
    797     m_pActionRelease = new QAction(this);
    798     AssertPtrReturnVoid(m_pActionRelease);
    799     {
    800         /* Configure release-action: */
    801         m_pActionRelease->setShortcut(QKeySequence("Ctrl+L"));
    802         connect(m_pActionRelease, &QAction::triggered, this, &UIMediumManagerWidget::sltReleaseMedium);
    803     }
    804 
    805     /* Create 'Details' action: */
    806     m_pActionDetails = new QAction(this);
    807     AssertPtrReturnVoid(m_pActionDetails);
    808     {
    809         /* Configure modify-action: */
    810         m_pActionDetails->setCheckable(true);
    811         m_pActionDetails->setShortcut(QKeySequence("Ctrl+Space"));
    812         connect(m_pActionDetails, &QAction::toggled, this, &UIMediumManagerWidget::sltToggleMediumDetailsVisibility);
    813     }
    814 
    815     /* Create 'Refresh' action: */
    816     m_pActionRefresh = new QAction(this);
    817     AssertPtrReturnVoid(m_pActionRefresh);
    818     {
    819         /* Configure refresh-action: */
    820         m_pActionRefresh->setShortcut(QKeySequence(QKeySequence::Refresh));
    821         connect(m_pActionRefresh, &QAction::triggered, this, &UIMediumManagerWidget::sltRefreshAll);
    822     }
     716    /* Connect actions: */
     717    connect(m_pActionPool->action(UIActionIndexST_M_Medium_S_Add), &QAction::triggered,
     718            this, &UIMediumManagerWidget::sltAddMedium);
     719    connect(m_pActionPool->action(UIActionIndexST_M_Medium_S_Copy), &QAction::triggered,
     720            this, &UIMediumManagerWidget::sltCopyMedium);
     721    connect(m_pActionPool->action(UIActionIndexST_M_Medium_S_Move), &QAction::triggered,
     722            this, &UIMediumManagerWidget::sltMoveMedium);
     723    connect(m_pActionPool->action(UIActionIndexST_M_Medium_S_Remove), &QAction::triggered,
     724            this, &UIMediumManagerWidget::sltRemoveMedium);
     725    connect(m_pActionPool->action(UIActionIndexST_M_Medium_S_Release), &QAction::triggered,
     726            this, &UIMediumManagerWidget::sltReleaseMedium);
     727    connect(m_pActionPool->action(UIActionIndexST_M_Medium_T_Details), &QAction::toggled,
     728            this, &UIMediumManagerWidget::sltToggleMediumDetailsVisibility);
     729    connect(m_pActionPool->action(UIActionIndexST_M_Medium_S_Refresh), &QAction::triggered,
     730            this, &UIMediumManagerWidget::sltRefreshAll);
    823731
    824732    /* Update action icons: */
    825733    updateActionIcons();
    826734
    827     /* Prepare menu: */
    828     prepareMenu();
    829735    /* Prepare context-menu: */
    830736    prepareContextMenu();
    831 }
    832 
    833 void UIMediumManagerWidget::prepareMenu()
    834 {
    835     /* Create 'Medium' menu: */
    836     m_pMenu = new QMenu(this);
    837     AssertPtrReturnVoid(m_pMenu);
    838     {
    839         /* Configure 'Medium' menu: */
    840         if (m_pActionAdd)
    841             m_pMenu->addAction(m_pActionAdd);
    842         if (m_pActionCopy)
    843             m_pMenu->addAction(m_pActionCopy);
    844         if (m_pActionMove)
    845             m_pMenu->addAction(m_pActionMove);
    846         if (m_pActionRemove)
    847             m_pMenu->addAction(m_pActionRemove);
    848         if (   (m_pActionCopy || m_pActionMove || m_pActionRemove)
    849             && (m_pActionRelease || m_pActionDetails))
    850             m_pMenu->addSeparator();
    851         if (m_pActionRelease)
    852             m_pMenu->addAction(m_pActionRelease);
    853         if (m_pActionDetails)
    854             m_pMenu->addAction(m_pActionDetails);
    855         if (   (m_pActionRelease || m_pActionDetails)
    856             && (m_pActionRefresh))
    857             m_pMenu->addSeparator();
    858         if (m_pActionRefresh)
    859             m_pMenu->addAction(m_pActionRefresh);
    860     }
    861737}
    862738
     
    868744    {
    869745        /* Configure contex-menu: */
    870         if (m_pActionAdd)
    871             m_pContextMenu->addAction(m_pActionAdd);
    872         if (m_pActionCopy)
    873             m_pContextMenu->addAction(m_pActionCopy);
    874         if (m_pActionMove)
    875             m_pContextMenu->addAction(m_pActionMove);
    876         if (m_pActionRemove)
    877             m_pContextMenu->addAction(m_pActionRemove);
    878         if (   (m_pActionCopy || m_pActionMove || m_pActionRemove)
    879             && (m_pActionRelease || m_pActionDetails))
    880             m_pContextMenu->addSeparator();
    881         if (m_pActionRelease)
    882             m_pContextMenu->addAction(m_pActionRelease);
    883         if (m_pActionDetails)
    884             m_pContextMenu->addAction(m_pActionDetails);
     746        m_pContextMenu->addAction(m_pActionPool->action(UIActionIndexST_M_Medium_S_Add));
     747        m_pContextMenu->addAction(m_pActionPool->action(UIActionIndexST_M_Medium_S_Copy));
     748        m_pContextMenu->addAction(m_pActionPool->action(UIActionIndexST_M_Medium_S_Move));
     749        m_pContextMenu->addAction(m_pActionPool->action(UIActionIndexST_M_Medium_S_Remove));
     750        m_pContextMenu->addSeparator();
     751        m_pContextMenu->addAction(m_pActionPool->action(UIActionIndexST_M_Medium_S_Release));
     752        m_pContextMenu->addAction(m_pActionPool->action(UIActionIndexST_M_Medium_T_Details));
    885753    }
    886754}
     
    920788        m_pToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
    921789        /* Add toolbar actions: */
    922         if (m_pActionAdd)
    923             m_pToolBar->addAction(m_pActionAdd);
    924         if (m_pActionCopy)
    925             m_pToolBar->addAction(m_pActionCopy);
    926         if (m_pActionMove)
    927             m_pToolBar->addAction(m_pActionMove);
    928         if (m_pActionRemove)
    929             m_pToolBar->addAction(m_pActionRemove);
    930         if (   (m_pActionCopy || m_pActionMove || m_pActionRemove)
    931             && (m_pActionRelease || m_pActionDetails))
    932             m_pToolBar->addSeparator();
    933         if (m_pActionRelease)
    934             m_pToolBar->addAction(m_pActionRelease);
    935         if (m_pActionDetails)
    936             m_pToolBar->addAction(m_pActionDetails);
    937         if (   (m_pActionRelease || m_pActionDetails)
    938             && (m_pActionRefresh))
    939             m_pToolBar->addSeparator();
    940         if (m_pActionRefresh)
    941             m_pToolBar->addAction(m_pActionRefresh);
     790        m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Medium_S_Add));
     791        m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Medium_S_Copy));
     792        m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Medium_S_Move));
     793        m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Medium_S_Remove));
     794        m_pToolBar->addSeparator();
     795        m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Medium_S_Release));
     796        m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Medium_T_Details));
     797        m_pToolBar->addSeparator();
     798        m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Medium_S_Refresh));
    942799
    943800#ifdef VBOX_WS_MAC
     
    1027884        connect(pTreeWidget, &QITreeWidget::currentItemChanged,
    1028885                this, &UIMediumManagerWidget::sltHandleCurrentItemChanged);
    1029         if (m_pActionDetails)
    1030             connect(pTreeWidget, &QITreeWidget::itemDoubleClicked,
    1031                     m_pActionDetails, &QAction::setChecked);
     886        connect(pTreeWidget, &QITreeWidget::itemDoubleClicked,
     887                m_pActionPool->action(UIActionIndexST_M_Medium_T_Details), &QAction::setChecked);
    1032888        connect(pTreeWidget, &QITreeWidget::customContextMenuRequested,
    1033889                this, &UIMediumManagerWidget::sltHandleContextMenuCall);
     
    1067923{
    1068924    /* Details action/widget: */
    1069     m_pActionDetails->setChecked(gEDataManager->virtualMediaManagerDetailsExpanded());
     925    m_pActionPool->action(UIActionIndexST_M_Medium_T_Details)->setChecked(gEDataManager->virtualMediaManagerDetailsExpanded());
    1070926}
    1071927
     
    11621018
    11631019    /* Apply actions accessibility: */
    1164     if (m_pActionCopy)
    1165     {
    1166         bool fActionEnabledCopy = fNotInEnumeration && pMediumItem && checkMediumFor(pMediumItem, Action_Copy);
    1167         m_pActionCopy->setEnabled(fActionEnabledCopy);
    1168     }
    1169     if (m_pActionMove)
    1170     {
    1171         bool fActionEnabledMove = fNotInEnumeration && pMediumItem && checkMediumFor(pMediumItem, Action_Edit);
    1172         m_pActionMove->setEnabled(fActionEnabledMove);
    1173     }
    1174     if (m_pActionRemove)
    1175     {
    1176         bool fActionEnabledRemove = fNotInEnumeration && pMediumItem && checkMediumFor(pMediumItem, Action_Remove);
    1177         m_pActionRemove->setEnabled(fActionEnabledRemove);
    1178     }
    1179     if (m_pActionRelease)
    1180     {
    1181         bool fActionEnabledRelease = fNotInEnumeration && pMediumItem && checkMediumFor(pMediumItem, Action_Release);
    1182         m_pActionRelease->setEnabled(fActionEnabledRelease);
    1183     }
    1184     if (m_pActionDetails)
    1185     {
    1186         bool fActionEnabledDetails = true;
    1187         m_pActionDetails->setEnabled(fActionEnabledDetails);
    1188     }
     1020    bool fActionEnabledCopy = fNotInEnumeration && pMediumItem && checkMediumFor(pMediumItem, Action_Copy);
     1021    m_pActionPool->action(UIActionIndexST_M_Medium_S_Copy)->setEnabled(fActionEnabledCopy);
     1022    bool fActionEnabledMove = fNotInEnumeration && pMediumItem && checkMediumFor(pMediumItem, Action_Edit);
     1023    m_pActionPool->action(UIActionIndexST_M_Medium_S_Move)->setEnabled(fActionEnabledMove);
     1024    bool fActionEnabledRemove = fNotInEnumeration && pMediumItem && checkMediumFor(pMediumItem, Action_Remove);
     1025    m_pActionPool->action(UIActionIndexST_M_Medium_S_Remove)->setEnabled(fActionEnabledRemove);
     1026    bool fActionEnabledRelease = fNotInEnumeration && pMediumItem && checkMediumFor(pMediumItem, Action_Release);
     1027    m_pActionPool->action(UIActionIndexST_M_Medium_S_Release)->setEnabled(fActionEnabledRelease);
     1028    bool fActionEnabledDetails = true;
     1029    m_pActionPool->action(UIActionIndexST_M_Medium_T_Details)->setEnabled(fActionEnabledDetails);
    11891030}
    11901031
    11911032void UIMediumManagerWidget::updateActionIcons()
    11921033{
    1193     QString strPrefix = "hd";
    1194     if (m_pTabWidget)
    1195     {
    1196         switch (currentMediumType())
    1197         {
    1198             case UIMediumType_HardDisk: strPrefix = "hd"; break;
    1199             case UIMediumType_DVD:      strPrefix = "cd"; break;
    1200             case UIMediumType_Floppy:   strPrefix = "fd"; break;
    1201             default: break;
    1202         }
    1203     }
    1204 
    1205     if (m_pActionAdd)
    1206         m_pActionAdd->setIcon(UIIconPool::iconSetFull(QString(":/%1_add_22px.png").arg(strPrefix),
    1207                                                        QString(":/%1_add_16px.png").arg(strPrefix),
    1208                                                        QString(":/%1_add_disabled_22px.png").arg(strPrefix),
    1209                                                        QString(":/%1_add_disabled_16px.png").arg(strPrefix)));
    1210 
    1211     if (m_pActionCopy)
    1212         m_pActionCopy->setIcon(UIIconPool::iconSetFull(QString(":/%1_copy_22px.png").arg(strPrefix),
    1213                                                        QString(":/%1_copy_16px.png").arg(strPrefix),
    1214                                                        QString(":/%1_copy_disabled_22px.png").arg(strPrefix),
    1215                                                        QString(":/%1_copy_disabled_16px.png").arg(strPrefix)));
    1216     if (m_pActionMove)
    1217         m_pActionMove->setIcon(UIIconPool::iconSetFull(QString(":/%1_move_22px.png").arg(strPrefix),
    1218                                                        QString(":/%1_move_16px.png").arg(strPrefix),
    1219                                                        QString(":/%1_move_disabled_22px.png").arg(strPrefix),
    1220                                                        QString(":/%1_move_disabled_16px.png").arg(strPrefix)));
    1221     if (m_pActionRemove)
    1222         m_pActionRemove->setIcon(UIIconPool::iconSetFull(QString(":/%1_remove_22px.png").arg(strPrefix),
    1223                                                          QString(":/%1_remove_16px.png").arg(strPrefix),
    1224                                                          QString(":/%1_remove_disabled_22px.png").arg(strPrefix),
    1225                                                          QString(":/%1_remove_disabled_16px.png").arg(strPrefix)));
    1226     if (m_pActionRelease)
    1227         m_pActionRelease->setIcon(UIIconPool::iconSetFull(QString(":/%1_release_22px.png").arg(strPrefix),
    1228                                                           QString(":/%1_release_16px.png").arg(strPrefix),
    1229                                                           QString(":/%1_release_disabled_22px.png").arg(strPrefix),
    1230                                                           QString(":/%1_release_disabled_16px.png").arg(strPrefix)));
    1231     if (m_pActionDetails)
    1232         m_pActionDetails->setIcon(UIIconPool::iconSetFull(QString(":/%1_modify_22px.png").arg(strPrefix),
    1233                                                           QString(":/%1_modify_16px.png").arg(strPrefix),
    1234                                                           QString(":/%1_modify_disabled_22px.png").arg(strPrefix),
    1235                                                           QString(":/%1_modify_disabled_16px.png").arg(strPrefix)));
    1236     if (m_pActionRefresh && m_pActionRefresh->icon().isNull())
    1237         m_pActionRefresh->setIcon(UIIconPool::iconSetFull(":/refresh_22px.png", ":/refresh_16px.png",
    1238                                                           ":/refresh_disabled_22px.png", ":/refresh_disabled_16px.png"));
     1034    const UIMediumType enmCurrentMediumType = currentMediumType();
     1035    if (enmCurrentMediumType != UIMediumType_Invalid)
     1036    {
     1037        m_pActionPool->action(UIActionIndexST_M_Medium_S_Add)->setState((int)enmCurrentMediumType);
     1038        m_pActionPool->action(UIActionIndexST_M_Medium_S_Copy)->setState((int)enmCurrentMediumType);
     1039        m_pActionPool->action(UIActionIndexST_M_Medium_S_Move)->setState((int)enmCurrentMediumType);
     1040        m_pActionPool->action(UIActionIndexST_M_Medium_S_Remove)->setState((int)enmCurrentMediumType);
     1041        m_pActionPool->action(UIActionIndexST_M_Medium_S_Release)->setState((int)enmCurrentMediumType);
     1042        m_pActionPool->action(UIActionIndexST_M_Medium_T_Details)->setState((int)enmCurrentMediumType);
     1043    }
    12391044}
    12401045
     
    17311536*********************************************************************************************************************************/
    17321537
     1538UIMediumManagerFactory::UIMediumManagerFactory(UIActionPool *pActionPool /* = 0 */)
     1539    : m_pActionPool(pActionPool)
     1540{
     1541}
     1542
    17331543void UIMediumManagerFactory::create(QIManagerDialog *&pDialog, QWidget *pCenterWidget)
    17341544{
    1735     pDialog = new UIMediumManager(pCenterWidget);
     1545    pDialog = new UIMediumManager(pCenterWidget, m_pActionPool);
    17361546}
    17371547
     
    17411551*********************************************************************************************************************************/
    17421552
    1743 UIMediumManager::UIMediumManager(QWidget *pCenterWidget)
     1553UIMediumManager::UIMediumManager(QWidget *pCenterWidget, UIActionPool *pActionPool)
    17441554    : QIWithRetranslateUI<QIManagerDialog>(pCenterWidget)
     1555    , m_pActionPool(pActionPool)
    17451556    , m_pProgressBar(0)
    17461557{
     
    17901601{
    17911602    /* Create widget: */
    1792     UIMediumManagerWidget *pWidget = new UIMediumManagerWidget(EmbedTo_Dialog, this);
     1603    UIMediumManagerWidget *pWidget = new UIMediumManagerWidget(EmbedTo_Dialog, m_pActionPool, this);
    17931604    AssertPtrReturnVoid(pWidget);
    17941605    {
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h

    r72344 r73717  
    3333class QILabel;
    3434class QITreeWidget;
     35class UIActionPool;
    3536class UIMedium;
    3637class UIMediumDetailsWidget;
     
    105106
    106107    /** Constructs Virtual Media Manager widget. */
    107     UIMediumManagerWidget(EmbedTo enmEmbedding, QWidget *pParent = 0);
     108    UIMediumManagerWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool, QWidget *pParent = 0);
    108109
    109110    /** Returns the menu. */
    110     QMenu *menu() const { return m_pMenu; }
     111    QMenu *menu() const;
    111112
    112113#ifdef VBOX_WS_MAC
     
    205206        /** Prepares actions. */
    206207        void prepareActions();
    207         /** Prepares menu. */
    208         void prepareMenu();
    209208        /** Prepares context-menu. */
    210209        void prepareContextMenu();
     
    299298        /** Holds the widget embedding type. */
    300299        const EmbedTo m_enmEmbedding;
     300
     301        /** Holds the action-pool reference. */
     302        UIActionPool *m_pActionPool;
    301303
    302304        /** Holds whether Virtual Media Manager should preserve current item change. */
     
    344346        /** Holds the context-menu object instance. */
    345347        QMenu     *m_pContextMenu;
    346         /** Holds the menu object instance. */
    347         QMenu     *m_pMenu;
    348         /** Holds the Add action instance. */
    349         QAction   *m_pActionAdd;
    350         /** Holds the Copy action instance. */
    351         QAction   *m_pActionCopy;
    352         /** Holds the Move action instance. */
    353         QAction   *m_pActionMove;
    354         /** Holds the Remove action instance. */
    355         QAction   *m_pActionRemove;
    356         /** Holds the Release action instance. */
    357         QAction   *m_pActionRelease;
    358         /** Holds the Details action instance. */
    359         QAction   *m_pActionDetails;
    360         /** Holds the Refresh action instance. */
    361         QAction   *m_pActionRefresh;
    362348    /** @} */
    363349
     
    373359class UIMediumManagerFactory : public QIManagerDialogFactory
    374360{
     361public:
     362
     363    /** Constructs Media Manager factory acquiring additional arguments.
     364      * @param  pActionPool  Brings the action-pool reference. */
     365    UIMediumManagerFactory(UIActionPool *pActionPool = 0);
     366
    375367protected:
    376368
     
    378370      * @param  pCenterWidget  Brings the widget reference to center according to. */
    379371    virtual void create(QIManagerDialog *&pDialog, QWidget *pCenterWidget) /* override */;
     372
     373    /** Holds the action-pool reference. */
     374    UIActionPool *m_pActionPool;
    380375};
    381376
     
    404399
    405400    /** Constructs Host Network Manager dialog.
    406       * @param  pCenterWidget  Brings the widget reference to center according to. */
    407     UIMediumManager(QWidget *pCenterWidget);
     401      * @param  pCenterWidget  Brings the widget reference to center according to.
     402      * @param  pActionPool    Brings the action-pool reference. */
     403    UIMediumManager(QWidget *pCenterWidget, UIActionPool *pActionPool);
    408404
    409405    /** @name Event-handling stuff.
     
    431427    /** @} */
    432428
     429    /** @name Action related variables.
     430      * @{ */
     431        /** Holds the action-pool reference. */
     432        UIActionPool *m_pActionPool;
     433    /** @} */
     434
    433435    /** @name Progress-bar variables.
    434436      * @{ */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r73694 r73717  
    454454    if (!m_pManagerVirtualMedia)
    455455    {
    456         UIMediumManagerFactory().prepare(m_pManagerVirtualMedia, this);
     456        UIMediumManagerFactory(m_pActionPool).prepare(m_pManagerVirtualMedia, this);
    457457        connect(m_pManagerVirtualMedia, &QIManagerDialog::sigClose,
    458458                this, &UISelectorWindow::sltCloseVirtualMediumManagerWindow);
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsPaneGlobal.cpp

    r69726 r73717  
    108108            {
    109109                /* Create Virtual Media Manager: */
    110                 m_pPaneMedia = new UIMediumManagerWidget(EmbedTo_Stack);
     110                m_pPaneMedia = new UIMediumManagerWidget(EmbedTo_Stack, m_pActionPool);
    111111                AssertPtrReturnVoid(m_pPaneMedia);
    112112                {
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