VirtualBox

Changeset 47579 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 7, 2013 10:29:50 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
87779
Message:

FE/Qt: Settings dialog: New validation stuff: Step 4 (Perform cascade revalidation only *after* page loading).

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

Legend:

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

    r47563 r47579  
    204204            /* If such page present we should fetch internal page cache: */
    205205            if (m_pages.contains(iPageId))
    206                 m_pages[iPageId]->getFromCache();
     206            {
     207                UISettingsPage *pSettingsPage = m_pages[iPageId];
     208                pSettingsPage->setValidatorBlocked(true);
     209                pSettingsPage->getFromCache();
     210                pSettingsPage->setValidatorBlocked(false);
     211            }
    207212        }
    208213    }
     
    217222            if (!m_fSavingComplete)
    218223                m_fSavingComplete = true;
     224        }
     225        /* If serializer loads settings: */
     226        else
     227        {
     228            /* We have to do initial validation finally: */
     229            foreach (UISettingsPage *pPage, m_pages.values())
     230                pPage->revalidate();
    219231        }
    220232    }
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.cpp

    r47573 r47579  
    3131    , m_pFirstWidget(0)
    3232    , m_pValidator(0)
     33    , m_fIsValidatorBlocked(true)
    3334{
    3435}
     
    4849{
    4950    /* Revalidate if possible: */
    50     if (m_pValidator)
     51    if (m_pValidator && !m_fIsValidatorBlocked)
    5152        m_pValidator->revalidate();
    5253}
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.h

    r47573 r47579  
    9494    /* Validation stuff: */
    9595    void setValidator(UIPageValidator *pValidator);
     96    void setValidatorBlocked(bool fIsValidatorBlocked) { m_fIsValidatorBlocked = fIsValidatorBlocked; }
    9697    virtual bool validate(QString& /* strWarningText */, QString& /* strTitle */) { return true; }
    9798
     
    149150    QWidget *m_pFirstWidget;
    150151    UIPageValidator *m_pValidator;
     152    bool m_fIsValidatorBlocked;
    151153};
    152154
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