儲存庫 vbox 的更動 52385
- 時間撮記:
- 2014-8-14 下午04:40:36 (10 年 以前)
- 位置:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- 檔案:
-
- 修改 2 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r52319 r52385 1040 1040 void UIIndicatorsPool::sltAutoUpdateIndicatorStates() 1041 1041 { 1042 /* Update states for following indicators: */ 1043 QVector <KDeviceType> deviceTypes(0); 1044 1042 /* We should update states for following indicators: */ 1043 QVector<KDeviceType> deviceTypes; 1045 1044 if (m_pool.contains(IndicatorType_HardDisks)) 1046 1045 deviceTypes.append(KDeviceType_HardDisk); … … 1058 1057 deviceTypes.append(KDeviceType_Graphics3D); 1059 1058 1059 /* Acquire current states from the console: */ 1060 1060 CConsole console = m_session.GetConsole(); 1061 QVector <KDeviceActivity> activities = console.GetDeviceActivity(deviceTypes); 1062 if (!console.isOk()) 1063 return; 1064 1065 int i; 1066 for (i = 0; i < activities.size(); ++i) 1067 { 1068 QIStatusBarIndicator *pIndicator = NULL; 1069 1070 switch (deviceTypes[i]) 1071 { 1072 case KDeviceType_HardDisk: 1073 pIndicator = m_pool.value(IndicatorType_HardDisks); 1074 break; 1075 case KDeviceType_DVD: 1076 pIndicator = m_pool.value(IndicatorType_OpticalDisks); 1077 break; 1078 case KDeviceType_Floppy: 1079 pIndicator = m_pool.value(IndicatorType_FloppyDisks); 1080 break; 1081 case KDeviceType_USB: 1082 pIndicator = m_pool.value(IndicatorType_USB); 1083 break; 1084 case KDeviceType_Network: 1085 pIndicator = m_pool.value(IndicatorType_Network); 1086 break; 1087 case KDeviceType_SharedFolder: 1088 pIndicator = m_pool.value(IndicatorType_SharedFolders); 1089 break; 1090 case KDeviceType_Graphics3D: 1091 pIndicator = m_pool.value(IndicatorType_Display); 1092 break; 1093 default: 1094 AssertFailed(); 1095 break; 1096 } 1097 1061 const QVector<KDeviceActivity> states = console.GetDeviceActivity(deviceTypes); 1062 AssertReturnVoid(console.isOk()); 1063 1064 /* Update indicators with the acquired states: */ 1065 for (int iIndicator = 0; iIndicator < states.size(); ++iIndicator) 1066 { 1067 QIStatusBarIndicator *pIndicator = 0; 1068 switch (deviceTypes[iIndicator]) 1069 { 1070 case KDeviceType_HardDisk: pIndicator = m_pool.value(IndicatorType_HardDisks); break; 1071 case KDeviceType_DVD: pIndicator = m_pool.value(IndicatorType_OpticalDisks); break; 1072 case KDeviceType_Floppy: pIndicator = m_pool.value(IndicatorType_FloppyDisks); break; 1073 case KDeviceType_USB: pIndicator = m_pool.value(IndicatorType_USB); break; 1074 case KDeviceType_Network: pIndicator = m_pool.value(IndicatorType_Network); break; 1075 case KDeviceType_SharedFolder: pIndicator = m_pool.value(IndicatorType_SharedFolders); break; 1076 case KDeviceType_Graphics3D: pIndicator = m_pool.value(IndicatorType_Display); break; 1077 default: AssertFailed(); break; 1078 } 1098 1079 if (pIndicator) 1099 updateIndicatorStateForDevice(pIndicator, deviceTypes[i], activities[i]);1080 updateIndicatorStateForDevice(pIndicator, states[iIndicator]); 1100 1081 } 1101 1082 } … … 1294 1275 } 1295 1276 1296 void UIIndicatorsPool::updateIndicatorStateForDevice(QIStatusBarIndicator *pIndicator, KDeviceType deviceType, 1297 KDeviceActivity deviceActivity) 1277 void UIIndicatorsPool::updateIndicatorStateForDevice(QIStatusBarIndicator *pIndicator, KDeviceActivity state) 1298 1278 { 1299 1279 /* Assert indicators with NO state: */ … … 1315 1295 { 1316 1296 /* If current state differs from actual => set the actual one: */ 1317 const int iState = (int) deviceActivity;1297 const int iState = (int)state; 1318 1298 if (pStateIndicator->state() != iState) 1319 1299 pStateIndicator->setState(iState); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.h
r52319 r52385 98 98 int indicatorPosition(IndicatorType indicatorType) const; 99 99 100 /** Updates state for passed @a pIndicator through @a deviceType. */ 101 void updateIndicatorStateForDevice(QIStatusBarIndicator *pIndicator, KDeviceType deviceType, 102 KDeviceActivity deviceActivity); 100 /** Updates passed @a pIndicator with current @a state value. */ 101 void updateIndicatorStateForDevice(QIStatusBarIndicator *pIndicator, KDeviceActivity state); 103 102 104 103 /** Holds the UI session reference. */
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器