VirtualBox

Changeset 91125 in vbox


Ignore:
Timestamp:
Sep 6, 2021 2:32:23 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
146778
Message:

FE/Qt: bugref:10067: Move icon-pool stuff from UICommon to UIIconPoolGeneral; Convert UIIconPoolGeneral to singleton.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r91109 r91125  
    408408    /* If proper machine ID passed => return corresponding pixmap/size: */
    409409    if (index.data(Field_ID).toUuid() != UIExtraDataManager::GlobalID)
    410         pixmap = uiCommon().vmGuestOSTypePixmapDefault(index.data(Field_OsTypeID).toString(), &pixmapSize);
     410        pixmap = generalIconPool().guestOSTypePixmapDefault(index.data(Field_OsTypeID).toString(), &pixmapSize);
    411411    else
    412412    {
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp

    r91122 r91125  
    2525#include <QMenu>
    2626#include <QMutex>
    27 #include <QPainter>
    2827#include <QProcess>
    2928#include <QProgressDialog>
     
    215214    , m_pThreadPool(0)
    216215    , m_pThreadPoolCloud(0)
    217     , m_pIconPool(0)
    218216    , m_pMediumEnumerator(0)
    219217{
     
    257255
    258256    /* Prepare general icon-pool: */
    259     m_pIconPool = new UIIconPoolGeneral;
     257    UIIconPoolGeneral::create();
    260258
    261259    /* Load translation based on the current locale: */
     
    824822    delete m_pThreadPoolCloud;
    825823    m_pThreadPoolCloud = 0;
     824
    826825    /* Cleanup general icon-pool: */
    827     delete m_pIconPool;
    828     m_pIconPool = 0;
     826    UIIconPoolGeneral::destroy();
    829827
    830828    /* Ensure CGuestOSType objects are no longer used: */
     
    27372735}
    27382736
    2739 QIcon UICommon::vmUserIcon(const CMachine &comMachine) const
    2740 {
    2741     /* Prepare fallback icon: */
    2742     static QIcon nullIcon;
    2743 
    2744     /* Make sure general icon-pool initialized: */
    2745     AssertReturn(m_pIconPool, nullIcon);
    2746 
    2747     /* Redirect to general icon-pool: */
    2748     return m_pIconPool->userMachineIcon(comMachine);
    2749 }
    2750 
    2751 QPixmap UICommon::vmUserPixmap(const CMachine &comMachine, const QSize &size) const
    2752 {
    2753     /* Prepare fallback pixmap: */
    2754     static QPixmap nullPixmap;
    2755 
    2756     /* Make sure general icon-pool initialized: */
    2757     AssertReturn(m_pIconPool, nullPixmap);
    2758 
    2759     /* Redirect to general icon-pool: */
    2760     return m_pIconPool->userMachinePixmap(comMachine, size);
    2761 }
    2762 
    2763 QPixmap UICommon::vmUserPixmapDefault(const CMachine &comMachine, QSize *pLogicalSize /* = 0 */) const
    2764 {
    2765     /* Prepare fallback pixmap: */
    2766     static QPixmap nullPixmap;
    2767 
    2768     /* Make sure general icon-pool initialized: */
    2769     AssertReturn(m_pIconPool, nullPixmap);
    2770 
    2771     /* Redirect to general icon-pool: */
    2772     return m_pIconPool->userMachinePixmapDefault(comMachine, pLogicalSize);
    2773 }
    2774 
    2775 QIcon UICommon::vmGuestOSTypeIcon(const QString &strOSTypeID) const
    2776 {
    2777     /* Prepare fallback icon: */
    2778     static QIcon nullIcon;
    2779 
    2780     /* Make sure general icon-pool initialized: */
    2781     AssertReturn(m_pIconPool, nullIcon);
    2782 
    2783     /* Redirect to general icon-pool: */
    2784     return m_pIconPool->guestOSTypeIcon(strOSTypeID);
    2785 }
    2786 
    2787 QPixmap UICommon::vmGuestOSTypePixmap(const QString &strOSTypeID, const QSize &size) const
    2788 {
    2789     /* Prepare fallback pixmap: */
    2790     static QPixmap nullPixmap;
    2791 
    2792     /* Make sure general icon-pool initialized: */
    2793     AssertReturn(m_pIconPool, nullPixmap);
    2794 
    2795     /* Redirect to general icon-pool: */
    2796     return m_pIconPool->guestOSTypePixmap(strOSTypeID, size);
    2797 }
    2798 
    2799 QPixmap UICommon::vmGuestOSTypePixmapDefault(const QString &strOSTypeID, QSize *pLogicalSize /* = 0 */) const
    2800 {
    2801     /* Prepare fallback pixmap: */
    2802     static QPixmap nullPixmap;
    2803 
    2804     /* Make sure general icon-pool initialized: */
    2805     AssertReturn(m_pIconPool, nullPixmap);
    2806 
    2807     /* Redirect to general icon-pool: */
    2808     return m_pIconPool->guestOSTypePixmapDefault(strOSTypeID, pLogicalSize);
    2809 }
    2810 
    2811 /* static */
    2812 QPixmap UICommon::joinPixmaps(const QPixmap &pixmap1, const QPixmap &pixmap2)
    2813 {
    2814     if (pixmap1.isNull())
    2815         return pixmap2;
    2816     if (pixmap2.isNull())
    2817         return pixmap1;
    2818 
    2819     QPixmap result(pixmap1.width() + pixmap2.width() + 2,
    2820                    qMax(pixmap1.height(), pixmap2.height()));
    2821     result.fill(Qt::transparent);
    2822 
    2823     QPainter painter(&result);
    2824     painter.drawPixmap(0, 0, pixmap1);
    2825     painter.drawPixmap(pixmap1.width() + 2, result.height() - pixmap2.height(), pixmap2);
    2826     painter.end();
    2827 
    2828     return result;
    2829 }
    2830 
    28312737/* static */
    28322738void UICommon::setHelpKeyword(QObject *pObject, const QString &strHelpKeyword)
     
    30062912void UICommon::retranslateUi()
    30072913{
    3008     m_pixWarning = UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_MessageBoxWarning).pixmap(16, 16);
    3009     Assert(!m_pixWarning.isNull());
    3010 
    3011     m_pixError = UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_MessageBoxCritical).pixmap(16, 16);
    3012     Assert(!m_pixError.isNull());
    3013 
    30142914    /* Re-enumerate uimedium since they contain some translations too: */
    30152915    if (m_fValid)
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h

    r91122 r91125  
    2323
    2424/* Qt includes: */
    25 #include <QFileIconProvider>
    2625#include <QMap>
    2726#include <QReadWriteLock>
     27#include <QObject>
    2828
    2929/* GUI includes: */
     
    5656class CMachine;
    5757class CUSBDevice;
    58 class UIIconPoolGeneral;
    5958class UIMedium;
    6059class UIMediumEnumerator;
     
    516515        /** Returns the thread-pool instance for cloud needs. */
    517516        UIThreadPool *threadPoolCloud() const { return m_pThreadPoolCloud; }
    518     /** @} */
    519 
    520     /** @name Icon/Pixmap stuff.
    521      * @{ */
    522         /** Returns icon defined for a passed @a comMachine. */
    523         QIcon vmUserIcon(const CMachine &comMachine) const;
    524         /** Returns pixmap of a passed @a size defined for a passed @a comMachine. */
    525         QPixmap vmUserPixmap(const CMachine &comMachine, const QSize &size) const;
    526         /** Returns pixmap defined for a passed @a comMachine.
    527           * In case if non-null @a pLogicalSize pointer provided, it will be updated properly. */
    528         QPixmap vmUserPixmapDefault(const CMachine &comMachine, QSize *pLogicalSize = 0) const;
    529 
    530         /** Returns pixmap corresponding to passed @a strOSTypeID. */
    531         QIcon vmGuestOSTypeIcon(const QString &strOSTypeID) const;
    532         /** Returns pixmap corresponding to passed @a strOSTypeID and @a size. */
    533         QPixmap vmGuestOSTypePixmap(const QString &strOSTypeID, const QSize &size) const;
    534         /** Returns pixmap corresponding to passed @a strOSTypeID.
    535           * In case if non-null @a pLogicalSize pointer provided, it will be updated properly. */
    536         QPixmap vmGuestOSTypePixmapDefault(const QString &strOSTypeID, QSize *pLogicalSize = 0) const;
    537 
    538         /** Returns default icon of certain @a enmType. */
    539         QIcon icon(QFileIconProvider::IconType enmType) { return m_fileIconProvider.icon(enmType); }
    540         /** Returns file icon fetched from passed file @a info. */
    541         QIcon icon(const QFileInfo &info) { return m_fileIconProvider.icon(info); }
    542 
    543         /** Returns cached default warning pixmap. */
    544         QPixmap warningIcon() const { return m_pixWarning; }
    545         /** Returns cached default error pixmap. */
    546         QPixmap errorIcon() const { return m_pixError; }
    547 
    548         /** Joins two pixmaps horizontally with 2px space between them and returns the result. */
    549         static QPixmap joinPixmaps(const QPixmap &pixmap1, const QPixmap &pixmap2);
    550517    /** @} */
    551518
     
    830797    /** @} */
    831798
    832     /** @name Icon/Pixmap stuff.
    833      * @{ */
    834         /** Holds the general icon-pool instance. */
    835         UIIconPoolGeneral *m_pIconPool;
    836 
    837         /** Holds the global file icon provider instance. */
    838         QFileIconProvider  m_fileIconProvider;
    839 
    840         /** Holds the warning pixmap. */
    841         QPixmap  m_pixWarning;
    842         /** Holds the error pixmap. */
    843         QPixmap  m_pixError;
    844     /** @} */
    845 
    846799    /** @name Media related stuff.
    847800     * @{ */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIIconPool.cpp

    r83488 r91125  
    55
    66/*
    7  * Copyright (C) 2010-2020 Oracle Corporation
     7 * Copyright (C) 2010-2021 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1919#include <QApplication>
    2020#include <QFile>
     21#include <QPainter>
    2122#include <QStyle>
    2223#include <QWidget>
     
    236237
    237238/* static */
     239QPixmap UIIconPool::joinPixmaps(const QPixmap &pixmap1, const QPixmap &pixmap2)
     240{
     241    if (pixmap1.isNull())
     242        return pixmap2;
     243    if (pixmap2.isNull())
     244        return pixmap1;
     245
     246    QPixmap result(pixmap1.width() + pixmap2.width() + 2,
     247                   qMax(pixmap1.height(), pixmap2.height()));
     248    result.fill(Qt::transparent);
     249
     250    QPainter painter(&result);
     251    painter.drawPixmap(0, 0, pixmap1);
     252    painter.drawPixmap(pixmap1.width() + 2, result.height() - pixmap2.height(), pixmap2);
     253    painter.end();
     254
     255    return result;
     256}
     257
     258/* static */
    238259void UIIconPool::addName(QIcon &icon, const QString &strName,
    239260                         QIcon::Mode mode /* = QIcon::Normal */, QIcon::State state /* = QIcon::Off */)
     
    270291*********************************************************************************************************************************/
    271292
     293/* static */
     294UIIconPoolGeneral *UIIconPoolGeneral::s_pInstance = 0;
     295
     296/* static */
     297void UIIconPoolGeneral::create()
     298{
     299    AssertReturnVoid(!s_pInstance);
     300    new UIIconPoolGeneral;
     301}
     302
     303/* static */
     304void UIIconPoolGeneral::destroy()
     305{
     306    AssertPtrReturnVoid(s_pInstance);
     307    delete s_pInstance;
     308}
     309
     310/* static */
     311UIIconPoolGeneral *UIIconPoolGeneral::instance()
     312{
     313    return s_pInstance;
     314}
     315
    272316UIIconPoolGeneral::UIIconPoolGeneral()
    273317{
     318    /* Init instance: */
     319    s_pInstance = this;
     320
    274321    /* Prepare OS type icon-name hash: */
    275322    m_guestOSTypeIconNames.insert("Other",           ":/os_other.png");
     
    367414    m_guestOSTypeIconNames.insert("VBoxBS_64",       ":/os_other_64.png");
    368415    m_guestOSTypeIconNames.insert("Cloud",           ":/os_cloud.png");
     416
     417    /* Prepare warning/error icons: */
     418    m_pixWarning = defaultIcon(UIDefaultIconType_MessageBoxWarning).pixmap(16, 16);
     419    Assert(!m_pixWarning.isNull());
     420    m_pixError = defaultIcon(UIDefaultIconType_MessageBoxCritical).pixmap(16, 16);
     421    Assert(!m_pixError.isNull());
     422}
     423
     424UIIconPoolGeneral::~UIIconPoolGeneral()
     425{
     426    /* Deinit instance: */
     427    s_pInstance = 0;
    369428}
    370429
     
    534593    return pixmap;
    535594}
    536 
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIIconPool.h

    r82968 r91125  
    55
    66/*
    7  * Copyright (C) 2010-2020 Oracle Corporation
     7 * Copyright (C) 2010-2021 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2323
    2424/* Qt includes: */
     25#include <QFileIconProvider>
    2526#include <QIcon>
    2627#include <QPixmap>
     
    3233/* Forward declarations: */
    3334class CMachine;
    34 
    3535
    3636/** Interface which provides GUI with static API
     
    8888    static QIcon defaultIcon(UIDefaultIconType defaultIconType, const QWidget *pWidget = 0);
    8989
     90    /** Joins two pixmaps horizontally with 2px space between them and returns the result. */
     91    static QPixmap joinPixmaps(const QPixmap &pixmap1, const QPixmap &pixmap2);
     92
    9093protected:
    9194
     
    106109};
    107110
    108 
    109111/** UIIconPool interface extension used as general GUI icon-pool.
    110112  * Provides GUI with guest OS types pixmap cache. */
     
    113115public:
    114116
    115     /** Constructs general icon-pool. */
    116     UIIconPoolGeneral();
     117    /** Creates singleton instance. */
     118    static void create();
     119    /** Destroys singleton instance. */
     120    static void destroy();
     121    /** Returns singleton instance. */
     122    static UIIconPoolGeneral *instance();
    117123
    118124    /** Returns icon defined for a passed @a comMachine. */
     
    132138    QPixmap guestOSTypePixmapDefault(const QString &strOSTypeID, QSize *pLogicalSize = 0) const;
    133139
     140    /** Returns default system icon of certain @a enmType. */
     141    QIcon defaultSystemIcon(QFileIconProvider::IconType enmType) { return m_fileIconProvider.icon(enmType); }
     142    /** Returns file icon fetched from passed file @a info. */
     143    QIcon defaultFileIcon(const QFileInfo &info) { return m_fileIconProvider.icon(info); }
     144
     145    /** Returns cached default warning pixmap. */
     146    QPixmap warningIcon() const { return m_pixWarning; }
     147    /** Returns cached default error pixmap. */
     148    QPixmap errorIcon() const { return m_pixError; }
     149
    134150private:
    135151
     152    /** Constructs general icon-pool. */
     153    UIIconPoolGeneral();
     154    /** Destructs general icon-pool. */
     155    virtual ~UIIconPoolGeneral() /* override final */;
     156
     157    /** Holds the singleton instance. */
     158    static UIIconPoolGeneral *s_pInstance;
     159
     160    /** Holds the global file icon provider instance. */
     161    QFileIconProvider  m_fileIconProvider;
     162
    136163    /** Guest OS type icon-names cache. */
    137     QHash<QString, QString> m_guestOSTypeIconNames;
     164    QHash<QString, QString>        m_guestOSTypeIconNames;
    138165    /** Guest OS type icons cache. */
    139     mutable QHash<QString, QIcon> m_guestOSTypeIcons;
     166    mutable QHash<QString, QIcon>  m_guestOSTypeIcons;
     167
     168    /** Holds the warning pixmap. */
     169    QPixmap  m_pixWarning;
     170    /** Holds the error pixmap. */
     171    QPixmap  m_pixError;
     172
     173    /** Allows for shortcut access. */
     174    friend UIIconPoolGeneral &generalIconPool();
    140175};
    141176
     177/** Singleton UIIconPoolGeneral 'official' name. */
     178inline UIIconPoolGeneral &generalIconPool() { return *UIIconPoolGeneral::instance(); }
    142179
    143180#endif /* !FEQT_INCLUDED_SRC_globals_UIIconPool_h */
    144 
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemCloud.cpp

    r86922 r91125  
    269269    if (   itemType() == UIVirtualMachineItemType_CloudFake
    270270        && fakeCloudItemState() == UIFakeCloudVirtualMachineItemState_Loading)
    271         m_pixmap = uiCommon().vmGuestOSTypePixmapDefault("Cloud", &m_logicalPixmapSize);
     271        m_pixmap = generalIconPool().guestOSTypePixmapDefault("Cloud", &m_logicalPixmapSize);
    272272    else
    273         m_pixmap = uiCommon().vmGuestOSTypePixmapDefault(m_strOSTypeId, &m_logicalPixmapSize);
     273        m_pixmap = generalIconPool().guestOSTypePixmapDefault(m_strOSTypeId, &m_logicalPixmapSize);
    274274}
    275275
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemLocal.cpp

    r91079 r91125  
    2525#include "UIErrorString.h"
    2626#include "UIExtraDataManager.h"
     27#include "UIIconPool.h"
    2728#include "UIVirtualMachineItemLocal.h"
    2829#ifdef VBOX_WS_MAC
     
    155156    {
    156157        /* First, we are trying to acquire personal machine guest OS type icon: */
    157         m_pixmap = uiCommon().vmUserPixmapDefault(m_comMachine, &m_logicalPixmapSize);
     158        m_pixmap = generalIconPool().userMachinePixmapDefault(m_comMachine, &m_logicalPixmapSize);
    158159        /* If there is nothing, we are using icon corresponding to cached guest OS type: */
    159160        if (m_pixmap.isNull())
    160             m_pixmap = uiCommon().vmGuestOSTypePixmapDefault(m_strOSTypeId, &m_logicalPixmapSize);
     161            m_pixmap = generalIconPool().guestOSTypePixmapDefault(m_strOSTypeId, &m_logicalPixmapSize);
    161162    }
    162163    /* Otherwise: */
     
    164165    {
    165166        /* We are using "Other" guest OS type icon: */
    166         m_pixmap = uiCommon().vmGuestOSTypePixmapDefault("Other", &m_logicalPixmapSize);
     167        m_pixmap = generalIconPool().guestOSTypePixmapDefault("Other", &m_logicalPixmapSize);
    167168    }
    168169}
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.cpp

    r90967 r91125  
    469469
    470470    if (state(fNoDiffs) == KMediumState_Inaccessible)
    471         pixmap = result(fNoDiffs).isOk() ? uiCommon().warningIcon() : uiCommon().errorIcon();
     471        pixmap = result(fNoDiffs).isOk() ? generalIconPool().warningIcon() : generalIconPool().errorIcon();
    472472
    473473    if (fCheckRO && m_fReadOnly)
    474474    {
    475475        QIcon icon = UIIconPool::iconSet(":/hd_create_16px.png");
    476         pixmap = UICommon::joinPixmaps(pixmap, icon.pixmap(icon.availableSizes().value(0, QSize(16, 16))));
     476        pixmap = UIIconPool::joinPixmaps(pixmap, icon.pixmap(icon.availableSizes().value(0, QSize(16, 16))));
    477477    }
    478478
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp

    r90748 r91125  
    3131#include "QIMessageBox.h"
    3232#include "QITabWidget.h"
     33#include "UIActionPoolManager.h"
    3334#include "UICommon.h"
    34 #include "UIActionPoolManager.h"
    3535#include "UIExtraDataManager.h"
     36#include "UIIconPool.h"
    3637#include "UIMediumDetailsWidget.h"
    3738#include "UIMediumItem.h"
     
    11431144
    11441145            if (m_pTabWidget)
    1145                 m_pTabWidget->setTabIcon(tabIndex(mediumType), uiCommon().warningIcon());
     1146                m_pTabWidget->setTabIcon(tabIndex(mediumType), generalIconPool().warningIcon());
    11461147
    11471148            break;
     
    11801181            {
    11811182                if (*pfInaccessible)
    1182                     m_pTabWidget->setTabIcon(tabIndex(mediumType), uiCommon().warningIcon());
     1183                    m_pTabWidget->setTabIcon(tabIndex(mediumType), generalIconPool().warningIcon());
    11831184                else
    11841185                    m_pTabWidget->setTabIcon(tabIndex(mediumType), *pIcon);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r91122 r91125  
    12591259
    12601260    /* Now the dock icon preview: */
    1261     QPixmap pixmap = uiCommon().vmUserPixmap(machine(), QSize(42, 42));
     1261    QPixmap pixmap = generalIconPool().userMachinePixmap(machine(), QSize(42, 42));
    12621262    if (pixmap.isNull())
    1263         pixmap = uiCommon().vmGuestOSTypePixmap(guest().GetOSTypeId(), QSize(42, 42));
     1263        pixmap = generalIconPool().guestOSTypePixmap(guest().GetOSTypeId(), QSize(42, 42));
    12641264    m_pDockIconPreview = new UIDockIconPreview(uisession(), pixmap);
    12651265
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r91104 r91125  
    3636#include "UIDesktopWidgetWatchdog.h"
    3737#include "UIExtraDataManager.h"
     38#include "UIIconPool.h"
    3839#include "UISession.h"
    3940#include "UIMachine.h"
     
    11281129{
    11291130    /* Acquire user machine-window icon: */
    1130     QIcon icon = uiCommon().vmUserIcon(machine());
     1131    QIcon icon = generalIconPool().userMachineIcon(machine());
    11311132    /* Use the OS type icon if user one was not set: */
    11321133    if (icon.isNull())
    1133         icon = uiCommon().vmGuestOSTypeIcon(machine().GetOSTypeId());
     1134        icon = generalIconPool().guestOSTypeIcon(machine().GetOSTypeId());
    11341135    /* Use the default icon if nothing else works: */
    11351136    if (icon.isNull())
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.cpp

    r90094 r91125  
    2525#include "QILineEdit.h"
    2626#include "UICommon.h"
     27#include "UIIconPool.h"
    2728#include "UIFilePathSelector.h"
    2829#include "UINameAndSystemEditor.h"
     
    397398
    398399    /* Update selected type pixmap: */
    399     m_pIconType->setPixmap(uiCommon().vmGuestOSTypePixmapDefault(m_strTypeId));
     400    m_pIconType->setPixmap(generalIconPool().guestOSTypePixmapDefault(m_strTypeId));
    400401
    401402    /* Save the most recently used item: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp

    r90967 r91125  
    1919#include <QCheckBox>
    2020#include <QComboBox>
     21#include <QFileInfo>
    2122#include <QGridLayout>
    2223#include <QLabel>
  • trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotPane.cpp

    r90967 r91125  
    15451545
    15461546        /* Assign corresponding icon: */
    1547         QIcon icon = uiCommon().vmUserIcon(m_comMachine);
     1547        QIcon icon = generalIconPool().userMachineIcon(m_comMachine);
    15481548        if (icon.isNull())
    1549             icon = uiCommon().vmGuestOSTypeIcon(m_comMachine.GetOSTypeId());
     1549            icon = generalIconPool().guestOSTypeIcon(m_comMachine.GetOSTypeId());
    15501550        pDlg->setIcon(icon);
    15511551
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp

    r88447 r91125  
    664664                    case KVirtualSystemDescriptionType_USBController:          value = UIIconPool::iconSet(":/usb_16px.png"); break;
    665665                    case KVirtualSystemDescriptionType_SoundCard:              value = UIIconPool::iconSet(":/sound_16px.png"); break;
    666                     case KVirtualSystemDescriptionType_BaseFolder:             value = uiCommon().icon(QFileIconProvider::Folder); break;
     666                    case KVirtualSystemDescriptionType_BaseFolder:             value = generalIconPool().defaultSystemIcon(QFileIconProvider::Folder); break;
    667667                    case KVirtualSystemDescriptionType_PrimaryGroup:           value = UIIconPool::iconSet(":/vm_group_name_16px.png"); break;
    668668                    case KVirtualSystemDescriptionType_CloudProfileName:
     
    680680            }
    681681            else if (iColumn == ApplianceViewSection_ConfigValue && m_enmVSDType == KVirtualSystemDescriptionType_OS)
    682                 value = uiCommon().vmGuestOSTypeIcon(m_strConfigValue);
     682                value = generalIconPool().guestOSTypeIcon(m_strConfigValue);
    683683            break;
    684684        }
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.cpp

    r88551 r91125  
    439439{
    440440    if (m_enmMode == Mode_Folder)
    441         return uiCommon().icon(QFileIconProvider::Folder);
     441        return generalIconPool().defaultSystemIcon(QFileIconProvider::Folder);
    442442    else
    443         return uiCommon().icon(QFileIconProvider::File);
     443        return generalIconPool().defaultSystemIcon(QFileIconProvider::File);
    444444}
    445445
     
    579579        /* Attach corresponding icon: */
    580580        setItemIcon(PathId, QFileInfo(m_strPath).exists() ?
    581                             uiCommon().icon(QFileInfo(m_strPath)) :
     581                            generalIconPool().defaultFileIcon(QFileInfo(m_strPath)) :
    582582                            defaultIcon());
    583583
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIGuestOSTypeSelectionButton.cpp

    r82968 r91125  
    2424#include "UICommon.h"
    2525#include "UIGuestOSTypeSelectionButton.h"
     26#include "UIIconPool.h"
    2627
    2728
     
    6566#ifndef VBOX_WS_MAC
    6667    /* Looks ugly on the Mac: */
    67     setIcon(uiCommon().vmGuestOSTypePixmapDefault(enmType.GetId()));
     68    setIcon(generalIconPool().guestOSTypePixmapDefault(enmType.GetId()));
    6869#endif
    6970
     
    8788        foreach (const CGuestOSType &comType, uiCommon().vmGuestOSTypeList(strFamilyId))
    8889        {
    89             QAction *pAction = pSubMenu->addAction(uiCommon().vmGuestOSTypePixmapDefault(comType.GetId()),
     90            QAction *pAction = pSubMenu->addAction(generalIconPool().guestOSTypePixmapDefault(comType.GetId()),
    9091                                                   comType.GetDescription());
    9192            connect(pAction, &QAction::triggered,
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic1.cpp

    r87719 r91125  
    2323#include "QIRichTextLabel.h"
    2424#include "UICommon.h"
     25#include "UIIconPool.h"
    2526#include "UIMessageCenter.h"
    2627#include "UIWizardExportApp.h"
     
    5455        if (machine.GetAccessible())
    5556        {
    56             pixIcon = uiCommon().vmUserPixmapDefault(machine);
     57            pixIcon = generalIconPool().userMachinePixmapDefault(machine);
    5758            if (pixIcon.isNull())
    58                 pixIcon = uiCommon().vmGuestOSTypePixmapDefault(machine.GetOSTypeId());
     59                pixIcon = generalIconPool().guestOSTypePixmapDefault(machine.GetOSTypeId());
    5960            strName = machine.GetName();
    6061            uUuid = machine.GetId();
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