Changeset 4131 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Aug 13, 2007 2:04:12 PM (17 years ago)
- Location:
- trunk/src/VBox/Frontends
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r4071 r4131 435 435 } 436 436 437 STDMETHOD(OnStateChange)(MachineState_T machineState)438 {439 LogFlow(("OnStateChange: machineState = %d (%s)\n", machineState, GetStateName(machineState)));440 SDL_Event event = {0};441 442 if ( machineState == MachineState_Aborted443 || (machineState == MachineState_Saved && !m_fIgnorePowerOffEvents)444 || (machineState == MachineState_PoweredOff && !m_fIgnorePowerOffEvents))445 {446 /*447 * We have to inform the SDL thread that the application has be terminated448 */449 event.type = SDL_USEREVENT;450 event.user.type = SDL_USER_EVENT_TERMINATE;451 event.user.code = machineState == MachineState_Aborted452 ? VBOXSDL_TERM_ABEND453 : VBOXSDL_TERM_NORMAL;454 }455 else456 {457 /*458 * Inform the SDL thread to refresh the titlebar459 */460 event.type = SDL_USEREVENT;461 event.user.type = SDL_USER_EVENT_UPDATE_TITLEBAR;462 }463 464 PushSDLEventForSure(&event);465 return S_OK;466 }467 468 STDMETHOD(OnAdditionsStateChange)()469 {470 return S_OK;471 }472 473 437 STDMETHOD(OnKeyboardLedsChange)(BOOL fNumLock, BOOL fCapsLock, BOOL fScrollLock) 474 438 { … … 484 448 } 485 449 486 STDMETHOD(OnUSBDeviceStateChange)(IUSBDevice *device, BOOL attached, 487 IVirtualBoxErrorInfo *message) 450 STDMETHOD(OnStateChange)(MachineState_T machineState) 451 { 452 LogFlow(("OnStateChange: machineState = %d (%s)\n", machineState, GetStateName(machineState))); 453 SDL_Event event = {0}; 454 455 if ( machineState == MachineState_Aborted 456 || (machineState == MachineState_Saved && !m_fIgnorePowerOffEvents) 457 || (machineState == MachineState_PoweredOff && !m_fIgnorePowerOffEvents)) 458 { 459 /* 460 * We have to inform the SDL thread that the application has be terminated 461 */ 462 event.type = SDL_USEREVENT; 463 event.user.type = SDL_USER_EVENT_TERMINATE; 464 event.user.code = machineState == MachineState_Aborted 465 ? VBOXSDL_TERM_ABEND 466 : VBOXSDL_TERM_NORMAL; 467 } 468 else 469 { 470 /* 471 * Inform the SDL thread to refresh the titlebar 472 */ 473 event.type = SDL_USEREVENT; 474 event.user.type = SDL_USER_EVENT_UPDATE_TITLEBAR; 475 } 476 477 PushSDLEventForSure(&event); 478 return S_OK; 479 } 480 481 STDMETHOD(OnAdditionsStateChange)() 482 { 483 return S_OK; 484 } 485 486 STDMETHOD(OnDVDDriveChange)() 487 { 488 return S_OK; 489 } 490 491 STDMETHOD(OnFloppyDriveChange)() 492 { 493 return S_OK; 494 } 495 496 STDMETHOD(OnNetworkAdapterChange) (INetworkAdapter *aNetworkAdapter) 497 { 498 return S_OK; 499 } 500 501 STDMETHOD(OnSerialPortChange) (ISerialPort *aSerialPort) 502 { 503 return S_OK; 504 } 505 506 STDMETHOD(OnParallelPortChange) (IParallelPort *aParallelPort) 507 { 508 return S_OK; 509 } 510 511 STDMETHOD(OnVRDPServerChange)() 512 { 513 return S_OK; 514 } 515 516 STDMETHOD(OnUSBControllerChange)() 517 { 518 return S_OK; 519 } 520 521 STDMETHOD(OnUSBDeviceStateChange) (IUSBDevice *aDevice, BOOL aAttached, 522 IVirtualBoxErrorInfo *aError) 523 { 524 return S_OK; 525 } 526 527 STDMETHOD(OnSharedFolderChange) (Scope_T aScope) 488 528 { 489 529 return S_OK; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r4071 r4131 372 372 } 373 373 374 STDMETHOD(OnKeyboardLedsChange)(BOOL fNumLock, BOOL fCapsLock, BOOL fScrollLock) 375 { 376 QApplication::postEvent (mView, 377 new ModifierKeyChangeEvent (fNumLock, fCapsLock, 378 fScrollLock)); 379 return S_OK; 380 } 381 374 382 STDMETHOD(OnStateChange)(MachineState_T machineState) 375 383 { … … 396 404 } 397 405 398 STDMETHOD(OnKeyboardLedsChange)(BOOL fNumLock, BOOL fCapsLock, BOOL fScrollLock) 399 { 400 QApplication::postEvent (mView, 401 new ModifierKeyChangeEvent (fNumLock, fCapsLock, 402 fScrollLock)); 406 STDMETHOD(OnDVDDriveChange)() 407 { 408 LogTrace(); 403 409 return S_OK; 404 410 } 405 411 406 STDMETHOD(OnUSBDeviceStateChange)(IUSBDevice *device, BOOL attached, 407 IVirtualBoxErrorInfo *error) 412 STDMETHOD(OnFloppyDriveChange)() 413 { 414 return S_OK; 415 } 416 417 STDMETHOD(OnNetworkAdapterChange) (INetworkAdapter *aNetworkAdapter) 418 { 419 return S_OK; 420 } 421 422 STDMETHOD(OnSerialPortChange) (ISerialPort *aSerialPort) 423 { 424 return S_OK; 425 } 426 427 STDMETHOD(OnParallelPortChange) (IParallelPort *aParallelPort) 428 { 429 return S_OK; 430 } 431 432 STDMETHOD(OnVRDPServerChange)() 433 { 434 return S_OK; 435 } 436 437 STDMETHOD(OnUSBControllerChange)() 438 { 439 return S_OK; 440 } 441 442 STDMETHOD(OnUSBDeviceStateChange)(IUSBDevice *aDevice, BOOL aAttached, 443 IVirtualBoxErrorInfo *aError) 408 444 { 409 445 QApplication::postEvent (mView, 410 446 new USBDeviceStateChangeEvent ( 411 CUSBDevice (device), 412 bool (attached), 413 CVirtualBoxErrorInfo (error))); 447 CUSBDevice (aDevice), 448 bool (aAttached), 449 CVirtualBoxErrorInfo (aError))); 450 return S_OK; 451 } 452 453 STDMETHOD(OnSharedFolderChange) (Scope_T aScope) 454 { 414 455 return S_OK; 415 456 }
Note:
See TracChangeset
for help on using the changeset viewer.