Changeset 46782 in vbox
- Timestamp:
- Jun 25, 2013 2:58:15 PM (12 years ago)
- 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 32 32 const char* UIDefs::GUI_RecentListCD = "GUI/RecentListCD"; 33 33 const char* UIDefs::GUI_RecentListFD = "GUI/RecentListFD"; 34 const char* UIDefs::GUI_PreventApplicationUpdate = "GUI/PreventApplicationUpdate"; 34 35 35 36 /* Selector-window definitions: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h
r46763 r46782 104 104 extern const char* GUI_RecentListCD; 105 105 extern const char* GUI_RecentListFD; 106 extern const char* GUI_PreventApplicationUpdate; 106 107 107 108 /* Selector-window declarations: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r46763 r46782 3619 3619 3620 3620 /* static */ 3621 bool VBoxGlobal::isApprovedByExtraData(C Machine &machine, const QString &strExtraDataKey)3621 bool VBoxGlobal::isApprovedByExtraData(CVirtualBox &vbox, const QString &strExtraDataKey) 3622 3622 { 3623 3623 /* Load corresponding extra-data value: */ 3624 QString strExtraDataValue( machine.GetExtraData(strExtraDataKey));3624 QString strExtraDataValue(vbox.GetExtraData(strExtraDataKey)); 3625 3625 3626 3626 /* 'false' if value was not set: */ … … 3633 3633 || strExtraDataValue.compare("on", Qt::CaseInsensitive) == 0 3634 3634 || strExtraDataValue == "1"; 3635 } 3636 3637 /* static */ 3638 bool 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 */ 3655 bool VBoxGlobal::shouldWeAllowApplicationUpdate(CVirtualBox &vbox) 3656 { 3657 /* 'true' if disabling is not approved by the extra-data: */ 3658 return !isApprovedByExtraData(vbox, GUI_PreventApplicationUpdate); 3635 3659 } 3636 3660 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r46763 r46782 375 375 376 376 /* Extra-data settings stuff: */ 377 static bool isApprovedByExtraData(CVirtualBox &vbox, const QString &strExtraDataKey); 377 378 static bool isApprovedByExtraData(CMachine &machine, const QString &strExtraDataKey); 379 static bool shouldWeAllowApplicationUpdate(CVirtualBox &vbox); 378 380 static bool shouldWeShowMachine(CMachine &machine); 379 381 static bool shouldWeAllowMachineReconfiguration(CMachine &machine, -
trunk/src/VBox/Frontends/VirtualBox/src/net/UIUpdateManager.cpp
r45569 r46782 485 485 #ifdef VBOX_WITH_UPDATE_REQUEST 486 486 /* 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()) 488 490 QTimer::singleShot(0, this, SLOT(sltCheckIfUpdateIsNecessary())); 489 491 #endif /* VBOX_WITH_UPDATE_REQUEST */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
r45736 r46782 1317 1317 pMenu->addAction(m_pNetworkAccessManager); 1318 1318 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); 1320 1324 #ifndef Q_WS_MAC 1321 1325 pMenu->addSeparator();
Note:
See TracChangeset
for help on using the changeset viewer.