Changeset 108356 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Feb 24, 2025 4:21:30 PM (8 weeks ago)
- svn:sync-xref-src-repo-rev:
- 167716
- 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 291 291 case UIToolType_Home: 292 292 case UIToolType_Machines: 293 case UIToolType_Managers: 293 294 case UIToolType_Extensions: 294 295 case UIToolType_Media: -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r108273 r108356 943 943 UIToolClass_Aux, 944 944 UIToolClass_Global, 945 UIToolClass_Machine 945 UIToolClass_Machine, 946 UIToolClass_Management 946 947 }; 947 948 … … 956 957 UIToolType_Home, 957 958 UIToolType_Machines, 959 UIToolType_Managers, 958 960 UIToolType_Extensions, 959 961 UIToolType_Media, -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r108266 r108356 2873 2873 } 2874 2874 2875 void UIExtraDataManager::toolsPaneLastItemsChosen(UIToolType &enmTypeGlobal, UIToolType &enmTypeMachine) 2875 void UIExtraDataManager::toolsPaneLastItemsChosen(UIToolType &enmTypeGlobal, 2876 UIToolType &enmTypeMachine, 2877 UIToolType &enmTypeManagement) 2876 2878 { 2877 2879 /* Parse loaded data: */ … … 2891 2893 if (!UIToolStuff::isTypeOfClass(enmTypeMachine, UIToolClass_Machine)) 2892 2894 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 2900 void UIExtraDataManager::setToolsPaneLastItemsChosen(UIToolType enmTypeGlobal, 2901 UIToolType enmTypeMachine, 2902 UIToolType enmTypeManagement) 2896 2903 { 2897 2904 /* 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; 2899 2909 QStringList data; 2900 2910 foreach (const UIToolType &enmType, currentTypes) -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r108266 r108356 400 400 401 401 /** 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); 403 405 /** 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); 405 409 /** Returns the list of detached tools of VirtualBox Manager. */ 406 410 QList<UIToolType> detachedTools(); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIGlobalToolsManagerWidget.cpp
r108308 r108356 117 117 toolPane()->openTool(enmType); 118 118 119 /* Special handling for Machines Global tool,119 /* Special handling for Machines global tool, 120 120 * notify Machine tool-pane it's active: */ 121 121 if (enmType == UIToolType_Machines) … … 272 272 if (enmClass == UIToolClass_Global) 273 273 { 274 /* Mark Machine tools [un]suitable depending on Global tool selected: */274 /* Mark Machine & Management tools [un]suitable depending on Global tool selected: */ 275 275 toolMenu()->setUnsuitableToolClass(UIToolClass_Machine, enmType != UIToolType_Machines); 276 toolMenu()->setUnsuitableToolClass(UIToolClass_Management, enmType != UIToolType_Managers); 276 277 277 278 /* Switch tool-pane accordingly: */ … … 281 282 else if (enmClass == UIToolClass_Machine) 282 283 machineToolManager()->switchToolTo(enmType); 284 /* For Management tool class => switch tool-pane accordingly: */ 285 else if (enmClass == UIToolClass_Management) 286 switchToolTo(enmType); 283 287 } 284 288 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsItem.cpp
r108353 r108356 575 575 fnt.setWeight(QFont::Bold); 576 576 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)) 579 581 fnt.setPointSize(fnt.pointSize() - 1); 580 582 … … 591 593 void UIToolsItem::updatePixmap() 592 594 { 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; 597 601 598 602 /* Prepare new pixmap size: */ … … 792 796 } 793 797 case UIToolClass_Machine: 798 case UIToolClass_Management: 794 799 { 795 800 /* A bit of indentation for Machine tools in widget mode: */ … … 839 844 #endif /* !VBOX_WS_MAC */ 840 845 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 843 848 ? QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) * .5 : 0; 844 849 … … 966 971 #endif 967 972 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)) 970 977 iPixmapX += QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) * .5; 971 978 … … 992 999 #endif 993 1000 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)) 996 1005 iNameX += QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) * .5; 997 1006 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.cpp
r108308 r108356 207 207 /* Is there something changed? */ 208 208 if ( !m_mapCurrentItems.value(UIToolClass_Global) 209 && !m_mapCurrentItems.value(UIToolClass_Machine)) 209 && !m_mapCurrentItems.value(UIToolClass_Machine) 210 && !m_mapCurrentItems.value(UIToolClass_Management)) 210 211 return; 211 212 … … 213 214 m_mapCurrentItems[UIToolClass_Global] = 0; 214 215 m_mapCurrentItems[UIToolClass_Machine] = 0; 216 m_mapCurrentItems[UIToolClass_Management] = 0; 215 217 216 218 /* Notify about selection change: */ … … 379 381 case UIToolClass_Global: 380 382 case UIToolClass_Machine: 383 case UIToolClass_Management: 381 384 { 382 385 /* Make clicked item the current one: */ … … 418 421 switch (pItem->itemType()) 419 422 { 423 // Aux 420 424 case UIToolType_Toggle: pItem->setName(tr("Show text")); break; 425 // Global 421 426 case UIToolType_Home: pItem->setName(tr("Home")); break; 422 427 case UIToolType_Machines: pItem->setName(tr("Machines")); break; 428 case UIToolType_Managers: pItem->setName(tr("Management")); break; 423 429 case UIToolType_Extensions: pItem->setName(tr("Extensions")); break; 424 430 case UIToolType_Media: pItem->setName(tr("Media")); break; … … 426 432 case UIToolType_Cloud: pItem->setName(tr("Cloud")); break; 427 433 case UIToolType_Activities: pItem->setName(tr("Activities")); break; 434 // Machine 428 435 case UIToolType_Details: pItem->setName(tr("Details")); break; 429 436 case UIToolType_Snapshots: pItem->setName(tr("Snapshots")); break; … … 463 470 ":/welcome_screen_24px.png"), 464 471 UIToolClass_Global, UIToolType_Home); 465 472 } 473 474 if ( m_enmClass == UIToolClass_Global 475 || m_enmClass == UIToolClass_Invalid) 476 { 466 477 /* Machines: */ 467 478 m_items << new UIToolsItem(scene(), UIIconPool::iconSet(":/machine_details_manager_24px.png", … … 499 510 } 500 511 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 501 521 if ( m_enmClass == UIToolClass_Global 502 522 || m_enmClass == UIToolClass_Invalid) … … 526 546 ":/resources_monitor_disabled_24px.png"), 527 547 UIToolClass_Global, UIToolType_Activities); 528 548 } 549 550 if ( m_enmClass == UIToolClass_Global 551 || m_enmClass == UIToolClass_Invalid) 552 { 529 553 /* Toggle: */ 530 554 m_items << new UIToolsItem(scene(), UIIconPool::iconSet(":/tools_menu_24px.png", … … 548 572 { 549 573 /* 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)); 554 578 555 579 /* Assign values depending on model class: */ … … 570 594 setCurrentItem(pItem); 571 595 } 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 } 572 604 } 573 605 … … 575 607 { 576 608 /* Load last tool types: */ 577 UIToolType enmTypeGlobal, enmTypeMachine ;578 gEDataManager->toolsPaneLastItemsChosen(enmTypeGlobal, enmTypeMachine );609 UIToolType enmTypeGlobal, enmTypeMachine, enmTypeManagment; 610 gEDataManager->toolsPaneLastItemsChosen(enmTypeGlobal, enmTypeMachine, enmTypeManagment); 579 611 580 612 /* Update values depending on model class: */ … … 591 623 enmTypeMachine = pItem->itemType(); 592 624 } 625 if ( m_enmClass == UIToolClass_Management 626 || m_enmClass == UIToolClass_Invalid) 627 { 628 if (UIToolsItem *pItem = currentItem(UIToolClass_Management)) 629 enmTypeMachine = pItem->itemType(); 630 } 593 631 594 632 /* 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); 598 636 } 599 637
Note:
See TracChangeset
for help on using the changeset viewer.