Changeset 86541 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Oct 12, 2020 12:30:09 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h
r84904 r86541 109 109 template<> SHARED_LIBRARY_STUFF bool canConvert<DetailsElementType>(); 110 110 template<> SHARED_LIBRARY_STUFF bool canConvert<PreviewUpdateIntervalType>(); 111 template<> SHARED_LIBRARY_STUFF bool canConvert<EventHandlingType>();112 111 template<> SHARED_LIBRARY_STUFF bool canConvert<GUIFeatureType>(); 113 112 template<> SHARED_LIBRARY_STUFF bool canConvert<GlobalSettingsPageType>(); … … 232 231 template<> SHARED_LIBRARY_STUFF int toInternalInteger(const PreviewUpdateIntervalType &previewUpdateIntervalType); 233 232 template<> SHARED_LIBRARY_STUFF PreviewUpdateIntervalType fromInternalInteger<PreviewUpdateIntervalType>(const int &iPreviewUpdateIntervalType); 234 template<> SHARED_LIBRARY_STUFF EventHandlingType fromInternalString<EventHandlingType>(const QString &strEventHandlingType);235 233 template<> SHARED_LIBRARY_STUFF QString toInternalString(const GUIFeatureType &guiFeatureType); 236 234 template<> SHARED_LIBRARY_STUFF GUIFeatureType fromInternalString<GUIFeatureType>(const QString &strGuiFeatureType); -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp
r85772 r86541 63 63 template<> bool canConvert<DetailsElementType>() { return true; } 64 64 template<> bool canConvert<PreviewUpdateIntervalType>() { return true; } 65 template<> bool canConvert<EventHandlingType>() { return true; }66 65 template<> bool canConvert<GUIFeatureType>() { return true; } 67 66 template<> bool canConvert<GlobalSettingsPageType>() { return true; } … … 1813 1812 } 1814 1813 1815 /* EventHandlingType <= QString: */1816 template<> EventHandlingType fromInternalString<EventHandlingType>(const QString &strEventHandlingType)1817 {1818 /* Here we have some fancy stuff allowing us1819 * to search through the keys using 'case-insensitive' rule: */1820 QStringList keys; QList<EventHandlingType> values;1821 keys << "Active"; values << EventHandlingType_Active;1822 keys << "Passive"; values << EventHandlingType_Passive;1823 /* Passive type for unknown words: */1824 if (!keys.contains(strEventHandlingType, Qt::CaseInsensitive))1825 return EventHandlingType_Passive;1826 /* Corresponding type for known words: */1827 return values.at(keys.indexOf(QRegExp(strEventHandlingType, Qt::CaseInsensitive)));1828 }1829 1830 1814 /* QString <= GUIFeatureType: */ 1831 1815 template<> QString toInternalString(const GUIFeatureType &guiFeatureType) -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
r86094 r86541 21 21 22 22 /* General: */ 23 const char *UIExtraDataDefs::GUI_EventHandlingType = "GUI/EventHandlingType";24 23 const char *UIExtraDataDefs::GUI_RestrictedDialogs = "GUI/RestrictedDialogs"; 25 24 -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r86094 r86541 44 44 /** @name General 45 45 * @{ */ 46 /** Holds event handling type. */47 SHARED_LIBRARY_STUFF extern const char *GUI_EventHandlingType;48 49 46 /** Holds restricted dialogs. */ 50 47 SHARED_LIBRARY_STUFF extern const char *GUI_RestrictedDialogs; … … 794 791 795 792 796 /** Common UI: Event handling types. */797 enum EventHandlingType798 {799 EventHandlingType_Active,800 EventHandlingType_Passive801 };802 803 804 793 /** Common UI: GUI feature types. */ 805 794 enum GUIFeatureType -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r86233 r86541 177 177 178 178 /* Register event listener for VirtualBox event source: */ 179 comEventSourceVBox.RegisterListener(m_comEventListener, eventTypes, 180 gEDataManager->eventHandlingType() == EventHandlingType_Active ? TRUE : FALSE); 179 comEventSourceVBox.RegisterListener(m_comEventListener, eventTypes, FALSE /* active? */); 181 180 AssertWrapperOk(comEventSourceVBox); 182 181 183 /* If event listener registered as passive one: */ 184 if (gEDataManager->eventHandlingType() == EventHandlingType_Passive) 185 { 186 /* Register event sources in their listeners as well: */ 187 m_pQtListener->getWrapped()->registerSource(comEventSourceVBox, m_comEventListener); 188 } 182 /* Register event sources in their listeners as well: */ 183 m_pQtListener->getWrapped()->registerSource(comEventSourceVBox, m_comEventListener); 189 184 } 190 185 … … 207 202 void UIExtraDataEventHandler::cleanupListener() 208 203 { 209 /* If event listener registered as passive one: */ 210 if (gEDataManager->eventHandlingType() == EventHandlingType_Passive) 211 { 212 /* Unregister everything: */ 213 m_pQtListener->getWrapped()->unregisterSources(); 214 } 204 /* Unregister everything: */ 205 m_pQtListener->getWrapped()->unregisterSources(); 215 206 216 207 /* Make sure VBoxSVC is available: */ … … 1903 1894 return QStringList() 1904 1895 << QString() 1905 << GUI_EventHandlingType1906 1896 << GUI_RestrictedDialogs 1907 1897 << GUI_SuppressMessages << GUI_InvertMessageOption … … 2272 2262 } 2273 2263 2274 EventHandlingType UIExtraDataManager::eventHandlingType()2275 {2276 return gpConverter->fromInternalString<EventHandlingType>(extraDataString(GUI_EventHandlingType));2277 }2278 2279 2264 UIExtraDataMetaDefs::DialogType UIExtraDataManager::restrictedDialogTypes(const QUuid &uID) 2280 2265 { -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r86094 r86541 158 158 /** @name General 159 159 * @{ */ 160 /** Returns event handling type. */161 EventHandlingType eventHandlingType();162 163 160 /** Returns a list of restricted dialogs. */ 164 161 UIExtraDataMetaDefs::DialogType restrictedDialogTypes(const QUuid &uID); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIProgressEventHandler.cpp
r86324 r86541 64 64 65 65 /* Register event listener for CProgress event source: */ 66 comEventSourceProgress.RegisterListener(m_comEventListener, eventTypes, 67 gEDataManager->eventHandlingType() == EventHandlingType_Active ? TRUE : FALSE); 66 comEventSourceProgress.RegisterListener(m_comEventListener, eventTypes, FALSE /* active? */); 68 67 AssertWrapperOk(comEventSourceProgress); 69 68 70 /* If event listener registered as passive one: */ 71 if (gEDataManager->eventHandlingType() == EventHandlingType_Passive) 72 { 73 /* Register event sources in their listeners as well: */ 74 m_pQtListener->getWrapped()->registerSource(comEventSourceProgress, 75 m_comEventListener, 76 QSet<KVBoxEventType>() << KVBoxEventType_OnProgressTaskCompleted); 77 } 69 /* Register event sources in their listeners as well: */ 70 m_pQtListener->getWrapped()->registerSource(comEventSourceProgress, 71 m_comEventListener, 72 QSet<KVBoxEventType>() << KVBoxEventType_OnProgressTaskCompleted); 78 73 } 79 74 … … 99 94 void UIProgressEventHandler::cleanupListener() 100 95 { 101 /* If event listener registered as passive one: */ 102 if (gEDataManager->eventHandlingType() == EventHandlingType_Passive) 103 { 104 /* Unregister everything: */ 105 m_pQtListener->getWrapped()->unregisterSources(); 106 } 96 /* Unregister everything: */ 97 m_pQtListener->getWrapped()->unregisterSources(); 107 98 108 99 /* Make sure VBoxSVC is available: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIVirtualBoxClientEventHandler.cpp
r86154 r86541 120 120 121 121 /* Register event listener for event source aggregator: */ 122 m_comEventSource.RegisterListener(m_comEventListener, eventTypes, 123 gEDataManager->eventHandlingType() == EventHandlingType_Active ? TRUE : FALSE); 122 m_comEventSource.RegisterListener(m_comEventListener, eventTypes, FALSE /* active? */); 124 123 AssertWrapperOk(m_comEventSource); 125 124 126 /* If event listener registered as passive one: */ 127 if (gEDataManager->eventHandlingType() == EventHandlingType_Passive) 128 { 129 /* Register event sources in their listeners as well: */ 130 m_pQtListener->getWrapped()->registerSource(m_comEventSource, m_comEventListener); 131 } 125 /* Register event sources in their listeners as well: */ 126 m_pQtListener->getWrapped()->registerSource(m_comEventSource, m_comEventListener); 132 127 } 133 128 … … 148 143 void UIVirtualBoxClientEventHandlerProxy::cleanupListener() 149 144 { 150 /* If event listener registered as passive one: */ 151 if (gEDataManager->eventHandlingType() == EventHandlingType_Passive) 152 { 153 /* Unregister everything: */ 154 m_pQtListener->getWrapped()->unregisterSources(); 155 } 145 /* Unregister everything: */ 146 m_pQtListener->getWrapped()->unregisterSources(); 156 147 157 148 /* Unregister event listener for event source aggregator: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIVirtualBoxEventHandler.cpp
r86154 r86541 171 171 172 172 /* Register event listener for event source aggregator: */ 173 m_comEventSource.RegisterListener(m_comEventListener, eventTypes, 174 gEDataManager->eventHandlingType() == EventHandlingType_Active ? TRUE : FALSE); 173 m_comEventSource.RegisterListener(m_comEventListener, eventTypes, FALSE /* active? */); 175 174 AssertWrapperOk(m_comEventSource); 176 175 177 /* If event listener registered as passive one: */ 178 if (gEDataManager->eventHandlingType() == EventHandlingType_Passive) 179 { 180 /* Register event sources in their listeners as well: */ 181 m_pQtListener->getWrapped()->registerSource(m_comEventSource, m_comEventListener); 182 } 176 /* Register event sources in their listeners as well: */ 177 m_pQtListener->getWrapped()->registerSource(m_comEventSource, m_comEventListener); 183 178 } 184 179 … … 241 236 void UIVirtualBoxEventHandlerProxy::cleanupListener() 242 237 { 243 /* If event listener registered as passive one: */ 244 if (gEDataManager->eventHandlingType() == EventHandlingType_Passive) 245 { 246 /* Unregister everything: */ 247 m_pQtListener->getWrapped()->unregisterSources(); 248 } 238 /* Unregister everything: */ 239 m_pQtListener->getWrapped()->unregisterSources(); 249 240 250 241 /* Unregister event listener for event source aggregator: */ -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.cpp
r86233 r86541 639 639 640 640 /* Register event listener for CProgress event source: */ 641 comEventSource.RegisterListener(comEventListener, eventTypes, 642 gEDataManager->eventHandlingType() == EventHandlingType_Active ? TRUE : FALSE); 643 644 /* If event listener registered as passive one: */ 645 if (gEDataManager->eventHandlingType() == EventHandlingType_Passive) 646 { 647 /* Register event sources in their listeners as well: */ 648 QtListener->getWrapped()->registerSource(comEventSource, comEventListener); 649 } 641 comEventSource.RegisterListener(comEventListener, eventTypes, FALSE /* active? */); 642 643 /* Register event sources in their listeners as well: */ 644 QtListener->getWrapped()->registerSource(comEventSource, comEventListener); 650 645 } 651 646 … … 656 651 if (!comEventSource.isOk()) 657 652 return; 658 /* If event listener registered as passive one: */ 659 if (gEDataManager->eventHandlingType() == EventHandlingType_Passive) 660 { 661 /* Unregister everything: */ 662 QtListener->getWrapped()->unregisterSources(); 663 } 653 /* Unregister everything: */ 654 QtListener->getWrapped()->unregisterSources(); 664 655 665 656 /* Make sure VBoxSVC is available: */ -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlTreeItem.cpp
r82968 r86541 67 67 68 68 /* Register event listener for CProgress event source: */ 69 comEventSource.RegisterListener(m_comEventListener, eventTypes, 70 gEDataManager->eventHandlingType() == EventHandlingType_Active ? TRUE : FALSE); 71 72 /* If event listener registered as passive one: */ 73 if (gEDataManager->eventHandlingType() == EventHandlingType_Passive) 74 { 75 /* Register event sources in their listeners as well: */ 76 m_pQtListener->getWrapped()->registerSource(comEventSource, m_comEventListener); 77 } 69 comEventSource.RegisterListener(m_comEventListener, eventTypes, FALSE /* active? */); 70 71 /* Register event sources in their listeners as well: */ 72 m_pQtListener->getWrapped()->registerSource(comEventSource, m_comEventListener); 78 73 } 79 74 … … 82 77 if (!comEventSource.isOk()) 83 78 return; 84 /* If event listener registered as passive one: */ 85 if (gEDataManager->eventHandlingType() == EventHandlingType_Passive) 86 { 87 /* Unregister everything: */ 88 m_pQtListener->getWrapped()->unregisterSources(); 89 } 79 /* Unregister everything: */ 80 m_pQtListener->getWrapped()->unregisterSources(); 90 81 91 82 /* Make sure VBoxSVC is available: */ -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestProcessControlWidget.cpp
r86233 r86541 466 466 467 467 /* Register event listener for CProgress event source: */ 468 comEventSource.RegisterListener(m_comEventListener, eventTypes, 469 gEDataManager->eventHandlingType() == EventHandlingType_Active ? TRUE : FALSE); 468 comEventSource.RegisterListener(m_comEventListener, eventTypes, FALSE /* active? */); 470 469 AssertWrapperOk(comEventSource); 471 470 472 /* If event listener registered as passive one: */ 473 if (gEDataManager->eventHandlingType() == EventHandlingType_Passive) 474 { 475 /* Register event sources in their listeners as well: */ 476 m_pQtListener->getWrapped()->registerSource(comEventSource, m_comEventListener); 477 } 471 /* Register event sources in their listeners as well: */ 472 m_pQtListener->getWrapped()->registerSource(comEventSource, m_comEventListener); 478 473 } 479 474 … … 521 516 void UIGuestProcessControlWidget::cleanupListener() 522 517 { 523 /* If event listener registered as passive one: */ 524 if (gEDataManager->eventHandlingType() == EventHandlingType_Passive) 525 { 526 /* Unregister everything: */ 527 m_pQtListener->getWrapped()->unregisterSources(); 528 } 518 /* Unregister everything: */ 519 m_pQtListener->getWrapped()->unregisterSources(); 529 520 530 521 /* Make sure VBoxSVC is available: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.cpp
r82968 r86541 206 206 207 207 /* Register event listener for console event source: */ 208 comEventSourceConsole.RegisterListener(m_comEventListener, eventTypes, 209 gEDataManager->eventHandlingType() == EventHandlingType_Active ? TRUE : FALSE); 208 comEventSourceConsole.RegisterListener(m_comEventListener, eventTypes, FALSE /* active? */); 210 209 AssertWrapperOk(comEventSourceConsole); 211 210 212 /* If event listener registered as passive one: */ 213 if (gEDataManager->eventHandlingType() == EventHandlingType_Passive) 214 { 215 /* Register event sources in their listeners as well: */ 216 m_pQtListener->getWrapped()->registerSource(comEventSourceConsole, m_comEventListener); 217 } 211 /* Register event sources in their listeners as well: */ 212 m_pQtListener->getWrapped()->registerSource(comEventSourceConsole, m_comEventListener); 218 213 } 219 214 … … 299 294 AssertPtrReturnVoid(m_pSession); 300 295 301 /* If event listener registered as passive one: */ 302 if (gEDataManager->eventHandlingType() == EventHandlingType_Passive) 303 { 304 /* Unregister everything: */ 305 m_pQtListener->getWrapped()->unregisterSources(); 306 } 296 /* Unregister everything: */ 297 m_pQtListener->getWrapped()->unregisterSources(); 307 298 308 299 /* Get console: */
Note:
See TracChangeset
for help on using the changeset viewer.