VirtualBox

Changeset 85644 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 7, 2020 5:42:07 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9609: VirtualBox Manager: Search action should be available for both machine and group item types.

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  
    882882        setName(QApplication::translate("UIActionPool", "&Sort"));
    883883        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 UIActionToggle
    889 {
    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-boxes
    899     {}
    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"));
    920884    }
    921885};
     
    13051269        setStatusTip(QApplication::translate("UIActionPool", "Create shortcut files to the VirtualBox Machine Definition files on your desktop"));
    13061270#endif
     1271    }
     1272};
     1273
     1274/** Toggle action extension, used as 'Search' action class. */
     1275class UIActionToggleManagerCommonToggleSearch : public UIActionToggle
     1276{
     1277    Q_OBJECT;
     1278
     1279public:
     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
     1288protected:
     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"));
    13071307    }
    13081308};
     
    34333433    m_pool[UIActionIndexMN_M_Group_S_CreateShortcut] = new UIActionSimpleManagerCommonPerformCreateShortcut(this);
    34343434    m_pool[UIActionIndexMN_M_Group_S_Sort] = new UIActionSimpleManagerGroupPerformSort(this);
     3435    m_pool[UIActionIndexMN_M_Group_T_Search] = new UIActionToggleManagerCommonToggleSearch(this);
    34353436
    34363437    /* 'Machine' actions: */
     
    34753476    m_pool[UIActionIndexMN_M_Machine_S_CreateShortcut] = new UIActionSimpleManagerCommonPerformCreateShortcut(this);
    34763477    m_pool[UIActionIndexMN_M_Machine_S_SortParent] = new UIActionSimpleManagerMachinePerformSortParent(this);
    3477     m_pool[UIActionIndexMN_M_Machine_T_Search] = new UIActionToggleManagerMachineToggleSearch(this);
     3478    m_pool[UIActionIndexMN_M_Machine_T_Search] = new UIActionToggleManagerCommonToggleSearch(this);
    34783479
    34793480    /* Global Tools actions: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.h

    r85597 r85644  
    9090    UIActionIndexMN_M_Group_S_CreateShortcut,
    9191    UIActionIndexMN_M_Group_S_Sort,
     92    UIActionIndexMN_M_Group_T_Search,
    9293
    9394    /* 'Machine' menu actions: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r85636 r85644  
    21812181    connect(actionPool()->action(UIActionIndexMN_M_Group_S_Sort), &UIAction::triggered,
    21822182            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);
    21832187
    21842188    /* 'Machine' menu connections: */
     
    26422646        pMenu->addSeparator();
    26432647        pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_Sort));
     2648        pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_T_Search));
    26442649    }
    26452650    else
     
    26572662        pMenu->addSeparator();
    26582663        pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_Sort));
     2664        pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_T_Search));
    26592665    }
    26602666}
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp

    r85597 r85644  
    13231323        pMenuGroup->addSeparator();
    13241324        pMenuGroup->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_Sort));
     1325        pMenuGroup->addAction(actionPool()->action(UIActionIndexMN_M_Group_T_Search));
    13251326    }
    13261327
     
    13671368        pMenuGroup->addSeparator();
    13681369        pMenuGroup->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_Sort));
     1370        pMenuGroup->addAction(actionPool()->action(UIActionIndexMN_M_Group_T_Search));
    13691371    }
    13701372
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