- Timestamp:
- Oct 29, 2018 8:47:55 AM (6 years ago)
- 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 1184 1184 }; 1185 1185 1186 1187 1186 /** Menu action extension, used as 'Log' menu class. */ 1188 1187 class UIActionMenuSelectorLog : public UIActionMenu … … 1434 1433 } 1435 1434 }; 1435 1436 /** Menu action extension, used as 'Guest Control File Manager' menu class. */ 1437 class UIActionMenuGuestControlFileManager : public UIActionMenu 1438 { 1439 Q_OBJECT; 1440 1441 public: 1442 1443 /** Constructs action passing @a pParent to the base-class. */ 1444 UIActionMenuGuestControlFileManager(UIActionPool *pParent) 1445 : UIActionMenu(pParent) 1446 {} 1447 1448 protected: 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 1464 class UIActionMenuGuestControlFileManagerHostSubmenu : public UIActionMenu 1465 { 1466 Q_OBJECT; 1467 1468 public: 1469 1470 /** Constructs action passing @a pParent to the base-class. */ 1471 UIActionMenuGuestControlFileManagerHostSubmenu(UIActionPool *pParent) 1472 : UIActionMenu(pParent) 1473 {} 1474 1475 protected: 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 1491 class UIActionMenuGuestControlFileManagerGuestSubmenu : public UIActionMenu 1492 { 1493 Q_OBJECT; 1494 1495 public: 1496 1497 /** Constructs action passing @a pParent to the base-class. */ 1498 UIActionMenuGuestControlFileManagerGuestSubmenu(UIActionPool *pParent) 1499 : UIActionMenu(pParent) 1500 {} 1501 1502 protected: 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. */ 1520 class UIActionMenuGuestControlFileManagerSettings : public UIActionSimple 1521 { 1522 Q_OBJECT; 1523 1524 public: 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 1531 protected: 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. */ 1555 class UIActionMenuGuestControlFileManagerGoUp : public UIActionSimple 1556 { 1557 Q_OBJECT; 1558 1559 public: 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 1566 protected: 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. */ 1592 class UIActionMenuGuestControlFileManagerGoHome : public UIActionSimple 1593 { 1594 Q_OBJECT; 1595 1596 public: 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 1603 protected: 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. */ 1629 class UIActionMenuGuestControlFileManagerDelete : public UIActionSimple 1630 { 1631 Q_OBJECT; 1632 1633 public: 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 1640 protected: 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. */ 1665 class UIActionMenuGuestControlFileManagerRefresh : public UIActionSimple 1666 { 1667 Q_OBJECT; 1668 1669 public: 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 1676 protected: 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. */ 1702 class UIActionMenuGuestControlFileManagerRename : public UIActionSimple 1703 { 1704 Q_OBJECT; 1705 1706 public: 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 1712 protected: 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. */ 1737 class UIActionMenuGuestControlFileManagerCreateNewDirectory : public UIActionSimple 1738 { 1739 Q_OBJECT; 1740 1741 public: 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 1747 protected: 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. */ 1773 class UIActionMenuGuestControlFileManagerCopy : public UIActionSimple 1774 { 1775 Q_OBJECT; 1776 1777 public: 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 1783 protected: 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. */ 1808 class UIActionMenuGuestControlFileManagerCut : public UIActionSimple 1809 { 1810 Q_OBJECT; 1811 1812 public: 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 1818 protected: 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. */ 1843 class UIActionMenuGuestControlFileManagerPaste : public UIActionSimple 1844 { 1845 Q_OBJECT; 1846 1847 public: 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 1853 protected: 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. */ 1878 class UIActionMenuGuestControlFileManagerSelectAll : public UIActionSimple 1879 { 1880 Q_OBJECT; 1881 1882 public: 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 1888 protected: 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. */ 1914 class UIActionMenuGuestControlFileManagerInvertSelection : public UIActionSimple 1915 { 1916 Q_OBJECT; 1917 1918 public: 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 1924 protected: 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. */ 1950 class UIActionMenuGuestControlFileManagerShowProperties : public UIActionSimple 1951 { 1952 Q_OBJECT; 1953 1954 public: 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 1960 protected: 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 1436 1986 1437 1987 … … 1641 2191 m_pool[UIActionIndex_M_Log_S_Save] = new UIActionMenuSelectorLogPerformSave(this); 1642 2192 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 1643 2224 /* Prepare update-handlers for known menus: */ 1644 2225 #ifdef VBOX_WS_MAC … … 1649 2230 m_menuUpdateHandlers[UIActionIndex_M_LogWindow].ptf = &UIActionPool::updateMenuLogViewerWindow; 1650 2231 m_menuUpdateHandlers[UIActionIndex_M_Log].ptf = &UIActionPool::updateMenuLogViewer; 2232 2233 m_menuUpdateHandlers[UIActionIndex_M_GuestControlFileManager].ptf = &UIActionPool::updateMenuGuestControlFileManager; 1651 2234 1652 2235 /* Invalidate all known menus: */ … … 1941 2524 } 1942 2525 2526 void 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 2535 void 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 1943 2576 void UIActionPool::retranslateUi() 1944 2577 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h
r73882 r75136 97 97 UIActionIndex_M_Log_S_Refresh, 98 98 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 99 131 100 132 /* Maximum index: */ … … 572 604 virtual void updateMenuLogViewerWrapper(UIMenu *pMenu); 573 605 606 /** Updates 'Guest Control Window' menu. */ 607 virtual void updateMenuGuestControlFileManager(); 608 /** Updates 'Guest Control' @a pMenu. */ 609 virtual void updateMenuGuestControlFileManagerWrapper(UIMenu *pMenu); 610 574 611 /** Updates shortcuts. */ 575 612 virtual void updateShortcuts(); … … 612 649 613 650 #endif /* !___UIActionPool_h___ */ 614 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileManager.cpp
r75087 r75136 325 325 } 326 326 327 QMenu *UIGuestControlFileManager::menu() const 328 { 329 if (!m_pActionPool) 330 return 0; 331 return m_pActionPool->action(UIActionIndex_M_GuestControlFileManager)->menu(); 332 } 333 327 334 void UIGuestControlFileManager::retranslateUi() 328 335 { … … 394 401 m_pFileTableContainerLayout->setSpacing(0); 395 402 m_pFileTableContainerLayout->setContentsMargins(0, 0, 0, 0); 396 m_pGuestFileTable = new UIGuestFileTable ;403 m_pGuestFileTable = new UIGuestFileTable(m_pActionPool); 397 404 m_pGuestFileTable->setEnabled(false); 398 405 399 m_pHostFileTable = new UIHostFileTable ;406 m_pHostFileTable = new UIHostFileTable(m_pActionPool); 400 407 if (m_pHostFileTable) 401 408 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileManager.h
r75087 r75136 78 78 const CGuest &comGuest, QWidget *pParent); 79 79 ~UIGuestControlFileManager(); 80 QMenu *menu() const; 80 81 //const UIGuestControlFileManagerSettings& settings() const; 81 82 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileManagerDialog.cpp
r75088 r75136 96 96 /* Configure widget: */ 97 97 setWidget(pWidget); 98 //setWidgetMenu(pWidget->menu());98 setWidgetMenu(pWidget->menu()); 99 99 #ifdef VBOX_WS_MAC 100 100 //setWidgetToolbar(pWidget->toolbar()); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileTable.cpp
r75087 r75136 39 39 # include "QILineEdit.h" 40 40 # include "QIMessageBox.h" 41 # include "UIActionPool.h" 41 42 # include "UIErrorString.h" 42 43 # include "UIGuestFileTable.h" … … 738 739 *********************************************************************************************************************************/ 739 740 const unsigned UIGuestControlFileTable::m_iKiloByte = 1000; 740 UIGuestControlFileTable::UIGuestControlFileTable( QWidget *pParent /* = 0 */)741 UIGuestControlFileTable::UIGuestControlFileTable(UIActionPool *pActionPool, QWidget *pParent /* = 0 */) 741 742 :QIWithRetranslateUI<QWidget>(pParent) 742 743 , m_pRootItem(0) 743 744 , m_pLocationLabel(0) 744 , m_pCopy(0)745 , m_pCut(0)746 , m_pPaste(0)747 745 , m_pPropertiesDialog(0) 746 , m_pActionPool(pActionPool) 747 , m_pToolBar(0) 748 748 , m_pModel(0) 749 749 , m_pView(0) … … 751 751 , m_pMainLayout(0) 752 752 , 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 764 753 { 765 754 prepareObjects(); 766 prepareActions();767 755 } 768 756 … … 888 876 return; 889 877 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 // } 992 980 993 981 disableSelectionDependentActions(); … … 1300 1288 1301 1289 m_copyCutBuffer = selectedItemPathList(); 1302 if (!m_copyCutBuffer.isEmpty())1303 m_pPaste->setEnabled(true);1304 else1305 m_pPaste->setEnabled(false);1290 // if (!m_copyCutBuffer.isEmpty()) 1291 // m_pPaste->setEnabled(true); 1292 // else 1293 // m_pPaste->setEnabled(false); 1306 1294 } 1307 1295 … … 1309 1297 { 1310 1298 m_copyCutBuffer = selectedItemPathList(); 1311 if (!m_copyCutBuffer.isEmpty())1312 m_pPaste->setEnabled(true);1313 else1314 m_pPaste->setEnabled(false);1299 // if (!m_copyCutBuffer.isEmpty()) 1300 // m_pPaste->setEnabled(true); 1301 // else 1302 // m_pPaste->setEnabled(false); 1315 1303 } 1316 1304 … … 1319 1307 // paste them 1320 1308 m_copyCutBuffer.clear(); 1321 m_pPaste->setEnabled(false);1309 //m_pPaste->setEnabled(false); 1322 1310 } 1323 1311 … … 1433 1421 void UIGuestControlFileTable::retranslateUi() 1434 1422 { 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 // } 1519 1507 } 1520 1508 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileTable.h
r75000 r75136 37 37 class QAction; 38 38 class QFileInfo; 39 40 39 class QComboBox; 41 40 class QILabel; … … 45 44 class QTextEdit; 46 45 class QVBoxLayout; 46 class UIActionPool; 47 47 class UIFileTableItem; 48 48 class UIGuestControlFileModel; … … 248 248 public: 249 249 250 UIGuestControlFileTable( QWidget *pParent = 0);250 UIGuestControlFileTable(UIActionPool *pActionPool, QWidget *pParent = 0); 251 251 virtual ~UIGuestControlFileTable(); 252 252 /** Deletes all the tree nodes */ … … 292 292 bool eventFilter(QObject *pObject, QEvent *pEvent) /* override */; 293 293 CGuestFsObjInfo guestFsObjectInfo(const QString& path, CGuestSession &comGuestSession) const; 294 virtual void prepareActions(); 294 295 295 296 UIFileTableItem *m_pRootItem; 296 297 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; 300 301 UIPropertiesDialog *m_pPropertiesDialog; 302 UIActionPool *m_pActionPool; 303 UIToolBar *m_pToolBar; 304 301 305 /** Stores the drive letters the file system has (for windows system). For non-windows 302 306 * systems this is empty and for windows system it should at least contain C:/ */ … … 331 335 332 336 void prepareObjects(); 333 void prepareActions();334 337 /** @p itemIndex is assumed to be 'model' index not 'proxy model' index */ 335 338 void deleteByIndex(const QModelIndex &itemIndex); … … 358 361 QGridLayout *m_pMainLayout; 359 362 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; 370 372 /** The vector of actions which need some selection to work on. Like cut, copy etc. */ 371 373 QVector<QAction*> m_selectionDependentActions; 372 374 /** The absolue path list of the file objects which user has chosen to cut/copy. this 373 375 * 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; 376 378 friend class UIGuestControlFileModel; 377 379 }; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestFileTable.cpp
r75087 r75136 27 27 /* GUI includes: */ 28 28 # include "QILabel.h" 29 # include "UIActionPool.h" 29 30 # include "UIErrorString.h" 30 31 # include "UIGuestFileTable.h" 32 # include "UIToolBar.h" 31 33 32 34 /* COM includes: */ … … 143 145 } 144 146 145 UIGuestFileTable::UIGuestFileTable(QWidget *pParent /*= 0*/) 146 :UIGuestControlFileTable(pParent) 147 { 147 UIGuestFileTable::UIGuestFileTable(UIActionPool *pActionPool, QWidget *pParent /*= 0*/) 148 :UIGuestControlFileTable(pActionPool, pParent) 149 { 150 prepareActions(); 148 151 retranslateUi(); 149 152 } … … 586 589 } 587 590 591 void 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 588 617 #include "UIGuestFileTable.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestFileTable.h
r74947 r75136 26 26 #include "UIGuestControlFileTable.h" 27 27 28 /* Forward declarations: */ 29 class UIActionPool; 30 28 31 /** This class scans the guest file system by using the VBox Guest Control API 29 32 * and populates the UIGuestControlFileModel*/ … … 34 37 public: 35 38 36 UIGuestFileTable( QWidget *pParent = 0);39 UIGuestFileTable(UIActionPool *pActionPool, QWidget *pParent = 0); 37 40 void initGuestFileTable(const CGuestSession &session); 38 41 void copyGuestToHost(const QString& hostDestinationPath); … … 50 53 virtual void showProperties() /* override */; 51 54 virtual void determineDriveLetters() /* override */; 55 virtual void prepareActions() /* override */; 52 56 53 57 private: -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIHostFileTable.cpp
r75087 r75136 27 27 /* GUI includes: */ 28 28 # include "QILabel.h" 29 # include "UIActionPool.h" 29 30 # include "UIGuestControlFileModel.h" 30 31 # include "UIHostFileTable.h" 32 # include "UIToolBar.h" 31 33 32 34 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ … … 123 125 *********************************************************************************************************************************/ 124 126 125 UIHostFileTable::UIHostFileTable( QWidget *pParent /* = 0 */)126 :UIGuestControlFileTable(p Parent)127 UIHostFileTable::UIHostFileTable(UIActionPool *pActionPool, QWidget *pParent /* = 0 */) 128 :UIGuestControlFileTable(pActionPool, pParent) 127 129 { 128 130 initializeFileTree(); … … 140 142 void UIHostFileTable::prepareActions() 141 143 { 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 142 165 /* Hide cut, copy, and paste for now. We will implement those 143 166 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(); 150 175 } 151 176 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIHostFileTable.h
r74947 r75136 22 22 #include "UIGuestControlFileTable.h" 23 23 24 /* Forward declarations: */ 25 class UIActionPool; 26 24 27 /** This class scans the host file system by using the Qt API 25 28 and connects to the UIGuestControlFileModel*/ … … 30 33 public: 31 34 32 UIHostFileTable( QWidget *pParent = 0);35 UIHostFileTable(UIActionPool *pActionPool, QWidget *pParent = 0); 33 36 34 37 protected:
Note:
See TracChangeset
for help on using the changeset viewer.