VirtualBox

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


Ignore:
Timestamp:
Feb 5, 2025 3:51:45 PM (3 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167371
Message:

FE/Qt: Message-center: Make sure confirmSettingsDiscarding and confirmSettingsReloading messages do not interfere each other; That can happen on dialog closing if saving some setting was failed while saving others was't.

File:
1 edited

Legend:

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

    r107599 r108077  
    788788bool UIMessageCenter::confirmSettingsDiscarding(QWidget *pParent /* = 0 */) const
    789789{
    790     return questionBinary(pParent, MessageType_Question,
    791                           tr("<p>The machine settings were changed.</p>"
    792                              "<p>Would you like to discard the changed settings or to keep editing them?</p>"),
    793                           0 /* auto-confirm id */,
    794                           tr("Discard changes"), tr("Keep editing"));
    795 
     790    if (   warningShown("confirmSettingsDiscarding")
     791        || warningShown("confirmSettingsReloading"))
     792        return false;
     793    setWarningShown("confirmSettingsDiscarding", true);
     794
     795    const bool fResult = questionBinary(pParent, MessageType_Question,
     796                                        tr("<p>The machine settings were changed.</p>"
     797                                           "<p>Would you like to discard the changed settings or to keep editing them?</p>"),
     798                                        0 /* auto-confirm id */,
     799                                        tr("Discard changes"), tr("Keep editing"));
     800
     801    setWarningShown("confirmSettingsDiscarding", false);
     802
     803    return fResult;
    796804}
    797805
    798806bool UIMessageCenter::confirmSettingsReloading(QWidget *pParent /* = 0 */) const
    799807{
    800     if (warningShown("confirmSettingsReloading"))
     808    if (   warningShown("confirmSettingsReloading")
     809        || warningShown("confirmSettingsDiscarding"))
    801810        return false;
    802811    setWarningShown("confirmSettingsReloading", true);
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