VirtualBox

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


Ignore:
Timestamp:
Feb 3, 2017 1:34:25 PM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: Settings dialog: Do not close the dialog on OK if save procedure had issues delivered through the new notification mechanism.

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

Legend:

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

    r64159 r65600  
    6464    , m_pSerializeProcess(0)
    6565    , m_fSerializationIsInProgress(false)
     66    , m_fSerializationClean(true)
    6667    /* Status-bar stuff: */
    6768    , m_pStatusBar(0)
     
    177178    saveOwnData();
    178179
    179     /* Call to base-class: */
    180     QIWithRetranslateUI<QIMainDialog>::accept();
     180    /* If serialization was clean: */
     181    if (m_fSerializationClean)
     182    {
     183        /* Call to base-class: */
     184        QIWithRetranslateUI<QIMainDialog>::accept();
     185    }
    181186}
    182187
     
    332337        if (pDlgSerializeProgress)
    333338        {
     339            /* Remember whether the serialization was clean: */
     340            m_fSerializationClean = pDlgSerializeProgress->isClean();
     341
    334342            /* Upload 'settings saver' data: */
    335343            data = pDlgSerializeProgress->data();
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h

    r63978 r65600  
    147147    /** Holds whether the serialization is in progress. */
    148148    bool m_fSerializationIsInProgress;
     149    /** Holds whether there were no serialization errors. */
     150    bool m_fSerializationClean;
    149151
    150152    /* Status bar widget: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsSerializer.cpp

    r62493 r65600  
    204204    , m_pLabelSubOperationProgress(0)
    205205    , m_pBarSubOperationProgress(0)
     206    , m_fClean(true)
    206207{
    207208    /* Prepare: */
     
    383384void UISettingsSerializerProgress::sltHandleOperationProgressError(QString strErrorInfo)
    384385{
     386    /* Mark the serialization process dirty: */
     387    m_fClean = false;
     388
    385389    /* Show the error message: */
    386390    msgCenter().cannotSaveSettings(strErrorInfo, this);
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsSerializer.h

    r62493 r65600  
    166166    QVariant& data();
    167167
     168    /** Returns whether there were no errors. */
     169    bool isClean() const { return m_fClean; }
     170
    168171protected:
    169172
     
    223226    QProgressBar *m_pBarSubOperationProgress;
    224227
     228    /** Holds whether there were no errors. */
     229    bool m_fClean;
     230
    225231    /** Holds the template for the sub-operation progress label. */
    226232    static QString m_strProgressDescriptionTemplate;
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