Changeset 39296 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Nov 14, 2011 1:24:53 PM (13 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r38476 r39296 126 126 { 127 127 UIMachineWindow::sltMachineStateChanged(); 128 updateAppearanceOf(UIVisualElement_ VirtualizationStuff);128 updateAppearanceOf(UIVisualElement_PauseStuff | UIVisualElement_VirtualizationStuff); 129 129 } 130 130 … … 193 193 void UIMachineWindowNormal::sltUpdateIndicators() 194 194 { 195 CConsole console = session().GetConsole(); 196 QIStateIndicator *pStateIndicator = 0; 197 198 pStateIndicator = indicatorsPool()->indicator(UIIndicatorIndex_HardDisks); 199 if (pStateIndicator->state() != KDeviceActivity_Null) 200 { 201 int state = console.GetDeviceActivity(KDeviceType_HardDisk); 202 if (pStateIndicator->state() != state) 203 pStateIndicator->setState(state); 204 } 205 pStateIndicator = indicatorsPool()->indicator(UIIndicatorIndex_OpticalDisks); 206 if (pStateIndicator->state() != KDeviceActivity_Null) 207 { 208 int state = console.GetDeviceActivity(KDeviceType_DVD); 209 if (pStateIndicator->state() != state) 210 pStateIndicator->setState(state); 211 } 212 pStateIndicator = indicatorsPool()->indicator(UIIndicatorIndex_FloppyDisks); 213 if (pStateIndicator->state() != KDeviceActivity_Null) 214 { 215 int state = console.GetDeviceActivity(KDeviceType_Floppy); 216 if (pStateIndicator->state() != state) 217 pStateIndicator->setState(state); 218 } 219 pStateIndicator = indicatorsPool()->indicator(UIIndicatorIndex_USBDevices); 220 if (pStateIndicator->state() != KDeviceActivity_Null) 221 { 222 int state = console.GetDeviceActivity(KDeviceType_USB); 223 if (pStateIndicator->state() != state) 224 pStateIndicator->setState(state); 225 } 226 pStateIndicator = indicatorsPool()->indicator(UIIndicatorIndex_NetworkAdapters); 227 if (pStateIndicator->state() != KDeviceActivity_Null) 228 { 229 int state = console.GetDeviceActivity(KDeviceType_Network); 230 if (pStateIndicator->state() != state) 231 pStateIndicator->setState(state); 232 } 233 pStateIndicator = indicatorsPool()->indicator(UIIndicatorIndex_SharedFolders); 234 if (pStateIndicator->state() != KDeviceActivity_Null) 235 { 236 int state = console.GetDeviceActivity(KDeviceType_SharedFolder); 237 if (pStateIndicator->state() != state) 238 pStateIndicator->setState(state); 239 } 195 updateIndicatorState(indicatorsPool()->indicator(UIIndicatorIndex_HardDisks), KDeviceType_HardDisk); 196 updateIndicatorState(indicatorsPool()->indicator(UIIndicatorIndex_OpticalDisks), KDeviceType_DVD); 197 updateIndicatorState(indicatorsPool()->indicator(UIIndicatorIndex_FloppyDisks), KDeviceType_Floppy); 198 updateIndicatorState(indicatorsPool()->indicator(UIIndicatorIndex_USBDevices), KDeviceType_USB); 199 updateIndicatorState(indicatorsPool()->indicator(UIIndicatorIndex_NetworkAdapters), KDeviceType_Network); 200 updateIndicatorState(indicatorsPool()->indicator(UIIndicatorIndex_SharedFolders), KDeviceType_SharedFolder); 240 201 } 241 202 … … 298 259 299 260 /* Update that machine window: */ 261 if (iElement & UIVisualElement_PauseStuff) 262 { 263 if (uisession()->isPaused() && m_pIdleTimer->isActive()) 264 m_pIdleTimer->stop(); 265 else if (uisession()->isRunning() && !m_pIdleTimer->isActive()) 266 m_pIdleTimer->start(500); 267 sltUpdateIndicators(); 268 } 300 269 if (iElement & UIVisualElement_HDStuff) 301 270 indicatorsPool()->indicator(UIIndicatorIndex_HardDisks)->updateAppearance(); … … 482 451 m_pIdleTimer = new QTimer(this); 483 452 connect(m_pIdleTimer, SIGNAL(timeout()), this, SLOT(sltUpdateIndicators())); 484 m_pIdleTimer->start(50 );453 m_pIdleTimer->start(500); 485 454 486 455 #ifdef Q_WS_MAC … … 707 676 } 708 677 678 void UIMachineWindowNormal::updateIndicatorState(QIStateIndicator *pIndicator, KDeviceType deviceType) 679 { 680 /* Do NOT update indicators with NULL state: */ 681 if (pIndicator->state() == KDeviceActivity_Null) 682 return; 683 684 /* Paused VM have all indicator states set to IDLE: */ 685 bool fPaused = uisession()->isPaused(); 686 if (fPaused) 687 { 688 /* If state differs from IDLE => set IDLE one: */ 689 if (pIndicator->state() != KDeviceActivity_Idle) 690 pIndicator->setState(KDeviceActivity_Idle); 691 } 692 else 693 { 694 /* Get current indicator state: */ 695 int state = session().GetConsole().GetDeviceActivity(deviceType); 696 /* If state differs => set new one: */ 697 if (pIndicator->state() != state) 698 pIndicator->setState(state); 699 } 700 } 701 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h
r38476 r39296 27 27 #include "QIWithRetranslateUI.h" 28 28 #include "UIMachineWindow.h" 29 #include "COMDefs.h" 29 30 30 31 /* Local forwards */ … … 104 105 void showSimple(); 105 106 bool isMaximizedChecked(); 107 void updateIndicatorState(QIStateIndicator *pIndicator, KDeviceType deviceType); 106 108 107 109 /* Indicators pool: */
Note:
See TracChangeset
for help on using the changeset viewer.