VirtualBox

Ignore:
Timestamp:
Jun 25, 2013 2:58:15 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: Extra-data flag (GUI/PreventApplicationUpdate) to prevent application update and hide corresponding action.

File:
1 edited

Legend:

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

    r46763 r46782  
    36193619
    36203620/* static */
    3621 bool VBoxGlobal::isApprovedByExtraData(CMachine &machine, const QString &strExtraDataKey)
     3621bool VBoxGlobal::isApprovedByExtraData(CVirtualBox &vbox, const QString &strExtraDataKey)
    36223622{
    36233623    /* Load corresponding extra-data value: */
    3624     QString strExtraDataValue(machine.GetExtraData(strExtraDataKey));
     3624    QString strExtraDataValue(vbox.GetExtraData(strExtraDataKey));
    36253625
    36263626    /* 'false' if value was not set: */
     
    36333633           || strExtraDataValue.compare("on", Qt::CaseInsensitive) == 0
    36343634           || strExtraDataValue == "1";
     3635}
     3636
     3637/* static */
     3638bool VBoxGlobal::isApprovedByExtraData(CMachine &machine, const QString &strExtraDataKey)
     3639{
     3640    /* Load corresponding extra-data value: */
     3641    QString strExtraDataValue(machine.GetExtraData(strExtraDataKey));
     3642
     3643    /* 'false' if value was not set: */
     3644    if (strExtraDataValue.isEmpty())
     3645        return false;
     3646
     3647    /* Handle particular values: */
     3648    return    strExtraDataValue.compare("true", Qt::CaseInsensitive) == 0
     3649           || strExtraDataValue.compare("yes", Qt::CaseInsensitive) == 0
     3650           || strExtraDataValue.compare("on", Qt::CaseInsensitive) == 0
     3651           || strExtraDataValue == "1";
     3652}
     3653
     3654/* static */
     3655bool VBoxGlobal::shouldWeAllowApplicationUpdate(CVirtualBox &vbox)
     3656{
     3657    /* 'true' if disabling is not approved by the extra-data: */
     3658    return !isApprovedByExtraData(vbox, GUI_PreventApplicationUpdate);
    36353659}
    36363660
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