Changeset 88721 in vbox for trunk/src/VBox
- Timestamp:
- Apr 27, 2021 8:05:03 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/activity/vmactivity/UIVMActivityMonitor.cpp
r88242 r88721 800 800 connect(this, &UIVMActivityMonitor::customContextMenuRequested, 801 801 this, &UIVMActivityMonitor::sltCreateContextMenu); 802 } 803 804 UIVMActivityMonitor::~UIVMActivityMonitor() 805 { 806 if (!m_comSession.isNull()) 807 m_comSession.UnlockMachine(); 802 connect(&uiCommon(), &UICommon::sigAskToDetachCOM, 803 this, &UIVMActivityMonitor::sltClearCOMData); 808 804 } 809 805 … … 1072 1068 } 1073 1069 1070 void UIVMActivityMonitor::sltClearCOMData() 1071 { 1072 if (!m_comSession.isNull()) 1073 m_comSession.UnlockMachine(); 1074 } 1075 1074 1076 void UIVMActivityMonitor::prepareMetrics() 1075 1077 { -
trunk/src/VBox/Frontends/VirtualBox/src/activity/vmactivity/UIVMActivityMonitor.h
r88119 r88721 125 125 UIVMActivityMonitor(EmbedTo enmEmbedding, QWidget *pParent, const CMachine &machine, 126 126 UIActionPool *pActionPool,bool fShowToolbar = false); 127 ~UIVMActivityMonitor();128 127 void setMachine(const CMachine &machine); 129 128 … … 151 150 void sltExportMetricsToFile(); 152 151 void sltCreateContextMenu(const QPoint &point); 152 void sltClearCOMData(); 153 153 154 154 private: -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestProcessControlWidget.cpp
r87718 r88721 313 313 } 314 314 315 UIGuestProcessControlWidget::~UIGuestProcessControlWidget()316 {317 saveSettings();318 cleanupListener();319 }320 321 315 void UIGuestProcessControlWidget::retranslateUi() 322 316 { … … 393 387 this, &UIGuestProcessControlWidget::sltGuestSessionUnregistered); 394 388 } 389 390 connect(&uiCommon(), &UICommon::sigAskToCommitData, 391 this, &UIGuestProcessControlWidget::sltSaveSettings); 392 connect(&uiCommon(), &UICommon::sigAskToDetachCOM, 393 this, &UIGuestProcessControlWidget::sltCleanupListener); 395 394 } 396 395 … … 514 513 } 515 514 516 void UIGuestProcessControlWidget::cleanupListener()517 {518 /* Unregister everything: */519 m_pQtListener->getWrapped()->unregisterSources();520 521 /* Make sure VBoxSVC is available: */522 if (!uiCommon().isVBoxSVCAvailable())523 return;524 525 /* Get CProgress event source: */526 CEventSource comEventSource = m_comGuest.GetEventSource();527 AssertWrapperOk(comEventSource);528 529 /* Unregister event listener for CProgress event source: */530 comEventSource.UnregisterListener(m_comEventListener);531 }532 533 534 515 void UIGuestProcessControlWidget::sltGuestSessionRegistered(CGuestSession guestSession) 535 516 { … … 576 557 } 577 558 578 void UIGuestProcessControlWidget::s aveSettings()559 void UIGuestProcessControlWidget::sltSaveSettings() 579 560 { 580 561 if (!m_pSplitter) 581 562 return; 582 563 gEDataManager->setGuestControlProcessControlSplitterHints(m_pSplitter->sizes()); 564 } 565 566 void UIGuestProcessControlWidget::sltCleanupListener() 567 { 568 /* Unregister everything: */ 569 m_pQtListener->getWrapped()->unregisterSources(); 570 571 /* Make sure VBoxSVC is available: */ 572 if (!uiCommon().isVBoxSVCAvailable()) 573 return; 574 575 /* Get CProgress event source: */ 576 CEventSource comEventSource = m_comGuest.GetEventSource(); 577 //AssertWrapperOk(comEventSource); 578 579 /* Unregister event listener for CProgress event source: */ 580 comEventSource.UnregisterListener(m_comEventListener); 583 581 } 584 582 -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestProcessControlWidget.h
r86233 r88721 55 55 UIGuestProcessControlWidget(EmbedTo enmEmbedding, const CGuest &comGuest, QWidget *pParent, 56 56 QString strMachineName = QString(), bool fShowToolbar = false); 57 ~UIGuestProcessControlWidget();58 57 /** When true we delete the corresponding tree item as soon as the guest session/process is unregistered. */ 59 58 static const bool m_fDeleteAfterUnregister; … … 71 70 void sltCloseSessionOrProcess(); 72 71 void sltShowProperties(); 72 void sltSaveSettings(); 73 void sltCleanupListener(); 73 74 74 75 private: … … 80 81 void initGuestSessionTree(); 81 82 void updateTreeWidget(); 82 void cleanupListener();83 83 void addGuestSession(CGuestSession guestSession); 84 void saveSettings();85 84 void loadSettings(); 86 85 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp
r88071 r88721 94 94 UIVMInformationDialog::~UIVMInformationDialog() 95 95 { 96 /* Cleanup: */97 cleanup();98 99 96 /* Deinitialize instance: */ 100 97 s_pInstance = 0; … … 137 134 } 138 135 136 void UIVMInformationDialog::sltSaveSettings() 137 { 138 /* Save window geometry: */ 139 { 140 const QRect geo = currentGeometry(); 141 LogRel2(("GUI: UIVMInformationDialog: Saving geometry as: Origin=%dx%d, Size=%dx%d\n", 142 geo.x(), geo.y(), geo.width(), geo.height())); 143 gEDataManager->setSessionInformationDialogGeometry(geo, isCurrentlyMaximized()); 144 } 145 } 146 139 147 void UIVMInformationDialog::prepare() 140 148 { … … 143 151 /* Load settings: */ 144 152 loadSettings(); 153 connect(&uiCommon(), &UICommon::sigAskToCommitData, 154 this, &UIVMInformationDialog::sltSaveSettings); 145 155 } 146 156 … … 282 292 } 283 293 } 284 285 void UIVMInformationDialog::saveSettings()286 {287 /* Save window geometry: */288 {289 const QRect geo = currentGeometry();290 LogRel2(("GUI: UIVMInformationDialog: Saving geometry as: Origin=%dx%d, Size=%dx%d\n",291 geo.x(), geo.y(), geo.width(), geo.height()));292 gEDataManager->setSessionInformationDialogGeometry(geo, isCurrentlyMaximized());293 }294 }295 296 void UIVMInformationDialog::cleanup()297 {298 /* Save settings: */299 saveSettings();300 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.h
r82968 r88721 74 74 /** Handles tab-widget page change. */ 75 75 void sltHandlePageChanged(int iIndex); 76 void sltSaveSettings(); 76 77 77 78 private: … … 91 92 /** Loads settings. */ 92 93 void loadSettings(); 93 94 /** Saves settings. */95 void saveSettings();96 /** Cleanups all. */97 void cleanup();98 94 99 95 /** @name General variables. … … 117 113 118 114 #endif /* !FEQT_INCLUDED_SRC_runtime_information_UIVMInformationDialog_h */ 119
Note:
See TracChangeset
for help on using the changeset viewer.