Changeset 43553 in vbox
- Timestamp:
- Oct 5, 2012 11:02:18 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserHandlerKeyboard.cpp
r43539 r43553 113 113 /* Make sure 'previous' item is visible: */ 114 114 pPreviousItem->makeSureItsVisible(); 115 /* Move focus to 'previous' item: */116 model()->setFocusItem(pPreviousItem);117 115 /* Calculate positions: */ 118 116 UIGChooserItem *pFirstItem = model()->currentItem(); 119 117 int iFirstPosition = model()->navigationList().indexOf(pFirstItem); 120 118 int iPreviousPosition = model()->navigationList().indexOf(pPreviousItem); 121 /* Clear selection: */ 122 model()->clearSelectionList(); 123 /* Select all the items from 'first' to 'previous': */ 119 /* Populate list of items from 'first' to 'previous': */ 120 QList<UIGChooserItem*> items; 124 121 if (iFirstPosition <= iPreviousPosition) 125 122 for (int i = iFirstPosition; i <= iPreviousPosition; ++i) 126 model()->addToCurrentItems(model()->navigationList().at(i));123 items << model()->navigationList().at(i); 127 124 else 128 125 for (int i = iFirstPosition; i >= iPreviousPosition; --i) 129 model()->addToCurrentItems(model()->navigationList().at(i)); 130 /* Notify selection changed: */ 131 model()->notifyCurrentItemChanged(); 126 items << model()->navigationList().at(i); 127 /* Set that list as current: */ 128 model()->setCurrentItems(items); 129 /* Move focus to 'previous' item: */ 130 model()->setFocusItem(pPreviousItem); 132 131 /* Filter-out this event: */ 133 132 return true; … … 156 155 /* Make sure 'previous' item is visible: */ 157 156 pPreviousItem->makeSureItsVisible(); 158 /* Move focus to 'previous' item: */ 159 model()->setFocusItem(pPreviousItem); 160 /* Move selection to 'previous' item: */ 161 model()->clearSelectionList(); 162 model()->addToCurrentItems(pPreviousItem); 163 /* Notify selection changed: */ 164 model()->notifyCurrentItemChanged(); 157 /* Make 'previous' item the current one: */ 158 model()->setCurrentItem(pPreviousItem); 165 159 /* Filter-out this event: */ 166 160 return true; … … 229 223 /* Make sure 'next' item is visible: */ 230 224 pNextItem->makeSureItsVisible(); 231 /* Move focus to 'next' item: */232 model()->setFocusItem(pNextItem);233 225 /* Calculate positions: */ 234 226 UIGChooserItem *pFirstItem = model()->currentItem(); 235 227 int iFirstPosition = model()->navigationList().indexOf(pFirstItem); 236 228 int iNextPosition = model()->navigationList().indexOf(pNextItem); 237 /* Clear selection: */ 238 model()->clearSelectionList(); 239 /* Select all the items from 'first' to 'next': */ 229 /* Populate list of items from 'first' to 'next': */ 230 QList<UIGChooserItem*> items; 240 231 if (iFirstPosition <= iNextPosition) 241 232 for (int i = iFirstPosition; i <= iNextPosition; ++i) 242 model()->addToCurrentItems(model()->navigationList().at(i));233 items << model()->navigationList().at(i); 243 234 else 244 235 for (int i = iFirstPosition; i >= iNextPosition; --i) 245 model()->addToCurrentItems(model()->navigationList().at(i)); 246 /* Notify selection changed: */ 247 model()->notifyCurrentItemChanged(); 236 items << model()->navigationList().at(i); 237 /* Set that list as current: */ 238 model()->setCurrentItems(items); 239 /* Move focus to 'next' item: */ 240 model()->setFocusItem(pNextItem); 248 241 /* Filter-out this event: */ 249 242 return true; … … 272 265 /* Make sure 'next' item is visible: */ 273 266 pNextItem->makeSureItsVisible(); 274 /* Move focus to 'next' item: */ 275 model()->setFocusItem(pNextItem); 276 /* Move selection to 'next' item: */ 277 model()->clearSelectionList(); 278 model()->addToCurrentItems(pNextItem); 279 /* Notify selection changed: */ 280 model()->notifyCurrentItemChanged(); 267 /* Make 'next' item the current one: */ 268 model()->setCurrentItem(pNextItem); 281 269 /* Filter-out this event: */ 282 270 return true;
Note:
See TracChangeset
for help on using the changeset viewer.