VirtualBox

Changeset 75096 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 26, 2018 1:38:08 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9241: VirtualBox Manager: Tools pane: A small cleanup for tool item creation.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsItem.cpp

    r75070 r75096  
    181181UIToolsItem::UIToolsItem(QGraphicsScene *pScene,
    182182                         UIToolClass enmClass, UIToolType enmType,
    183                          const QIcon &icon, const QString &strName)
     183                         const QString &strName, const QIcon &icon)
    184184    : m_pScene(pScene)
    185185    , m_enmClass(enmClass)
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsItem.h

    r75070 r75096  
    7575    /** Constructs item on the basis of passed arguments.
    7676      * @param  pScene   Brings the scene reference to add item to.
    77       * @param  icon     Brings the item icon.
    78       * @param  strName  Brings the item name. */
     77      * @param  enmClass Brings the item class.
     78      * @param  enmType  Brings the item type.
     79      * @param  strName  Brings the item name.
     80      * @param  icon     Brings the item icon. */
    7981    UIToolsItem(QGraphicsScene *pScene,
    8082                UIToolClass enmClass, UIToolType enmType,
    81                 const QIcon &icon, const QString &strName);
     83                const QString &strName, const QIcon &icon);
    8284    /** Destructs item. */
    8385    virtual ~UIToolsItem() /* override */;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.cpp

    r75081 r75096  
    447447void UIToolsModel::prepareItems()
    448448{
    449     /* Enable all classes of tools initially: */
     449    /* Enable both classes of tools initially: */
    450450    m_statesToolsEnabled[UIToolClass_Global] = true;
    451451    m_statesToolsEnabled[UIToolClass_Machine] = true;
    452452
    453     /* Prepare classes: */
    454     QList<UIToolClass> classes;
    455     classes << UIToolClass_Global;
    456     classes << UIToolClass_Global;
    457     classes << UIToolClass_Global;
    458     classes << UIToolClass_Global;
    459     classes << UIToolClass_Machine;
    460     classes << UIToolClass_Machine;
    461     classes << UIToolClass_Machine;
    462 
    463     /* Prepare types: */
    464     QList<UIToolType> types;
    465     types << UIToolType_Welcome;
    466     types << UIToolType_Media;
    467     types << UIToolType_Network;
    468     types << UIToolType_Cloud;
    469     types << UIToolType_Details;
    470     types << UIToolType_Snapshots;
    471     types << UIToolType_Logs;
    472 
    473     /* Prepare icons: */
    474     QList<QIcon> icons;
    475     icons << UIIconPool::iconSet(":/welcome_screen_24px.png",          ":/welcome_screen_24px.png"); /// @todo fix icon!
    476     icons << UIIconPool::iconSet(":/media_manager_24px.png",           ":/media_manager_disabled_24px.png");
    477     icons << UIIconPool::iconSet(":/host_iface_manager_24px.png",      ":/host_iface_manager_disabled_24px.png");
    478     icons << UIIconPool::iconSet(":/cloud_profile_manager_24px.png",   ":/cloud_profile_manager_disabled_24px.png");
    479     icons << UIIconPool::iconSet(":/machine_details_manager_24px.png", ":/machine_details_manager_disabled_24px.png");
    480     icons << UIIconPool::iconSet(":/snapshot_manager_24px.png",        ":/snapshot_manager_disabled_24px.png");
    481     icons << UIIconPool::iconSet(":/vm_show_logs_24px.png",            ":/vm_show_logs_disabled_24px.png");
    482 
    483     /* Prepare names: */
    484     QList<QString> names;
    485     names << tr("Welcome");
    486     names << tr("Media");
    487     names << tr("Network");
    488     names << tr("Cloud");
    489     names << tr("Details");
    490     names << tr("Snapshots");
    491     names << tr("Logs");
    492 
    493     /* Populate the items: */
    494     for (int i = 0; i < names.size(); ++i)
    495         m_items << new UIToolsItem(scene(),
    496                                    classes.value(i),
    497                                    types.value(i),
    498                                    icons.value(i),
    499                                    names.value(i));
     453    /* Welcome: */
     454    m_items << new UIToolsItem(scene(), UIToolClass_Global, UIToolType_Welcome, tr("Welcome"),
     455                               UIIconPool::iconSet(":/welcome_screen_24px.png", ":/welcome_screen_24px.png")); /// @todo fix icon!
     456
     457    /* Media: */
     458    m_items << new UIToolsItem(scene(), UIToolClass_Global, UIToolType_Media, tr("Media"),
     459                               UIIconPool::iconSet(":/media_manager_24px.png", ":/media_manager_disabled_24px.png"));
     460
     461    /* Network: */
     462    m_items << new UIToolsItem(scene(), UIToolClass_Global, UIToolType_Network, tr("Network"),
     463                               UIIconPool::iconSet(":/host_iface_manager_24px.png", ":/host_iface_manager_disabled_24px.png"));
     464
     465    /* Cloud: */
     466    m_items << new UIToolsItem(scene(), UIToolClass_Global, UIToolType_Cloud, tr("Cloud"),
     467                               UIIconPool::iconSet(":/cloud_profile_manager_24px.png", ":/cloud_profile_manager_disabled_24px.png"));
     468
     469    /* Details: */
     470    m_items << new UIToolsItem(scene(), UIToolClass_Machine, UIToolType_Details, tr("Details"),
     471                               UIIconPool::iconSet(":/machine_details_manager_24px.png", ":/machine_details_manager_disabled_24px.png"));
     472
     473    /* Snapshots: */
     474    m_items << new UIToolsItem(scene(), UIToolClass_Machine, UIToolType_Snapshots, tr("Snapshots"),
     475                               UIIconPool::iconSet(":/snapshot_manager_24px.png",        ":/snapshot_manager_disabled_24px.png"));
     476
     477    /* Logs: */
     478    m_items << new UIToolsItem(scene(), UIToolClass_Machine, UIToolType_Logs, tr("Logs"),
     479                               UIIconPool::iconSet(":/vm_show_logs_24px.png", ":/vm_show_logs_disabled_24px.png"));
    500480}
    501481
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