VirtualBox

Changeset 94294 in vbox


Ignore:
Timestamp:
Mar 17, 2022 1:44:25 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10081. Adding an action to the virtual media manager to clear inaccessible media. Slot is not yet implemented.

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

Legend:

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

    r94089 r94294  
    27522752};
    27532753
     2754/** Simple action extension, used as 'Perform Clear' action class. */
     2755class UIActionMenuManagerMediumPerformClear : public UIActionSimple
     2756{
     2757    Q_OBJECT;
     2758
     2759public:
     2760
     2761    /** Constructs action passing @a pParent to the base-class. */
     2762    UIActionMenuManagerMediumPerformClear(UIActionPool *pParent)
     2763        : UIActionSimple(pParent)
     2764    {
     2765        setShortcutContext(Qt::WidgetWithChildrenShortcut);
     2766        setIcon(0, UIIconPool::iconSetFull(":/hd_remove_32px.png",          ":/hd_remove_16px.png",
     2767                                           ":/hd_remove_disabled_32px.png", ":/hd_remove_disabled_16px.png"));
     2768        setIcon(1, UIIconPool::iconSetFull(":/cd_remove_32px.png",          ":/cd_remove_16px.png",
     2769                                           ":/cd_remove_disabled_32px.png", ":/cd_remove_disabled_16px.png"));
     2770        setIcon(2, UIIconPool::iconSetFull(":/fd_remove_32px.png",          ":/fd_remove_16px.png",
     2771                                           ":/fd_remove_disabled_32px.png", ":/fd_remove_disabled_16px.png"));
     2772    }
     2773
     2774protected:
     2775
     2776    /** Returns shortcut extra-data ID. */
     2777    virtual QString shortcutExtraDataID() const RT_OVERRIDE
     2778    {
     2779        return QString("Clear");
     2780    }
     2781
     2782    /** Returns default shortcut. */
     2783    virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
     2784    {
     2785        return QKeySequence();
     2786    }
     2787
     2788    /** Handles translation event. */
     2789    virtual void retranslateUi() RT_OVERRIDE
     2790    {
     2791        setName(QApplication::translate("UIActionPool", "&Clear"));
     2792        setShortcutScope(QApplication::translate("UIActionPool", "Media Manager"));
     2793        setStatusTip(QApplication::translate("UIActionPool", "remove all inaccessible media"));
     2794        setToolTip(  QApplication::translate("UIActionPool", "Remove All Inaccessible Media")
     2795                   + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
     2796    }
     2797};
    27542798
    27552799/** Menu action extension, used as 'Network' menu class. */
     
    36903734    m_pool[UIActionIndexMN_M_Medium_T_Search] = new UIActionMenuManagerMediumToggleSearch(this);
    36913735    m_pool[UIActionIndexMN_M_Medium_S_Refresh] = new UIActionMenuManagerMediumPerformRefresh(this);
     3736    m_pool[UIActionIndexMN_M_Medium_S_Clear] = new UIActionMenuManagerMediumPerformClear(this);
    36923737
    36933738    /* Network Manager actions: */
     
    43764421    /* 'Release' action: */
    43774422    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Release)) || fSeparator;
     4423    /* 'Clean' action: */
     4424    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Clear)) || fSeparator;
    43784425    /* 'Search' action: */
    43794426    fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_T_Search)) || fSeparator;
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.h

    r94089 r94294  
    165165    UIActionIndexMN_M_Medium_T_Search,
    166166    UIActionIndexMN_M_Medium_S_Refresh,
     167    UIActionIndexMN_M_Medium_S_Clear,
    167168
    168169    /* Network Manager actions: */
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp

    r93868 r94294  
    525525}
    526526
     527void UIMediumManagerWidget::sltClear()
     528{
     529}
     530
    527531void UIMediumManagerWidget::sltToggleMediumDetailsVisibility(bool fVisible)
    528532{
     
    754758    addAction(m_pActionPool->action(UIActionIndexMN_M_Medium_S_Remove));
    755759    addAction(m_pActionPool->action(UIActionIndexMN_M_Medium_S_Release));
     760    addAction(m_pActionPool->action(UIActionIndexMN_M_Medium_S_Clear));
    756761    addAction(m_pActionPool->action(UIActionIndexMN_M_Medium_T_Search));
    757762    addAction(m_pActionPool->action(UIActionIndexMN_M_Medium_T_Details));
     
    771776    connect(m_pActionPool->action(UIActionIndexMN_M_Medium_S_Release), &QAction::triggered,
    772777            this, &UIMediumManagerWidget::sltReleaseMedium);
     778    connect(m_pActionPool->action(UIActionIndexMN_M_Medium_S_Clear), &QAction::triggered,
     779            this, &UIMediumManagerWidget::sltClear);
    773780    connect(m_pActionPool->action(UIActionIndexMN_M_Medium_T_Details), &QAction::toggled,
    774781            this, &UIMediumManagerWidget::sltToggleMediumDetailsVisibility);
     
    827834        m_pToolBar->addAction(m_pActionPool->action(UIActionIndexMN_M_Medium_S_Remove));
    828835        m_pToolBar->addAction(m_pActionPool->action(UIActionIndexMN_M_Medium_S_Release));
     836        m_pToolBar->addAction(m_pActionPool->action(UIActionIndexMN_M_Medium_S_Clear));
    829837        m_pToolBar->addAction(m_pActionPool->action(UIActionIndexMN_M_Medium_T_Search));
    830838        m_pToolBar->addAction(m_pActionPool->action(UIActionIndexMN_M_Medium_T_Details));
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h

    r93990 r94294  
    179179        /** Handles command to release medium. */
    180180        void sltReleaseMedium();
     181        /** Removes all inaccessible media. */
     182        void sltClear();
    181183        /** Handles command to make medium details @a fVisible. */
    182184        void sltToggleMediumDetailsVisibility(bool fVisible);
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