VirtualBox

Changeset 84019 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Apr 27, 2020 4:47:43 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137589
Message:

FE/Qt: bugref:9653: UIDetailsGenerator: Cleanup for cloud VM general info generation.

File:
1 edited

Legend:

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

    r83747 r84019  
    160160            if (!comIteratedValue.GetVisible())
    161161                continue;
    162             /* Handle possible value type: */
     162
     163            /* Acquire label: */
     164            const QString strLabel = comIteratedValue.GetLabel();
     165
     166            /* Handle possible value types: */
     167            QString strValue;
    163168            switch (comIteratedValue.GetType())
    164169            {
     
    167172                    CBooleanFormValue comValue(comIteratedValue);
    168173                    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)"));
     174                    strValue = fBool ? QApplication::translate("UIDetails", "Enabled", "details (cloud value)")
     175                                     : QApplication::translate("UIDetails", "Disabled", "details (cloud value)");
    172176                    break;
    173177                }
     
    175179                {
    176180                    CStringFormValue comValue(comIteratedValue);
    177                     table << UITextTableLine(comValue.GetLabel(), comValue.GetString());
     181                    strValue = comValue.GetString();
    178182                    break;
    179183                }
     
    184188                    const QVector<QString> possibleValues = comValue.GetValues();
    185189                    const int iCurrentIndex = comValue.GetSelectedIndex();
    186                     table << UITextTableLine(comValue.GetLabel(), possibleValues.at(iCurrentIndex));
     190                    strValue = possibleValues.value(iCurrentIndex);
    187191                    break;
    188192                }
     
    190194                {
    191195                    CRangedIntegerFormValue comValue(comIteratedValue);
    192                     table << UITextTableLine(comValue.GetLabel(),
    193                                              QString("%1 %2").arg(comValue.GetInteger()).arg(comValue.GetSuffix()));
     196                    strValue = QString("%1 %2")
     197                                   .arg(comValue.GetInteger())
     198                                   .arg(QApplication::translate("UICommon", comValue.GetSuffix().toUtf8().constData()));
    194199                    break;
    195200                }
     
    197202                    break;
    198203            }
     204
     205            /* Generate table string: */
     206            table << UITextTableLine(strLabel, strValue);
    199207        }
    200208    }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette