VirtualBox

Ignore:
Timestamp:
May 3, 2012 10:23:07 PM (13 years ago)
Author:
vboxsync
Message:

FE/Qt: 5956: Network/Update Managers stuff: Never show Network Manager UI for an automatic-update case. Do not propose to cancel all the current network operations on Network Manager UI close-event.

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

Legend:

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

    r41017 r41153  
    19491949}
    19501950
    1951 bool UIMessageCenter::askAboutCancelOrLeaveAllNetworkRequest(QWidget *pParent)
    1952 {
    1953     return messageYesNo(pParent, Question, tr("Do you wish to cancel all current network operations or leave them running in the background?"),
    1954                         0 /* auto-confirm id */, tr("Cancel All"), tr("Leave in Background"));
    1955 }
    1956 
    19571951/**
    19581952 *  @return @c true if the user has confirmed input capture (this is always
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r41017 r41153  
    327327
    328328    bool askAboutCancelAllNetworkRequest(QWidget *pParent);
    329     bool askAboutCancelOrLeaveAllNetworkRequest(QWidget *pParent);
    330329
    331330    bool confirmInputCapture(bool *pfAutoConfirmed = NULL);
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkCustomer.cpp

    r41142 r41153  
    2525#include "UINetworkManager.h"
    2626
    27 UINetworkCustomer::UINetworkCustomer(QObject *pParent /* = 0 */)
     27UINetworkCustomer::UINetworkCustomer()
     28    : QObject(0)
     29    , m_fForceCall(true)
     30{
     31}
     32
     33UINetworkCustomer::UINetworkCustomer(QObject *pParent, bool fForceCall)
    2834    : QObject(pParent)
     35    , m_fForceCall(fForceCall)
    2936{
    3037}
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkCustomer.h

    r41142 r41153  
    3737public:
    3838
    39     /* Constructor: */
    40     UINetworkCustomer(QObject *pParent = 0);
     39    /* Constructors: */
     40    UINetworkCustomer();
     41    UINetworkCustomer(QObject *pParent, bool fForceCall);
     42
     43    /* Getters: */
     44    bool isItForceCall() const { return m_fForceCall; }
    4145
    4246    /* Network-reply progress handler: */
     
    5357    /* Network-request wrapper (set): */
    5458    void createNetworkRequest(const QList<QNetworkRequest> &requests, UINetworkRequestType type, const QString &strDescription);
     59
     60private:
     61
     62    /* Variables: */
     63    bool m_fForceCall;
    5564};
    5665
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkManager.cpp

    r41152 r41153  
    335335        /* Show button-box: */
    336336        m_pButtonBox->setHidden(false);
    337         /* Show dialog: */
    338         showNormal();
     337        /* If customer made a force-call: */
     338        if (pNetworkRequest->customer()->isItForceCall())
     339        {
     340            /* Show dialog: */
     341            showNormal();
     342        }
    339343
    340344        /* Return network-request widget: */
     
    401405        /* Pass event to the base-class: */
    402406        QMainWindow::showEvent(pShowEvent);
    403     }
    404 
    405     /* Overloaded close-event: */
    406     void closeEvent(QCloseEvent *pCloseEvent)
    407     {
    408         /* If there are network-requests present
    409          * ask if user wants to cancel all current network-requests
    410          * or leave them working at the background: */
    411         if (!m_widgets.isEmpty() &&
    412             msgCenter().askAboutCancelOrLeaveAllNetworkRequest(this))
    413             emit sigCancelNetworkRequests();
    414 
    415         /* Pass event to the base-class: */
    416         QMainWindow::closeEvent(pCloseEvent);
    417407    }
    418408
     
    854844
    855845/* Slot to handle network-request failure: */
    856 void UINetworkManager::sltHandleNetworkRequestFailure(const QUuid &uuid, const QString &strError)
    857 {
    858     /* Just show the dialog: */
    859     show();
    860     Q_UNUSED(uuid);
    861     Q_UNUSED(strError);
     846void UINetworkManager::sltHandleNetworkRequestFailure(const QUuid &uuid, const QString &)
     847{
     848    /* Make sure corresponding map contains received ID: */
     849    AssertMsg(m_requests.contains(uuid), ("Network-request NOT found!\n"));
     850
     851    /* Get corresponding network-request: */
     852    UINetworkRequest *pNetworkRequest = m_requests.value(uuid);
     853
     854    /* Get corresponding customer: */
     855    UINetworkCustomer *pNetworkCustomer = pNetworkRequest->customer();
     856
     857    /* If customer made a force-call: */
     858    if (pNetworkCustomer->isItForceCall())
     859    {
     860        /* Just show the dialog: */
     861        show();
     862    }
    862863}
    863864
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIUpdateManager.cpp

    r41145 r41153  
    9191
    9292    /* Constructor: */
    93     UIUpdateStep(UIUpdateQueue *pQueue) : UINetworkCustomer(pQueue)
     93    UIUpdateStep(UIUpdateQueue *pQueue, bool fForceCall) : UINetworkCustomer(pQueue, fForceCall)
    9494    {
    9595        /* If queue has no steps yet: */
     
    140140    /* Constructor: */
    141141    UIUpdateStepVirtualBox(UIUpdateQueue *pQueue, bool fForceCall)
    142         : UIUpdateStep(pQueue)
     142        : UIUpdateStep(pQueue, fForceCall)
    143143        , m_url("http://update.virtualbox.org/query.php")
    144         , m_fForceCall(fForceCall)
    145144    {
    146145    }
     
    217216        else
    218217        {
    219             if (m_fForceCall)
     218            if (isItForceCall())
    220219                msgCenter().showUpdateNotFound();
    221220        }
     
    240239    /* Variables: */
    241240    QUrl m_url;
    242     bool m_fForceCall;
    243241};
    244242
     
    251249
    252250    /* Constructor: */
    253     UIUpdateStepVirtualBoxExtensionPack(UIUpdateQueue *pQueue)
    254         : UIUpdateStep(pQueue)
     251    UIUpdateStepVirtualBoxExtensionPack(UIUpdateQueue *pQueue, bool fForceCall)
     252        : UIUpdateStep(pQueue, fForceCall)
    255253    {
    256254    }
     
    395393void UIUpdateManager::sltCheckIfUpdateIsNecessary(bool fForceCall /* = false */)
    396394{
    397     /* If already running => just open Network Access Manager GUI: */
     395    /* If already running: */
    398396    if (m_fIsRunning)
    399397    {
    400         gNetworkManager->show();
     398        /* And we have a force-call: */
     399        if (fForceCall)
     400        {
     401            /* Just show Network Access Manager: */
     402            gNetworkManager->show();
     403        }
    401404        return;
    402405    }
     
    413416        /* Prepare update queue: */
    414417        new UIUpdateStepVirtualBox(m_pQueue, fForceCall);
    415         new UIUpdateStepVirtualBoxExtensionPack(m_pQueue);
     418        new UIUpdateStepVirtualBoxExtensionPack(m_pQueue, fForceCall);
    416419        /* Start update queue: */
    417420        m_pQueue->start();
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