- Timestamp:
- Mar 28, 2019 12:30:56 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.cpp
r77228 r77933 51 51 UIVirtualMachineItem *UIChooser::currentItem() const 52 52 { 53 return m_pChooserModel-> currentMachineItem();53 return m_pChooserModel->firstSelectedMachineItem(); 54 54 } 55 55 56 56 QList<UIVirtualMachineItem*> UIChooser::currentItems() const 57 57 { 58 return m_pChooserModel-> currentMachineItems();58 return m_pChooserModel->selectedMachineItems(); 59 59 } 60 60 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.h
r77315 r77933 89 89 /** @} */ 90 90 91 /** @name Current 91 /** @name Current-item stuff. 92 92 * @{ */ 93 /** Returns current 93 /** Returns current-item. */ 94 94 UIVirtualMachineItem *currentItem() const; 95 /** Returns a list of current 95 /** Returns a list of current-items. */ 96 96 QList<UIVirtualMachineItem*> currentItems() const; 97 97 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserHandlerKeyboard.cpp
r77919 r77933 87 87 #endif /* !VBOX_WS_MAC */ 88 88 { 89 /* Determine focusitem position: */90 int iPosition = model()->navigationList().indexOf(model()-> focusItem());89 /* Determine current-item position: */ 90 int iPosition = model()->navigationList().indexOf(model()->currentItem()); 91 91 /* Determine 'previous' item: */ 92 92 UIChooserItem *pPreviousItem = 0; … … 103 103 pPreviousItem->makeSureItsVisible(); 104 104 /* Calculate positions: */ 105 UIChooserItem *pFirstItem = model()-> currentItem();105 UIChooserItem *pFirstItem = model()->firstSelectedItem(); 106 106 int iFirstPosition = model()->navigationList().indexOf(pFirstItem); 107 107 int iPreviousPosition = model()->navigationList().indexOf(pPreviousItem); … … 114 114 for (int i = iFirstPosition; i >= iPreviousPosition; --i) 115 115 items << model()->navigationList().at(i); 116 /* Set that list as current: */117 model()->set CurrentItems(items);118 /* M ove focus to 'previous' item: */119 model()->set FocusItem(pPreviousItem);116 /* Set that list as selected: */ 117 model()->setSelectedItems(items); 118 /* Make 'previous' item current one: */ 119 model()->setCurrentItem(pPreviousItem); 120 120 /* Filter-out this event: */ 121 121 return true; … … 130 130 #endif /* !VBOX_WS_MAC */ 131 131 { 132 /* Determine focusitem position: */133 int iPosition = model()->navigationList().indexOf(model()-> focusItem());132 /* Determine current-item position: */ 133 int iPosition = model()->navigationList().indexOf(model()->currentItem()); 134 134 /* Determine 'previous' item: */ 135 135 UIChooserItem *pPreviousItem = 0; … … 145 145 /* Make sure 'previous' item is visible: */ 146 146 pPreviousItem->makeSureItsVisible(); 147 /* Make 'previous' item the current one: */148 model()->set CurrentItem(pPreviousItem);147 /* Make 'previous' item the only selected: */ 148 model()->setSelectedItem(pPreviousItem); 149 149 /* Filter-out this event: */ 150 150 return true; … … 180 180 #endif /* !VBOX_WS_MAC */ 181 181 { 182 /* Determine focusitem position: */183 int iPosition = model()->navigationList().indexOf(model()-> focusItem());182 /* Determine current-item position: */ 183 int iPosition = model()->navigationList().indexOf(model()->currentItem()); 184 184 /* Determine 'next' item: */ 185 185 UIChooserItem *pNextItem = 0; … … 196 196 pNextItem->makeSureItsVisible(); 197 197 /* Calculate positions: */ 198 UIChooserItem *pFirstItem = model()-> currentItem();198 UIChooserItem *pFirstItem = model()->firstSelectedItem(); 199 199 int iFirstPosition = model()->navigationList().indexOf(pFirstItem); 200 200 int iNextPosition = model()->navigationList().indexOf(pNextItem); … … 207 207 for (int i = iFirstPosition; i >= iNextPosition; --i) 208 208 items << model()->navigationList().at(i); 209 /* Set that list as current: */210 model()->set CurrentItems(items);211 /* M ove focus to 'next' item: */212 model()->set FocusItem(pNextItem);209 /* Set that list as selected: */ 210 model()->setSelectedItems(items); 211 /* Make 'next' item current one: */ 212 model()->setCurrentItem(pNextItem); 213 213 /* Filter-out this event: */ 214 214 return true; … … 223 223 #endif /* !VBOX_WS_MAC */ 224 224 { 225 /* Determine focusitem position: */226 int iPosition = model()->navigationList().indexOf(model()-> focusItem());225 /* Determine current-item position: */ 226 int iPosition = model()->navigationList().indexOf(model()->currentItem()); 227 227 /* Determine 'next' item: */ 228 228 UIChooserItem *pNextItem = 0; … … 238 238 /* Make sure 'next' item is visible: */ 239 239 pNextItem->makeSureItsVisible(); 240 /* Make 'next' item the currentone: */241 model()->set CurrentItem(pNextItem);240 /* Make 'next' item the only selected one: */ 241 model()->setSelectedItem(pNextItem); 242 242 /* Filter-out this event: */ 243 243 return true; … … 251 251 { 252 252 /* If this item is of group type: */ 253 if (model()-> focusItem()->type() == UIChooserItemType_Group)254 { 255 /* Start embedded editing focusitem: */253 if (model()->currentItem()->type() == UIChooserItemType_Group) 254 { 255 /* Start embedded editing of current-item: */ 256 256 model()->startEditingGroupItemName(); 257 257 /* Filter that event out: */ … … 265 265 { 266 266 /* If this item is of group or machine type: */ 267 if ( model()-> focusItem()->type() == UIChooserItemType_Group268 || model()-> focusItem()->type() == UIChooserItemType_Machine)267 if ( model()->currentItem()->type() == UIChooserItemType_Group 268 || model()->currentItem()->type() == UIChooserItemType_Machine) 269 269 { 270 270 /* Activate item: */ … … 278 278 case Qt::Key_Space: 279 279 { 280 /* If there is a focusitem: */281 if (UIChooserItem *p FocusItem = model()->focusItem())280 /* If there is a current-item: */ 281 if (UIChooserItem *pCurrentItem = model()->currentItem()) 282 282 { 283 283 /* Of the group type: */ 284 if (p FocusItem->type() == UIChooserItemType_Group)284 if (pCurrentItem->type() == UIChooserItemType_Group) 285 285 { 286 286 /* Toggle that group: */ 287 UIChooserItemGroup *pGroupItem = p FocusItem->toGroupItem();287 UIChooserItemGroup *pGroupItem = pCurrentItem->toGroupItem(); 288 288 if (pGroupItem->isClosed()) 289 289 pGroupItem->open(); … … 324 324 void UIChooserHandlerKeyboard::shift(UIItemShiftDirection enmDirection, UIItemShiftType enmShiftType) const 325 325 { 326 /* Get focus-node and its parent: */327 UIChooserNode *p FocusNode = model()->focusItem()->node();328 UIChooserNode *pParentNode = p FocusNode->parentNode();329 /* Get focus-node position: */330 const int i FocusNodePosition = pFocusNode->position();326 /* Get current-node and its parent: */ 327 UIChooserNode *pCurrentNode = model()->currentItem()->node(); 328 UIChooserNode *pParentNode = pCurrentNode->parentNode(); 329 /* Get current-node position: */ 330 const int iCurrentNodePosition = pCurrentNode->position(); 331 331 332 332 /* Calculate new position: */ 333 int iNew FocusNodePosition = -1;333 int iNewCurrentNodePosition = -1; 334 334 switch (enmDirection) 335 335 { 336 336 case UIItemShiftDirection_Up: 337 337 { 338 if (i FocusNodePosition > 0)338 if (iCurrentNodePosition > 0) 339 339 switch (enmShiftType) 340 340 { 341 case UIItemShiftSize_Item: iNew FocusNodePosition = iFocusNodePosition - 1; break;342 case UIItemShiftSize_Full: iNew FocusNodePosition = 0; break;341 case UIItemShiftSize_Item: iNewCurrentNodePosition = iCurrentNodePosition - 1; break; 342 case UIItemShiftSize_Full: iNewCurrentNodePosition = 0; break; 343 343 default: break; 344 344 } … … 347 347 case UIItemShiftDirection_Down: 348 348 { 349 if (i FocusNodePosition < pParentNode->nodes(pFocusNode->type()).size() - 1)349 if (iCurrentNodePosition < pParentNode->nodes(pCurrentNode->type()).size() - 1) 350 350 switch (enmShiftType) 351 351 { 352 case UIItemShiftSize_Item: iNew FocusNodePosition = iFocusNodePosition + 2; break;353 case UIItemShiftSize_Full: iNew FocusNodePosition = pParentNode->nodes(pFocusNode->type()).size(); break;352 case UIItemShiftSize_Item: iNewCurrentNodePosition = iCurrentNodePosition + 2; break; 353 case UIItemShiftSize_Full: iNewCurrentNodePosition = pParentNode->nodes(pCurrentNode->type()).size(); break; 354 354 default: break; 355 355 } … … 360 360 } 361 361 /* Filter out invalid requests: */ 362 if (iNew FocusNodePosition == -1)362 if (iNewCurrentNodePosition == -1) 363 363 return; 364 364 365 365 /* Create shifted node/item: */ 366 366 UIChooserItem *pShiftedItem = 0; 367 switch (p FocusNode->type())367 switch (pCurrentNode->type()) 368 368 { 369 369 case UIChooserItemType_Group: 370 370 { 371 UIChooserNodeGroup *pNewNode = new UIChooserNodeGroup(pParentNode, p FocusNode->toGroupNode(), iNewFocusNodePosition);371 UIChooserNodeGroup *pNewNode = new UIChooserNodeGroup(pParentNode, pCurrentNode->toGroupNode(), iNewCurrentNodePosition); 372 372 pShiftedItem = new UIChooserItemGroup(pParentNode->item(), pNewNode); 373 373 break; … … 375 375 case UIChooserItemType_Machine: 376 376 { 377 UIChooserNodeMachine *pNewNode = new UIChooserNodeMachine(pParentNode, p FocusNode->toMachineNode(), iNewFocusNodePosition);377 UIChooserNodeMachine *pNewNode = new UIChooserNodeMachine(pParentNode, pCurrentNode->toMachineNode(), iNewCurrentNodePosition); 378 378 pShiftedItem = new UIChooserItemMachine(pParentNode->item(), pNewNode); 379 379 break; … … 384 384 385 385 /* Delete old node/item: */ 386 delete p FocusNode;386 delete pCurrentNode; 387 387 388 388 /* Update model: */ … … 390 390 model()->updateNavigation(); 391 391 model()->updateLayout(); 392 model()->set CurrentItem(pShiftedItem);392 model()->setSelectedItem(pShiftedItem); 393 393 model()->saveGroupSettings(); 394 394 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserHandlerMouse.cpp
r77430 r77933 73 73 const QPoint itemCursorPos = pGlobalItem->mapFromScene(scenePos).toPoint(); 74 74 if ( pGlobalItem->isToolButtonArea(itemCursorPos) 75 && ( model()-> currentItem() == pGlobalItem75 && ( model()->firstSelectedItem() == pGlobalItem 76 76 || pGlobalItem->isHovered())) 77 77 { 78 78 model()->handleToolButtonClick(pGlobalItem); 79 if (model()-> currentItem() != pGlobalItem)79 if (model()->firstSelectedItem() != pGlobalItem) 80 80 pClickedItem = pGlobalItem; 81 81 } 82 82 else 83 83 if ( pGlobalItem->isPinButtonArea(itemCursorPos) 84 && ( model()-> currentItem() == pGlobalItem84 && ( model()->firstSelectedItem() == pGlobalItem 85 85 || pGlobalItem->isHovered())) 86 86 model()->handlePinButtonClick(pGlobalItem); … … 93 93 const QPoint itemCursorPos = pMachineItem->mapFromScene(scenePos).toPoint(); 94 94 if ( pMachineItem->isToolButtonArea(itemCursorPos) 95 && ( model()-> currentItem() == pMachineItem95 && ( model()->firstSelectedItem() == pMachineItem 96 96 || pMachineItem->isHovered())) 97 97 { 98 98 model()->handleToolButtonClick(pMachineItem); 99 if (model()-> currentItem() != pMachineItem)99 if (model()->firstSelectedItem() != pMachineItem) 100 100 pClickedItem = pMachineItem; 101 101 } … … 110 110 { 111 111 /* Calculate positions: */ 112 UIChooserItem *pFirstItem = model()-> currentItem();112 UIChooserItem *pFirstItem = model()->firstSelectedItem(); 113 113 int iFirstPosition = model()->navigationList().indexOf(pFirstItem); 114 114 int iClickedPosition = model()->navigationList().indexOf(pClickedItem); … … 121 121 for (int i = iFirstPosition; i >= iClickedPosition; --i) 122 122 items << model()->navigationList().at(i); 123 /* Set that list as current: */124 model()->set CurrentItems(items);125 /* M ove focus to clicked item: */126 model()->set FocusItem(pClickedItem);123 /* Make that list selected: */ 124 model()->setSelectedItems(items); 125 /* Make clicked item current one: */ 126 model()->setCurrentItem(pClickedItem); 127 127 } 128 128 /* Was 'control' modifier pressed? */ … … 130 130 { 131 131 /* Invert selection state for clicked item: */ 132 if (model()-> currentItems().contains(pClickedItem))133 model()->removeFrom CurrentItems(pClickedItem);132 if (model()->selectedItems().contains(pClickedItem)) 133 model()->removeFromSelectedItems(pClickedItem); 134 134 else 135 model()->addTo CurrentItems(pClickedItem);136 /* M ove focus to clicked item: */137 model()->set FocusItem(pClickedItem);135 model()->addToSelectedItems(pClickedItem); 136 /* Make clicked item current one: */ 137 model()->setCurrentItem(pClickedItem); 138 138 model()->makeSureSomeItemIsSelected(); 139 139 } … … 141 141 else if (pEvent->modifiers() == Qt::NoModifier) 142 142 { 143 /* Make clicked item the currentone: */144 model()->set CurrentItem(pClickedItem);143 /* Make clicked item the only selected one: */ 144 model()->setSelectedItem(pClickedItem); 145 145 } 146 146 } … … 165 165 { 166 166 /* Select clicked item if not selected yet: */ 167 if (!model()-> currentItems().contains(pClickedItem))168 model()->set CurrentItem(pClickedItem);167 if (!model()->selectedItems().contains(pClickedItem)) 168 model()->setSelectedItem(pClickedItem); 169 169 } 170 170 break; -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItem.cpp
r77829 r77933 186 186 state.selectable = true; 187 187 188 /* Compose the state of currentitem: */189 if (item() && item() == item()->model()-> currentItem())188 /* Compose the state of first selected-item: */ 189 if (item() && item() == item()->model()->firstSelectedItem()) 190 190 { 191 191 state.active = true; -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGlobal.cpp
r77847 r77933 367 367 void UIChooserItemGlobal::cleanup() 368 368 { 369 /* If that item is focused: */370 if (model()-> focusItem() == this)371 { 372 /* Unset the focus: */373 model()->set FocusItem(0);369 /* If that item is current: */ 370 if (model()->currentItem() == this) 371 { 372 /* Unset current-item: */ 373 model()->setCurrentItem(0); 374 374 } 375 375 /* If that item is in selection list: */ 376 if (model()-> currentItems().contains(this))376 if (model()->selectedItems().contains(this)) 377 377 { 378 378 /* Remove item from the selection list: */ 379 model()->removeFrom CurrentItems(this);379 model()->removeFromSelectedItems(this); 380 380 } 381 381 /* If that item is in navigation list: */ … … 556 556 const QPalette pal = palette(); 557 557 558 /* Select ionbackground: */559 if (model()-> currentItems().contains(unconst(this)))558 /* Selected-item background: */ 559 if (model()->selectedItems().contains(unconst(this))) 560 560 { 561 561 /* Prepare color: */ … … 578 578 #endif 579 579 animationColor2.setAlpha(0); 580 /* Draw hover inganimated gradient: */580 /* Draw hovered-item animated gradient: */ 581 581 QRect animatedRect = rectangle; 582 582 animatedRect.setWidth(animatedRect.height()); … … 593 593 } 594 594 } 595 /* Hover ingbackground: */595 /* Hovered-item background: */ 596 596 else if (isHovered()) 597 597 { … … 613 613 #endif 614 614 animationColor2.setAlpha(0); 615 /* Draw hover inganimated gradient: */615 /* Draw hovered-item animated gradient: */ 616 616 QRect animatedRect = rectangle; 617 617 animatedRect.setWidth(animatedRect.height()); … … 652 652 void UIChooserItemGlobal::paintFrame(QPainter *pPainter, const QRect &rectangle) const 653 653 { 654 /* Only chosenand/or hovered item should have a frame: */655 if (!model()-> currentItems().contains(unconst(this)) && !isHovered())654 /* Only selected and/or hovered item should have a frame: */ 655 if (!model()->selectedItems().contains(unconst(this)) && !isHovered()) 656 656 return; 657 657 … … 663 663 QColor strokeColor; 664 664 665 /* Select ionframe: */666 if (model()-> currentItems().contains(unconst(this)))665 /* Selected-item frame: */ 666 if (model()->selectedItems().contains(unconst(this))) 667 667 strokeColor = pal.color(QPalette::Active, QPalette::Highlight).lighter(m_iHighlightLightnessMin - 40); 668 /* Hover ingframe: */668 /* Hovered-item frame: */ 669 669 else if (isHovered()) 670 670 strokeColor = pal.color(QPalette::Active, QPalette::Highlight).lighter(m_iHoverLightnessMin - 50); … … 697 697 const int iButtonMargin = data(GlobalItemData_ButtonMargin).toInt(); 698 698 699 /* Selected 700 if (model()-> currentItems().contains(unconst(this)))699 /* Selected-item foreground: */ 700 if (model()->selectedItems().contains(unconst(this))) 701 701 { 702 702 const QPalette pal = palette(); … … 765 765 766 766 /* Paint right column: */ 767 if ( model()-> currentItem() == this767 if ( model()->firstSelectedItem() == this 768 768 || isHovered()) 769 769 { … … 800 800 801 801 /* Paint right column: */ 802 if ( model()-> currentItem() == this802 if ( model()->firstSelectedItem() == this 803 803 || isHovered()) 804 804 { -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.cpp
r77923 r77933 836 836 pModel->updateNavigation(); 837 837 pModel->updateLayout(); 838 pModel->set CurrentItem(pNewGroupItem);838 pModel->setSelectedItem(pNewGroupItem); 839 839 pModel->saveGroupSettings(); 840 840 break; … … 890 890 pModel->updateNavigation(); 891 891 pModel->updateLayout(); 892 pModel->set CurrentItem(pNewMachineItem);892 pModel->setSelectedItem(pNewMachineItem); 893 893 pModel->saveGroupSettings(); 894 894 break; … … 1204 1204 while (!m_machineItems.isEmpty()) { delete m_machineItems.last(); } 1205 1205 1206 /* If that item is focused: */1207 if (model()-> focusItem() == this)1208 { 1209 /* Unset the focus: */1210 model()->set FocusItem(0);1206 /* If that item is current: */ 1207 if (model()->currentItem() == this) 1208 { 1209 /* Unset current-item: */ 1210 model()->setCurrentItem(0); 1211 1211 } 1212 1212 /* If that item is in selection list: */ 1213 if (model()-> currentItems().contains(this))1213 if (model()->selectedItems().contains(this)) 1214 1214 { 1215 1215 /* Remove item from the selection list: */ 1216 model()->removeFrom CurrentItems(this);1216 model()->removeFromSelectedItems(this); 1217 1217 } 1218 1218 /* If that item is in navigation list: */ … … 1609 1609 const QPalette pal = palette(); 1610 1610 const QColor headerColor = pal.color(QPalette::Active, 1611 model()-> currentItems().contains(this) ?1611 model()->selectedItems().contains(this) ? 1612 1612 QPalette::Highlight : QPalette::Midlight); 1613 1613 … … 1706 1706 const QPalette pal = palette(); 1707 1707 const QColor strokeColor = pal.color(QPalette::Active, 1708 model()-> currentItems().contains(this) ?1708 model()->selectedItems().contains(this) ? 1709 1709 QPalette::Highlight : QPalette::Midlight).darker(headerDarkness() + 10); 1710 1710 … … 1745 1745 /* Configure painter color: */ 1746 1746 pPainter->setPen(palette().color(QPalette::Active, 1747 model()-> currentItems().contains(this) ?1747 model()->selectedItems().contains(this) ? 1748 1748 QPalette::HighlightedText : QPalette::ButtonText)); 1749 1749 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.cpp
r77890 r77933 415 415 UIChooserNode *pNode = pCastedMime->item()->node(); 416 416 417 /* Group passed item with current 417 /* Group passed item with current-item into the new group: */ 418 418 UIChooserNodeGroup *pNewGroupNode = new UIChooserNodeGroup(parentItem()->node(), 419 419 false /* favorite */, … … 444 444 pModel->updateNavigation(); 445 445 pModel->updateLayout(); 446 pModel->set CurrentItem(pNewGroupItem);446 pModel->setSelectedItem(pNewGroupItem); 447 447 pModel->saveGroupSettings(); 448 448 break; … … 531 531 void UIChooserItemMachine::cleanup() 532 532 { 533 /* If that item is focused: */534 if (model()-> focusItem() == this)535 { 536 /* Unset the focus: */537 model()->set FocusItem(0);533 /* If that item is current: */ 534 if (model()->currentItem() == this) 535 { 536 /* Unset current-item: */ 537 model()->setCurrentItem(0); 538 538 } 539 539 /* If that item is in selection list: */ 540 if (model()-> currentItems().contains(this))540 if (model()->selectedItems().contains(this)) 541 541 { 542 542 /* Remove item from the selection list: */ 543 model()->removeFrom CurrentItems(this);543 model()->removeFromSelectedItems(this); 544 544 } 545 545 /* If that item is in navigation list: */ … … 667 667 iFirstRowMaximumWidth -= m_pixmapSize.width(); /* left pixmap width */ 668 668 iFirstRowMaximumWidth -= iMajorSpacing; /* spacing between left pixmap and name(s) */ 669 if ( model()-> currentItem() == this669 if ( model()->firstSelectedItem() == this 670 670 || isHovered()) 671 671 { … … 834 834 const QPalette pal = palette(); 835 835 836 /* Select ionbackground: */837 if (model()-> currentItems().contains(unconst(this)))836 /* Selected-item background: */ 837 if (model()->selectedItems().contains(unconst(this))) 838 838 { 839 839 /* Prepare color: */ … … 856 856 #endif 857 857 animationColor2.setAlpha(0); 858 /* Draw hover inganimated gradient: */858 /* Draw hovered-item animated gradient: */ 859 859 QRect animatedRect = rectangle; 860 860 animatedRect.setWidth(animatedRect.height()); … … 871 871 } 872 872 } 873 /* Hover ingbackground: */873 /* Hovered-item background: */ 874 874 else if (isHovered()) 875 875 { … … 891 891 #endif 892 892 animationColor2.setAlpha(0); 893 /* Draw hover inganimated gradient: */893 /* Draw hovered-item animated gradient: */ 894 894 QRect animatedRect = rectangle; 895 895 animatedRect.setWidth(animatedRect.height()); … … 928 928 if (dragTokenPlace() == UIChooserItemDragToken_Up) 929 929 { 930 /* Select ionbackground: */931 if (model()-> currentItems().contains(unconst(this)))930 /* Selected-item background: */ 931 if (model()->selectedItems().contains(unconst(this))) 932 932 { 933 933 QColor backgroundColor = pal.color(QPalette::Active, QPalette::Highlight); … … 949 949 else if (dragTokenPlace() == UIChooserItemDragToken_Down) 950 950 { 951 /* Select ionbackground: */952 if (model()-> currentItems().contains(unconst(this)))951 /* Selected-item background: */ 952 if (model()->selectedItems().contains(unconst(this))) 953 953 { 954 954 QColor backgroundColor = pal.color(QPalette::Active, QPalette::Highlight); … … 986 986 QColor strokeColor; 987 987 988 /* Select ionframe: */989 if (model()-> currentItems().contains(unconst(this)))988 /* Selected-item frame: */ 989 if (model()->selectedItems().contains(unconst(this))) 990 990 strokeColor = pal.color(QPalette::Active, QPalette::Highlight).lighter(m_iHighlightLightnessMin - 40); 991 /* Hover ingframe: */991 /* Hovered-item frame: */ 992 992 else if (isHovered()) 993 993 strokeColor = pal.color(QPalette::Active, QPalette::Highlight).lighter(m_iHoverLightnessMin - 50); … … 1025 1025 1026 1026 /* Selected or hovered item foreground: */ 1027 if (model()-> currentItems().contains(unconst(this)) || isHovered())1027 if (model()->selectedItems().contains(unconst(this)) || isHovered()) 1028 1028 { 1029 1029 /* Prepare color: */ … … 1163 1163 1164 1164 /* Paint right column: */ 1165 if ( model()-> currentItem() == this1165 if ( model()->firstSelectedItem() == this 1166 1166 || isHovered()) 1167 1167 { -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r77923 r77933 85 85 updateLayout(); 86 86 87 /* Load last selected 87 /* Load last selected-item: */ 88 88 loadLastSelectedItem(); 89 89 } … … 91 91 void UIChooserModel::deinit() 92 92 { 93 /* Save last selected 93 /* Save last selected-item: */ 94 94 saveLastSelectedItem(); 95 95 96 /* Unset currentitems: */97 unsetCurrentItems();96 /* Clear list of selected-items: */ 97 clearSelectedItems(); 98 98 99 99 /* Call to base-class: */ … … 158 158 } 159 159 160 void UIChooserModel::set CurrentItems(const QList<UIChooserItem*> &items)160 void UIChooserModel::setSelectedItems(const QList<UIChooserItem*> &items) 161 161 { 162 162 /* Is there something changed? */ 163 if (m_ currentItems == items)164 return; 165 166 /* Remember old current-item list: */167 const QList<UIChooserItem*> oldCurrentItems = m_ currentItems;168 169 /* Clear current current-item list: */170 m_ currentItems.clear();163 if (m_selectedItems == items) 164 return; 165 166 /* Remember old selected-item list: */ 167 const QList<UIChooserItem*> oldCurrentItems = m_selectedItems; 168 169 /* Clear current selected-item list: */ 170 m_selectedItems.clear(); 171 171 172 172 /* Iterate over all the passed items: */ 173 173 foreach (UIChooserItem *pItem, items) 174 174 { 175 /* Add item to current list if navigation list contains it: */175 /* Add item to current selected-item list if navigation list contains it: */ 176 176 if (pItem && navigationList().contains(pItem)) 177 m_ currentItems << pItem;177 m_selectedItems << pItem; 178 178 else 179 179 AssertMsgFailed(("Passed item is not in navigation list!")); … … 181 181 182 182 /* Is there something really changed? */ 183 if (oldCurrentItems == m_ currentItems)183 if (oldCurrentItems == m_selectedItems) 184 184 return; 185 185 … … 188 188 pItem->update(); 189 189 /* Update all the new items (they are selected now): */ 190 foreach (UIChooserItem *pItem, m_ currentItems)190 foreach (UIChooserItem *pItem, m_selectedItems) 191 191 pItem->update(); 192 192 … … 195 195 } 196 196 197 void UIChooserModel::set CurrentItem(UIChooserItem *pItem)197 void UIChooserModel::setSelectedItem(UIChooserItem *pItem) 198 198 { 199 199 /* Call for wrapper above: */ … … 201 201 if (pItem) 202 202 items << pItem; 203 set CurrentItems(items);204 205 /* M ove focus to current-item: */206 set FocusItem(currentItem());207 } 208 209 void UIChooserModel::set CurrentItem(const QString &strDefinition)203 setSelectedItems(items); 204 205 /* Make selected-item current one as well: */ 206 setCurrentItem(firstSelectedItem()); 207 } 208 209 void UIChooserModel::setSelectedItem(const QString &strDefinition) 210 210 { 211 211 /* Ignore if empty definition passed: */ … … 244 244 245 245 /* Call for wrapper above: */ 246 set CurrentItem(pItem);247 } 248 249 void UIChooserModel:: unsetCurrentItems()246 setSelectedItem(pItem); 247 } 248 249 void UIChooserModel::clearSelectedItems() 250 250 { 251 251 /* Call for wrapper above: */ 252 set CurrentItem(0);253 } 254 255 void UIChooserModel::addTo CurrentItems(UIChooserItem *pItem)252 setSelectedItem(0); 253 } 254 255 void UIChooserModel::addToSelectedItems(UIChooserItem *pItem) 256 256 { 257 257 /* Call for wrapper above: */ 258 set CurrentItems(QList<UIChooserItem*>(m_currentItems) << pItem);259 } 260 261 void UIChooserModel::removeFrom CurrentItems(UIChooserItem *pItem)258 setSelectedItems(QList<UIChooserItem*>(m_selectedItems) << pItem); 259 } 260 261 void UIChooserModel::removeFromSelectedItems(UIChooserItem *pItem) 262 262 { 263 263 /* Prepare filtered list: */ 264 QList<UIChooserItem*> list(m_ currentItems);264 QList<UIChooserItem*> list(m_selectedItems); 265 265 list.removeAll(pItem); 266 266 /* Call for wrapper above: */ 267 set CurrentItems(list);268 } 269 270 UIChooserItem *UIChooserModel:: currentItem() const271 { 272 /* Return first of currentitems, if any: */273 return currentItems().isEmpty() ? 0 : currentItems().first();274 } 275 276 const QList<UIChooserItem*> &UIChooserModel:: currentItems() const277 { 278 return m_ currentItems;279 } 280 281 UIVirtualMachineItem *UIChooserModel:: currentMachineItem() const282 { 283 /* Return first machine-item of the current-item: */284 return currentItem() && currentItem()->firstMachineItem() && currentItem()->firstMachineItem()->node()285 ? currentItem()->firstMachineItem()->node()->toMachineNode()267 setSelectedItems(list); 268 } 269 270 UIChooserItem *UIChooserModel::firstSelectedItem() const 271 { 272 /* Return first of selected-items, if any: */ 273 return selectedItems().isEmpty() ? 0 : selectedItems().first(); 274 } 275 276 const QList<UIChooserItem*> &UIChooserModel::selectedItems() const 277 { 278 return m_selectedItems; 279 } 280 281 UIVirtualMachineItem *UIChooserModel::firstSelectedMachineItem() const 282 { 283 /* Return first machine-item of the selected-item: */ 284 return firstSelectedItem() && firstSelectedItem()->firstMachineItem() && firstSelectedItem()->firstMachineItem()->node() 285 ? firstSelectedItem()->firstMachineItem()->node()->toMachineNode() 286 286 : 0; 287 287 } 288 288 289 QList<UIVirtualMachineItem*> UIChooserModel:: currentMachineItems() const290 { 291 /* Gather list of currentunique machine-items: */289 QList<UIVirtualMachineItem*> UIChooserModel::selectedMachineItems() const 290 { 291 /* Gather list of selected unique machine-items: */ 292 292 QList<UIChooserItemMachine*> currentMachineItemList; 293 UIChooserItemMachine::enumerateMachineItems( currentItems(), currentMachineItemList,293 UIChooserItemMachine::enumerateMachineItems(selectedItems(), currentMachineItemList, 294 294 UIChooserItemMachineEnumerationFlag_Unique); 295 295 … … 303 303 bool UIChooserModel::isGroupItemSelected() const 304 304 { 305 return currentItem() && currentItem()->type() == UIChooserItemType_Group;305 return firstSelectedItem() && firstSelectedItem()->type() == UIChooserItemType_Group; 306 306 } 307 307 308 308 bool UIChooserModel::isGlobalItemSelected() const 309 309 { 310 return currentItem() && currentItem()->type() == UIChooserItemType_Global;310 return firstSelectedItem() && firstSelectedItem()->type() == UIChooserItemType_Global; 311 311 } 312 312 313 313 bool UIChooserModel::isMachineItemSelected() const 314 314 { 315 return currentItem() && currentItem()->type() == UIChooserItemType_Machine;315 return firstSelectedItem() && firstSelectedItem()->type() == UIChooserItemType_Machine; 316 316 } 317 317 318 318 bool UIChooserModel::isSingleGroupSelected() const 319 319 { 320 return currentItems().size() == 1321 && currentItem()->type() == UIChooserItemType_Group;320 return selectedItems().size() == 1 321 && firstSelectedItem()->type() == UIChooserItemType_Group; 322 322 } 323 323 … … 325 325 { 326 326 /* Make sure at least one item selected: */ 327 if ( currentItems().isEmpty())327 if (selectedItems().isEmpty()) 328 328 return false; 329 329 330 330 /* Determine the parent group of the first item: */ 331 UIChooserItem *pFirstParent = currentItem()->parentItem();331 UIChooserItem *pFirstParent = firstSelectedItem()->parentItem(); 332 332 333 333 /* Make sure this parent is not main root-item: */ … … 335 335 return false; 336 336 337 /* Enumerate current-item set: */337 /* Enumerate selected-item set: */ 338 338 QSet<UIChooserItem*> currentItemSet; 339 foreach (UIChooserItem *pCurrentItem, currentItems())339 foreach (UIChooserItem *pCurrentItem, selectedItems()) 340 340 currentItemSet << pCurrentItem; 341 341 … … 351 351 UIChooserItem *UIChooserModel::findClosestUnselectedItem() const 352 352 { 353 /* Take the focusitem (if any) as a starting point354 * and find the closest non-selected 355 UIChooserItem *pItem = focusItem();353 /* Take the current-item (if any) as a starting point 354 * and find the closest non-selected-item. */ 355 UIChooserItem *pItem = currentItem(); 356 356 if (!pItem) 357 pItem = currentItem();357 pItem = firstSelectedItem(); 358 358 if (pItem) 359 359 { … … 365 365 { 366 366 pItem = navigationList().at(idxBefore); 367 if (! currentItems().contains(pItem) && pItem->type() == UIChooserItemType_Machine)367 if (!selectedItems().contains(pItem) && pItem->type() == UIChooserItemType_Machine) 368 368 return pItem; 369 369 --idxBefore; … … 372 372 { 373 373 pItem = navigationList().at(idxAfter); 374 if (! currentItems().contains(pItem) && pItem->type() == UIChooserItemType_Machine)374 if (!selectedItems().contains(pItem) && pItem->type() == UIChooserItemType_Machine) 375 375 return pItem; 376 376 ++idxAfter; … … 384 384 { 385 385 /* Make sure selection list is never empty if at 386 * least one item (for example ' focus') present: */387 if (! currentItem() && focusItem())388 set CurrentItem(focusItem());389 } 390 391 void UIChooserModel::set FocusItem(UIChooserItem *pItem)386 * least one item (for example 'current') present: */ 387 if (!firstSelectedItem() && currentItem()) 388 setSelectedItem(currentItem()); 389 } 390 391 void UIChooserModel::setCurrentItem(UIChooserItem *pItem) 392 392 { 393 393 /* Make sure real focus unset: */ … … 395 395 396 396 /* Is there something changed? */ 397 if (m_p FocusItem == pItem)398 return; 399 400 /* Remember old focus-item: */401 UIChooserItem *pOld FocusItem = m_pFocusItem;402 403 /* Set new focus-item: */404 m_p FocusItem = pItem;405 406 /* Disconnect old focus-item (if any): */407 if (pOld FocusItem)408 disconnect(pOld FocusItem, SIGNAL(destroyed(QObject*)), this, SLOT(sltFocusItemDestroyed()));409 /* Connect new focus-item (if any): */410 if (m_p FocusItem)411 connect(m_p FocusItem, SIGNAL(destroyed(QObject*)), this, SLOT(sltFocusItemDestroyed()));397 if (m_pCurrentItem == pItem) 398 return; 399 400 /* Remember old current-item: */ 401 UIChooserItem *pOldCurrentItem = m_pCurrentItem; 402 403 /* Set new current-item: */ 404 m_pCurrentItem = pItem; 405 406 /* Disconnect old current-item (if any): */ 407 if (pOldCurrentItem) 408 disconnect(pOldCurrentItem, SIGNAL(destroyed(QObject*)), this, SLOT(sltCurrentItemDestroyed())); 409 /* Connect new current-item (if any): */ 410 if (m_pCurrentItem) 411 connect(m_pCurrentItem, SIGNAL(destroyed(QObject*)), this, SLOT(sltCurrentItemDestroyed())); 412 412 413 413 /* If dialog is visible and item exists => make it visible as well: */ … … 417 417 } 418 418 419 UIChooserItem *UIChooserModel:: focusItem() const420 { 421 return m_p FocusItem;419 UIChooserItem *UIChooserModel::currentItem() const 420 { 421 return m_pCurrentItem; 422 422 } 423 423 … … 523 523 { 524 524 pItem->makeSureItsVisible(); 525 set CurrentItem(pItem);525 setSelectedItem(pItem); 526 526 } 527 527 } … … 668 668 updateLayout(); 669 669 670 /* Make sure selected-item present, if possible: */ 671 if (!firstSelectedItem() && !navigationList().isEmpty()) 672 setSelectedItem(navigationList().first()); 670 673 /* Make sure current-item present, if possible: */ 671 if (!currentItem() && !navigationList().isEmpty()) 672 setCurrentItem(navigationList().first()); 673 /* Make sure focus-item present, if possible: */ 674 else if (!focusItem() && currentItem()) 675 setFocusItem(currentItem()); 676 /* Notify about current-item change: */ 674 else if (!currentItem() && firstSelectedItem()) 675 setCurrentItem(firstSelectedItem()); 676 /* Notify about selected-item change: */ 677 677 emit sigSelectionChanged(); 678 678 } … … 688 688 updateLayout(); 689 689 690 /* Choosenewly added item: */690 /* Select newly added item: */ 691 691 CMachine comMachine = vboxGlobal().virtualBox().FindMachine(uId.toString()); 692 set CurrentItem(root()->searchForItem(comMachine.GetName(),692 setSelectedItem(root()->searchForItem(comMachine.GetName(), 693 693 UIChooserItemSearchFlag_Machine | 694 694 UIChooserItemSearchFlag_ExactName)); … … 710 710 updateLayout(); 711 711 712 /* Choosenewly added item: */712 /* Select newly added item: */ 713 713 CMachine comMachine = vboxGlobal().virtualBox().FindMachine(uId.toString()); 714 set CurrentItem(root()->searchForItem(comMachine.GetName(),714 setSelectedItem(root()->searchForItem(comMachine.GetName(), 715 715 UIChooserItemSearchFlag_Machine | 716 716 UIChooserItemSearchFlag_ExactName)); … … 719 719 { 720 720 /* Make sure at least one item selected after that: */ 721 if (! currentItem() && !navigationList().isEmpty())722 set CurrentItem(navigationList().first());721 if (!firstSelectedItem() && !navigationList().isEmpty()) 722 setSelectedItem(navigationList().first()); 723 723 } 724 724 … … 727 727 } 728 728 729 void UIChooserModel::slt FocusItemDestroyed()730 { 731 AssertMsgFailed((" Focusitem destroyed!"));729 void UIChooserModel::sltCurrentItemDestroyed() 730 { 731 AssertMsgFailed(("Current-item destroyed!")); 732 732 } 733 733 … … 742 742 743 743 /* Start editing group name: */ 744 currentItem()->startEditing();744 firstSelectedItem()->startEditing(); 745 745 } 746 746 … … 755 755 756 756 /* Sort nodes: */ 757 currentItem()->node()->sortNodes();757 firstSelectedItem()->node()->sortNodes(); 758 758 759 759 /* Rebuild tree for main root: */ … … 769 769 return; 770 770 771 /* Make sure focusitem is of group type! */772 AssertMsg( focusItem()->type() == UIChooserItemType_Group, ("This is not group-item!"));771 /* Make sure current-item is of group type! */ 772 AssertMsg(currentItem()->type() == UIChooserItemType_Group, ("This is not group-item!")); 773 773 774 774 /* Check if we have collisions with our siblings: */ 775 UIChooserItem *p FocusItem = focusItem();776 UIChooserNode *p FocusNode = pFocusItem->node();777 UIChooserItem *pParentItem = p FocusItem->parentItem();775 UIChooserItem *pCurrentItem = currentItem(); 776 UIChooserNode *pCurrentNode = pCurrentItem->node(); 777 UIChooserItem *pParentItem = pCurrentItem->parentItem(); 778 778 UIChooserNode *pParentNode = pParentItem->node(); 779 779 QList<UIChooserNode*> siblings = pParentNode->nodes(); 780 780 QList<UIChooserNode*> toBeRenamed; 781 781 QList<UIChooserNode*> toBeRemoved; 782 foreach (UIChooserNode *pNode, p FocusNode->nodes())782 foreach (UIChooserNode *pNode, pCurrentNode->nodes()) 783 783 { 784 784 QString strItemName = pNode->name(); 785 785 UIChooserNode *pCollisionSibling = 0; 786 786 foreach (UIChooserNode *pSibling, siblings) 787 if (pSibling != p FocusNode && pSibling->name() == strItemName)787 if (pSibling != pCurrentNode && pSibling->name() == strItemName) 788 788 pCollisionSibling = pSibling; 789 789 if (pCollisionSibling) … … 811 811 /* Copy all the children into our parent: */ 812 812 QList<UIChooserItem*> copiedItems; 813 foreach (UIChooserNode *pNode, p FocusNode->nodes())813 foreach (UIChooserNode *pNode, pCurrentNode->nodes()) 814 814 { 815 815 if (toBeRemoved.contains(pNode)) … … 842 842 } 843 843 844 /* Delete focusgroup: */845 delete p FocusNode;844 /* Delete current group: */ 845 delete pCurrentNode; 846 846 847 847 /* Notify about selection invalidated: */ … … 853 853 if (!copiedItems.isEmpty()) 854 854 { 855 set CurrentItems(copiedItems);856 set FocusItem(currentItem());855 setSelectedItems(copiedItems); 856 setCurrentItem(firstSelectedItem()); 857 857 } 858 858 else 859 set CurrentItem(navigationList().first());859 setSelectedItem(navigationList().first()); 860 860 saveGroupSettings(); 861 861 } … … 867 867 return; 868 868 869 /* Choosethe parent: */869 /* Select the parent: */ 870 870 UIChooserItem *pGroup = 0; 871 871 if (isSingleGroupSelected()) 872 pGroup = currentItem();873 else if (! currentItems().isEmpty())874 pGroup = currentItem()->parentItem();872 pGroup = firstSelectedItem(); 873 else if (!selectedItems().isEmpty()) 874 pGroup = firstSelectedItem()->parentItem(); 875 875 QString strGroupName; 876 876 if (pGroup) … … 913 913 UIChooserItemGroup *pNewGroupItem = new UIChooserItemGroup(root(), pNewGroupNode); 914 914 915 /* Enumerate all the currently chosenitems: */915 /* Enumerate all the currently selected-items: */ 916 916 QStringList busyGroupNames; 917 917 QStringList busyMachineNames; 918 QList<UIChooserItem*> selectedItems = currentItems(); 919 foreach (UIChooserItem *pItem, selectedItems) 918 foreach (UIChooserItem *pItem, selectedItems()) 920 919 { 921 920 /* For each of known types: */ … … 959 958 updateNavigation(); 960 959 updateLayout(); 961 set CurrentItem(pNewGroupItem);960 setSelectedItem(pNewGroupItem); 962 961 saveGroupSettings(); 963 962 } … … 970 969 971 970 /* Only if some item selected: */ 972 if (! currentItem())971 if (!firstSelectedItem()) 973 972 return; 974 973 975 974 /* Sort nodes: */ 976 currentItem()->parentItem()->node()->sortNodes();975 firstSelectedItem()->parentItem()->node()->sortNodes(); 977 976 978 977 /* Rebuild tree for main root: */ … … 990 989 /* Gather list of current unique inaccessible machine-items: */ 991 990 QList<UIChooserItemMachine*> inaccessibleMachineItemList; 992 UIChooserItemMachine::enumerateMachineItems( currentItems(), inaccessibleMachineItemList,991 UIChooserItemMachine::enumerateMachineItems(selectedItems(), inaccessibleMachineItemList, 993 992 UIChooserItemMachineEnumerationFlag_Unique | 994 993 UIChooserItemMachineEnumerationFlag_Inaccessible); … … 1019 1018 { 1020 1019 pSelectedItem->makeSureItsVisible(); 1021 set CurrentItem(pSelectedItem);1020 setSelectedItem(pSelectedItem); 1022 1021 } 1023 1022 } … … 1031 1030 /* Enumerate all the selected machine-items: */ 1032 1031 QList<UIChooserItemMachine*> selectedMachineItemList; 1033 UIChooserItemMachine::enumerateMachineItems( currentItems(), selectedMachineItemList);1032 UIChooserItemMachine::enumerateMachineItems(selectedItems(), selectedMachineItemList); 1034 1033 /* Enumerate all the existing machine-items: */ 1035 1034 QList<UIChooserItemMachine*> existingMachineItemList; … … 1068 1067 /* If selected copy count equal to existing copy count, 1069 1068 * we will propose ro unregister machine fully else 1070 * we will just propose to remove selected 1069 * we will just propose to remove selected-items: */ 1071 1070 bool fVerdict = iSelectedCopyCount == iExistingCopyCount; 1072 1071 verdicts.insert(uId, fVerdict); … … 1298 1297 void UIChooserModel::loadLastSelectedItem() 1299 1298 { 1300 /* Load last selected 1301 set CurrentItem(gEDataManager->selectorWindowLastItemChosen());1302 if (! currentItem() && !navigationList().isEmpty())1303 set CurrentItem(navigationList().first());1299 /* Load last selected-item (choose first if unable to load): */ 1300 setSelectedItem(gEDataManager->selectorWindowLastItemChosen()); 1301 if (!firstSelectedItem() && !navigationList().isEmpty()) 1302 setSelectedItem(navigationList().first()); 1304 1303 } 1305 1304 1306 1305 void UIChooserModel::saveLastSelectedItem() 1307 1306 { 1308 /* Save last selected 1309 gEDataManager->setSelectorWindowLastItemChosen( currentItem() ? currentItem()->definition() : QString());1307 /* Save last selected-item: */ 1308 gEDataManager->setSelectorWindowLastItemChosen(firstSelectedItem() ? firstSelectedItem()->definition() : QString()); 1310 1309 } 1311 1310 … … 1368 1367 return false; 1369 1368 /* Is this group-item only the one selected? */ 1370 if ( currentItems().contains(pGroupItem) && currentItems().size() == 1)1369 if (selectedItems().contains(pGroupItem) && selectedItems().size() == 1) 1371 1370 { 1372 1371 /* Group context menu in that case: */ … … 1390 1389 case QGraphicsSceneContextMenuEvent::Keyboard: 1391 1390 { 1392 /* Get first selected 1393 if (UIChooserItem *pItem = currentItem())1391 /* Get first selected-item: */ 1392 if (UIChooserItem *pItem = firstSelectedItem()) 1394 1393 { 1395 1394 /* If this item of known type? */ … … 1405 1404 { 1406 1405 /* Is this group-item only the one selected? */ 1407 if ( currentItems().size() == 1)1406 if (selectedItems().size() == 1) 1408 1407 { 1409 1408 /* Group context menu in that case: */ … … 1519 1518 updateLayout(); 1520 1519 if (!navigationList().isEmpty()) 1521 set CurrentItem(navigationList().first());1520 setSelectedItem(navigationList().first()); 1522 1521 else 1523 unsetCurrentItems();1522 clearSelectedItems(); 1524 1523 saveGroupSettings(); 1525 1524 } … … 1543 1542 1544 1543 /* Change selection to some close by item: */ 1545 set CurrentItem(findClosestUnselectedItem());1546 1547 /* For every selected 1544 setSelectedItem(findClosestUnselectedItem()); 1545 1546 /* For every selected-item: */ 1548 1547 for (int iMachineIndex = 0; iMachineIndex < machines.size(); ++iMachineIndex) 1549 1548 { -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.h
r77919 r77933 120 120 /** @name Selection stuff. 121 121 * @{ */ 122 /** Sets a list of current@a items. */123 void set CurrentItems(const QList<UIChooserItem*> &items);124 /** Defines current@a pItem. */125 void set CurrentItem(UIChooserItem *pItem);126 /** Defines currentitem by @a definition. */127 void set CurrentItem(const QString &strDefinition);128 /** Unsets all current items. */129 void unsetCurrentItems();130 131 /** Adds @a pItem to list of current. */132 void addTo CurrentItems(UIChooserItem *pItem);133 /** Removes @a pItem from list of current. */134 void removeFrom CurrentItems(UIChooserItem *pItem);135 136 /** Returns currentitem. */137 UIChooserItem * currentItem() const;138 /** Returns a list of currentitems. */139 const QList<UIChooserItem*> & currentItems() const;140 141 /** Returns currentmachine item. */142 UIVirtualMachineItem * currentMachineItem() const;143 /** Returns a list of currentmachine items. */144 QList<UIVirtualMachineItem*> currentMachineItems() const;122 /** Sets a list of selected @a items. */ 123 void setSelectedItems(const QList<UIChooserItem*> &items); 124 /** Defines selected @a pItem. */ 125 void setSelectedItem(UIChooserItem *pItem); 126 /** Defines selected-item by @a definition. */ 127 void setSelectedItem(const QString &strDefinition); 128 /** Clear selected-items list. */ 129 void clearSelectedItems(); 130 131 /** Adds @a pItem to list of selected. */ 132 void addToSelectedItems(UIChooserItem *pItem); 133 /** Removes @a pItem from list of selected. */ 134 void removeFromSelectedItems(UIChooserItem *pItem); 135 136 /** Returns first selected-item. */ 137 UIChooserItem *firstSelectedItem() const; 138 /** Returns a list of selected-items. */ 139 const QList<UIChooserItem*> &selectedItems() const; 140 141 /** Returns first selected machine item. */ 142 UIVirtualMachineItem *firstSelectedMachineItem() const; 143 /** Returns a list of selected machine items. */ 144 QList<UIVirtualMachineItem*> selectedMachineItems() const; 145 145 146 146 /** Returns whether group item is selected. */ … … 156 156 bool isAllItemsOfOneGroupSelected() const; 157 157 158 /** Finds closest non-selected 158 /** Finds closest non-selected-item. */ 159 159 UIChooserItem *findClosestUnselectedItem() const; 160 160 … … 162 162 void makeSureSomeItemIsSelected(); 163 163 164 /** Defines focus@a pItem. */165 void set FocusItem(UIChooserItem *pItem);166 /** Returns focusitem. */167 UIChooserItem * focusItem() const;164 /** Defines current @a pItem. */ 165 void setCurrentItem(UIChooserItem *pItem); 166 /** Returns current-item. */ 167 UIChooserItem *currentItem() const; 168 168 /** @} */ 169 169 … … 252 252 /** @name Selection stuff. 253 253 * @{ */ 254 /** Handles focusitem destruction. */255 void slt FocusItemDestroyed();254 /** Handles current-item destruction. */ 255 void sltCurrentItemDestroyed(); 256 256 /** @} */ 257 257 … … 299 299 /** Prepares connections. */ 300 300 void prepareConnections(); 301 /** Loads last selected 301 /** Loads last selected-items. */ 302 302 void loadLastSelectedItem(); 303 303 304 /** Saves last selected 304 /** Saves last selected-items. */ 305 305 void saveLastSelectedItem(); 306 306 /** Cleanups connections. */ … … 373 373 /** @name Selection stuff. 374 374 * @{ */ 375 /** Holds the focusitem reference. */376 QPointer<UIChooserItem> m_p FocusItem;375 /** Holds the current-item reference. */ 376 QPointer<UIChooserItem> m_pCurrentItem; 377 377 /** @} */ 378 378 … … 392 392 /** Holds the navigation list. */ 393 393 QList<UIChooserItem*> m_navigationList; 394 QList<UIChooserItem*> m_currentItems; 394 /** Holds the selected-items. */ 395 QList<UIChooserItem*> m_selectedItems; 395 396 396 397 /** Holds the current drag object instance. */
Note:
See TracChangeset
for help on using the changeset viewer.