VirtualBox

Changeset 90253 in vbox


Ignore:
Timestamp:
Jul 20, 2021 9:56:47 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
145792
Message:

FE/Qt: bugref:10067: Extend UIProgressTask and underlying UIProgressObject with API to acquire cancelable state.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/globals
Files:
4 edited

Legend:

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

    r86772 r90253  
    55
    66/*
    7  * Copyright (C) 2006-2020 Oracle Corporation
     7 * Copyright (C) 2006-2021 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2828    : QObject(pParent)
    2929    , m_comProgress(comProgress)
     30    , m_fCancelable(false)
    3031    , m_pEventHandler(0)
    3132{
     
    9798void UIProgressObject::sltHandleProgressPercentageChange(const QUuid &, const int iPercent)
    9899{
     100    /* Update cancelable value: */
     101    m_fCancelable = m_comProgress.GetCancelable();
     102
     103    /* Notify listeners: */
    99104    emit sigProgressChange(m_comProgress.GetOperationCount(),
    100105                           m_comProgress.GetOperationDescription(),
     
    121126void UIProgressObject::prepare()
    122127{
     128    /* Init cancelable value: */
     129    m_fCancelable = m_comProgress.GetCancelable();
     130
    123131    /* Create CProgress event handler: */
    124132    m_pEventHandler = new UIProgressEventHandler(this, m_comProgress);
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIProgressObject.h

    r86772 r90253  
    55
    66/*
    7  * Copyright (C) 2009-2020 Oracle Corporation
     7 * Copyright (C) 2009-2021 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    7171    virtual ~UIProgressObject() /* override */;
    7272
     73    /** Returns whether progress is cancelable. */
     74    bool isCancelable() const { return m_fCancelable; }
     75
    7376    /** Executes the progress within local event-loop. */
    7477    void exec();
     
    9396    CProgress &m_comProgress;
    9497
     98    /** Holds whether progress is cancelable. */
     99    bool  m_fCancelable;
     100
    95101    /** Holds the progress event handler instance. */
    96102    UIProgressEventHandler *m_pEventHandler;
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIProgressTask.cpp

    r86793 r90253  
    55
    66/*
    7  * Copyright (C) 2020 Oracle Corporation
     7 * Copyright (C) 2020-2021 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4444{
    4545    return m_pProgressObject;
     46}
     47
     48bool UIProgressTask::isCancelable() const
     49{
     50    return m_pProgressObject ? m_pProgressObject->isCancelable() : false;
    4651}
    4752
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIProgressTask.h

    r86773 r90253  
    55
    66/*
    7  * Copyright (C) 2020 Oracle Corporation
     7 * Copyright (C) 2020-2021 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    6262    bool isRunning() const;
    6363
     64    /** Returns whether task is cancelable. */
     65    bool isCancelable() const;
     66
    6467public slots:
    6568
Note: See TracChangeset for help on using the changeset viewer.

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