VirtualBox

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


Ignore:
Timestamp:
Aug 1, 2007 3:47:41 PM (17 years ago)
Author:
vboxsync
Message:

FE/Qt: GA Download UI: Show 0% initially.

File:
1 edited

Legend:

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

    r3957 r3971  
    230230        mProgressBar = new QProgressBar (this);
    231231        mProgressBar->setFixedWidth (100);
     232        mProgressBar->setPercentageVisible (true);
     233        mProgressBar->setProgress (0);
     234
    232235        mCancelButton = new QToolButton (this);
    233236        mCancelButton->setAutoRaise (true);
     
    273276    {
    274277        mCancelButton->setText (tr ("Cancel"));
    275         QToolTip::add (mProgressBar, tr ("Downloading the VirtualBox Guest Additions CD image "
    276                                          "from <nobr><b>%1</b>...</nobr>")
     278        QToolTip::add (mProgressBar, tr ("Downloading the VirtualBox Guest Additions "
     279                                         "CD image from <nobr><b>%1</b>...</nobr>")
    277280                                     .arg (mProtocol + mHost + mPath + mFile));
    278281        QToolTip::add (mCancelButton, tr ("Cancel the VirtualBox Guest "
     
    295298                if (mStatus == 404)
    296299                    abortDownload (tr ("Could not locate the file on "
    297                                        "the server."));
     300                                       "the server (response: %1).")
     301                                   .arg (mStatus));
    298302                else
    299303                    processFile (aTotal);
     
    352356    void processTimeout()
    353357    {
    354         if (mConnectDone) return;
     358        if (mConnectDone)
     359            return;
    355360        mHttp->abort();
    356         abortDownload (tr ("The download process has been cancelled "
    357                            "due to connection timeout."));
     361        abortDownload (tr ("Connection timed out."));
    358362    }
    359363
     
    401405        }
    402406        else
    403             abortDownload (tr ("Download rejected by user."));
    404     }
    405 
    406     /* This wrapper displays the error message box with the root cause of the
    407      * download procedure termination. It is also used to command the
    408      * downloader to terminate himself after all the events being processed. */
    409     void abortDownload (const QString &aReason)
     407            abortDownload();
     408    }
     409
     410    /* This wrapper displays an error message box (unless @aReason is
     411     * QString::null) with the cause of the download procedure
     412     * termination. After the message box is dismissed, the downloader signals
     413     * to close itself on the next event loop iteration. */
     414    void abortDownload (const QString &aReason = QString::null)
    410415    {
    411416        /* Protect against double kill request. */
    412         if (mSuicide) return;
     417        if (mSuicide)
     418            return;
    413419        mSuicide = true;
    414420
    415         vboxProblem().cannotDownloadGuestAdditions (mProtocol + mHost +
    416                                                     mPath + mFile, aReason);
     421        if (!aReason.isNull())
     422            vboxProblem().cannotDownloadGuestAdditions (mProtocol + mHost +
     423                                                        mPath + mFile, aReason);
    417424        /* Allows all the queued signals to be processed before quit. */
    418425        QTimer::singleShot (0, this, SLOT (suicide()));
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