VirtualBox

Changeset 76835 in vbox


Ignore:
Timestamp:
Jan 16, 2019 11:54:21 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9361: Handle unhandled URL arguments later, when VirtualBox Manager UI is ready and shown, this prevents double manager creation.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIStarter.cpp

    r76825 r76835  
    8080    connect(&vboxGlobal(), &VBoxGlobal::sigAskToRestartUI,
    8181            this, &UIStarter::sltRestartUI);
    82     connect(&vboxGlobal(), &VBoxGlobal::sigAskToOpenURLs,
    83             this, &UIStarter::sltOpenURLs);
    8482    connect(&vboxGlobal(), &VBoxGlobal::sigAskToCommitData,
    8583            this, &UIStarter::sltHandleCommitDataRequest);
     
    9189    disconnect(&vboxGlobal(), &VBoxGlobal::sigAskToRestartUI,
    9290               this, &UIStarter::sltRestartUI);
    93     disconnect(&vboxGlobal(), &VBoxGlobal::sigAskToOpenURLs,
    94                this, &UIStarter::sltOpenURLs);
    9591    disconnect(&vboxGlobal(), &VBoxGlobal::sigAskToCommitData,
    9692               this, &UIStarter::sltHandleCommitDataRequest);
     
    173169}
    174170
    175 void UIStarter::sltOpenURLs()
    176 {
    177 #ifndef VBOX_RUNTIME_UI
    178     /* Create/show manager-window: */
    179     UIVirtualBoxManager::create();
    180 
    181     /* Ask the Manager UI to open URLs asynchronously: */
    182     QMetaObject::invokeMethod(gpManager, "sltHandleOpenUrlCall", Qt::QueuedConnection);
    183 #endif
    184 }
    185 
    186171void UIStarter::sltHandleCommitDataRequest()
    187172{
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIStarter.h

    r76581 r76835  
    6464    void cleanup();
    6565
    66     /** Opens URLs in Selector UI. */
    67     void sltOpenURLs();
    68 
    6966    /** Handles commit data request. */
    7067    void sltHandleCommitDataRequest();
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r76834 r76835  
    496496    if (!listArgUrls.isEmpty())
    497497    {
    498         /* We store them: */
     498        /* We store them, they will be handled later: */
    499499        m_listArgUrls = listArgUrls;
    500         /* And ask UIStarter to open them: */
    501         emit sigAskToOpenURLs();
    502500    }
    503501
    504502    return fResult;
     503}
     504
     505bool VBoxGlobal::argumentUrlsPresent() const
     506{
     507    return !m_listArgUrls.isEmpty();
    505508}
    506509
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r76826 r76835  
    7676    /** @} */
    7777
    78     /** @name Process arguments stuff.
    79      * @{ */
    80         /** Asks #UIStarter listener to open URLs. */
    81         void sigAskToOpenURLs();
    82     /** @} */
    83 
    8478    /** @name COM stuff.
    8579     * @{ */
     
    201195        bool processArgs();
    202196
     197        /** Returns whether there are unhandled URL arguments present. */
     198        bool argumentUrlsPresent() const;
    203199        /** Takes and returns the URL argument list while clearing the source. */
    204200        QList<QUrl> takeArgumentUrls();
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r76815 r76835  
    12401240    }
    12411241#endif /* VBOX_WS_MAC */
     1242
     1243    /* If there are unhandled URLs we should handle them after manager is shown: */
     1244    if (vboxGlobal().argumentUrlsPresent())
     1245        QMetaObject::invokeMethod(this, "sltHandleOpenUrlCall", Qt::QueuedConnection);
    12421246}
    12431247
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