VirtualBox

Changeset 46782 in vbox


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.

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

Legend:

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

    r46763 r46782  
    3232const char* UIDefs::GUI_RecentListCD = "GUI/RecentListCD";
    3333const char* UIDefs::GUI_RecentListFD = "GUI/RecentListFD";
     34const char* UIDefs::GUI_PreventApplicationUpdate = "GUI/PreventApplicationUpdate";
    3435
    3536/* Selector-window definitions: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h

    r46763 r46782  
    104104    extern const char* GUI_RecentListCD;
    105105    extern const char* GUI_RecentListFD;
     106    extern const char* GUI_PreventApplicationUpdate;
    106107
    107108    /* Selector-window declarations: */
  • 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
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r46763 r46782  
    375375
    376376    /* Extra-data settings stuff: */
     377    static bool isApprovedByExtraData(CVirtualBox &vbox, const QString &strExtraDataKey);
    377378    static bool isApprovedByExtraData(CMachine &machine, const QString &strExtraDataKey);
     379    static bool shouldWeAllowApplicationUpdate(CVirtualBox &vbox);
    378380    static bool shouldWeShowMachine(CMachine &machine);
    379381    static bool shouldWeAllowMachineReconfiguration(CMachine &machine,
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIUpdateManager.cpp

    r45569 r46782  
    485485#ifdef VBOX_WITH_UPDATE_REQUEST
    486486    /* Ask updater to check for the first time: */
    487     if (!vboxGlobal().isVMConsoleProcess())
     487    CVirtualBox vbox = vboxGlobal().virtualBox();
     488    if (VBoxGlobal::shouldWeAllowApplicationUpdate(vbox) &&
     489        !vboxGlobal().isVMConsoleProcess())
    488490        QTimer::singleShot(0, this, SLOT(sltCheckIfUpdateIsNecessary()));
    489491#endif /* VBOX_WITH_UPDATE_REQUEST */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r45736 r46782  
    13171317    pMenu->addAction(m_pNetworkAccessManager);
    13181318    m_pUpdateAction = gActionPool->action(UIActionIndex_Simple_CheckForUpdates);
    1319     pMenu->addAction(m_pUpdateAction);
     1319    CVirtualBox vbox = vboxGlobal().virtualBox();
     1320    if (VBoxGlobal::shouldWeAllowApplicationUpdate(vbox))
     1321        pMenu->addAction(m_pUpdateAction);
     1322    else
     1323        m_pUpdateAction->setEnabled(false);
    13201324#ifndef Q_WS_MAC
    13211325    pMenu->addSeparator();
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