VirtualBox

Changeset 18300 in vbox for trunk/src


Ignore:
Timestamp:
Mar 26, 2009 10:34:25 AM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4: cancel support on long operations

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxProgressDialog.h

    r18299 r18300  
    6262    virtual void closeEvent (QCloseEvent *aEvent);
    6363
     64private slots:
     65    void cancelOperation();
     66
    6467private:
    6568    /* Private member vars */
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxProgressDialog.cpp

    r18299 r18300  
    6666    mCancelEnabled = aProgress.GetCancelable();
    6767    if (mCancelEnabled)
     68    {
    6869        setCancelButtonText(tr ("&Cancel"));
     70        connect (this, SIGNAL (canceled()),
     71                 this, SLOT (cancelOperation()));
     72    }
    6973}
    7074
     
    8993}
    9094
     95void VBoxProgressDialog::cancelOperation()
     96{
     97    mProgress.Cancel();
     98}
     99
    91100void VBoxProgressDialog::timerEvent (QTimerEvent * /* aEvent */)
    92101{
    93     if (!mEnded && (!mProgress.isOk() || mProgress.GetCompleted()))
     102    if (!mEnded && (!mProgress.isOk() || mProgress.GetCompleted() || mProgress.GetCanceled()))
    94103    {
    95104        /* Progress finished */
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