VirtualBox

Changeset 86541 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Oct 12, 2020 12:30:09 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: Event handling stuff: No more active event handling support, that was a temporary legacy mode.

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  
    109109template<> SHARED_LIBRARY_STUFF bool canConvert<DetailsElementType>();
    110110template<> SHARED_LIBRARY_STUFF bool canConvert<PreviewUpdateIntervalType>();
    111 template<> SHARED_LIBRARY_STUFF bool canConvert<EventHandlingType>();
    112111template<> SHARED_LIBRARY_STUFF bool canConvert<GUIFeatureType>();
    113112template<> SHARED_LIBRARY_STUFF bool canConvert<GlobalSettingsPageType>();
     
    232231template<> SHARED_LIBRARY_STUFF int toInternalInteger(const PreviewUpdateIntervalType &previewUpdateIntervalType);
    233232template<> SHARED_LIBRARY_STUFF PreviewUpdateIntervalType fromInternalInteger<PreviewUpdateIntervalType>(const int &iPreviewUpdateIntervalType);
    234 template<> SHARED_LIBRARY_STUFF EventHandlingType fromInternalString<EventHandlingType>(const QString &strEventHandlingType);
    235233template<> SHARED_LIBRARY_STUFF QString toInternalString(const GUIFeatureType &guiFeatureType);
    236234template<> SHARED_LIBRARY_STUFF GUIFeatureType fromInternalString<GUIFeatureType>(const QString &strGuiFeatureType);
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp

    r85772 r86541  
    6363template<> bool canConvert<DetailsElementType>() { return true; }
    6464template<> bool canConvert<PreviewUpdateIntervalType>() { return true; }
    65 template<> bool canConvert<EventHandlingType>() { return true; }
    6665template<> bool canConvert<GUIFeatureType>() { return true; }
    6766template<> bool canConvert<GlobalSettingsPageType>() { return true; }
     
    18131812}
    18141813
    1815 /* EventHandlingType <= QString: */
    1816 template<> EventHandlingType fromInternalString<EventHandlingType>(const QString &strEventHandlingType)
    1817 {
    1818     /* Here we have some fancy stuff allowing us
    1819      * 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 
    18301814/* QString <= GUIFeatureType: */
    18311815template<> QString toInternalString(const GUIFeatureType &guiFeatureType)
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp

    r86094 r86541  
    2121
    2222/* General: */
    23 const char *UIExtraDataDefs::GUI_EventHandlingType = "GUI/EventHandlingType";
    2423const char *UIExtraDataDefs::GUI_RestrictedDialogs = "GUI/RestrictedDialogs";
    2524
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h

    r86094 r86541  
    4444    /** @name General
    4545      * @{ */
    46         /** Holds event handling type. */
    47         SHARED_LIBRARY_STUFF extern const char *GUI_EventHandlingType;
    48 
    4946        /** Holds restricted dialogs. */
    5047        SHARED_LIBRARY_STUFF extern const char *GUI_RestrictedDialogs;
     
    794791
    795792
    796 /** Common UI: Event handling types. */
    797 enum EventHandlingType
    798 {
    799     EventHandlingType_Active,
    800     EventHandlingType_Passive
    801 };
    802 
    803 
    804793/** Common UI: GUI feature types. */
    805794enum GUIFeatureType
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r86233 r86541  
    177177
    178178    /* 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? */);
    181180    AssertWrapperOk(comEventSourceVBox);
    182181
    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);
    189184}
    190185
     
    207202void UIExtraDataEventHandler::cleanupListener()
    208203{
    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();
    215206
    216207    /* Make sure VBoxSVC is available: */
     
    19031894    return QStringList()
    19041895           << QString()
    1905            << GUI_EventHandlingType
    19061896           << GUI_RestrictedDialogs
    19071897           << GUI_SuppressMessages << GUI_InvertMessageOption
     
    22722262}
    22732263
    2274 EventHandlingType UIExtraDataManager::eventHandlingType()
    2275 {
    2276     return gpConverter->fromInternalString<EventHandlingType>(extraDataString(GUI_EventHandlingType));
    2277 }
    2278 
    22792264UIExtraDataMetaDefs::DialogType UIExtraDataManager::restrictedDialogTypes(const QUuid &uID)
    22802265{
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r86094 r86541  
    158158    /** @name General
    159159      * @{ */
    160         /** Returns event handling type. */
    161         EventHandlingType eventHandlingType();
    162 
    163160        /** Returns a list of restricted dialogs. */
    164161        UIExtraDataMetaDefs::DialogType restrictedDialogTypes(const QUuid &uID);
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIProgressEventHandler.cpp

    r86324 r86541  
    6464
    6565    /* 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? */);
    6867    AssertWrapperOk(comEventSourceProgress);
    6968
    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);
    7873}
    7974
     
    9994void UIProgressEventHandler::cleanupListener()
    10095{
    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();
    10798
    10899    /* Make sure VBoxSVC is available: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIVirtualBoxClientEventHandler.cpp

    r86154 r86541  
    120120
    121121    /* 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? */);
    124123    AssertWrapperOk(m_comEventSource);
    125124
    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);
    132127}
    133128
     
    148143void UIVirtualBoxClientEventHandlerProxy::cleanupListener()
    149144{
    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();
    156147
    157148    /* Unregister event listener for event source aggregator: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIVirtualBoxEventHandler.cpp

    r86154 r86541  
    171171
    172172    /* 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? */);
    175174    AssertWrapperOk(m_comEventSource);
    176175
    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);
    183178}
    184179
     
    241236void UIVirtualBoxEventHandlerProxy::cleanupListener()
    242237{
    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();
    249240
    250241    /* Unregister event listener for event source aggregator: */
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.cpp

    r86233 r86541  
    639639
    640640    /* 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);
    650645}
    651646
     
    656651    if (!comEventSource.isOk())
    657652        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();
    664655
    665656    /* Make sure VBoxSVC is available: */
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlTreeItem.cpp

    r82968 r86541  
    6767
    6868    /* 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);
    7873}
    7974
     
    8277    if (!comEventSource.isOk())
    8378        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();
    9081
    9182    /* Make sure VBoxSVC is available: */
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestProcessControlWidget.cpp

    r86233 r86541  
    466466
    467467    /* 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? */);
    470469    AssertWrapperOk(comEventSource);
    471470
    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);
    478473}
    479474
     
    521516void UIGuestProcessControlWidget::cleanupListener()
    522517{
    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();
    529520
    530521    /* Make sure VBoxSVC is available: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.cpp

    r82968 r86541  
    206206
    207207    /* 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? */);
    210209    AssertWrapperOk(comEventSourceConsole);
    211210
    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);
    218213}
    219214
     
    299294    AssertPtrReturnVoid(m_pSession);
    300295
    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();
    307298
    308299    /* Get console: */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette