Changeset 94666 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Apr 21, 2022 11:30:04 AM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings/global
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsDisplay.cpp
r94357 r94666 84 84 void UIGlobalSettingsDisplay::loadToCacheFrom(QVariant &data) 85 85 { 86 /* Sanity check: */ 87 if (!m_pCache) 88 return; 89 86 90 /* Fetch data to properties: */ 87 91 UISettingsPageGlobal::fetchData(data); … … 107 111 void UIGlobalSettingsDisplay::getFromCache() 108 112 { 113 /* Sanity check: */ 114 if (!m_pCache) 115 return; 116 109 117 /* Load old data from cache: */ 110 118 const UIDataSettingsGlobalDisplay &oldData = m_pCache->base(); 111 m_pEditorMaximumGuestScreenSize->setValue(oldData.m_guiMaximumGuestScreenSizeValue); 112 m_pEditorScaleFactor->setScaleFactors(oldData.m_scaleFactors); 113 m_pEditorScaleFactor->setMonitorCount(gpDesktop->screenCount()); 114 m_pEditorGlobalDisplayFeatures->setActivateOnMouseHover(oldData.m_fActivateHoveredMachineWindow); 115 m_pEditorGlobalDisplayFeatures->setDisableHostScreenSaver(oldData.m_fDisableHostScreenSaver); 119 if (m_pEditorMaximumGuestScreenSize) 120 m_pEditorMaximumGuestScreenSize->setValue(oldData.m_guiMaximumGuestScreenSizeValue); 121 if (m_pEditorScaleFactor) 122 { 123 m_pEditorScaleFactor->setScaleFactors(oldData.m_scaleFactors); 124 m_pEditorScaleFactor->setMonitorCount(gpDesktop->screenCount()); 125 } 126 if (m_pEditorGlobalDisplayFeatures) 127 { 128 m_pEditorGlobalDisplayFeatures->setActivateOnMouseHover(oldData.m_fActivateHoveredMachineWindow); 129 m_pEditorGlobalDisplayFeatures->setDisableHostScreenSaver(oldData.m_fDisableHostScreenSaver); 130 } 116 131 } 117 132 118 133 void UIGlobalSettingsDisplay::putToCache() 119 134 { 135 /* Sanity check: */ 136 if (!m_pCache) 137 return; 138 120 139 /* Prepare new data: */ 121 140 UIDataSettingsGlobalDisplay newData = m_pCache->base(); 122 141 123 142 /* Cache new data: */ 124 newData.m_guiMaximumGuestScreenSizeValue = m_pEditorMaximumGuestScreenSize->value(); 125 newData.m_scaleFactors = m_pEditorScaleFactor->scaleFactors(); 126 newData.m_fActivateHoveredMachineWindow = m_pEditorGlobalDisplayFeatures->activateOnMouseHover(); 127 newData.m_fDisableHostScreenSaver = m_pEditorGlobalDisplayFeatures->disableHostScreenSaver(); 143 if (m_pEditorMaximumGuestScreenSize) 144 newData.m_guiMaximumGuestScreenSizeValue = m_pEditorMaximumGuestScreenSize->value(); 145 if (m_pEditorScaleFactor) 146 newData.m_scaleFactors = m_pEditorScaleFactor->scaleFactors(); 147 if (m_pEditorGlobalDisplayFeatures) 148 { 149 newData.m_fActivateHoveredMachineWindow = m_pEditorGlobalDisplayFeatures->activateOnMouseHover(); 150 newData.m_fDisableHostScreenSaver = m_pEditorGlobalDisplayFeatures->disableHostScreenSaver(); 151 } 128 152 m_pCache->cacheCurrentData(newData); 129 153 } … … 201 225 bool UIGlobalSettingsDisplay::saveData() 202 226 { 227 /* Sanity check: */ 228 if (!m_pCache) 229 return false; 230 203 231 /* Prepare result: */ 204 232 bool fSuccess = true; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.cpp
r94288 r94666 76 76 void UIGlobalSettingsGeneral::loadToCacheFrom(QVariant &data) 77 77 { 78 /* Sanity check: */ 79 if (!m_pCache) 80 return; 81 78 82 /* Fetch data to properties: */ 79 83 UISettingsPageGlobal::fetchData(data); … … 94 98 void UIGlobalSettingsGeneral::getFromCache() 95 99 { 100 /* Sanity check: */ 101 if (!m_pCache) 102 return; 103 96 104 /* Load old data from cache: */ 97 105 const UIDataSettingsGlobalGeneral &oldData = m_pCache->base(); 98 m_pEditorDefaultMachineFolder->setValue(oldData.m_strDefaultMachineFolder); 99 m_pEditorVRDEAuthLibrary->setValue(oldData.m_strVRDEAuthLibrary); 106 if (m_pEditorDefaultMachineFolder) 107 m_pEditorDefaultMachineFolder->setValue(oldData.m_strDefaultMachineFolder); 108 if (m_pEditorVRDEAuthLibrary) 109 m_pEditorVRDEAuthLibrary->setValue(oldData.m_strVRDEAuthLibrary); 100 110 } 101 111 102 112 void UIGlobalSettingsGeneral::putToCache() 103 113 { 114 /* Sanity check: */ 115 if (!m_pCache) 116 return; 117 104 118 /* Prepare new data: */ 105 119 UIDataSettingsGlobalGeneral newData = m_pCache->base(); 106 120 107 121 /* Cache new data: */ 108 newData.m_strDefaultMachineFolder = m_pEditorDefaultMachineFolder->value(); 109 newData.m_strVRDEAuthLibrary = m_pEditorVRDEAuthLibrary->value(); 122 if (m_pEditorDefaultMachineFolder) 123 newData.m_strDefaultMachineFolder = m_pEditorDefaultMachineFolder->value(); 124 if (m_pEditorVRDEAuthLibrary) 125 newData.m_strVRDEAuthLibrary = m_pEditorVRDEAuthLibrary->value(); 110 126 m_pCache->cacheCurrentData(newData); 111 127 } … … 176 192 bool UIGlobalSettingsGeneral::saveData() 177 193 { 194 /* Sanity check: */ 195 if (!m_pCache) 196 return false; 197 178 198 /* Prepare result: */ 179 199 bool fSuccess = true; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.cpp
r94323 r94666 77 77 void UIGlobalSettingsInput::loadToCacheFrom(QVariant &data) 78 78 { 79 /* Sanity check: */ 80 if (!m_pCache) 81 return; 82 79 83 /* Fetch data to properties: */ 80 84 UISettingsPageGlobal::fetchData(data); … … 112 116 void UIGlobalSettingsInput::getFromCache() 113 117 { 118 /* Sanity check: */ 119 if (!m_pCache) 120 return; 121 114 122 /* Load old data from cache: */ 115 123 const UIDataSettingsGlobalInput &oldData = m_pCache->base(); 116 m_pEditorShortcutConfiguration->load(oldData.m_shortcuts); 117 m_pEditorAutoCaptureKeyboard->setValue(oldData.m_fAutoCapture); 124 if (m_pEditorShortcutConfiguration) 125 m_pEditorShortcutConfiguration->load(oldData.m_shortcuts); 126 if (m_pEditorAutoCaptureKeyboard) 127 m_pEditorAutoCaptureKeyboard->setValue(oldData.m_fAutoCapture); 118 128 119 129 /* Revalidate: */ … … 123 133 void UIGlobalSettingsInput::putToCache() 124 134 { 135 /* Sanity check: */ 136 if (!m_pCache) 137 return; 138 125 139 /* Prepare new data: */ 126 140 UIDataSettingsGlobalInput newData = m_pCache->base(); 127 141 128 142 /* Cache new data: */ 129 m_pEditorShortcutConfiguration->save(newData.m_shortcuts); 130 newData.m_fAutoCapture = m_pEditorAutoCaptureKeyboard->value(); 143 if (m_pEditorShortcutConfiguration) 144 m_pEditorShortcutConfiguration->save(newData.m_shortcuts); 145 if (m_pEditorAutoCaptureKeyboard) 146 newData.m_fAutoCapture = m_pEditorAutoCaptureKeyboard->value(); 131 147 m_pCache->cacheCurrentData(newData); 132 148 } … … 224 240 bool UIGlobalSettingsInput::saveData() 225 241 { 242 /* Sanity check: */ 243 if (!m_pCache) 244 return false; 245 226 246 /* Prepare result: */ 227 247 bool fSuccess = true; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInterface.cpp
r94333 r94666 69 69 void UIGlobalSettingsInterface::loadToCacheFrom(QVariant &data) 70 70 { 71 /* Sanity check: */ 72 if (!m_pCache) 73 return; 74 71 75 /* Fetch data to properties: */ 72 76 UISettingsPageGlobal::fetchData(data); … … 86 90 void UIGlobalSettingsInterface::getFromCache() 87 91 { 92 /* Sanity check: */ 93 if (!m_pCache) 94 return; 95 88 96 /* Load old data from cache: */ 89 97 const UIDataSettingsGlobalInterface &oldData = m_pCache->base(); 90 m_pEditorColorTheme->setValue(oldData.m_enmColorTheme); 98 if (m_pEditorColorTheme) 99 m_pEditorColorTheme->setValue(oldData.m_enmColorTheme); 91 100 92 101 /* Revalidate: */ … … 96 105 void UIGlobalSettingsInterface::putToCache() 97 106 { 107 /* Sanity check: */ 108 if (!m_pCache) 109 return; 110 98 111 /* Prepare new data: */ 99 112 UIDataSettingsGlobalInterface newData; 100 113 101 114 /* Cache new data: */ 102 newData.m_enmColorTheme = m_pEditorColorTheme->value(); 115 if (m_pEditorColorTheme) 116 newData.m_enmColorTheme = m_pEditorColorTheme->value(); 103 117 m_pCache->cacheCurrentData(newData); 104 118 } … … 158 172 bool UIGlobalSettingsInterface::saveData() 159 173 { 174 /* Sanity check: */ 175 if (!m_pCache) 176 return false; 177 160 178 /* Prepare result: */ 161 179 bool fSuccess = true; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsLanguage.cpp
r94323 r94666 69 69 void UIGlobalSettingsLanguage::loadToCacheFrom(QVariant &data) 70 70 { 71 /* Sanity check: */ 72 if (!m_pCache) 73 return; 74 71 75 /* Fetch data to properties: */ 72 76 UISettingsPageGlobal::fetchData(data); … … 86 90 void UIGlobalSettingsLanguage::getFromCache() 87 91 { 92 /* Sanity check: */ 93 if (!m_pCache) 94 return; 95 88 96 /* Load old data from cache: */ 89 97 const UIDataSettingsGlobalLanguage &oldData = m_pCache->base(); 90 m_pEditorLanguageSettings->setValue(oldData.m_strLanguageId); 98 if (m_pEditorLanguageSettings) 99 m_pEditorLanguageSettings->setValue(oldData.m_strLanguageId); 91 100 } 92 101 93 102 void UIGlobalSettingsLanguage::putToCache() 94 103 { 104 /* Sanity check: */ 105 if (!m_pCache) 106 return; 107 95 108 /* Prepare new data: */ 96 109 UIDataSettingsGlobalLanguage newData = m_pCache->base(); 97 110 98 111 /* Cache new data: */ 99 newData.m_strLanguageId = m_pEditorLanguageSettings->value(); 112 if (m_pEditorLanguageSettings) 113 newData.m_strLanguageId = m_pEditorLanguageSettings->value(); 100 114 m_pCache->cacheCurrentData(newData); 101 115 } … … 152 166 bool UIGlobalSettingsLanguage::saveData() 153 167 { 168 /* Sanity check: */ 169 if (!m_pCache) 170 return false; 171 154 172 /* Prepare result: */ 155 173 bool fSuccess = true; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsProxy.cpp
r94323 r94666 76 76 void UIGlobalSettingsProxy::loadToCacheFrom(QVariant &data) 77 77 { 78 /* Sanity check: */ 79 if (!m_pCache) 80 return; 81 78 82 /* Fetch data to properties: */ 79 83 UISettingsPageGlobal::fetchData(data); … … 94 98 void UIGlobalSettingsProxy::getFromCache() 95 99 { 100 /* Sanity check: */ 101 if (!m_pCache) 102 return; 103 96 104 /* Load old data from cache: */ 97 105 const UIDataSettingsGlobalProxy &oldData = m_pCache->base(); 98 m_pEditorGlobalProxyFeatures->setProxyMode(oldData.m_enmProxyMode); 99 m_pEditorGlobalProxyFeatures->setProxyHost(oldData.m_strProxyHost); 106 if (m_pEditorGlobalProxyFeatures) 107 { 108 m_pEditorGlobalProxyFeatures->setProxyMode(oldData.m_enmProxyMode); 109 m_pEditorGlobalProxyFeatures->setProxyHost(oldData.m_strProxyHost); 110 } 100 111 101 112 /* Revalidate: */ … … 105 116 void UIGlobalSettingsProxy::putToCache() 106 117 { 118 /* Sanity check: */ 119 if (!m_pCache) 120 return; 121 107 122 /* Prepare new data: */ 108 123 UIDataSettingsGlobalProxy newData = m_pCache->base(); 109 124 110 125 /* Cache new data: */ 111 newData.m_enmProxyMode = m_pEditorGlobalProxyFeatures->proxyMode(); 112 newData.m_strProxyHost = m_pEditorGlobalProxyFeatures->proxyHost(); 126 if (m_pEditorGlobalProxyFeatures) 127 { 128 newData.m_enmProxyMode = m_pEditorGlobalProxyFeatures->proxyMode(); 129 newData.m_strProxyHost = m_pEditorGlobalProxyFeatures->proxyHost(); 130 } 113 131 m_pCache->cacheCurrentData(newData); 114 132 } … … 225 243 bool UIGlobalSettingsProxy::saveData() 226 244 { 245 /* Sanity check: */ 246 if (!m_pCache) 247 return false; 248 227 249 /* Prepare result: */ 228 250 bool fSuccess = true; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsUpdate.cpp
r94323 r94666 69 69 void UIGlobalSettingsUpdate::loadToCacheFrom(QVariant &data) 70 70 { 71 /* Sanity check: */ 72 if (!m_pCache) 73 return; 74 71 75 /* Fetch data to properties: */ 72 76 UISettingsPageGlobal::fetchData(data); … … 86 90 void UIGlobalSettingsUpdate::getFromCache() 87 91 { 92 /* Sanity check: */ 93 if (!m_pCache) 94 return; 95 88 96 /* Load old data from cache: */ 89 97 const UIDataSettingsGlobalUpdate &oldData = m_pCache->base(); 90 m_pEditorUpdateSettings->setValue(oldData.m_guiUpdateData); 98 if (m_pEditorUpdateSettings) 99 m_pEditorUpdateSettings->setValue(oldData.m_guiUpdateData); 91 100 } 92 101 93 102 void UIGlobalSettingsUpdate::putToCache() 94 103 { 104 /* Sanity check: */ 105 if (!m_pCache) 106 return; 107 95 108 /* Prepare new data: */ 96 109 UIDataSettingsGlobalUpdate newData = m_pCache->base(); 97 110 98 111 /* Cache new data: */ 99 newData.m_guiUpdateData = m_pEditorUpdateSettings->value(); 112 if (m_pEditorUpdateSettings) 113 newData.m_guiUpdateData = m_pEditorUpdateSettings->value(); 100 114 m_pCache->cacheCurrentData(newData); 101 115 } … … 155 169 bool UIGlobalSettingsUpdate::saveData() 156 170 { 171 /* Sanity check: */ 172 if (!m_pCache) 173 return false; 174 157 175 /* Prepare result: */ 158 176 bool fSuccess = true;
Note:
See TracChangeset
for help on using the changeset viewer.