VirtualBox

Changeset 92427 in vbox


Ignore:
Timestamp:
Nov 15, 2021 2:12:20 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10141. Using action pool actions in medium selector.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.cpp

    r92414 r92427  
    2929#include "QITabWidget.h"
    3030#include "QIToolButton.h"
     31#include "UIActionPool.h"
    3132#include "UICommon.h"
    3233#include "UIDesktopWidgetWatchdog.h"
     
    169170void UIMediumSelector::prepareActions()
    170171{
    171     QString strPrefix("hd");
     172    if (!m_pActionPool)
     173        return;
     174
    172175    switch (m_enmMediumType)
    173176    {
    174177        case UIMediumDeviceType_DVD:
    175             strPrefix = "cd";
     178            m_pActionAdd = m_pActionPool->action(UIActionIndex_M_MediumSelector_AddCD);
     179            m_pActionCreate = m_pActionPool->action(UIActionIndex_M_MediumSelector_CreateCD);
    176180            break;
    177181        case UIMediumDeviceType_Floppy:
    178             strPrefix = "fd";
     182            m_pActionAdd = m_pActionPool->action(UIActionIndex_M_MediumSelector_AddFD);
     183            m_pActionCreate = m_pActionPool->action(UIActionIndex_M_MediumSelector_CreateFD);
    179184            break;
    180185        case UIMediumDeviceType_HardDisk:
     
    182187        case UIMediumDeviceType_Invalid:
    183188        default:
    184             strPrefix = "hd";
    185             break;
    186     }
    187 
    188     m_pActionAdd = new QAction(this);
    189     if (m_pActionAdd)
    190     {
    191         /* Configure add-action: */
    192         m_pActionAdd->setShortcut(QKeySequence(""));
    193 
    194         m_pActionAdd->setIcon(UIIconPool::iconSetFull(QString(":/%1_add_32px.png").arg(strPrefix),
    195                                                       QString(":/%1_add_16px.png").arg(strPrefix),
    196                                                       QString(":/%1_add_disabled_32px.png").arg(strPrefix),
    197                                                       QString(":/%1_add_disabled_16px.png").arg(strPrefix)));
    198     }
    199 
    200     m_pActionCreate = new QAction(this);
    201     if (m_pActionCreate)
    202     {
    203         m_pActionCreate->setShortcut(QKeySequence(""));
    204         m_pActionCreate->setIcon(UIIconPool::iconSetFull(QString(":/%1_create_32px.png").arg(strPrefix),
    205                                                          QString(":/%1_create_16px.png").arg(strPrefix),
    206                                                          QString(":/%1_create_disabled_32px.png").arg(strPrefix),
    207                                                          QString(":/%1_create_disabled_16px.png").arg(strPrefix)));
    208     }
    209 
    210     m_pActionRefresh = new QAction(this);
    211     if (m_pActionRefresh)
    212     {
    213         m_pActionRefresh->setShortcut(QKeySequence());
    214         if (m_pActionRefresh && m_pActionRefresh->icon().isNull())
    215             m_pActionRefresh->setIcon(UIIconPool::iconSetFull(":/refresh_32px.png", ":/refresh_16px.png",
    216                                                               ":/refresh_disabled_32px.png", ":/refresh_disabled_16px.png"));
    217     }
     189            m_pActionAdd = m_pActionPool->action(UIActionIndex_M_MediumSelector_AddHD);
     190            m_pActionCreate = m_pActionPool->action(UIActionIndex_M_MediumSelector_CreateHD);
     191            break;
     192    }
     193
     194    m_pActionRefresh = m_pActionPool->action(UIActionIndex_M_MediumSelector_Refresh);
    218195}
    219196
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