Changeset 50700 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Mar 5, 2014 11:51:38 AM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/medium
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp
r50697 r50700 323 323 324 324 /* Reset tab-widget icons: */ 325 mTabWidget->setTabIcon( HDTab, m_iconHD);326 mTabWidget->setTabIcon( CDTab, m_iconCD);327 mTabWidget->setTabIcon( FDTab, m_iconFD);325 mTabWidget->setTabIcon(TabIndex_HD, m_iconHD); 326 mTabWidget->setTabIcon(TabIndex_CD, m_iconCD); 327 mTabWidget->setTabIcon(TabIndex_FD, m_iconFD); 328 328 329 329 /* Repopulate tree-widgets content: */ … … 841 841 /* Configure tab-widget: */ 842 842 mTabWidget->setFocusPolicy(Qt::TabFocus); 843 mTabWidget->setTabIcon( HDTab, m_iconHD);844 mTabWidget->setTabIcon( CDTab, m_iconCD);845 mTabWidget->setTabIcon( FDTab, m_iconFD);843 mTabWidget->setTabIcon(TabIndex_HD, m_iconHD); 844 mTabWidget->setTabIcon(TabIndex_CD, m_iconCD); 845 mTabWidget->setTabIcon(TabIndex_FD, m_iconFD); 846 846 connect(mTabWidget, SIGNAL(currentChanged(int)), this, SLOT(sltHandleCurrentTabChanged())); 847 847 } … … 1067 1067 } 1068 1068 1069 void UIMediumManager::updateTabIcons(UIMediumItem *pMediumItem, ItemAction action)1069 void UIMediumManager::updateTabIcons(UIMediumItem *pMediumItem, Action action) 1070 1070 { 1071 1071 /* Make sure medium-item is valid: */ … … 1079 1079 { 1080 1080 case UIMediumType_HardDisk: 1081 iTab = HDTab;1081 iTab = TabIndex_HD; 1082 1082 pIcon = &m_iconHD; 1083 1083 pfInaccessible = &m_fInaccessibleHD; 1084 1084 break; 1085 1085 case UIMediumType_DVD: 1086 iTab = CDTab;1086 iTab = TabIndex_CD; 1087 1087 pIcon = &m_iconCD; 1088 1088 pfInaccessible = &m_fInaccessibleCD; 1089 1089 break; 1090 1090 case UIMediumType_Floppy: 1091 iTab = FDTab;1091 iTab = TabIndex_FD; 1092 1092 pIcon = &m_iconFD; 1093 1093 pfInaccessible = &m_fInaccessibleFD; … … 1100 1100 switch (action) 1101 1101 { 1102 case ItemAction_Added:1102 case Action_Add: 1103 1103 { 1104 1104 /* Does it change the overall state? */ … … 1112 1112 break; 1113 1113 } 1114 case ItemAction_Updated:1115 case ItemAction_Removed:1114 case Action_Edit: 1115 case Action_Remove: 1116 1116 { 1117 1117 bool fCheckRest = false; 1118 1118 1119 if (action == ItemAction_Updated)1119 if (action == Action_Edit) 1120 1120 { 1121 1121 /* Does it change the overall state? */ … … 1409 1409 1410 1410 /* Update tab-icons: */ 1411 updateTabIcons(pMediumItem, ItemAction_Added);1411 updateTabIcons(pMediumItem, Action_Add); 1412 1412 1413 1413 /* If medium-enumeration is not currently in progress or … … 1440 1440 1441 1441 /* Update tab-icons: */ 1442 updateTabIcons(pMediumItem, ItemAction_Updated);1442 updateTabIcons(pMediumItem, Action_Edit); 1443 1443 1444 1444 /* Re-fetch medium-item if it is current one updated: */ … … 1469 1469 1470 1470 /* Update tab-icons: */ 1471 updateTabIcons(pMediumItem, ItemAction_Removed);1471 updateTabIcons(pMediumItem, Action_Remove); 1472 1472 1473 1473 /* Delete medium-item: */ … … 1640 1640 switch (mTabWidget->currentIndex()) 1641 1641 { 1642 case HDTab: return UIMediumType_HardDisk;1643 case CDTab: return UIMediumType_DVD;1644 case FDTab: return UIMediumType_Floppy;1642 case TabIndex_HD: return UIMediumType_HardDisk; 1643 case TabIndex_CD: return UIMediumType_DVD; 1644 case TabIndex_FD: return UIMediumType_Floppy; 1645 1645 default: AssertMsgFailed(("Unknown page type: %d\n", mTabWidget->currentIndex())); break; 1646 1646 } -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h
r50368 r50700 50 50 Q_OBJECT; 51 51 52 /* Enumerators: */ 53 enum TabIndex { HDTab = 0, CDTab, FDTab }; 54 enum ItemAction { ItemAction_Added, ItemAction_Updated, ItemAction_Removed }; 55 enum Action { Action_Edit, Action_Copy, Action_Modify, Action_Remove, Action_Release }; 52 /** Tab index enumerator. */ 53 enum TabIndex { TabIndex_HD = 0, TabIndex_CD, TabIndex_FD }; 54 55 /** Item action enumerator. */ 56 enum Action { Action_Add, Action_Edit, Action_Copy, Action_Modify, Action_Remove, Action_Release }; 56 57 57 58 /* Constructor/destructor: */ … … 129 130 void updateActions(); 130 131 /** Update tab icons according last @a action happened with @a pItem. */ 131 void updateTabIcons(UIMediumItem *pItem, ItemAction action);132 void updateTabIcons(UIMediumItem *pItem, Action action); 132 133 /** Update information pane of passed medium @a type. */ 133 134 void updateInformationPanes(UIMediumType type = UIMediumType_Invalid);
Note:
See TracChangeset
for help on using the changeset viewer.