VirtualBox

Ignore:
Timestamp:
Nov 3, 2022 1:51:44 PM (2 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6669: Preferences/Settings dialog: A bit of cleanup for load/save functionality.

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

Legend:

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

    r97141 r97383  
    100100{
    101101    /* Load data: */
    102     loadOwnData();
     102    load();
    103103
    104104    /* Execute dialog: */
     
    109109{
    110110    /* Save data: */
    111     saveOwnData();
     111    save();
    112112
    113113    /* If serialization was clean: */
     
    348348     * which will be lost in such case: */
    349349    if (   !isSettingsChanged()
    350         || msgCenter().confirmSettingsDiscarding())
     350        || msgCenter().confirmSettingsDiscarding(this))
    351351    {
    352352        /* Call to base-class: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h

    r97141 r97383  
    5959using namespace UISettingsDefs;
    6060
    61 /** QIMainDialog aubclass used as
    62   * base dialog class for both Global & VM settings which encapsulates most of their common functionality. */
     61/** QIMainDialog subclass used as
     62  * base dialog class for both Global Preferences & Machine Settings
     63  * dialogs, which encapsulates most of their common functionality. */
    6364class SHARED_LIBRARY_STUFF UISettingsDialog : public QIWithRetranslateUI<QIMainDialog>
    6465{
     
    106107    virtual void closeEvent(QCloseEvent *pEvent) RT_OVERRIDE;
    107108
     109    /** Loads the dialog @a data. */
     110    void loadData(QVariant &data);
     111    /** Saves the dialog @a data. */
     112    void saveData(QVariant &data);
     113
     114    /** Loads the dialog data. */
     115    virtual void load() = 0;
     116    /** Saves the dialog data. */
     117    virtual void save() = 0;
     118
     119    /** Returns configuration access level. */
     120    ConfigurationAccessLevel configurationAccessLevel() const { return m_enmConfigurationAccessLevel; }
     121    /** Defines configuration access level. */
     122    void setConfigurationAccessLevel(ConfigurationAccessLevel enmConfigurationAccessLevel);
     123
    108124    /** Returns the serialize process instance. */
    109125    UISettingsSerializer *serializeProcess() const { return m_pSerializeProcess; }
    110126    /** Returns whether the serialization is in progress. */
    111127    bool isSerializationInProgress() const { return m_fSerializationIsInProgress; }
    112 
    113     /** Loads the @a data. */
    114     void loadData(QVariant &data);
    115     /** Wrapper for the method above.
    116       * Loads the data from the corresponding source. */
    117     virtual void loadOwnData() = 0;
    118 
    119     /** Saves the @a data. */
    120     void saveData(QVariant &data);
    121     /** Wrapper for the method above.
    122       * Saves the data to the corresponding source. */
    123     virtual void saveOwnData() = 0;
    124 
    125     /** Returns configuration access level. */
    126     ConfigurationAccessLevel configurationAccessLevel() const { return m_enmConfigurationAccessLevel; }
    127     /** Defines configuration access level. */
    128     void setConfigurationAccessLevel(ConfigurationAccessLevel enmConfigurationAccessLevel);
    129128
    130129    /** Returns the dialog title extension. */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp

    r97310 r97383  
    132132}
    133133
    134 void UISettingsDialogGlobal::loadOwnData()
     134void UISettingsDialogGlobal::load()
    135135{
    136136    /* Get host & properties: */
     
    146146}
    147147
    148 void UISettingsDialogGlobal::saveOwnData()
     148void UISettingsDialogGlobal::save()
    149149{
    150150    /* Get host & properties: */
     
    406406}
    407407
    408 void UISettingsDialogMachine::loadOwnData()
     408void UISettingsDialogMachine::load()
    409409{
    410410    /* Check that session is NOT created: */
     
    432432}
    433433
    434 void UISettingsDialogMachine::saveOwnData()
     434void UISettingsDialogMachine::save()
    435435{
    436436    /* Check that session is NOT created: */
     
    643643
    644644    /* Reload data: */
    645     loadOwnData();
     645    load();
    646646}
    647647
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.h

    r97135 r97383  
    6666    virtual void retranslateUi() RT_OVERRIDE;
    6767
    68     /** Loads the data from the corresponding source. */
    69     virtual void loadOwnData() RT_OVERRIDE;
    70     /** Saves the data to the corresponding source. */
    71     virtual void saveOwnData() RT_OVERRIDE;
     68    /** Loads the dialog data. */
     69    virtual void load() RT_OVERRIDE;
     70    /** Saves the dialog data. */
     71    virtual void save() RT_OVERRIDE;
    7272
    7373    /** Returns the dialog title extension. */
     
    114114    virtual void retranslateUi() RT_OVERRIDE;
    115115
    116     /** Loads the data from the corresponding source. */
    117     virtual void loadOwnData() RT_OVERRIDE;
    118     /** Saves the data to the corresponding source. */
    119     virtual void saveOwnData() RT_OVERRIDE;
     116    /** Loads the dialog data. */
     117    virtual void load() RT_OVERRIDE;
     118    /** Saves the dialog data. */
     119    virtual void save() RT_OVERRIDE;
    120120
    121121    /** Returns the dialog title extension. */
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