Changeset 83978 in vbox
- Timestamp:
- Apr 24, 2020 6:50:13 PM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/information
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationConfiguration.cpp
r82968 r83978 78 78 resetTable(); 79 79 QFontMetrics fontMetrics(m_pTableWidget->font()); 80 QTextDocument textDocument;81 82 80 int iMaxColumn1Length = 0; 83 84 81 /* General section: */ 85 82 insertTitleRow(m_strGeneralTitle, UIIconPool::iconSet(":/machine_16px.png"), fontMetrics); 86 83 insertInfoRows(UIDetailsGenerator::generateMachineInformationGeneral(m_machine, 87 84 UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Default), 88 fontMetrics, textDocument,iMaxColumn1Length);85 fontMetrics, iMaxColumn1Length); 89 86 90 87 /* System section: */ 91 88 insertTitleRow(m_strSystemTitle, UIIconPool::iconSet(":/chipset_16px.png"), fontMetrics); 92 89 insertInfoRows(UIDetailsGenerator::generateMachineInformationSystem(m_machine, 93 94 fontMetrics, textDocument,iMaxColumn1Length);90 UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_Default), 91 fontMetrics, iMaxColumn1Length); 95 92 96 93 /* Display section: */ … … 98 95 insertInfoRows(UIDetailsGenerator::generateMachineInformationDisplay(m_machine, 99 96 UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_Default), 100 fontMetrics, textDocument,iMaxColumn1Length);97 fontMetrics, iMaxColumn1Length); 101 98 102 99 /* Storage section: */ … … 104 101 insertInfoRows(UIDetailsGenerator::generateMachineInformationStorage(m_machine, 105 102 UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_Default), 106 fontMetrics, textDocument,iMaxColumn1Length);103 fontMetrics, iMaxColumn1Length); 107 104 108 105 /* Audio section: */ 109 106 insertTitleRow(m_strAudioTitle, UIIconPool::iconSet(":/sound_16px.png"), fontMetrics); 110 107 insertInfoRows(UIDetailsGenerator::generateMachineInformationAudio(m_machine, 111 112 fontMetrics, textDocument,iMaxColumn1Length);108 UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_Default), 109 fontMetrics, iMaxColumn1Length); 113 110 114 111 /* Network section: */ … … 116 113 insertInfoRows(UIDetailsGenerator::generateMachineInformationNetwork(m_machine, 117 114 UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_Default), 118 fontMetrics, textDocument,iMaxColumn1Length);115 fontMetrics, iMaxColumn1Length); 119 116 120 117 /* Serial port section: */ … … 122 119 insertInfoRows(UIDetailsGenerator::generateMachineInformationSerial(m_machine, 123 120 UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_Default), 124 fontMetrics, textDocument,iMaxColumn1Length);121 fontMetrics, iMaxColumn1Length); 125 122 126 123 /* USB section: */ 127 124 insertTitleRow(m_strUSBTitle, UIIconPool::iconSet(":/usb_16px.png"), fontMetrics); 128 125 insertInfoRows(UIDetailsGenerator::generateMachineInformationUSB(m_machine, 129 130 fontMetrics, textDocument,iMaxColumn1Length);126 UIExtraDataMetaDefs::DetailsElementOptionTypeUsb_Default), 127 fontMetrics, iMaxColumn1Length); 131 128 132 129 /* Share folders section: */ … … 134 131 insertInfoRows(UIDetailsGenerator::generateMachineInformationSharedFolders(m_machine, 135 132 UIExtraDataMetaDefs::DetailsElementOptionTypeSharedFolders_Default), 136 fontMetrics, textDocument,iMaxColumn1Length);133 fontMetrics, iMaxColumn1Length); 137 134 138 135 m_pTableWidget->resizeColumnToContents(0); … … 167 164 } 168 165 169 void UIInformationConfiguration::insertInfoRows(const UITextTable &table, const QFontMetrics &fontMetrics, 170 QTextDocument &textDocument, int &iMaxColumn1Length) 166 void UIInformationConfiguration::insertInfoRows(const UITextTable &table, const QFontMetrics &fontMetrics, int &iMaxColumn1Length) 171 167 { 172 168 foreach (const UITextTableLine &line, table) 173 169 { 174 textDocument.setHtml(line.string2()); 175 insertInfoRow(line.string1(), textDocument.toPlainText(), fontMetrics, iMaxColumn1Length); 170 insertInfoRow(removeHtmlFromString(line.string1()), 171 removeHtmlFromString(line.string2()), 172 fontMetrics, iMaxColumn1Length); 176 173 } 177 174 } … … 213 210 } 214 211 } 212 213 QString UIInformationConfiguration::removeHtmlFromString(const QString &strOriginal) 214 { 215 QTextDocument textDocument; 216 textDocument.setHtml(strOriginal); 217 return textDocument.toPlainText(); 218 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationConfiguration.h
r82968 r83978 66 66 void prepareObjects(); 67 67 void insertTitleRow(const QString &strTitle, const QIcon &icon, const QFontMetrics &fontMetrics); 68 void insertInfoRows(const UITextTable &table, const QFontMetrics &fontMetrics, 69 QTextDocument &textDocument, int &iMaxColumn1Length); 68 void insertInfoRows(const UITextTable &table, const QFontMetrics &fontMetrics, int &iMaxColumn1Length); 70 69 void insertInfoRow(const QString strText1, const QString &strText2, 71 70 const QFontMetrics &fontMetrics, int &iMaxColumn1Length); 72 71 void resetTable(); 72 QString removeHtmlFromString(const QString &strOriginal); 73 73 74 74 CMachine m_machine;
Note:
See TracChangeset
for help on using the changeset viewer.