VirtualBox

Changeset 75136 in vbox for trunk


Ignore:
Timestamp:
Oct 29, 2018 8:47:55 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6699. Move file manager actions to the global action pool

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

Legend:

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

    r75060 r75136  
    11841184};
    11851185
    1186 
    11871186/** Menu action extension, used as 'Log' menu class. */
    11881187class UIActionMenuSelectorLog : public UIActionMenu
     
    14341433    }
    14351434};
     1435
     1436/** Menu action extension, used as 'Guest Control File Manager' menu class. */
     1437class UIActionMenuGuestControlFileManager : public UIActionMenu
     1438{
     1439    Q_OBJECT;
     1440
     1441public:
     1442
     1443    /** Constructs action passing @a pParent to the base-class. */
     1444    UIActionMenuGuestControlFileManager(UIActionPool *pParent)
     1445        : UIActionMenu(pParent)
     1446    {}
     1447
     1448protected:
     1449
     1450    /** Returns shortcut extra-data ID. */
     1451    virtual QString shortcutExtraDataID() const /* override */
     1452    {
     1453        return QString("GuestControlFileManagerMenu");
     1454    }
     1455
     1456    /** Handles translation event. */
     1457    virtual void retranslateUi() /* override */
     1458    {
     1459        setName(QApplication::translate("UIActionPool", "File Manager"));
     1460        setStatusTip(QApplication::translate("UIActionPool", "Open the guest control file manager"));
     1461    }
     1462};
     1463
     1464class UIActionMenuGuestControlFileManagerHostSubmenu : public UIActionMenu
     1465{
     1466    Q_OBJECT;
     1467
     1468public:
     1469
     1470    /** Constructs action passing @a pParent to the base-class. */
     1471    UIActionMenuGuestControlFileManagerHostSubmenu(UIActionPool *pParent)
     1472        : UIActionMenu(pParent)
     1473    {}
     1474
     1475protected:
     1476
     1477    /** Returns shortcut extra-data ID. */
     1478    virtual QString shortcutExtraDataID() const /* override */
     1479    {
     1480        return QString("GuestControlFileManagerHostSubmenu");
     1481    }
     1482
     1483    /** Handles translation event. */
     1484    virtual void retranslateUi() /* override */
     1485    {
     1486        setName(QApplication::translate("UIActionPool", "Host"));
     1487        setStatusTip(QApplication::translate("UIActionPool", "Open the guest control file manager submenu"));
     1488    }
     1489};
     1490
     1491class UIActionMenuGuestControlFileManagerGuestSubmenu : public UIActionMenu
     1492{
     1493    Q_OBJECT;
     1494
     1495public:
     1496
     1497    /** Constructs action passing @a pParent to the base-class. */
     1498    UIActionMenuGuestControlFileManagerGuestSubmenu(UIActionPool *pParent)
     1499        : UIActionMenu(pParent)
     1500    {}
     1501
     1502protected:
     1503
     1504    /** Returns shortcut extra-data ID. */
     1505    virtual QString shortcutExtraDataID() const /* override */
     1506    {
     1507        return QString("GuestControlFileManagerGuestSubmenu");
     1508    }
     1509
     1510    /** Handles translation event. */
     1511    virtual void retranslateUi() /* override */
     1512    {
     1513        setName(QApplication::translate("UIActionPool", "Guest"));
     1514        setStatusTip(QApplication::translate("UIActionPool", "Open the guest control file manager submenu"));
     1515    }
     1516};
     1517
     1518
     1519/** Simple action extension, used as 'File Manager Settings' in guest control file manager action class. */
     1520class UIActionMenuGuestControlFileManagerSettings : public UIActionSimple
     1521{
     1522    Q_OBJECT;
     1523
     1524public:
     1525
     1526    /** Constructs action passing @a pParent to the base-class. */
     1527    UIActionMenuGuestControlFileManagerSettings(UIActionPool *pParent)
     1528        : UIActionSimple(pParent, ":/vm_delete_32px.png", ":/vm_delete_disabled_32px.png")
     1529    {}
     1530
     1531protected:
     1532
     1533    /** Returns shortcut extra-data ID. */
     1534    virtual QString shortcutExtraDataID() const /* override */
     1535    {
     1536        return QString("FileManagerSettings");
     1537    }
     1538
     1539    /** Returns default shortcut. */
     1540    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     1541    {
     1542        return QKeySequence();
     1543    }
     1544
     1545    /** Handles translation event. */
     1546    virtual void retranslateUi() /* override */
     1547    {
     1548        setName(QApplication::translate("UIActionPool", "Settings"));
     1549        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
     1550        setStatusTip(QApplication::translate("UIActionPool", "Modify file manager settings"));
     1551        setToolTip(tr("Modify File Manager Settings"));
     1552    }
     1553};
     1554/** Simple action extension, used as 'Perform GoUp' in guest control file manager action class. */
     1555class UIActionMenuGuestControlFileManagerGoUp : public UIActionSimple
     1556{
     1557    Q_OBJECT;
     1558
     1559public:
     1560
     1561    /** Constructs action passing @a pParent to the base-class. */
     1562    UIActionMenuGuestControlFileManagerGoUp(UIActionPool *pParent)
     1563        : UIActionSimple(pParent, ":/arrow_up_10px_x2.png", ":/arrow_up_10px_x2.png")
     1564    {}
     1565
     1566protected:
     1567
     1568    /** Returns shortcut extra-data ID. */
     1569    virtual QString shortcutExtraDataID() const /* override */
     1570    {
     1571        return QString("FileManagerGoUp");
     1572    }
     1573
     1574    /** Returns default shortcut. */
     1575    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     1576    {
     1577        return QKeySequence();
     1578    }
     1579
     1580    /** Handles translation event. */
     1581    virtual void retranslateUi() /* override */
     1582    {
     1583        setName(QApplication::translate("UIActionPool", "GoUp"));
     1584        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
     1585        setStatusTip(QApplication::translate("UIActionPool", "Go one level up to parent folder"));
     1586        setToolTip(tr("Go One Level Up to Parent Folder"));
     1587    }
     1588};
     1589
     1590
     1591/** Simple action extension, used as 'Perform GoHome' in guest control file manager action class. */
     1592class UIActionMenuGuestControlFileManagerGoHome : public UIActionSimple
     1593{
     1594    Q_OBJECT;
     1595
     1596public:
     1597
     1598    /** Constructs action passing @a pParent to the base-class. */
     1599    UIActionMenuGuestControlFileManagerGoHome(UIActionPool *pParent)
     1600        : UIActionSimple(pParent, ":/nw_24px.png", ":/nw_disabled_24px.png")
     1601    {}
     1602
     1603protected:
     1604
     1605    /** Returns shortcut extra-data ID. */
     1606    virtual QString shortcutExtraDataID() const /* override */
     1607    {
     1608        return QString("FileManagerGoHome");
     1609    }
     1610
     1611    /** Returns default shortcut. */
     1612    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     1613    {
     1614        return QKeySequence();
     1615    }
     1616
     1617    /** Handles translation event. */
     1618    virtual void retranslateUi() /* override */
     1619    {
     1620        setName(QApplication::translate("UIActionPool", "GoHome"));
     1621        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
     1622        setStatusTip(QApplication::translate("UIActionPool", "Go to home folder"));
     1623        setToolTip(tr("Go to Home Folder"));
     1624    }
     1625};
     1626
     1627
     1628/** Simple action extension, used as 'Perform Copy' in guest control file manager action class. */
     1629class UIActionMenuGuestControlFileManagerDelete : public UIActionSimple
     1630{
     1631    Q_OBJECT;
     1632
     1633public:
     1634
     1635    /** Constructs action passing @a pParent to the base-class. */
     1636    UIActionMenuGuestControlFileManagerDelete(UIActionPool *pParent)
     1637        : UIActionSimple(pParent, ":/vm_delete_32px.png", ":/vm_delete_disabled_32px.png")
     1638    {}
     1639
     1640protected:
     1641
     1642    /** Returns shortcut extra-data ID. */
     1643    virtual QString shortcutExtraDataID() const /* override */
     1644    {
     1645        return QString("FileManagerDelete");
     1646    }
     1647
     1648    /** Returns default shortcut. */
     1649    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     1650    {
     1651        return QKeySequence();
     1652    }
     1653
     1654    /** Handles translation event. */
     1655    virtual void retranslateUi() /* override */
     1656    {
     1657        setName(QApplication::translate("UIActionPool", "Delete"));
     1658        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
     1659        setStatusTip(QApplication::translate("UIActionPool", "Delete selected file object(s)"));
     1660        setToolTip(tr("Delete Selected File Object(s)"));
     1661    }
     1662};
     1663
     1664/** Simple action extension, used as 'Perform Refresh' in guest control file manager action class. */
     1665class UIActionMenuGuestControlFileManagerRefresh : public UIActionSimple
     1666{
     1667    Q_OBJECT;
     1668
     1669public:
     1670
     1671    /** Constructs action passing @a pParent to the base-class. */
     1672    UIActionMenuGuestControlFileManagerRefresh(UIActionPool *pParent)
     1673        : UIActionSimple(pParent, ":/refresh_16px.png", ":/refresh_disabled_16px.png")
     1674    {}
     1675
     1676protected:
     1677
     1678    /** Returns shortcut extra-data ID. */
     1679    virtual QString shortcutExtraDataID() const /* override */
     1680    {
     1681        return QString("FileManagerRefresh");
     1682    }
     1683
     1684    /** Returns default shortcut. */
     1685    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     1686    {
     1687        return QKeySequence();
     1688    }
     1689
     1690    /** Handles translation event. */
     1691    virtual void retranslateUi() /* override */
     1692    {
     1693        setName(QApplication::translate("UIActionPool", "Refresh"));
     1694        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
     1695        setStatusTip(QApplication::translate("UIActionPool", "Refresh"));
     1696        setToolTip(tr("Refresh"));
     1697    }
     1698};
     1699
     1700
     1701/** Simple action extension, used as 'Perform Rename' in guest control file manager action class. */
     1702class UIActionMenuGuestControlFileManagerRename : public UIActionSimple
     1703{
     1704    Q_OBJECT;
     1705
     1706public:
     1707
     1708    /** Constructs action passing @a pParent to the base-class. */
     1709    UIActionMenuGuestControlFileManagerRename(UIActionPool *pParent)
     1710        : UIActionSimple(pParent, ":/name_16px.png", ":/name_16px.png"){}
     1711
     1712protected:
     1713
     1714    /** Returns shortcut extra-data ID. */
     1715    virtual QString shortcutExtraDataID() const /* override */
     1716    {
     1717        return QString("FileManagerRename");
     1718    }
     1719
     1720    /** Returns default shortcut. */
     1721    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     1722    {
     1723        return QKeySequence();
     1724    }
     1725
     1726    /** Handles translation event. */
     1727    virtual void retranslateUi() /* override */
     1728    {
     1729        setName(QApplication::translate("UIActionPool", "Rename"));
     1730        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
     1731        setStatusTip(QApplication::translate("UIActionPool", "Rename"));
     1732        setToolTip(tr("Rename"));
     1733    }
     1734};
     1735
     1736/** Simple action extension, used as 'Perform Rename' in guest control file manager action class. */
     1737class UIActionMenuGuestControlFileManagerCreateNewDirectory : public UIActionSimple
     1738{
     1739    Q_OBJECT;
     1740
     1741public:
     1742
     1743    /** Constructs action passing @a pParent to the base-class. */
     1744    UIActionMenuGuestControlFileManagerCreateNewDirectory(UIActionPool *pParent)
     1745        : UIActionSimple(pParent, ":/sf_add_16px.png", ":/sf_add_disabled_16px.png"){}
     1746
     1747protected:
     1748
     1749    /** Returns shortcut extra-data ID. */
     1750    virtual QString shortcutExtraDataID() const /* override */
     1751    {
     1752        return QString("FileManagerCreateNewDirectory");
     1753    }
     1754
     1755    /** Returns default shortcut. */
     1756    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     1757    {
     1758        return QKeySequence();
     1759    }
     1760
     1761    /** Handles translation event. */
     1762    virtual void retranslateUi() /* override */
     1763    {
     1764        setName(QApplication::translate("UIActionPool", "CreateNewDirectory"));
     1765        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
     1766        setStatusTip(QApplication::translate("UIActionPool", "Create New Directory"));
     1767        setToolTip(tr("Create New Directory"));
     1768    }
     1769};
     1770
     1771
     1772/** Simple action extension, used as 'Perform Copy' in guest control file manager action class. */
     1773class UIActionMenuGuestControlFileManagerCopy : public UIActionSimple
     1774{
     1775    Q_OBJECT;
     1776
     1777public:
     1778
     1779    /** Constructs action passing @a pParent to the base-class. */
     1780    UIActionMenuGuestControlFileManagerCopy(UIActionPool *pParent)
     1781        : UIActionSimple(pParent, ":/fd_copy_32px.png", ":/fd_copy_disabled_32px.png"){}
     1782
     1783protected:
     1784
     1785    /** Returns shortcut extra-data ID. */
     1786    virtual QString shortcutExtraDataID() const /* override */
     1787    {
     1788        return QString("FileManagerCopy");
     1789    }
     1790
     1791    /** Returns default shortcut. */
     1792    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     1793    {
     1794        return QKeySequence();
     1795    }
     1796
     1797    /** Handles translation event. */
     1798    virtual void retranslateUi() /* override */
     1799    {
     1800        setName(QApplication::translate("UIActionPool", "Copy"));
     1801        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
     1802        setStatusTip(QApplication::translate("UIActionPool", "Copy selected file object(s)"));
     1803        setToolTip(tr("Copy Selected File Object(s)"));
     1804    }
     1805};
     1806
     1807/** Simple action extension, used as 'Perform Cut' in guest control file manager action class. */
     1808class UIActionMenuGuestControlFileManagerCut : public UIActionSimple
     1809{
     1810    Q_OBJECT;
     1811
     1812public:
     1813
     1814    /** Constructs action passing @a pParent to the base-class. */
     1815    UIActionMenuGuestControlFileManagerCut(UIActionPool *pParent)
     1816        : UIActionSimple(pParent, ":/fd_move_32px.png", ":/fd_move_disabled_32px.png"){}
     1817
     1818protected:
     1819
     1820    /** Returns shortcut extra-data ID. */
     1821    virtual QString shortcutExtraDataID() const /* override */
     1822    {
     1823        return QString("FileManagerCut");
     1824    }
     1825
     1826    /** Returns default shortcut. */
     1827    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     1828    {
     1829        return QKeySequence();
     1830    }
     1831
     1832    /** Handles translation event. */
     1833    virtual void retranslateUi() /* override */
     1834    {
     1835        setName(QApplication::translate("UIActionPool", "Cut"));
     1836        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
     1837        setStatusTip(QApplication::translate("UIActionPool", "Cut selected file object(s)"));
     1838        setToolTip(tr("Cut Selected File Object(s)"));
     1839    }
     1840};
     1841
     1842/** Simple action extension, used as 'Perform Paste' in guest control file manager action class. */
     1843class UIActionMenuGuestControlFileManagerPaste : public UIActionSimple
     1844{
     1845    Q_OBJECT;
     1846
     1847public:
     1848
     1849    /** Constructs action passing @a pParent to the base-class. */
     1850    UIActionMenuGuestControlFileManagerPaste(UIActionPool *pParent)
     1851        : UIActionSimple(pParent, ":/shared_clipboard_16px.png", ":/shared_clipboard_disabled_16px.png"){}
     1852
     1853protected:
     1854
     1855    /** Returns shortcut extra-data ID. */
     1856    virtual QString shortcutExtraDataID() const /* override */
     1857    {
     1858        return QString("FileManagerPaste");
     1859    }
     1860
     1861    /** Returns default shortcut. */
     1862    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     1863    {
     1864        return QKeySequence();
     1865    }
     1866
     1867    /** Handles translation event. */
     1868    virtual void retranslateUi() /* override */
     1869    {
     1870        setName(QApplication::translate("UIActionPool", "Paste"));
     1871        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
     1872        setStatusTip(QApplication::translate("UIActionPool", "Paste copied/cut file object(s)"));
     1873        setToolTip(tr("Paste Copied/Cut File Object(s)"));
     1874    }
     1875};
     1876
     1877/** Simple action extension, used as 'Select All' in guest control file manager action class. */
     1878class UIActionMenuGuestControlFileManagerSelectAll : public UIActionSimple
     1879{
     1880    Q_OBJECT;
     1881
     1882public:
     1883
     1884    /** Constructs action passing @a pParent to the base-class. */
     1885    UIActionMenuGuestControlFileManagerSelectAll(UIActionPool *pParent)
     1886        : UIActionSimple(pParent, ":/session_info_32px.png", ":/session_info_disabled_32px.png"){}
     1887
     1888protected:
     1889
     1890    /** Returns shortcut extra-data ID. */
     1891    virtual QString shortcutExtraDataID() const /* override */
     1892    {
     1893        return QString("FileManagerSelectAll");
     1894    }
     1895
     1896    /** Returns default shortcut. */
     1897    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     1898    {
     1899        return QKeySequence();
     1900    }
     1901
     1902    /** Handles translation event. */
     1903    virtual void retranslateUi() /* override */
     1904    {
     1905        setName(QApplication::translate("UIActionPool", "SelectAll"));
     1906        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
     1907        setStatusTip(QApplication::translate("UIActionPool", "Select all files objects"));
     1908        setToolTip(tr("Select All Files Objects"));
     1909    }
     1910};
     1911
     1912
     1913/** Simple action extension, used as 'Invert Selection' in guest control file manager action class. */
     1914class UIActionMenuGuestControlFileManagerInvertSelection : public UIActionSimple
     1915{
     1916    Q_OBJECT;
     1917
     1918public:
     1919
     1920    /** Constructs action passing @a pParent to the base-class. */
     1921    UIActionMenuGuestControlFileManagerInvertSelection(UIActionPool *pParent)
     1922        : UIActionSimple(pParent, ":/session_info_32px.png", ":/session_info_disabled_32px.png"){}
     1923
     1924protected:
     1925
     1926    /** Returns shortcut extra-data ID. */
     1927    virtual QString shortcutExtraDataID() const /* override */
     1928    {
     1929        return QString("FileManagerInvertSelection");
     1930    }
     1931
     1932    /** Returns default shortcut. */
     1933    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     1934    {
     1935        return QKeySequence();
     1936    }
     1937
     1938    /** Handles translation event. */
     1939    virtual void retranslateUi() /* override */
     1940    {
     1941        setName(QApplication::translate("UIActionPool", "InvertSelection"));
     1942        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
     1943        setStatusTip(QApplication::translate("UIActionPool", "Invert the current selection"));
     1944        setToolTip(tr("Invert The Current Selection"));
     1945    }
     1946};
     1947
     1948
     1949/** Simple action extension, used as 'Show Properties' in guest control file manager action class. */
     1950class UIActionMenuGuestControlFileManagerShowProperties : public UIActionSimple
     1951{
     1952    Q_OBJECT;
     1953
     1954public:
     1955
     1956    /** Constructs action passing @a pParent to the base-class. */
     1957    UIActionMenuGuestControlFileManagerShowProperties(UIActionPool *pParent)
     1958        : UIActionSimple(pParent, ":/session_info_32px.png", ":/session_info_disabled_32px.png"){}
     1959
     1960protected:
     1961
     1962    /** Returns shortcut extra-data ID. */
     1963    virtual QString shortcutExtraDataID() const /* override */
     1964    {
     1965        return QString("FileManagerShowProperties");
     1966    }
     1967
     1968    /** Returns default shortcut. */
     1969    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     1970    {
     1971        return QKeySequence();
     1972    }
     1973
     1974    /** Handles translation event. */
     1975    virtual void retranslateUi() /* override */
     1976    {
     1977        setName(QApplication::translate("UIActionPool", "ShowProperties"));
     1978        setShortcutScope(QApplication::translate("UIActionPool", "Guest Control File Manager"));
     1979        setStatusTip(QApplication::translate("UIActionPool", "Show the properties of currently selected file object(s)"));
     1980        setToolTip(tr("Show the Properties of Currently Selected File Object(s)"));
     1981    }
     1982};
     1983
     1984
     1985
    14361986
    14371987
     
    16412191    m_pool[UIActionIndex_M_Log_S_Save] = new UIActionMenuSelectorLogPerformSave(this);
    16422192
     2193    /* Create 'Guest Control File Manager' actions: */
     2194    m_pool[UIActionIndex_M_GuestControlFileManager] = new UIActionMenuGuestControlFileManager(this);
     2195    m_pool[UIActionIndex_M_GuestControlFileManager_M_HostSubmenu] = new UIActionMenuGuestControlFileManagerHostSubmenu(this);
     2196    m_pool[UIActionIndex_M_GuestControlFileManager_M_GuestSubmenu] = new UIActionMenuGuestControlFileManagerGuestSubmenu(this);
     2197    m_pool[UIActionIndex_M_GuestControlFileManager_S_Settings] = new UIActionMenuGuestControlFileManagerSettings(this);
     2198    m_pool[UIActionIndex_M_GuestControlFileManager_S_Host_GoUp] = new UIActionMenuGuestControlFileManagerGoUp(this);
     2199    m_pool[UIActionIndex_M_GuestControlFileManager_S_Guest_GoUp] = new UIActionMenuGuestControlFileManagerGoUp(this);
     2200    m_pool[UIActionIndex_M_GuestControlFileManager_S_Host_GoHome] = new UIActionMenuGuestControlFileManagerGoHome(this);
     2201    m_pool[UIActionIndex_M_GuestControlFileManager_S_Guest_GoHome] = new UIActionMenuGuestControlFileManagerGoHome(this);
     2202    m_pool[UIActionIndex_M_GuestControlFileManager_S_Host_Refresh] = new UIActionMenuGuestControlFileManagerRefresh(this);
     2203    m_pool[UIActionIndex_M_GuestControlFileManager_S_Guest_Refresh] = new UIActionMenuGuestControlFileManagerRefresh(this);
     2204    m_pool[UIActionIndex_M_GuestControlFileManager_S_Host_Delete] = new UIActionMenuGuestControlFileManagerDelete(this);
     2205    m_pool[UIActionIndex_M_GuestControlFileManager_S_Guest_Delete] = new UIActionMenuGuestControlFileManagerDelete(this);
     2206    m_pool[UIActionIndex_M_GuestControlFileManager_S_Host_Rename] = new UIActionMenuGuestControlFileManagerRename(this);
     2207    m_pool[UIActionIndex_M_GuestControlFileManager_S_Guest_Rename] = new UIActionMenuGuestControlFileManagerRename(this);
     2208    m_pool[UIActionIndex_M_GuestControlFileManager_S_Host_CreateNewDirectory] = new UIActionMenuGuestControlFileManagerCreateNewDirectory(this);
     2209    m_pool[UIActionIndex_M_GuestControlFileManager_S_Guest_CreateNewDirectory] = new UIActionMenuGuestControlFileManagerCreateNewDirectory(this);
     2210    m_pool[UIActionIndex_M_GuestControlFileManager_S_Host_Copy] = new UIActionMenuGuestControlFileManagerCopy(this);
     2211    m_pool[UIActionIndex_M_GuestControlFileManager_S_Guest_Copy] = new UIActionMenuGuestControlFileManagerCopy(this);
     2212    m_pool[UIActionIndex_M_GuestControlFileManager_S_Host_Cut] = new UIActionMenuGuestControlFileManagerCut(this);
     2213    m_pool[UIActionIndex_M_GuestControlFileManager_S_Guest_Cut] = new UIActionMenuGuestControlFileManagerCut(this);
     2214    m_pool[UIActionIndex_M_GuestControlFileManager_S_Host_Paste] = new UIActionMenuGuestControlFileManagerPaste(this);
     2215    m_pool[UIActionIndex_M_GuestControlFileManager_S_Guest_Paste] = new UIActionMenuGuestControlFileManagerPaste(this);
     2216    m_pool[UIActionIndex_M_GuestControlFileManager_S_Host_SelectAll] = new UIActionMenuGuestControlFileManagerSelectAll(this);
     2217    m_pool[UIActionIndex_M_GuestControlFileManager_S_Guest_SelectAll] = new UIActionMenuGuestControlFileManagerSelectAll(this);
     2218    m_pool[UIActionIndex_M_GuestControlFileManager_S_Host_InvertSelection] = new UIActionMenuGuestControlFileManagerInvertSelection(this);
     2219    m_pool[UIActionIndex_M_GuestControlFileManager_S_Guest_InvertSelection] = new UIActionMenuGuestControlFileManagerInvertSelection(this);
     2220    m_pool[UIActionIndex_M_GuestControlFileManager_S_Host_ShowProperties] = new UIActionMenuGuestControlFileManagerShowProperties(this);
     2221    m_pool[UIActionIndex_M_GuestControlFileManager_S_Guest_ShowProperties] = new UIActionMenuGuestControlFileManagerShowProperties(this);
     2222
     2223
    16432224    /* Prepare update-handlers for known menus: */
    16442225#ifdef VBOX_WS_MAC
     
    16492230    m_menuUpdateHandlers[UIActionIndex_M_LogWindow].ptf = &UIActionPool::updateMenuLogViewerWindow;
    16502231    m_menuUpdateHandlers[UIActionIndex_M_Log].ptf = &UIActionPool::updateMenuLogViewer;
     2232
     2233    m_menuUpdateHandlers[UIActionIndex_M_GuestControlFileManager].ptf = &UIActionPool::updateMenuGuestControlFileManager;
    16512234
    16522235    /* Invalidate all known menus: */
     
    19412524}
    19422525
     2526void UIActionPool::updateMenuGuestControlFileManager()
     2527{
     2528    updateMenuGuestControlFileManagerWrapper(action(UIActionIndex_M_GuestControlFileManager)->menu());
     2529
     2530    /* Mark menu as valid: */
     2531    m_invalidations.remove(UIActionIndex_M_Log);
     2532
     2533}
     2534
     2535void UIActionPool::updateMenuGuestControlFileManagerWrapper(UIMenu *pMenu)
     2536{
     2537    addAction(pMenu, action(UIActionIndex_M_GuestControlFileManager_S_Settings));
     2538    addAction(pMenu, action(UIActionIndex_M_GuestControlFileManager_M_HostSubmenu));
     2539    addAction(pMenu, action(UIActionIndex_M_GuestControlFileManager_M_GuestSubmenu));
     2540
     2541    UIMenu *pHostSubmenu = action(UIActionIndex_M_GuestControlFileManager_M_HostSubmenu)->menu();
     2542    if (pHostSubmenu)
     2543    {
     2544        addAction(pHostSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Host_GoUp));
     2545        addAction(pHostSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Host_GoHome));
     2546        addAction(pHostSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Host_Refresh));
     2547        addAction(pHostSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Host_Delete));
     2548        addAction(pHostSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Host_Rename));
     2549        addAction(pHostSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Host_CreateNewDirectory));
     2550        addAction(pHostSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Host_Copy));
     2551        addAction(pHostSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Host_Cut));
     2552        addAction(pHostSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Host_Paste));
     2553        addAction(pHostSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Host_SelectAll));
     2554        addAction(pHostSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Host_InvertSelection));
     2555        addAction(pHostSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Host_ShowProperties));
     2556    }
     2557
     2558    UIMenu *pGuestSubmenu = action(UIActionIndex_M_GuestControlFileManager_M_GuestSubmenu)->menu();
     2559    if (pGuestSubmenu)
     2560    {
     2561        addAction(pGuestSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Host_GoUp));
     2562        addAction(pGuestSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Guest_GoHome));
     2563        addAction(pGuestSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Guest_Refresh));
     2564        addAction(pGuestSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Guest_Delete));
     2565        addAction(pGuestSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Guest_Rename));
     2566        addAction(pGuestSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Guest_CreateNewDirectory));
     2567        addAction(pGuestSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Guest_Copy));
     2568        addAction(pGuestSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Guest_Cut));
     2569        addAction(pGuestSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Guest_Paste));
     2570        addAction(pGuestSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Guest_SelectAll));
     2571        addAction(pGuestSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Guest_InvertSelection));
     2572        addAction(pGuestSubmenu, action(UIActionIndex_M_GuestControlFileManager_S_Guest_ShowProperties));
     2573    }
     2574}
     2575
    19432576void UIActionPool::retranslateUi()
    19442577{
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h

    r73882 r75136  
    9797    UIActionIndex_M_Log_S_Refresh,
    9898    UIActionIndex_M_Log_S_Save,
     99
     100    /* Guest control file manager actions: */
     101    UIActionIndex_M_GuestControlFileManager,
     102    UIActionIndex_M_GuestControlFileManager_M_HostSubmenu,
     103    UIActionIndex_M_GuestControlFileManager_M_GuestSubmenu,
     104    UIActionIndex_M_GuestControlFileManager_S_Settings,
     105    UIActionIndex_M_GuestControlFileManager_S_Host_GoUp,
     106    UIActionIndex_M_GuestControlFileManager_S_Guest_GoUp,
     107    UIActionIndex_M_GuestControlFileManager_S_Host_GoHome,
     108    UIActionIndex_M_GuestControlFileManager_S_Guest_GoHome,
     109    UIActionIndex_M_GuestControlFileManager_S_Host_Refresh,
     110    UIActionIndex_M_GuestControlFileManager_S_Guest_Refresh,
     111    UIActionIndex_M_GuestControlFileManager_S_Host_Delete,
     112    UIActionIndex_M_GuestControlFileManager_S_Guest_Delete,
     113    UIActionIndex_M_GuestControlFileManager_S_Host_Rename,
     114    UIActionIndex_M_GuestControlFileManager_S_Guest_Rename,
     115    UIActionIndex_M_GuestControlFileManager_S_Host_CreateNewDirectory,
     116    UIActionIndex_M_GuestControlFileManager_S_Guest_CreateNewDirectory,
     117    UIActionIndex_M_GuestControlFileManager_S_Host_Copy,
     118    UIActionIndex_M_GuestControlFileManager_S_Guest_Copy,
     119    UIActionIndex_M_GuestControlFileManager_S_Host_Cut,
     120    UIActionIndex_M_GuestControlFileManager_S_Guest_Cut,
     121    UIActionIndex_M_GuestControlFileManager_S_Host_Paste,
     122    UIActionIndex_M_GuestControlFileManager_S_Guest_Paste,
     123    UIActionIndex_M_GuestControlFileManager_S_Host_SelectAll,
     124    UIActionIndex_M_GuestControlFileManager_S_Guest_SelectAll,
     125    UIActionIndex_M_GuestControlFileManager_S_Host_InvertSelection,
     126    UIActionIndex_M_GuestControlFileManager_S_Guest_InvertSelection,
     127    UIActionIndex_M_GuestControlFileManager_S_Host_ShowProperties,
     128    UIActionIndex_M_GuestControlFileManager_S_Guest_ShowProperties,
     129
     130
    99131
    100132    /* Maximum index: */
     
    572604    virtual void updateMenuLogViewerWrapper(UIMenu *pMenu);
    573605
     606    /** Updates 'Guest Control Window' menu. */
     607    virtual void updateMenuGuestControlFileManager();
     608    /** Updates 'Guest Control' @a pMenu. */
     609    virtual void updateMenuGuestControlFileManagerWrapper(UIMenu *pMenu);
     610
    574611    /** Updates shortcuts. */
    575612    virtual void updateShortcuts();
     
    612649
    613650#endif /* !___UIActionPool_h___ */
    614 
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileManager.cpp

    r75087 r75136  
    325325}
    326326
     327QMenu *UIGuestControlFileManager::menu() const
     328{
     329    if (!m_pActionPool)
     330        return 0;
     331    return m_pActionPool->action(UIActionIndex_M_GuestControlFileManager)->menu();
     332}
     333
    327334void UIGuestControlFileManager::retranslateUi()
    328335{
     
    394401            m_pFileTableContainerLayout->setSpacing(0);
    395402            m_pFileTableContainerLayout->setContentsMargins(0, 0, 0, 0);
    396             m_pGuestFileTable = new UIGuestFileTable;
     403            m_pGuestFileTable = new UIGuestFileTable(m_pActionPool);
    397404            m_pGuestFileTable->setEnabled(false);
    398405
    399             m_pHostFileTable = new UIHostFileTable;
     406            m_pHostFileTable = new UIHostFileTable(m_pActionPool);
    400407            if (m_pHostFileTable)
    401408            {
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileManager.h

    r75087 r75136  
    7878                              const CGuest &comGuest, QWidget *pParent);
    7979    ~UIGuestControlFileManager();
     80    QMenu *menu() const;
    8081    //const UIGuestControlFileManagerSettings& settings() const;
    8182
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileManagerDialog.cpp

    r75088 r75136  
    9696        /* Configure widget: */
    9797        setWidget(pWidget);
    98         //setWidgetMenu(pWidget->menu());
     98        setWidgetMenu(pWidget->menu());
    9999#ifdef VBOX_WS_MAC
    100100        //setWidgetToolbar(pWidget->toolbar());
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileTable.cpp

    r75087 r75136  
    3939# include "QILineEdit.h"
    4040# include "QIMessageBox.h"
     41# include "UIActionPool.h"
    4142# include "UIErrorString.h"
    4243# include "UIGuestFileTable.h"
     
    738739*********************************************************************************************************************************/
    739740const unsigned UIGuestControlFileTable::m_iKiloByte = 1000;
    740 UIGuestControlFileTable::UIGuestControlFileTable(QWidget *pParent /* = 0 */)
     741UIGuestControlFileTable::UIGuestControlFileTable(UIActionPool *pActionPool, QWidget *pParent /* = 0 */)
    741742    :QIWithRetranslateUI<QWidget>(pParent)
    742743    , m_pRootItem(0)
    743744    , m_pLocationLabel(0)
    744     , m_pCopy(0)
    745     , m_pCut(0)
    746     , m_pPaste(0)
    747745    , m_pPropertiesDialog(0)
     746    , m_pActionPool(pActionPool)
     747    , m_pToolBar(0)
    748748    , m_pModel(0)
    749749    , m_pView(0)
     
    751751    , m_pMainLayout(0)
    752752    , m_pLocationComboBox(0)
    753     , m_pToolBar(0)
    754     , m_pGoUp(0)
    755     , m_pGoHome(0)
    756     , m_pRefresh(0)
    757     , m_pDelete(0)
    758     , m_pRename(0)
    759     , m_pCreateNewDirectory(0)
    760     , m_pShowProperties(0)
    761     , m_pSelectAll(0)
    762     , m_pInvertSelection(0)
    763 
    764753{
    765754    prepareObjects();
    766     prepareActions();
    767755}
    768756
     
    888876        return;
    889877
    890     m_pGoUp = new QAction(this);
    891     if (m_pGoUp)
    892     {
    893         connect(m_pGoUp, &QAction::triggered, this, &UIGuestControlFileTable::sltGoUp);
    894         m_pGoUp->setIcon(UIIconPool::iconSet(QString(":/arrow_up_10px_x2.png")));
    895         m_pToolBar->addAction(m_pGoUp);
    896     }
    897 
    898     m_pGoHome = new QAction(this);
    899     if (m_pGoHome)
    900     {
    901         connect(m_pGoHome, &QAction::triggered, this, &UIGuestControlFileTable::sltGoHome);
    902         m_pGoHome->setIcon(UIIconPool::iconSet(QString(":/nw_24px.png")));
    903         m_pToolBar->addAction(m_pGoHome);
    904     }
    905 
    906     m_pRefresh = new QAction(this);
    907     if (m_pRefresh)
    908     {
    909         connect(m_pRefresh, &QAction::triggered, this, &UIGuestControlFileTable::sltRefresh);
    910         m_pRefresh->setIcon(UIIconPool::iconSet(QString(":/refresh_24px.png")));
    911         m_pToolBar->addAction(m_pRefresh);
    912     }
    913 
    914     m_pToolBar->addSeparator();
    915 
    916     m_pDelete = new QAction(this);
    917     if (m_pDelete)
    918     {
    919         connect(m_pDelete, &QAction::triggered, this, &UIGuestControlFileTable::sltDelete);
    920         m_pDelete->setIcon(UIIconPool::iconSet(QString(":/vm_delete_32px.png")));
    921         m_pToolBar->addAction(m_pDelete);
    922         m_selectionDependentActions.push_back(m_pDelete);
    923     }
    924 
    925     m_pRename = new QAction(this);
    926     if (m_pRename)
    927     {
    928         connect(m_pRename, &QAction::triggered, this, &UIGuestControlFileTable::sltRename);
    929         m_pRename->setIcon(UIIconPool::iconSet(QString(":/name_16px_x2.png")));
    930         m_pToolBar->addAction(m_pRename);
    931         m_selectionDependentActions.push_back(m_pRename);
    932     }
    933 
    934     m_pCreateNewDirectory = new QAction(this);
    935     if (m_pCreateNewDirectory)
    936     {
    937         connect(m_pCreateNewDirectory, &QAction::triggered, this, &UIGuestControlFileTable::sltCreateNewDirectory);
    938         m_pCreateNewDirectory->setIcon(UIIconPool::iconSet(QString(":/sf_add_16px.png")));
    939         m_pToolBar->addAction(m_pCreateNewDirectory);
    940     }
    941 
    942     m_pCopy = new QAction(this);
    943     if (m_pCopy)
    944     {
    945         m_pCopy->setIcon(UIIconPool::iconSet(QString(":/fd_copy_32px.png")));
    946         m_pToolBar->addAction(m_pCopy);
    947         connect(m_pCopy, &QAction::triggered, this, &UIGuestControlFileTable::sltCopy);
    948         m_selectionDependentActions.push_back(m_pCopy);
    949     }
    950 
    951     m_pCut = new QAction(this);
    952     if (m_pCut)
    953     {
    954         m_pCut->setIcon(UIIconPool::iconSet(QString(":/fd_move_32px.png")));
    955         m_pToolBar->addAction(m_pCut);
    956         connect(m_pCut, &QAction::triggered, this, &UIGuestControlFileTable::sltCut);
    957         m_selectionDependentActions.push_back(m_pCut);
    958     }
    959 
    960     m_pPaste = new QAction(this);
    961     if (m_pPaste)
    962     {
    963         m_pPaste->setIcon(UIIconPool::iconSet(QString(":/shared_clipboard_16px.png")));
    964         m_pToolBar->addAction(m_pPaste);
    965         connect(m_pPaste, &QAction::triggered, this, &UIGuestControlFileTable::sltPaste);
    966         m_pPaste->setEnabled(false);
    967     }
    968 
    969     m_pToolBar->addSeparator();
    970 
    971     m_pShowProperties = new QAction(this);
    972     {
    973         m_pShowProperties->setIcon(UIIconPool::iconSet(QString(":/session_info_32px.png")));
    974         m_pToolBar->addAction(m_pShowProperties);
    975         connect(m_pShowProperties, &QAction::triggered, this, &UIGuestControlFileTable::sltShowProperties);
    976         m_selectionDependentActions.push_back(m_pShowProperties);
    977     }
    978 
    979     m_pSelectAll = new QAction(this);
    980     {
    981         m_pSelectAll->setIcon(UIIconPool::iconSet(QString(":/session_info_32px.png")));
    982         m_pToolBar->addAction(m_pSelectAll);
    983         connect(m_pSelectAll, &QAction::triggered, this, &UIGuestControlFileTable::sltSelectAll);
    984     }
    985 
    986     m_pInvertSelection = new QAction(this);
    987     {
    988         m_pInvertSelection->setIcon(UIIconPool::iconSet(QString(":/session_info_32px.png")));
    989         m_pToolBar->addAction(m_pInvertSelection);
    990         connect(m_pInvertSelection, &QAction::triggered, this, &UIGuestControlFileTable::sltInvertSelection);
    991     }
     878    // m_pGoUp = new QAction(this);
     879    // if (m_pGoUp)
     880    // {
     881    //     connect(m_pGoUp, &QAction::triggered, this, &UIGuestControlFileTable::sltGoUp);
     882    //     m_pGoUp->setIcon(UIIconPool::iconSet(QString(":/arrow_up_10px_x2.png")));
     883    //     m_pToolBar->addAction(m_pGoUp);
     884    // }
     885
     886    // m_pGoHome = new QAction(this);
     887    // if (m_pGoHome)
     888    // {
     889    //     connect(m_pGoHome, &QAction::triggered, this, &UIGuestControlFileTable::sltGoHome);
     890    //     m_pGoHome->setIcon(UIIconPool::iconSet(QString(":/nw_24px.png")));
     891    //     m_pToolBar->addAction(m_pGoHome);
     892    // }
     893
     894    // m_pRefresh = new QAction(this);
     895    // if (m_pRefresh)
     896    // {
     897    //     connect(m_pRefresh, &QAction::triggered, this, &UIGuestControlFileTable::sltRefresh);
     898    //     m_pRefresh->setIcon(UIIconPool::iconSet(QString(":/refresh_24px.png")));
     899    //     m_pToolBar->addAction(m_pRefresh);
     900    // }
     901
     902    //m_pToolBar->addSeparator();
     903
     904    // m_pDelete = new QAction(this);
     905    // if (m_pDelete)
     906    // {
     907    //     connect(m_pDelete, &QAction::triggered, this, &UIGuestControlFileTable::sltDelete);
     908    //     m_pDelete->setIcon(UIIconPool::iconSet(QString(":/vm_delete_32px.png")));
     909    //     m_pToolBar->addAction(m_pDelete);
     910    //     m_selectionDependentActions.push_back(m_pDelete);
     911    // }
     912
     913    // m_pRename = new QAction(this);
     914    // if (m_pRename)
     915    // {
     916    //     connect(m_pRename, &QAction::triggered, this, &UIGuestControlFileTable::sltRename);
     917    //     m_pRename->setIcon(UIIconPool::iconSet(QString(":/name_16px_x2.png")));
     918    //     m_pToolBar->addAction(m_pRename);
     919    //     m_selectionDependentActions.push_back(m_pRename);
     920    // }
     921
     922    // m_pCreateNewDirectory = new QAction(this);
     923    // if (m_pCreateNewDirectory)
     924    // {
     925    //     connect(m_pCreateNewDirectory, &QAction::triggered, this, &UIGuestControlFileTable::sltCreateNewDirectory);
     926    //     m_pCreateNewDirectory->setIcon(UIIconPool::iconSet(QString(":/sf_add_16px.png")));
     927    //     m_pToolBar->addAction(m_pCreateNewDirectory);
     928    // }
     929
     930    // m_pCopy = new QAction(this);
     931    // if (m_pCopy)
     932    // {
     933    //     m_pCopy->setIcon(UIIconPool::iconSet(QString(":/fd_copy_32px.png")));
     934    //     m_pToolBar->addAction(m_pCopy);
     935    //     connect(m_pCopy, &QAction::triggered, this, &UIGuestControlFileTable::sltCopy);
     936    //     m_selectionDependentActions.push_back(m_pCopy);
     937    // }
     938
     939    // m_pCut = new QAction(this);
     940    // if (m_pCut)
     941    // {
     942    //     m_pCut->setIcon(UIIconPool::iconSet(QString(":/fd_move_32px.png")));
     943    //     m_pToolBar->addAction(m_pCut);
     944    //     connect(m_pCut, &QAction::triggered, this, &UIGuestControlFileTable::sltCut);
     945    //     m_selectionDependentActions.push_back(m_pCut);
     946    // }
     947
     948    // m_pPaste = new QAction(this);
     949    // if (m_pPaste)
     950    // {
     951    //     m_pPaste->setIcon(UIIconPool::iconSet(QString(":/shared_clipboard_16px.png")));
     952    //     m_pToolBar->addAction(m_pPaste);
     953    //     connect(m_pPaste, &QAction::triggered, this, &UIGuestControlFileTable::sltPaste);
     954    //     m_pPaste->setEnabled(false);
     955    // }
     956
     957    // m_pToolBar->addSeparator();
     958
     959    // m_pShowProperties = new QAction(this);
     960    // {
     961    //     m_pShowProperties->setIcon(UIIconPool::iconSet(QString(":/session_info_32px.png")));
     962    //     m_pToolBar->addAction(m_pShowProperties);
     963    //     connect(m_pShowProperties, &QAction::triggered, this, &UIGuestControlFileTable::sltShowProperties);
     964    //     m_selectionDependentActions.push_back(m_pShowProperties);
     965    // }
     966
     967    // m_pSelectAll = new QAction(this);
     968    // {
     969    //     m_pSelectAll->setIcon(UIIconPool::iconSet(QString(":/session_info_32px.png")));
     970    //     m_pToolBar->addAction(m_pSelectAll);
     971    //     connect(m_pSelectAll, &QAction::triggered, this, &UIGuestControlFileTable::sltSelectAll);
     972    // }
     973
     974    // m_pInvertSelection = new QAction(this);
     975    // {
     976    //     m_pInvertSelection->setIcon(UIIconPool::iconSet(QString(":/session_info_32px.png")));
     977    //     m_pToolBar->addAction(m_pInvertSelection);
     978    //     connect(m_pInvertSelection, &QAction::triggered, this, &UIGuestControlFileTable::sltInvertSelection);
     979    // }
    992980
    993981    disableSelectionDependentActions();
     
    13001288
    13011289    m_copyCutBuffer = selectedItemPathList();
    1302     if (!m_copyCutBuffer.isEmpty())
    1303         m_pPaste->setEnabled(true);
    1304     else
    1305         m_pPaste->setEnabled(false);
     1290    // if (!m_copyCutBuffer.isEmpty())
     1291    //     m_pPaste->setEnabled(true);
     1292    // else
     1293    //     m_pPaste->setEnabled(false);
    13061294}
    13071295
     
    13091297{
    13101298    m_copyCutBuffer = selectedItemPathList();
    1311     if (!m_copyCutBuffer.isEmpty())
    1312         m_pPaste->setEnabled(true);
    1313     else
    1314         m_pPaste->setEnabled(false);
     1299    // if (!m_copyCutBuffer.isEmpty())
     1300    //     m_pPaste->setEnabled(true);
     1301    // else
     1302    //     m_pPaste->setEnabled(false);
    13151303}
    13161304
     
    13191307    // paste them
    13201308    m_copyCutBuffer.clear();
    1321     m_pPaste->setEnabled(false);
     1309    //m_pPaste->setEnabled(false);
    13221310}
    13231311
     
    14331421void UIGuestControlFileTable::retranslateUi()
    14341422{
    1435     if (m_pGoUp)
    1436     {
    1437         m_pGoUp->setText(QApplication::translate("UIGuestControlFileManager", "Move one level up"));
    1438         m_pGoUp->setToolTip(QApplication::translate("UIGuestControlFileManager", "Move one level up"));
    1439         m_pGoUp->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Move one level up"));
    1440     }
    1441 
    1442     if (m_pGoHome)
    1443     {
    1444         m_pGoHome->setText(QApplication::translate("UIGuestControlFileManager", "Go to home directory"));
    1445         m_pGoHome->setToolTip(QApplication::translate("UIGuestControlFileManager", "Go to home directory"));
    1446         m_pGoHome->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Go to home directory"));
    1447     }
    1448 
    1449     if (m_pRename)
    1450     {
    1451         m_pRename->setText(QApplication::translate("UIGuestControlFileManager", "Rename the selected item"));
    1452         m_pRename->setToolTip(QApplication::translate("UIGuestControlFileManager", "Rename the selected item"));
    1453         m_pRename->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Rename the selected item"));
    1454     }
    1455 
    1456     if (m_pRefresh)
    1457     {
    1458         m_pRefresh->setText(QApplication::translate("UIGuestControlFileManager", "Refresh"));
    1459         m_pRefresh->setToolTip(QApplication::translate("UIGuestControlFileManager", "Refresh the current directory"));
    1460         m_pRefresh->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Refresh the current directory"));
    1461     }
    1462     if (m_pDelete)
    1463     {
    1464         m_pDelete->setText(QApplication::translate("UIGuestControlFileManager", "Delete"));
    1465         m_pDelete->setToolTip(QApplication::translate("UIGuestControlFileManager", "Delete the selected item(s)"));
    1466         m_pDelete->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Delete the selected item(s)"));
    1467     }
    1468 
    1469     if (m_pCreateNewDirectory)
    1470     {
    1471         m_pCreateNewDirectory->setText(QApplication::translate("UIGuestControlFileManager", "Create new directory"));
    1472         m_pCreateNewDirectory->setToolTip(QApplication::translate("UIGuestControlFileManager", "Create new directory"));
    1473         m_pCreateNewDirectory->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Create new directory"));
    1474     }
    1475 
    1476     if (m_pCopy)
    1477     {
    1478         m_pCopy->setText(QApplication::translate("UIGuestControlFileManager", "Copy the selected item"));
    1479         m_pCopy->setToolTip(QApplication::translate("UIGuestControlFileManager", "Copy the selected item(s)"));
    1480         m_pCopy->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Copy the selected item(s)"));
    1481 
    1482     }
    1483 
    1484     if (m_pCut)
    1485     {
    1486         m_pCut->setText(QApplication::translate("UIGuestControlFileManager", "Cut the selected item(s)"));
    1487         m_pCut->setToolTip(QApplication::translate("UIGuestControlFileManager", "Cut the selected item(s)"));
    1488         m_pCut->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Cut the selected item(s)"));
    1489 
    1490     }
    1491 
    1492     if ( m_pPaste)
    1493     {
    1494         m_pPaste->setText(QApplication::translate("UIGuestControlFileManager", "Paste the copied item(s)"));
    1495         m_pPaste->setToolTip(QApplication::translate("UIGuestControlFileManager", "Paste the copied item(s)"));
    1496         m_pPaste->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Paste the copied item(s)"));
    1497     }
    1498 
    1499     if (m_pShowProperties)
    1500     {
    1501         m_pShowProperties->setText(QApplication::translate("UIGuestControlFileManager", "Show the properties of the selected item(s)"));
    1502         m_pShowProperties->setToolTip(QApplication::translate("UIGuestControlFileManager", "Show the properties of the selected item(s)"));
    1503         m_pShowProperties->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Show the properties of the selected item(s)"));
    1504     }
    1505 
    1506     if (m_pSelectAll)
    1507     {
    1508         m_pSelectAll->setText(QApplication::translate("UIGuestControlFileManager", "Select All"));
    1509         m_pSelectAll->setToolTip(QApplication::translate("UIGuestControlFileManager", "Select All"));
    1510         m_pSelectAll->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Select All"));
    1511     }
    1512 
    1513     if (m_pInvertSelection)
    1514     {
    1515         m_pInvertSelection->setText(QApplication::translate("UIGuestControlFileManager", "Invert Selection"));
    1516         m_pInvertSelection->setToolTip(QApplication::translate("UIGuestControlFileManager", "Invert Selection"));
    1517         m_pInvertSelection->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Invert Selection"));
    1518     }
     1423    // if (m_pGoUp)
     1424    // {
     1425    //     m_pGoUp->setText(QApplication::translate("UIGuestControlFileManager", "Move one level up"));
     1426    //     m_pGoUp->setToolTip(QApplication::translate("UIGuestControlFileManager", "Move one level up"));
     1427    //     m_pGoUp->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Move one level up"));
     1428    // }
     1429
     1430    // if (m_pGoHome)
     1431    // {
     1432    //     m_pGoHome->setText(QApplication::translate("UIGuestControlFileManager", "Go to home directory"));
     1433    //     m_pGoHome->setToolTip(QApplication::translate("UIGuestControlFileManager", "Go to home directory"));
     1434    //     m_pGoHome->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Go to home directory"));
     1435    // }
     1436
     1437    // if (m_pRename)
     1438    // {
     1439    //     m_pRename->setText(QApplication::translate("UIGuestControlFileManager", "Rename the selected item"));
     1440    //     m_pRename->setToolTip(QApplication::translate("UIGuestControlFileManager", "Rename the selected item"));
     1441    //     m_pRename->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Rename the selected item"));
     1442    // }
     1443
     1444    // if (m_pRefresh)
     1445    // {
     1446    //     m_pRefresh->setText(QApplication::translate("UIGuestControlFileManager", "Refresh"));
     1447    //     m_pRefresh->setToolTip(QApplication::translate("UIGuestControlFileManager", "Refresh the current directory"));
     1448    //     m_pRefresh->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Refresh the current directory"));
     1449    // }
     1450    // if (m_pDelete)
     1451    // {
     1452    //     m_pDelete->setText(QApplication::translate("UIGuestControlFileManager", "Delete"));
     1453    //     m_pDelete->setToolTip(QApplication::translate("UIGuestControlFileManager", "Delete the selected item(s)"));
     1454    //     m_pDelete->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Delete the selected item(s)"));
     1455    // }
     1456
     1457    // if (m_pCreateNewDirectory)
     1458    // {
     1459    //     m_pCreateNewDirectory->setText(QApplication::translate("UIGuestControlFileManager", "Create new directory"));
     1460    //     m_pCreateNewDirectory->setToolTip(QApplication::translate("UIGuestControlFileManager", "Create new directory"));
     1461    //     m_pCreateNewDirectory->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Create new directory"));
     1462    // }
     1463
     1464    // if (m_pCopy)
     1465    // {
     1466    //     m_pCopy->setText(QApplication::translate("UIGuestControlFileManager", "Copy the selected item"));
     1467    //     m_pCopy->setToolTip(QApplication::translate("UIGuestControlFileManager", "Copy the selected item(s)"));
     1468    //     m_pCopy->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Copy the selected item(s)"));
     1469
     1470    // }
     1471
     1472    // if (m_pCut)
     1473    // {
     1474    //     m_pCut->setText(QApplication::translate("UIGuestControlFileManager", "Cut the selected item(s)"));
     1475    //     m_pCut->setToolTip(QApplication::translate("UIGuestControlFileManager", "Cut the selected item(s)"));
     1476    //     m_pCut->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Cut the selected item(s)"));
     1477
     1478    // }
     1479
     1480    // if ( m_pPaste)
     1481    // {
     1482    //     m_pPaste->setText(QApplication::translate("UIGuestControlFileManager", "Paste the copied item(s)"));
     1483    //     m_pPaste->setToolTip(QApplication::translate("UIGuestControlFileManager", "Paste the copied item(s)"));
     1484    //     m_pPaste->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Paste the copied item(s)"));
     1485    // }
     1486
     1487    // if (m_pShowProperties)
     1488    // {
     1489    //     m_pShowProperties->setText(QApplication::translate("UIGuestControlFileManager", "Show the properties of the selected item(s)"));
     1490    //     m_pShowProperties->setToolTip(QApplication::translate("UIGuestControlFileManager", "Show the properties of the selected item(s)"));
     1491    //     m_pShowProperties->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Show the properties of the selected item(s)"));
     1492    // }
     1493
     1494    // if (m_pSelectAll)
     1495    // {
     1496    //     m_pSelectAll->setText(QApplication::translate("UIGuestControlFileManager", "Select All"));
     1497    //     m_pSelectAll->setToolTip(QApplication::translate("UIGuestControlFileManager", "Select All"));
     1498    //     m_pSelectAll->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Select All"));
     1499    // }
     1500
     1501    // if (m_pInvertSelection)
     1502    // {
     1503    //     m_pInvertSelection->setText(QApplication::translate("UIGuestControlFileManager", "Invert Selection"));
     1504    //     m_pInvertSelection->setToolTip(QApplication::translate("UIGuestControlFileManager", "Invert Selection"));
     1505    //     m_pInvertSelection->setStatusTip(QApplication::translate("UIGuestControlFileManager", "Invert Selection"));
     1506    // }
    15191507}
    15201508
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileTable.h

    r75000 r75136  
    3737class QAction;
    3838class QFileInfo;
    39 
    4039class QComboBox;
    4140class QILabel;
     
    4544class QTextEdit;
    4645class QVBoxLayout;
     46class UIActionPool;
    4747class UIFileTableItem;
    4848class UIGuestControlFileModel;
     
    248248public:
    249249
    250     UIGuestControlFileTable(QWidget *pParent = 0);
     250    UIGuestControlFileTable(UIActionPool *pActionPool, QWidget *pParent = 0);
    251251    virtual ~UIGuestControlFileTable();
    252252    /** Deletes all the tree nodes */
     
    292292    bool             eventFilter(QObject *pObject, QEvent *pEvent) /* override */;
    293293    CGuestFsObjInfo  guestFsObjectInfo(const QString& path, CGuestSession &comGuestSession) const;
     294    virtual void     prepareActions();
    294295
    295296    UIFileTableItem         *m_pRootItem;
    296297    QILabel                 *m_pLocationLabel;
    297     QAction                 *m_pCopy;
    298     QAction                 *m_pCut;
    299     QAction                 *m_pPaste;
     298    // QAction                 *m_pCopy;
     299    // QAction                 *m_pCut;
     300    // QAction                 *m_pPaste;
    300301    UIPropertiesDialog      *m_pPropertiesDialog;
     302    UIActionPool            *m_pActionPool;
     303    UIToolBar               *m_pToolBar;
     304
    301305    /** Stores the drive letters the file system has (for windows system). For non-windows
    302306     *  systems this is empty and for windows system it should at least contain C:/ */
     
    331335
    332336    void             prepareObjects();
    333     void             prepareActions();
    334337    /** @p itemIndex is assumed to be 'model' index not 'proxy model' index */
    335338    void             deleteByIndex(const QModelIndex &itemIndex);
     
    358361    QGridLayout     *m_pMainLayout;
    359362    QComboBox       *m_pLocationComboBox;
    360     UIToolBar       *m_pToolBar;
    361     QAction         *m_pGoUp;
    362     QAction         *m_pGoHome;
    363     QAction         *m_pRefresh;
    364     QAction         *m_pDelete;
    365     QAction         *m_pRename;
    366     QAction         *m_pCreateNewDirectory;
    367     QAction         *m_pShowProperties;
    368     QAction         *m_pSelectAll;
    369     QAction         *m_pInvertSelection;
     363    //QAction         *m_pGoUp;
     364    //QAction         *m_pGoHome;
     365    //QAction         *m_pRefresh;
     366    //QAction         *m_pDelete;
     367    //QAction         *m_pRename;
     368    //QAction         *m_pCreateNewDirectory;
     369    // QAction         *m_pShowProperties;
     370    // QAction         *m_pSelectAll;
     371    // QAction         *m_pInvertSelection;
    370372    /** The vector of actions which need some selection to work on. Like cut, copy etc. */
    371373    QVector<QAction*> m_selectionDependentActions;
    372374    /** The absolue path list of the file objects which user has chosen to cut/copy. this
    373375     *  list will be cleaned after a paste operation or overwritten by a subsequent cut/copy */
    374     QStringList     m_copyCutBuffer;
    375     QILineEdit     *m_pSearchLineEdit;
     376    QStringList      m_copyCutBuffer;
     377    QILineEdit      *m_pSearchLineEdit;
    376378    friend class    UIGuestControlFileModel;
    377379};
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestFileTable.cpp

    r75087 r75136  
    2727/* GUI includes: */
    2828# include "QILabel.h"
     29# include "UIActionPool.h"
    2930# include "UIErrorString.h"
    3031# include "UIGuestFileTable.h"
     32# include "UIToolBar.h"
    3133
    3234/* COM includes: */
     
    143145}
    144146
    145 UIGuestFileTable::UIGuestFileTable(QWidget *pParent /*= 0*/)
    146     :UIGuestControlFileTable(pParent)
    147 {
     147UIGuestFileTable::UIGuestFileTable(UIActionPool *pActionPool, QWidget *pParent /*= 0*/)
     148    :UIGuestControlFileTable(pActionPool, pParent)
     149{
     150    prepareActions();
    148151    retranslateUi();
    149152}
     
    586589}
    587590
     591void UIGuestFileTable::prepareActions()
     592{
     593    if (m_pToolBar && m_pActionPool)
     594    {
     595        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Guest_GoUp));
     596        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Guest_GoHome));
     597        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Guest_Refresh));
     598
     599        m_pToolBar->addSeparator();
     600        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Guest_Delete));
     601        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Guest_Rename));
     602        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Guest_CreateNewDirectory));
     603        m_pToolBar->addSeparator();
     604        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Guest_Copy));
     605        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Guest_Cut));
     606        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Guest_Paste));
     607        m_pToolBar->addSeparator();
     608        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Guest_SelectAll));
     609        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Guest_InvertSelection));
     610        m_pToolBar->addSeparator();
     611        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Guest_ShowProperties));
     612    }
     613
     614    UIGuestControlFileTable::prepareActions();
     615}
     616
    588617#include "UIGuestFileTable.moc"
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestFileTable.h

    r74947 r75136  
    2626#include "UIGuestControlFileTable.h"
    2727
     28/* Forward declarations: */
     29class UIActionPool;
     30
    2831/** This class scans the guest file system by using the VBox Guest Control API
    2932 *  and populates the UIGuestControlFileModel*/
     
    3437public:
    3538
    36     UIGuestFileTable(QWidget *pParent = 0);
     39    UIGuestFileTable(UIActionPool *pActionPool, QWidget *pParent = 0);
    3740    void initGuestFileTable(const CGuestSession &session);
    3841    void copyGuestToHost(const QString& hostDestinationPath);
     
    5053    virtual void    showProperties() /* override */;
    5154    virtual void    determineDriveLetters() /* override */;
     55    virtual void    prepareActions() /* override */;
    5256
    5357private:
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIHostFileTable.cpp

    r75087 r75136  
    2727/* GUI includes: */
    2828# include "QILabel.h"
     29# include "UIActionPool.h"
    2930# include "UIGuestControlFileModel.h"
    3031# include "UIHostFileTable.h"
     32# include "UIToolBar.h"
    3133
    3234#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
     
    123125*********************************************************************************************************************************/
    124126
    125 UIHostFileTable::UIHostFileTable(QWidget *pParent /* = 0 */)
    126     :UIGuestControlFileTable(pParent)
     127UIHostFileTable::UIHostFileTable(UIActionPool *pActionPool, QWidget *pParent /* = 0 */)
     128    :UIGuestControlFileTable(pActionPool, pParent)
    127129{
    128130    initializeFileTree();
     
    140142void UIHostFileTable::prepareActions()
    141143{
     144    if (m_pToolBar && m_pActionPool)
     145    {
     146        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Host_GoUp));
     147        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Host_GoHome));
     148        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Host_Refresh));
     149
     150        m_pToolBar->addSeparator();
     151        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Host_Delete));
     152        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Host_Rename));
     153        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Host_CreateNewDirectory));
     154        m_pToolBar->addSeparator();
     155        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Host_Copy));
     156        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Host_Cut));
     157        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Host_Paste));
     158        m_pToolBar->addSeparator();
     159        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Host_SelectAll));
     160        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Host_InvertSelection));
     161        m_pToolBar->addSeparator();
     162        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_GuestControlFileManager_S_Host_ShowProperties));
     163    }
     164
    142165    /* Hide cut, copy, and paste for now. We will implement those
    143166       when we have an API for host file operations: */
    144     if (m_pCopy)
    145         m_pCopy->setVisible(false);
    146     if (m_pCut)
    147         m_pCut->setVisible(false);
    148     if (m_pPaste)
    149         m_pPaste->setVisible(false);
     167    // if (m_pCopy)
     168    //     m_pCopy->setVisible(false);
     169    // if (m_pCut)
     170    //     m_pCut->setVisible(false);
     171    // if (m_pPaste)
     172    //     m_pPaste->setVisible(false);
     173
     174    UIGuestControlFileTable::prepareActions();
    150175}
    151176
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIHostFileTable.h

    r74947 r75136  
    2222#include "UIGuestControlFileTable.h"
    2323
     24/* Forward declarations: */
     25class UIActionPool;
     26
    2427/** This class scans the host file system by using the Qt API
    2528    and connects to the UIGuestControlFileModel*/
     
    3033public:
    3134
    32     UIHostFileTable(QWidget *pParent = 0);
     35    UIHostFileTable(UIActionPool *pActionPool, QWidget *pParent = 0);
    3336
    3437protected:
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