VirtualBox

Changeset 108356 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Feb 24, 2025 4:21:30 PM (8 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167716
Message:

FE/Qt: bugref:10814: VBox Manager / Tools pane: Introducing invisible for now Management tool class which can be used to accumulate various manager tools; Pass it through all the handling places.

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

Legend:

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

    r108273 r108356  
    291291        case UIToolType_Home:
    292292        case UIToolType_Machines:
     293        case UIToolType_Managers:
    293294        case UIToolType_Extensions:
    294295        case UIToolType_Media:
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h

    r108273 r108356  
    943943    UIToolClass_Aux,
    944944    UIToolClass_Global,
    945     UIToolClass_Machine
     945    UIToolClass_Machine,
     946    UIToolClass_Management
    946947};
    947948
     
    956957    UIToolType_Home,
    957958    UIToolType_Machines,
     959    UIToolType_Managers,
    958960    UIToolType_Extensions,
    959961    UIToolType_Media,
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r108266 r108356  
    28732873}
    28742874
    2875 void UIExtraDataManager::toolsPaneLastItemsChosen(UIToolType &enmTypeGlobal, UIToolType &enmTypeMachine)
     2875void UIExtraDataManager::toolsPaneLastItemsChosen(UIToolType &enmTypeGlobal,
     2876                                                  UIToolType &enmTypeMachine,
     2877                                                  UIToolType &enmTypeManagement)
    28762878{
    28772879    /* Parse loaded data: */
     
    28912893    if (!UIToolStuff::isTypeOfClass(enmTypeMachine, UIToolClass_Machine))
    28922894        enmTypeMachine = UIToolType_Details;
    2893 }
    2894 
    2895 void UIExtraDataManager::setToolsPaneLastItemsChosen(UIToolType enmTypeGlobal, UIToolType enmTypeMachine)
     2895    enmTypeManagement = result.value(2);
     2896    if (!UIToolStuff::isTypeOfClass(enmTypeManagement, UIToolClass_Management))
     2897        enmTypeManagement = UIToolType_Extensions;
     2898}
     2899
     2900void UIExtraDataManager::setToolsPaneLastItemsChosen(UIToolType enmTypeGlobal,
     2901                                                     UIToolType enmTypeMachine,
     2902                                                     UIToolType enmTypeManagement)
    28962903{
    28972904    /* Serialize passed values: */
    2898     const QList<UIToolType> currentTypes = QList<UIToolType>() << enmTypeGlobal << enmTypeMachine;
     2905    const QList<UIToolType> currentTypes = QList<UIToolType>()
     2906                                         << enmTypeGlobal
     2907                                         << enmTypeMachine
     2908                                         << enmTypeManagement;
    28992909    QStringList data;
    29002910    foreach (const UIToolType &enmType, currentTypes)
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r108266 r108356  
    400400
    401401        /** Returns last selected tool set of VirtualBox Manager. */
    402         void toolsPaneLastItemsChosen(UIToolType &enmTypeGlobal, UIToolType &enmTypeMachine);
     402        void toolsPaneLastItemsChosen(UIToolType &enmTypeGlobal,
     403                                      UIToolType &enmTypeMachine,
     404                                      UIToolType &enmTypeManagement);
    403405        /** Defines last selected tool @a set of VirtualBox Manager. */
    404         void setToolsPaneLastItemsChosen(UIToolType enmTypeGlobal, UIToolType enmTypeMachine);
     406        void setToolsPaneLastItemsChosen(UIToolType enmTypeGlobal,
     407                                         UIToolType enmTypeMachine,
     408                                         UIToolType enmTypeManagement);
    405409        /** Returns the list of detached tools of VirtualBox Manager. */
    406410        QList<UIToolType> detachedTools();
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIGlobalToolsManagerWidget.cpp

    r108308 r108356  
    117117    toolPane()->openTool(enmType);
    118118
    119     /* Special handling for Machines Global tool,
     119    /* Special handling for Machines global tool,
    120120     * notify Machine tool-pane it's active: */
    121121    if (enmType == UIToolType_Machines)
     
    272272    if (enmClass == UIToolClass_Global)
    273273    {
    274         /* Mark Machine tools [un]suitable depending on Global tool selected: */
     274        /* Mark Machine & Management tools [un]suitable depending on Global tool selected: */
    275275        toolMenu()->setUnsuitableToolClass(UIToolClass_Machine, enmType != UIToolType_Machines);
     276        toolMenu()->setUnsuitableToolClass(UIToolClass_Management, enmType != UIToolType_Managers);
    276277
    277278        /* Switch tool-pane accordingly: */
     
    281282    else if (enmClass == UIToolClass_Machine)
    282283        machineToolManager()->switchToolTo(enmType);
     284    /* For Management tool class => switch tool-pane accordingly: */
     285    else if (enmClass == UIToolClass_Management)
     286        switchToolTo(enmType);
    283287}
    284288
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsItem.cpp

    r108353 r108356  
    575575            fnt.setWeight(QFont::Bold);
    576576
    577             /* Make Machine tool font smaller for widget mode: */
    578             if (!model()->isPopup() && itemClass() == UIToolClass_Machine)
     577            /* Make Machine & Management tool font smaller for widget mode: */
     578            if (   !model()->isPopup()
     579                && (   itemClass() == UIToolClass_Machine
     580                    || itemClass() == UIToolClass_Management))
    579581                fnt.setPointSize(fnt.pointSize() - 1);
    580582
     
    591593void UIToolsItem::updatePixmap()
    592594{
    593     /* Smaller Machine tool icons in widget mode: */
    594     const int iIconMetric = model()->isPopup() || itemClass() != UIToolClass_Machine
    595                           ? QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) * 1.5
    596                           : QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize);
     595    /* Smaller Machine & Management tool icons in widget mode: */
     596    const int iIconMetric =    !model()->isPopup()
     597                            && (   itemClass() == UIToolClass_Machine
     598                                || itemClass() == UIToolClass_Management)
     599                          ? QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize)
     600                          : QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) * 1.5;
    597601
    598602    /* Prepare new pixmap size: */
     
    792796                }
    793797                case UIToolClass_Machine:
     798                case UIToolClass_Management:
    794799                {
    795800                    /* A bit of indentation for Machine tools in widget mode: */
     
    839844#endif /* !VBOX_WS_MAC */
    840845
    841             /* A bit of indentation for Machine tools in widget mode: */
    842             const int iIndent = itemClass() == UIToolClass_Machine
     846            /* A bit of indentation for Machine & Management tools in widget mode: */
     847            const int iIndent = itemClass() == UIToolClass_Machine || itemClass() == UIToolClass_Management
    843848                              ? QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) * .5 : 0;
    844849
     
    966971#endif
    967972
    968         /* A bit of indentation for Machine tools in widget mode: */
    969         if (!model()->isPopup() && itemClass() == UIToolClass_Machine)
     973        /* A bit of indentation for Machine & Management tools in widget mode: */
     974        if (   !model()->isPopup()
     975            && (   itemClass() == UIToolClass_Machine
     976                || itemClass() == UIToolClass_Management))
    970977            iPixmapX += QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) * .5;
    971978
     
    992999#endif
    9931000
    994         /* A bit of indentation for Machine tools in widget mode: */
    995         if (!model()->isPopup() && itemClass() == UIToolClass_Machine)
     1001        /* A bit of indentation for Machine & Management tools in widget mode: */
     1002        if (   !model()->isPopup()
     1003            && (   itemClass() == UIToolClass_Machine
     1004                || itemClass() == UIToolClass_Management))
    9961005            iNameX += QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) * .5;
    9971006
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.cpp

    r108308 r108356  
    207207        /* Is there something changed? */
    208208        if (   !m_mapCurrentItems.value(UIToolClass_Global)
    209             && !m_mapCurrentItems.value(UIToolClass_Machine))
     209            && !m_mapCurrentItems.value(UIToolClass_Machine)
     210            && !m_mapCurrentItems.value(UIToolClass_Management))
    210211            return;
    211212
     
    213214        m_mapCurrentItems[UIToolClass_Global] = 0;
    214215        m_mapCurrentItems[UIToolClass_Machine] = 0;
     216        m_mapCurrentItems[UIToolClass_Management] = 0;
    215217
    216218        /* Notify about selection change: */
     
    379381                        case UIToolClass_Global:
    380382                        case UIToolClass_Machine:
     383                        case UIToolClass_Management:
    381384                        {
    382385                            /* Make clicked item the current one: */
     
    418421        switch (pItem->itemType())
    419422        {
     423            // Aux
    420424            case UIToolType_Toggle:      pItem->setName(tr("Show text")); break;
     425            // Global
    421426            case UIToolType_Home:        pItem->setName(tr("Home")); break;
    422427            case UIToolType_Machines:    pItem->setName(tr("Machines")); break;
     428            case UIToolType_Managers:    pItem->setName(tr("Management")); break;
    423429            case UIToolType_Extensions:  pItem->setName(tr("Extensions")); break;
    424430            case UIToolType_Media:       pItem->setName(tr("Media")); break;
     
    426432            case UIToolType_Cloud:       pItem->setName(tr("Cloud")); break;
    427433            case UIToolType_Activities:  pItem->setName(tr("Activities")); break;
     434            // Machine
    428435            case UIToolType_Details:     pItem->setName(tr("Details")); break;
    429436            case UIToolType_Snapshots:   pItem->setName(tr("Snapshots")); break;
     
    463470                                                                ":/welcome_screen_24px.png"),
    464471                                   UIToolClass_Global, UIToolType_Home);
    465 
     472    }
     473
     474    if (   m_enmClass == UIToolClass_Global
     475        || m_enmClass == UIToolClass_Invalid)
     476    {
    466477        /* Machines: */
    467478        m_items << new UIToolsItem(scene(), UIIconPool::iconSet(":/machine_details_manager_24px.png",
     
    499510    }
    500511
     512    if (   m_enmClass == UIToolClass_Management
     513        || m_enmClass == UIToolClass_Invalid)
     514    {
     515        /* Management: */
     516        m_items << new UIToolsItem(scene(), UIIconPool::iconSet(":/extension_pack_manager_24px.png",
     517                                                                ":/extension_pack_manager_disabled_24px.png"),
     518                                   UIToolClass_Global, UIToolType_Managers);
     519    }
     520
    501521    if (   m_enmClass == UIToolClass_Global
    502522        || m_enmClass == UIToolClass_Invalid)
     
    526546                                                                ":/resources_monitor_disabled_24px.png"),
    527547                                   UIToolClass_Global, UIToolType_Activities);
    528 
     548    }
     549
     550    if (   m_enmClass == UIToolClass_Global
     551        || m_enmClass == UIToolClass_Invalid)
     552    {
    529553        /* Toggle: */
    530554        m_items << new UIToolsItem(scene(), UIIconPool::iconSet(":/tools_menu_24px.png",
     
    548572{
    549573    /* Load last tool types: */
    550     UIToolType enmTypeGlobal, enmTypeMachine;
    551     gEDataManager->toolsPaneLastItemsChosen(enmTypeGlobal, enmTypeMachine);
    552     LogRel2(("GUI: UIToolsModel: Restoring tool items as: Global=%d, Machine=%d\n",
    553              (int)enmTypeGlobal, (int)enmTypeMachine));
     574    UIToolType enmTypeGlobal, enmTypeMachine, enmTypeManagment;
     575    gEDataManager->toolsPaneLastItemsChosen(enmTypeGlobal, enmTypeMachine, enmTypeManagment);
     576    LogRel2(("GUI: UIToolsModel: Restoring tool items as: Global=%d, Machine=%d, Management=%d\n",
     577             (int)enmTypeGlobal, (int)enmTypeMachine, (int)enmTypeManagment));
    554578
    555579    /* Assign values depending on model class: */
     
    570594        setCurrentItem(pItem);
    571595    }
     596    if (   m_enmClass == UIToolClass_Management
     597        || m_enmClass == UIToolClass_Invalid)
     598    {
     599        UIToolsItem *pItem = item(enmTypeManagment);
     600        if (!pItem)
     601            pItem = item(UIToolType_Extensions);
     602        setCurrentItem(pItem);
     603    }
    572604}
    573605
     
    575607{
    576608    /* Load last tool types: */
    577     UIToolType enmTypeGlobal, enmTypeMachine;
    578     gEDataManager->toolsPaneLastItemsChosen(enmTypeGlobal, enmTypeMachine);
     609    UIToolType enmTypeGlobal, enmTypeMachine, enmTypeManagment;
     610    gEDataManager->toolsPaneLastItemsChosen(enmTypeGlobal, enmTypeMachine, enmTypeManagment);
    579611
    580612    /* Update values depending on model class: */
     
    591623            enmTypeMachine = pItem->itemType();
    592624    }
     625    if (   m_enmClass == UIToolClass_Management
     626        || m_enmClass == UIToolClass_Invalid)
     627    {
     628        if (UIToolsItem *pItem = currentItem(UIToolClass_Management))
     629            enmTypeMachine = pItem->itemType();
     630    }
    593631
    594632    /* Save selected items data: */
    595     LogRel2(("GUI: UIToolsModel: Saving tool items as: Global=%d, Machine=%d\n",
    596              (int)enmTypeGlobal, (int)enmTypeMachine));
    597     gEDataManager->setToolsPaneLastItemsChosen(enmTypeGlobal, enmTypeMachine);
     633    LogRel2(("GUI: UIToolsModel: Saving tool items as: Global=%d, Machine=%d, Management=%d\n",
     634             (int)enmTypeGlobal, (int)enmTypeMachine, (int)enmTypeManagment));
     635    gEDataManager->setToolsPaneLastItemsChosen(enmTypeGlobal, enmTypeMachine, enmTypeManagment);
    598636}
    599637
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette