Changeset 88656 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Apr 22, 2021 2:55:38 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 143970
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
r88441 r88656 283 283 : m_enmType(enmType) 284 284 , m_fValid(false) 285 #ifdef VBOX_WS_WIN 286 , m_fDataCommitted(false) 287 #endif 285 288 #ifdef VBOX_WS_MAC 286 289 , m_enmMacOSVersion(MacOSXRelease_Old) … … 4078 4081 { 4079 4082 /* Make sure QApplication cleanup us on exit: */ 4080 connect(qApp, &QGuiApplication::aboutToQuit, this, &UICommon::cleanup); 4083 connect(qApp, &QGuiApplication::aboutToQuit, 4084 this, &UICommon::cleanup); 4081 4085 #ifndef VBOX_GUI_WITH_CUSTOMIZATIONS1 4082 4086 /* Make sure we handle host OS session shutdown as well: */ … … 4570 4574 void UICommon::cleanup() 4571 4575 { 4576 LogRel(("GUI: UICommon: Handling aboutToQuit request..\n")); 4577 4578 #ifdef VBOX_WS_WIN 4579 /* Ask listeners to commit data if haven't yet: */ 4580 if (!m_fDataCommitted) 4581 { 4582 emit sigAskToCommitData(); 4583 m_fDataCommitted = true; 4584 } 4585 #else 4586 /* Ask listeners to commit data: */ 4587 emit sigAskToCommitData(); 4588 #endif 4589 4572 4590 /// @todo Shouldn't that be protected with a mutex or something? 4573 4591 /* Remember that the cleanup is in progress preventing any unwanted … … 4654 4672 m_comCleanupProtectionToken.unlock(); 4655 4673 4674 /* Notify listener it can close UI now: */ 4675 emit sigAskToCloseUI(); 4676 4656 4677 /* Destroy popup-center: */ 4657 4678 UIPopupCenter::destroy(); … … 4663 4684 4664 4685 m_fValid = false; 4686 4687 LogRel(("GUI: UICommon: aboutToQuit request handled!\n")); 4665 4688 } 4666 4689 … … 4672 4695 /* Ask listener to commit data: */ 4673 4696 emit sigAskToCommitData(); 4697 #ifdef VBOX_WS_WIN 4698 m_fDataCommitted = true; 4699 #endif 4674 4700 4675 4701 /* Ask session manager to postpone shutdown until we done: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h
r86986 r88656 81 81 /** Asks #UIStarter listener to restart UI. */ 82 82 void sigAskToRestartUI(); 83 /** Asks #UIStarter listener to close UI. */ 84 void sigAskToCloseUI(); 83 85 84 86 /** Notifies listeners about the VBoxSVC availability change. */ … … 839 841 bool m_fValid; 840 842 843 #ifdef VBOX_WS_WIN 844 /** Holds whether overall GUI data is committed. */ 845 bool m_fDataCommitted; 846 #endif 847 841 848 #ifdef VBOX_WS_MAC 842 849 /** Mac OS X: Holds the #MacOSXRelease determined using <i>uname</i> call. */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIStarter.cpp
r82968 r88656 61 61 /* Assign instance: */ 62 62 s_pInstance = this; 63 64 /* Prepare: */65 prepare();66 63 } 67 64 68 65 UIStarter::~UIStarter() 69 66 { 70 /* Cleanup: */71 cleanup();72 73 67 /* Unassign instance: */ 74 68 s_pInstance = 0; … … 80 74 connect(&uiCommon(), &UICommon::sigAskToRestartUI, 81 75 this, &UIStarter::sltRestartUI); 76 connect(&uiCommon(), &UICommon::sigAskToCloseUI, 77 this, &UIStarter::sltCloseUI); 82 78 connect(&uiCommon(), &UICommon::sigAskToCommitData, 83 79 this, &UIStarter::sltHandleCommitDataRequest); … … 89 85 disconnect(&uiCommon(), &UICommon::sigAskToRestartUI, 90 86 this, &UIStarter::sltRestartUI); 87 disconnect(&uiCommon(), &UICommon::sigAskToCloseUI, 88 this, &UIStarter::sltCloseUI); 91 89 disconnect(&uiCommon(), &UICommon::sigAskToCommitData, 92 90 this, &UIStarter::sltHandleCommitDataRequest); 93 }94 95 void UIStarter::prepare()96 {97 /* Listen for QApplication signals: */98 connect(qApp, &QGuiApplication::aboutToQuit,99 this, &UIStarter::cleanup);100 91 } 101 92 … … 156 147 } 157 148 158 void UIStarter:: cleanup()149 void UIStarter::sltCloseUI() 159 150 { 160 151 #ifndef VBOX_RUNTIME_UI -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIStarter.h
r82968 r88656 53 53 private slots: 54 54 55 /** Prepares everything. */56 void prepare();57 58 55 /** Starts corresponding part of the UI. */ 59 56 void sltStartUI(); 60 57 /** Restarts corresponding part of the UI. */ 61 58 void sltRestartUI(); 62 63 /** Cleanups everything. */ 64 void cleanup(); 59 /** Closes corresponding part of the UI. */ 60 void sltCloseUI(); 65 61 66 62 /** Handles commit data request. */
Note:
See TracChangeset
for help on using the changeset viewer.