- Timestamp:
- Oct 13, 2014 6:10:56 PM (10 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r52902 r53050 315 315 316 316 /** Constructor, passes @a session to the UISessionStateStatusBarIndicator constructor. */ 317 UIIndicatorNetwork(CSession &session) 318 : UISessionStateStatusBarIndicator(session) 317 UIIndicatorNetwork(UISession *pSession) 318 : UISessionStateStatusBarIndicator(pSession->session()) 319 , m_pSession(pSession) 319 320 , m_pTimerAutoUpdate(0) 320 321 { … … 324 325 setStateIcon(KDeviceActivity_Writing, UIIconPool::iconSet(":/nw_write_16px.png")); 325 326 setStateIcon(KDeviceActivity_Null, UIIconPool::iconSet(":/nw_disabled_16px.png")); 327 /* Configure machine state-change listener: */ 328 connect(m_pSession, SIGNAL(sigMachineStateChange()), 329 this, SLOT(sltHandleMachineStateChange())); 326 330 /* Create auto-update timer: */ 327 331 m_pTimerAutoUpdate = new QTimer(this); … … 330 334 /* Configure auto-update timer: */ 331 335 connect(m_pTimerAutoUpdate, SIGNAL(timeout()), SLOT(sltUpdateNetworkIPs())); 332 m_pTimerAutoUpdate->start(5000); 336 /* Start timer immediately if machine is running: */ 337 sltHandleMachineStateChange(); 333 338 } 334 339 /* Translate finally: */ … … 337 342 338 343 private slots: 344 345 /** Updates auto-update timer depending on machine state. */ 346 void sltHandleMachineStateChange() 347 { 348 if (m_pSession->machineState() == KMachineState_Running) 349 { 350 /* Start auto-update timer otherwise: */ 351 m_pTimerAutoUpdate->start(5000); 352 return; 353 } 354 /* Stop auto-update timer otherwise: */ 355 m_pTimerAutoUpdate->stop(); 356 } 339 357 340 358 /** Updates network IP addresses. */ … … 425 443 } 426 444 445 /** Holds the session UI reference. */ 446 UISession *m_pSession; 427 447 /** Holds the auto-update timer instance. */ 428 448 QTimer *m_pTimerAutoUpdate; … … 1228 1248 case IndicatorType_OpticalDisks: m_pool[indicatorType] = new UIIndicatorOpticalDisks(m_session); break; 1229 1249 case IndicatorType_FloppyDisks: m_pool[indicatorType] = new UIIndicatorFloppyDisks(m_session); break; 1230 case IndicatorType_Network: m_pool[indicatorType] = new UIIndicatorNetwork(m_ session); break;1250 case IndicatorType_Network: m_pool[indicatorType] = new UIIndicatorNetwork(m_pSession); break; 1231 1251 case IndicatorType_USB: m_pool[indicatorType] = new UIIndicatorUSB(m_session); break; 1232 1252 case IndicatorType_SharedFolders: m_pool[indicatorType] = new UIIndicatorSharedFolders(m_session); break; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineDefs.h
r52727 r53050 26 26 UIVisualElement_WindowTitle = RT_BIT(0), 27 27 UIVisualElement_MouseIntegrationStuff = RT_BIT(1), 28 UIVisualElement_ PauseStuff= RT_BIT(2),28 UIVisualElement_IndicatorPoolStuff = RT_BIT(2), 29 29 UIVisualElement_HDStuff = RT_BIT(3), 30 30 UIVisualElement_CDStuff = RT_BIT(4), -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
r52902 r53050 271 271 pEvent->ignore(); 272 272 273 /* If VM process is running separately, then leave it alone and close UI: */274 if (vboxGlobal().isSeparateProcess())275 {276 uisession()->closeRuntimeUI();277 return;278 }279 280 273 /* Make sure machine is in one of the allowed states: */ 281 274 if (!uisession()->isRunning() && !uisession()->isPaused() && !uisession()->isStuck()) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r52937 r53050 68 68 UIMachineWindow::sltMachineStateChanged(); 69 69 70 /* Update pauseand virtualization stuff: */71 updateAppearanceOf(UIVisualElement_ PauseStuff | UIVisualElement_FeaturesStuff);70 /* Update indicator-pool and virtualization stuff: */ 71 updateAppearanceOf(UIVisualElement_IndicatorPoolStuff | UIVisualElement_FeaturesStuff); 72 72 } 73 73 … … 507 507 508 508 /* Update machine window content: */ 509 if (iElement & UIVisualElement_PauseStuff) 510 { 511 if (!statusBar()->isHidden()) 512 { 513 if (uisession()->isPaused()) 514 m_pIndicatorsPool->setAutoUpdateIndicatorStates(false); 515 else if (uisession()->isRunning()) 516 m_pIndicatorsPool->setAutoUpdateIndicatorStates(statusBar()->isVisible()); 517 } 518 } 509 if (iElement & UIVisualElement_IndicatorPoolStuff) 510 m_pIndicatorsPool->setAutoUpdateIndicatorStates(statusBar()->isVisible() && uisession()->isRunning()); 519 511 if (iElement & UIVisualElement_HDStuff) 520 512 m_pIndicatorsPool->updateAppearance(IndicatorType_HardDisks);
Note:
See TracChangeset
for help on using the changeset viewer.