Changeset 51410 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- May 27, 2014 8:03:54 AM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/UIVMInfoDialog.cpp
r51311 r51410 330 330 { 331 331 /* Details page update: */ 332 m_browsers[0]->setText(vboxGlobal().detailsReport(m_session.GetMachine(), false /* with links */));332 setText(m_browsers[0], vboxGlobal().detailsReport(m_session.GetMachine(), false /* with links */)); 333 333 } 334 334 … … 565 565 /* Prepare templates: */ 566 566 QString strTable = "<table width=100% cellspacing=1 cellpadding=0>%1</table>"; 567 QString strHeader = "<tr><td width=22><img src='%1'></td>"567 QString strHeader = "<tr><td width=22><img width=16 height=16 src='%1'></td>" 568 568 "<td colspan=2><nobr><b>%2</b></nobr></td></tr>"; 569 569 QString strParagraph = "<tr><td colspan=3></td></tr>"; … … 788 788 /* Show full composed page & save/restore scroll-bar position: */ 789 789 int iScrollBarValue = m_browsers[1]->verticalScrollBar()->value(); 790 m_browsers[1]->setText(strTable.arg(strResult));790 setText(m_browsers[1], strResult); 791 791 m_browsers[1]->verticalScrollBar()->setValue(iScrollBarValue); 792 792 } … … 875 875 } 876 876 877 /* static */ 878 void UIVMInfoDialog::setText(QRichTextEdit *pTextEdit, QString strText) 879 { 880 /* Temporary replace ":/tpixel.png" with "__tpixel__": */ 881 strText.replace(":/tpixel.png", "__tpixel__"); 882 /* Search for all the mentioned pixmaps: */ 883 QRegExp exp(":/([^/]+.png)"); 884 exp.setMinimal(true); 885 /* Initialize iterator: */ 886 int iPos = exp.indexIn(strText); 887 while (iPos != -1) 888 { 889 /* Replace pixmap record with HiDPI-aware analog: */ 890 strText.replace(iPos, 2, "pixmaps://"); 891 /* Load HiDPI-aware pixmap: */ 892 QPixmap pixmap = UIIconPool::pixmap(exp.cap(0)); 893 /* Register loaded pixmap in text-edit' document: */ 894 pTextEdit->document()->addResource(QTextDocument::ImageResource, 895 QUrl(QString("pixmaps://%1").arg(exp.cap(1))), QVariant(pixmap)); 896 /* Advance iterator: */ 897 iPos = exp.indexIn(strText); 898 } 899 /* Replace "__tpixel__" with ":/tpixel.png" back: */ 900 strText.replace("__tpixel__", ":/tpixel.png"); 901 /* Assign text finally: */ 902 pTextEdit->setText(strText); 903 } 904 -
trunk/src/VBox/Frontends/VirtualBox/src/UIVMInfoDialog.h
r51312 r51410 118 118 QString composeArticle(const QString &strBelongsTo, int iSpacesCount = 0); 119 119 120 /** Helper to set @a strText with HiDPI-aware pixmaps to corresponding @a pTextEdit. */ 121 static void setText(QRichTextEdit *pTextEdit, QString strText); 122 120 123 /** @name General variables. 121 124 * @{ */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r51401 r51410 1113 1113 "<table border=0 cellspacing=1 cellpadding=0>%1</table>"; 1114 1114 static const char *sSectionHrefTpl = 1115 "<tr><td width=22 rowspan=%1 align=left><img src='%2'></td>"1115 "<tr><td width=22 rowspan=%1 align=left><img width=16 height=16 src='%2'></td>" 1116 1116 "<td colspan=3><b><a href='%3'><nobr>%4</nobr></a></b></td></tr>" 1117 1117 "%5" 1118 1118 "<tr><td colspan=3><font size=1> </font></td></tr>"; 1119 1119 static const char *sSectionBoldTpl = 1120 "<tr><td width=22 rowspan=%1 align=left><img src='%2'></td>"1120 "<tr><td width=22 rowspan=%1 align=left><img width=16 height=16 src='%2'></td>" 1121 1121 "<td colspan=3><!-- %3 --><b><nobr>%4</nobr></b></td></tr>" 1122 1122 "%5"
Note:
See TracChangeset
for help on using the changeset viewer.