Changeset 83747 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Apr 17, 2020 12:37:15 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 137268
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.cpp
r83719 r83747 148 148 } 149 149 150 // WORKAROUND: 151 // While we are waiting for GetDetailsForm implementation we will be using GetSettingsForm. 152 // This requires to wait for progress to complete and handle out all possible value types. 153 CForm comForm; 154 CProgress comProgress = comCloudMachine.GetSettingsForm(comForm); 150 /* Acquire details form: */ 151 CForm comForm = comCloudMachine.GetDetailsForm(); 155 152 /* Ignore cloud machine errors: */ 156 153 if (comCloudMachine.isOk()) 157 154 { 158 /* Wait for progress to complete: */159 co mProgress.WaitForCompletion(-1);160 /* Ignore progress errors: */161 if (comProgress.isOk() && comProgress.GetResultCode() == 0)162 {163 /* For each form value: */164 QVector<CFormValue> values = comForm.GetValues();165 foreach (const CFormValue &comIteratedValue, values)166 {167 /* Handle possible value type: */168 switch (comIteratedValue.GetType())155 /* For each form value: */ 156 const QVector<CFormValue> values = comForm.GetValues(); 157 foreach (const CFormValue &comIteratedValue, values) 158 { 159 /* Ignore invisible values: */ 160 if (!comIteratedValue.GetVisible()) 161 continue; 162 /* Handle possible value type: */ 163 switch (comIteratedValue.GetType()) 164 { 165 case KFormValueType_Boolean: 169 166 { 170 case KFormValueType_Boolean: 171 { 172 CBooleanFormValue comValue(comIteratedValue); 173 const bool fBool = comValue.GetSelected(); 174 table << UITextTableLine(comValue.GetLabel(), 175 fBool ? QApplication::translate("UIDetails", "Enabled", "details (cloud value)") 176 : QApplication::translate("UIDetails", "Disabled", "details (cloud value)")); 177 break; 178 } 179 case KFormValueType_String: 180 { 181 CStringFormValue comValue(comIteratedValue); 182 table << UITextTableLine(comValue.GetLabel(), comValue.GetString()); 183 break; 184 } 185 case KFormValueType_Choice: 186 { 187 CChoiceFormValue comValue(comIteratedValue); 188 const QVector<QString> possibleValues = comValue.GetValues(); 189 const int iCurrentIndex = comValue.GetSelectedIndex(); 190 table << UITextTableLine(comValue.GetLabel(), possibleValues.at(iCurrentIndex)); 191 break; 192 } 193 case KFormValueType_RangedInteger: 194 { 195 CRangedIntegerFormValue comValue(comIteratedValue); 196 table << UITextTableLine(comValue.GetLabel(), 197 QString("%1 %2").arg(comValue.GetInteger()).arg(comValue.GetSuffix())); 198 break; 199 } 200 default: 201 break; 167 CBooleanFormValue comValue(comIteratedValue); 168 const bool fBool = comValue.GetSelected(); 169 table << UITextTableLine(comValue.GetLabel(), 170 fBool ? QApplication::translate("UIDetails", "Enabled", "details (cloud value)") 171 : QApplication::translate("UIDetails", "Disabled", "details (cloud value)")); 172 break; 202 173 } 174 case KFormValueType_String: 175 { 176 CStringFormValue comValue(comIteratedValue); 177 table << UITextTableLine(comValue.GetLabel(), comValue.GetString()); 178 break; 179 } 180 case KFormValueType_Choice: 181 { 182 AssertMsgFailed(("Aren't we decided to convert all choices to strings?\n")); 183 CChoiceFormValue comValue(comIteratedValue); 184 const QVector<QString> possibleValues = comValue.GetValues(); 185 const int iCurrentIndex = comValue.GetSelectedIndex(); 186 table << UITextTableLine(comValue.GetLabel(), possibleValues.at(iCurrentIndex)); 187 break; 188 } 189 case KFormValueType_RangedInteger: 190 { 191 CRangedIntegerFormValue comValue(comIteratedValue); 192 table << UITextTableLine(comValue.GetLabel(), 193 QString("%1 %2").arg(comValue.GetInteger()).arg(comValue.GetSuffix())); 194 break; 195 } 196 default: 197 break; 203 198 } 204 199 }
Note:
See TracChangeset
for help on using the changeset viewer.