VirtualBox

Changeset 37901 in vbox for trunk


Ignore:
Timestamp:
Jul 12, 2011 1:46:36 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
72803
Message:

FE/Qt: VM settings dialog: Warn the user about VM state was changed from 'offline' to 'runtime' (so only editable settings will be saved) if he has some changed settings.

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

Legend:

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

    r37570 r37901  
    742742}
    743743
     744void VBoxProblemReporter::warnAboutStateChange(QWidget *pParent)
     745{
     746    if (isAlreadyShown("warnAboutStateChange"))
     747        return;
     748    setShownStatus("warnAboutStateChange");
     749
     750    message(pParent ? pParent : mainWindowShown(), Warning,
     751            tr("The state of the virtual machine you currently edit has changed. "
     752               "Only settings which are editable at runtime are saved when you press OK. "
     753               "All changes to other settings will be lost."));
     754
     755    clearShownStatus("warnAboutStateChange");
     756}
     757
    744758void VBoxProblemReporter::cannotStartMachine (const CConsole &console)
    745759{
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.h

    r37570 r37901  
    203203
    204204    bool confirmedSettingsReloading(QWidget *pParent);
     205    void warnAboutStateChange(QWidget *pParent);
    205206
    206207    void cannotStartMachine (const CConsole &console);
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp

    r37649 r37901  
    10151015        return;
    10161016
     1017    /* Should we show a warning about leaving 'offline' state? */
     1018    bool fShouldWe = dialogType() == SettingsDialogType_Offline;
     1019
    10171020    /* Update current dialog type: */
    10181021    setDialogType(newDialogType);
     1022
     1023    /* Show a warning about leaving 'offline' state if we should: */
     1024    if (isSettingsChanged() && fShouldWe)
     1025        vboxProblem().warnAboutStateChange(this);
    10191026}
    10201027
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