Changeset 88519 in vbox for trunk/src/VBox
- Timestamp:
- Apr 15, 2021 10:20:22 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r88471 r88519 467 467 , m_fFirstMediumEnumerationHandled(false) 468 468 , m_pActionPool(0) 469 , m_iGeometrySaveTimerId(-1) 469 470 { 470 471 s_pInstance = this; … … 537 538 emit sigWindowRemapped(); 538 539 break; 540 } 541 /* Handle move/resize geometry changes: */ 542 case QEvent::Move: 543 case QEvent::Resize: 544 { 545 if (m_iGeometrySaveTimerId != -1) 546 killTimer(m_iGeometrySaveTimerId); 547 m_iGeometrySaveTimerId = startTimer(300); 548 break; 549 } 550 /* Handle timer event started above: */ 551 case QEvent::Timer: 552 { 553 QTimerEvent *pTimerEvent = static_cast<QTimerEvent*>(pEvent); 554 if (pTimerEvent->timerId() == m_iGeometrySaveTimerId) 555 { 556 killTimer(m_iGeometrySaveTimerId); 557 m_iGeometrySaveTimerId = -1; 558 const QRect geo = currentGeometry(); 559 LogRel2(("GUI: UIVirtualBoxManager: Saving geometry as: Origin=%dx%d, Size=%dx%d\n", 560 geo.x(), geo.y(), geo.width(), geo.height())); 561 gEDataManager->setSelectorWindowGeometry(geo, isCurrentlyMaximized()); 562 } 539 563 } 540 564 default: … … 2254 2278 #endif 2255 2279 2256 /* Medium enumeration connections: */2280 /* UICommon connections: */ 2257 2281 connect(&uiCommon(), &UICommon::sigMediumEnumerationFinished, 2258 2282 this, &UIVirtualBoxManager::sltHandleMediumEnumerationFinish); … … 2470 2494 } 2471 2495 2472 void UIVirtualBoxManager::saveSettings()2473 {2474 /* Save window geometry: */2475 {2476 const QRect geo = currentGeometry();2477 LogRel2(("GUI: UIVirtualBoxManager: Saving geometry as: Origin=%dx%d, Size=%dx%d\n",2478 geo.x(), geo.y(), geo.width(), geo.height()));2479 gEDataManager->setSelectorWindowGeometry(geo, isCurrentlyMaximized());2480 }2481 }2482 2483 2496 void UIVirtualBoxManager::cleanupConnections() 2484 2497 { … … 2517 2530 sltCloseManagerWindow(UIToolType_Cloud); 2518 2531 sltCloseManagerWindow(UIToolType_CloudConsole); 2519 2520 /* Save settings: */2521 saveSettings();2522 2532 2523 2533 /* Cleanup: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h
r88071 r88519 321 321 void loadSettings(); 322 322 323 /** Saves settings. */324 void saveSettings();325 323 /** Cleanups connections. */ 326 324 void cleanupConnections(); … … 458 456 /** Holds the central-widget instance. */ 459 457 UIVirtualBoxManagerWidget *m_pWidget; 458 459 /** Holds the geometry save timer ID. */ 460 int m_iGeometrySaveTimerId; 460 461 }; 461 462
Note:
See TracChangeset
for help on using the changeset viewer.