Changeset 89323 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- May 27, 2021 2:23:11 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings/global
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsDisplay.cpp
r86978 r89323 5 5 6 6 /* 7 * Copyright (C) 2012-202 0Oracle Corporation7 * Copyright (C) 2012-2021 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 41 41 bool equal(const UIDataSettingsGlobalDisplay &other) const 42 42 { 43 return true43 return true 44 44 && (m_guiMaximumGuestScreenSizeValue == other.m_guiMaximumGuestScreenSizeValue) 45 45 && (m_fActivateHoveredMachineWindow == other.m_fActivateHoveredMachineWindow) 46 46 && (m_scaleFactors == other.m_scaleFactors) 47 ;47 ; 48 48 } 49 49 … … 61 61 }; 62 62 63 64 /********************************************************************************************************************************* 65 * Class UIGlobalSettingsDisplay implementation. * 66 *********************************************************************************************************************************/ 63 67 64 68 UIGlobalSettingsDisplay::UIGlobalSettingsDisplay() … … 129 133 130 134 /* Update data and failing state: */ 131 setFailed(!saveD isplayData());135 setFailed(!saveData()); 132 136 133 137 /* Upload properties to data: */ … … 240 244 } 241 245 242 bool UIGlobalSettingsDisplay::saveD isplayData()246 bool UIGlobalSettingsDisplay::saveData() 243 247 { 244 248 /* Prepare result: */ 245 249 bool fSuccess = true; 246 250 /* Save display settings from cache: */ 247 if (fSuccess && m_pCache->wasChanged()) 251 if ( fSuccess 252 && m_pCache->wasChanged()) 248 253 { 249 254 /* Get old data from cache: */ … … 253 258 254 259 /* Save maximum guest screen size and policy: */ 255 if (fSuccess && newData.m_guiMaximumGuestScreenSizeValue != oldData.m_guiMaximumGuestScreenSizeValue) 256 gEDataManager->setMaxGuestScreenResolution(newData.m_guiMaximumGuestScreenSizeValue.m_enmPolicy, 257 newData.m_guiMaximumGuestScreenSizeValue.m_size); 260 if ( fSuccess 261 && newData.m_guiMaximumGuestScreenSizeValue != oldData.m_guiMaximumGuestScreenSizeValue) 262 /* fSuccess = */ gEDataManager->setMaxGuestScreenResolution(newData.m_guiMaximumGuestScreenSizeValue.m_enmPolicy, 263 newData.m_guiMaximumGuestScreenSizeValue.m_size); 258 264 /* Save whether hovered machine-window should be activated automatically: */ 259 if (fSuccess && newData.m_fActivateHoveredMachineWindow != oldData.m_fActivateHoveredMachineWindow) 260 gEDataManager->setActivateHoveredMachineWindow(newData.m_fActivateHoveredMachineWindow); 265 if ( fSuccess 266 && newData.m_fActivateHoveredMachineWindow != oldData.m_fActivateHoveredMachineWindow) 267 /* fSuccess = */ gEDataManager->setActivateHoveredMachineWindow(newData.m_fActivateHoveredMachineWindow); 261 268 /* Save guest-screen scale-factor: */ 262 if (fSuccess && newData.m_scaleFactors != oldData.m_scaleFactors) 263 gEDataManager->setScaleFactors(newData.m_scaleFactors, UIExtraDataManager::GlobalID); 269 if ( fSuccess 270 && newData.m_scaleFactors != oldData.m_scaleFactors) 271 /* fSuccess = */ gEDataManager->setScaleFactors(newData.m_scaleFactors, UIExtraDataManager::GlobalID); 264 272 } 265 273 /* Return result: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsDisplay.h
r86978 r89323 5 5 6 6 /* 7 * Copyright (C) 2012-202 0Oracle Corporation7 * Copyright (C) 2012-2021 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 73 73 void cleanup(); 74 74 75 /** Saves existing data from thecache. */76 bool saveD isplayData();75 /** Saves existing data from cache. */ 76 bool saveData(); 77 77 78 78 /** Holds the page data cache instance. */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.cpp
r86122 r89323 5 5 6 6 /* 7 * Copyright (C) 2006-202 0Oracle Corporation7 * Copyright (C) 2006-2021 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 58 58 59 59 60 /********************************************************************************************************************************* 61 * Class UIGlobalSettingsGeneral implementation. * 62 *********************************************************************************************************************************/ 63 60 64 UIGlobalSettingsGeneral::UIGlobalSettingsGeneral() 61 65 : m_pCache(0) … … 196 200 bool fSuccess = true; 197 201 /* Save settings from cache: */ 198 if (fSuccess && m_pCache->wasChanged()) 202 if ( fSuccess 203 && m_pCache->wasChanged()) 199 204 { 200 205 /* Get old data from cache: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.cpp
r86124 r89323 5 5 6 6 /* 7 * Copyright (C) 2006-202 0Oracle Corporation7 * Copyright (C) 2006-2021 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 59 59 }; 60 60 61 62 /********************************************************************************************************************************* 63 * Class UIGlobalSettingsInput implementation. * 64 *********************************************************************************************************************************/ 61 65 62 66 UIGlobalSettingsInput::UIGlobalSettingsInput() … … 234 238 bool fSuccess = true; 235 239 /* Save settings from cache: */ 236 if (fSuccess && m_pCache->wasChanged()) 240 if ( fSuccess 241 && m_pCache->wasChanged()) 237 242 { 238 243 /* Get old data from cache: */ … … 242 247 243 248 /* Save new host-combo shortcut from cache: */ 244 const UIShortcutConfigurationItem fakeHostComboItem(UIHostCombo::hostComboCacheKey(), QString(), QString(), QString(), QString()); 245 const int iHostComboItemBase = UIShortcutSearchFunctor<UIShortcutConfigurationItem>()(oldData.m_shortcuts, fakeHostComboItem); 246 const int iHostComboItemData = UIShortcutSearchFunctor<UIShortcutConfigurationItem>()(newData.m_shortcuts, fakeHostComboItem); 247 const QString strHostComboBase = iHostComboItemBase != -1 ? oldData.m_shortcuts.at(iHostComboItemBase).currentSequence() : QString(); 248 const QString strHostComboData = iHostComboItemData != -1 ? newData.m_shortcuts.at(iHostComboItemData).currentSequence() : QString(); 249 if (strHostComboData != strHostComboBase) 250 gEDataManager->setHostKeyCombination(strHostComboData); 249 if (fSuccess) 250 { 251 const UIShortcutConfigurationItem fakeHostComboItem(UIHostCombo::hostComboCacheKey(), QString(), QString(), QString(), QString()); 252 const int iHostComboItemBase = UIShortcutSearchFunctor<UIShortcutConfigurationItem>()(oldData.m_shortcuts, fakeHostComboItem); 253 const int iHostComboItemData = UIShortcutSearchFunctor<UIShortcutConfigurationItem>()(newData.m_shortcuts, fakeHostComboItem); 254 const QString strHostComboBase = iHostComboItemBase != -1 ? oldData.m_shortcuts.at(iHostComboItemBase).currentSequence() : QString(); 255 const QString strHostComboData = iHostComboItemData != -1 ? newData.m_shortcuts.at(iHostComboItemData).currentSequence() : QString(); 256 if (strHostComboData != strHostComboBase) 257 /* fSuccess = */ gEDataManager->setHostKeyCombination(strHostComboData); 258 } 251 259 252 260 /* Save other new shortcuts from cache: */ 253 QMap<QString, QString> sequencesBase; 254 QMap<QString, QString> sequencesData; 255 foreach (const UIShortcutConfigurationItem &item, oldData.m_shortcuts) 256 sequencesBase.insert(item.key(), item.currentSequence()); 257 foreach (const UIShortcutConfigurationItem &item, newData.m_shortcuts) 258 sequencesData.insert(item.key(), item.currentSequence()); 259 if (sequencesData != sequencesBase) 260 gShortcutPool->setOverrides(sequencesData); 261 if (fSuccess) 262 { 263 QMap<QString, QString> sequencesBase; 264 QMap<QString, QString> sequencesData; 265 foreach (const UIShortcutConfigurationItem &item, oldData.m_shortcuts) 266 sequencesBase.insert(item.key(), item.currentSequence()); 267 foreach (const UIShortcutConfigurationItem &item, newData.m_shortcuts) 268 sequencesData.insert(item.key(), item.currentSequence()); 269 if (sequencesData != sequencesBase) 270 /* fSuccess = */ gShortcutPool->setOverrides(sequencesData); 271 } 261 272 262 273 /* Save other new things from cache: */ 263 if (newData.m_fAutoCapture != oldData.m_fAutoCapture) 264 gEDataManager->setAutoCaptureEnabled(newData.m_fAutoCapture); 274 if ( fSuccess 275 && newData.m_fAutoCapture != oldData.m_fAutoCapture) 276 /* fSuccess = */ gEDataManager->setAutoCaptureEnabled(newData.m_fAutoCapture); 265 277 } 266 278 /* Return result: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsLanguage.cpp
r86976 r89323 5 5 6 6 /* 7 * Copyright (C) 2006-202 0Oracle Corporation7 * Copyright (C) 2006-2021 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 36 36 bool equal(const UIDataSettingsGlobalLanguage &other) const 37 37 { 38 return true38 return true 39 39 && (m_strLanguageId == other.m_strLanguageId) 40 ;40 ; 41 41 } 42 42 … … 50 50 }; 51 51 52 53 /********************************************************************************************************************************* 54 * Class UIGlobalSettingsLanguage implementation. * 55 *********************************************************************************************************************************/ 52 56 53 57 UIGlobalSettingsLanguage::UIGlobalSettingsLanguage() … … 151 155 bool fSuccess = true; 152 156 /* Save settings from cache: */ 153 if (fSuccess && m_pCache->wasChanged()) 157 if ( fSuccess 158 && m_pCache->wasChanged()) 154 159 { 155 160 /* Get old data from cache: */ … … 159 164 160 165 /* Save new data from cache: */ 161 if (newData.m_strLanguageId != oldData.m_strLanguageId) 162 gEDataManager->setLanguageId(newData.m_strLanguageId); 166 if ( fSuccess 167 && newData.m_strLanguageId != oldData.m_strLanguageId) 168 /* fSuccess = */ gEDataManager->setLanguageId(newData.m_strLanguageId); 163 169 } 164 170 /* Return result: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsProxy.cpp
r86020 r89323 5 5 6 6 /* 7 * Copyright (C) 2011-202 0Oracle Corporation7 * Copyright (C) 2011-2021 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 48 48 bool equal(const UIDataSettingsGlobalProxy &other) const 49 49 { 50 return true50 return true 51 51 && (m_enmProxyMode == other.m_enmProxyMode) 52 52 && (m_strProxyHost == other.m_strProxyHost) 53 ;53 ; 54 54 } 55 55 … … 65 65 }; 66 66 67 68 /********************************************************************************************************************************* 69 * Class UIGlobalSettingsProxy implementation. * 70 *********************************************************************************************************************************/ 67 71 68 72 UIGlobalSettingsProxy::UIGlobalSettingsProxy() … … 76 80 , m_pEditorHost(0) 77 81 { 78 /* Prepare: */79 82 prepare(); 80 83 } … … 82 85 UIGlobalSettingsProxy::~UIGlobalSettingsProxy() 83 86 { 84 /* Cleanup: */85 87 cleanup(); 86 88 } … … 94 96 m_pCache->clear(); 95 97 96 /* Prepare old proxy data: */ 97 UIDataSettingsGlobalProxy oldProxyData; 98 99 /* Gather old proxy data: */ 100 oldProxyData.m_enmProxyMode = m_properties.GetProxyMode(); 101 oldProxyData.m_strProxyHost = m_properties.GetProxyURL(); 102 103 /* Cache old proxy data: */ 104 m_pCache->cacheInitialData(oldProxyData); 98 /* Cache old data: */ 99 UIDataSettingsGlobalProxy oldData; 100 oldData.m_enmProxyMode = m_properties.GetProxyMode(); 101 oldData.m_strProxyHost = m_properties.GetProxyURL(); 102 m_pCache->cacheInitialData(oldData); 105 103 106 104 /* Upload properties to data: */ … … 110 108 void UIGlobalSettingsProxy::getFromCache() 111 109 { 112 /* Get old proxy data from the cache: */ 113 const UIDataSettingsGlobalProxy &oldProxyData = m_pCache->base(); 114 115 /* Load old proxy data from the cache: */ 116 switch (oldProxyData.m_enmProxyMode) 110 /* Load old data from cache: */ 111 const UIDataSettingsGlobalProxy &oldData = m_pCache->base(); 112 switch (oldData.m_enmProxyMode) 117 113 { 118 114 case KProxyMode_System: m_pRadioButtonProxyAuto->setChecked(true); break; … … 121 117 case KProxyMode_Max: break; /* (compiler warnings) */ 122 118 } 123 m_pEditorHost->setText(old ProxyData.m_strProxyHost);119 m_pEditorHost->setText(oldData.m_strProxyHost); 124 120 sltHandleProxyToggle(); 125 121 … … 130 126 void UIGlobalSettingsProxy::putToCache() 131 127 { 132 /* Prepare new proxy data: */ 133 UIDataSettingsGlobalProxy newProxyData = m_pCache->base(); 134 135 /* Gather new proxy data: */ 136 newProxyData.m_enmProxyMode = m_pRadioButtonProxyEnabled->isChecked() ? KProxyMode_Manual 137 : m_pRadioButtonProxyDisabled->isChecked() ? KProxyMode_NoProxy : KProxyMode_System; 138 newProxyData.m_strProxyHost = m_pEditorHost->text(); 139 140 /* Cache new proxy data: */ 141 m_pCache->cacheCurrentData(newProxyData); 128 /* Prepare new data: */ 129 UIDataSettingsGlobalProxy newData = m_pCache->base(); 130 131 /* Cache new data: */ 132 newData.m_enmProxyMode = m_pRadioButtonProxyEnabled->isChecked() 133 ? KProxyMode_Manual : m_pRadioButtonProxyDisabled->isChecked() 134 ? KProxyMode_NoProxy : KProxyMode_System; 135 newData.m_strProxyHost = m_pEditorHost->text(); 136 m_pCache->cacheCurrentData(newData); 142 137 } 143 138 … … 147 142 UISettingsPageGlobal::fetchData(data); 148 143 149 /* Update proxydata and failing state: */150 setFailed(!save ProxyData());144 /* Update data and failing state: */ 145 setFailed(!saveData()); 151 146 152 147 /* Upload properties to data: */ … … 335 330 } 336 331 337 bool UIGlobalSettingsProxy::save ProxyData()332 bool UIGlobalSettingsProxy::saveData() 338 333 { 339 334 /* Prepare result: */ 340 335 bool fSuccess = true; 341 /* Save proxy settings from the cache: */ 342 if (fSuccess && m_pCache->wasChanged()) 343 { 344 /* Get old proxy data from the cache: */ 345 //const UIDataSettingsGlobalProxy &oldProxyData = m_pCache->base(); 346 /* Get new proxy data from the cache: */ 347 const UIDataSettingsGlobalProxy &newProxyData = m_pCache->data(); 348 349 /* Save new proxy data from the cache: */ 350 m_properties.SetProxyMode(newProxyData.m_enmProxyMode); 351 fSuccess &= m_properties.isOk(); 352 m_properties.SetProxyURL(newProxyData.m_strProxyHost); 353 fSuccess &= m_properties.isOk(); 336 /* Save settings from cache: */ 337 if ( fSuccess 338 && m_pCache->wasChanged()) 339 { 340 /* Get old data from cache: */ 341 //const UIDataSettingsGlobalProxy &oldData = m_pCache->base(); 342 /* Get new data from cache: */ 343 const UIDataSettingsGlobalProxy &newData = m_pCache->data(); 344 345 /* Save new data from cache: */ 346 if (fSuccess) 347 { 348 m_properties.SetProxyMode(newData.m_enmProxyMode); 349 fSuccess &= m_properties.isOk(); 350 } 351 if (fSuccess) 352 { 353 m_properties.SetProxyURL(newData.m_strProxyHost); 354 fSuccess &= m_properties.isOk(); 355 } 354 356 355 357 /* Drop the old extra data setting if still around: */ 356 if (fSuccess && !gEDataManager->proxySettings().isEmpty()) 357 gEDataManager->setProxySettings(QString()); 358 if ( fSuccess 359 && !gEDataManager->proxySettings().isEmpty()) 360 /* fSuccess = */ gEDataManager->setProxySettings(QString()); 358 361 } 359 362 /* Return result: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsProxy.h
r86095 r89323 5 5 6 6 /* 7 * Copyright (C) 2011-202 0Oracle Corporation7 * Copyright (C) 2011-2021 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 84 84 void cleanup(); 85 85 86 /** Saves existing proxy data from thecache. */87 bool save ProxyData();86 /** Saves existing proxy data from cache. */ 87 bool saveData(); 88 88 89 89 /** Holds the page data cache instance. */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsUpdate.cpp
r86128 r89323 5 5 6 6 /* 7 * Copyright (C) 2006-202 0Oracle Corporation7 * Copyright (C) 2006-2021 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 50 50 }; 51 51 52 53 /********************************************************************************************************************************* 54 * Class UIGlobalSettingsUpdate implementation. * 55 *********************************************************************************************************************************/ 52 56 53 57 UIGlobalSettingsUpdate::UIGlobalSettingsUpdate() … … 151 155 bool fSuccess = true; 152 156 /* Save update settings from cache: */ 153 if (fSuccess && m_pCache->wasChanged()) 157 if ( fSuccess 158 && m_pCache->wasChanged()) 154 159 { 155 160 /* Get old data from cache: */ … … 161 166 if ( fSuccess 162 167 && newData != oldData) 163 gEDataManager->setApplicationUpdateData(newData.m_guiUpdateData.data());168 /* fSuccess = */ gEDataManager->setApplicationUpdateData(newData.m_guiUpdateData.data()); 164 169 } 165 170 /* Return result: */
Note:
See TracChangeset
for help on using the changeset viewer.