Changeset 85644 in vbox for trunk/src/VBox
- Timestamp:
- Aug 7, 2020 5:42:07 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.cpp
r85642 r85644 882 882 setName(QApplication::translate("UIActionPool", "&Sort")); 883 883 setStatusTip(QApplication::translate("UIActionPool", "Sort group of first selected virtual machine alphabetically")); 884 }885 };886 887 /** Toggle action extension, used as 'Search' action class. */888 class UIActionToggleManagerMachineToggleSearch : public UIActionToggle889 {890 Q_OBJECT;891 892 public:893 894 /** Constructs action passing @a pParent to the base-class. */895 UIActionToggleManagerMachineToggleSearch(UIActionPool *pParent)896 : UIActionToggle(pParent,897 ":/search_16px.png", ":/search_16px.png",898 ":/search_16px.png", ":/search_16px.png") /// @todo use icons with check-boxes899 {}900 901 protected:902 903 /** Returns shortcut extra-data ID. */904 virtual QString shortcutExtraDataID() const /* override */905 {906 return QString("SearchVM");907 }908 909 /** Returns default shortcut. */910 virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */911 {912 return QKeySequence("Ctrl+F");913 }914 915 /** Handles translation event. */916 virtual void retranslateUi() /* override */917 {918 setName(QApplication::translate("UIActionPool", "S&earch"));919 setStatusTip(QApplication::translate("UIActionPool", "Search virtual machines with respect to a search term"));920 884 } 921 885 }; … … 1305 1269 setStatusTip(QApplication::translate("UIActionPool", "Create shortcut files to the VirtualBox Machine Definition files on your desktop")); 1306 1270 #endif 1271 } 1272 }; 1273 1274 /** Toggle action extension, used as 'Search' action class. */ 1275 class UIActionToggleManagerCommonToggleSearch : public UIActionToggle 1276 { 1277 Q_OBJECT; 1278 1279 public: 1280 1281 /** Constructs action passing @a pParent to the base-class. */ 1282 UIActionToggleManagerCommonToggleSearch(UIActionPool *pParent) 1283 : UIActionToggle(pParent, 1284 ":/search_16px.png", ":/search_16px.png", 1285 ":/search_16px.png", ":/search_16px.png") /// @todo use icons with check-boxes 1286 {} 1287 1288 protected: 1289 1290 /** Returns shortcut extra-data ID. */ 1291 virtual QString shortcutExtraDataID() const /* override */ 1292 { 1293 return QString("SearchVM"); 1294 } 1295 1296 /** Returns default shortcut. */ 1297 virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */ 1298 { 1299 return QKeySequence("Ctrl+F"); 1300 } 1301 1302 /** Handles translation event. */ 1303 virtual void retranslateUi() /* override */ 1304 { 1305 setName(QApplication::translate("UIActionPool", "S&earch")); 1306 setStatusTip(QApplication::translate("UIActionPool", "Search virtual machines with respect to a search term")); 1307 1307 } 1308 1308 }; … … 3433 3433 m_pool[UIActionIndexMN_M_Group_S_CreateShortcut] = new UIActionSimpleManagerCommonPerformCreateShortcut(this); 3434 3434 m_pool[UIActionIndexMN_M_Group_S_Sort] = new UIActionSimpleManagerGroupPerformSort(this); 3435 m_pool[UIActionIndexMN_M_Group_T_Search] = new UIActionToggleManagerCommonToggleSearch(this); 3435 3436 3436 3437 /* 'Machine' actions: */ … … 3475 3476 m_pool[UIActionIndexMN_M_Machine_S_CreateShortcut] = new UIActionSimpleManagerCommonPerformCreateShortcut(this); 3476 3477 m_pool[UIActionIndexMN_M_Machine_S_SortParent] = new UIActionSimpleManagerMachinePerformSortParent(this); 3477 m_pool[UIActionIndexMN_M_Machine_T_Search] = new UIActionToggleManager MachineToggleSearch(this);3478 m_pool[UIActionIndexMN_M_Machine_T_Search] = new UIActionToggleManagerCommonToggleSearch(this); 3478 3479 3479 3480 /* Global Tools actions: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.h
r85597 r85644 90 90 UIActionIndexMN_M_Group_S_CreateShortcut, 91 91 UIActionIndexMN_M_Group_S_Sort, 92 UIActionIndexMN_M_Group_T_Search, 92 93 93 94 /* 'Machine' menu actions: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r85636 r85644 2181 2181 connect(actionPool()->action(UIActionIndexMN_M_Group_S_Sort), &UIAction::triggered, 2182 2182 this, &UIVirtualBoxManager::sltPerformGroupSorting); 2183 connect(actionPool()->action(UIActionIndexMN_M_Group_T_Search), &UIAction::toggled, 2184 this, &UIVirtualBoxManager::sltPerformMachineSearchWidgetVisibilityToggling); 2185 connect(m_pWidget, &UIVirtualBoxManagerWidget::sigMachineSearchWidgetVisibilityChanged, 2186 actionPool()->action(UIActionIndexMN_M_Group_T_Search), &QAction::setChecked); 2183 2187 2184 2188 /* 'Machine' menu connections: */ … … 2642 2646 pMenu->addSeparator(); 2643 2647 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_Sort)); 2648 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_T_Search)); 2644 2649 } 2645 2650 else … … 2657 2662 pMenu->addSeparator(); 2658 2663 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_Sort)); 2664 pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_T_Search)); 2659 2665 } 2660 2666 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r85597 r85644 1323 1323 pMenuGroup->addSeparator(); 1324 1324 pMenuGroup->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_Sort)); 1325 pMenuGroup->addAction(actionPool()->action(UIActionIndexMN_M_Group_T_Search)); 1325 1326 } 1326 1327 … … 1367 1368 pMenuGroup->addSeparator(); 1368 1369 pMenuGroup->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_Sort)); 1370 pMenuGroup->addAction(actionPool()->action(UIActionIndexMN_M_Group_T_Search)); 1369 1371 } 1370 1372
Note:
See TracChangeset
for help on using the changeset viewer.