Changeset 50924 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Mar 28, 2014 7:21:17 PM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGMachinePreview.cpp
r50041 r50924 112 112 void UIGMachinePreview::setMachine(const CMachine& machine) 113 113 { 114 /* Pause: */ 114 115 stop(); 116 117 /* Assign new machine: */ 115 118 m_machine = machine; 119 120 /* Fetch machine data: */ 121 m_strPreviewName = tr("No preview"); 122 if (!m_machine.isNull()) 123 m_strPreviewName = m_machine.GetAccessible() ? m_machine.GetName() : 124 QApplication::translate("UIVMListView", "Inaccessible"); 125 126 /* Resume: */ 116 127 restart(); 117 128 } … … 299 310 pPainter->drawPixmap(cr.x() + m_iMargin, cr.y() + m_iMargin, *m_pbgFullImage); 300 311 301 /* Compose name: */ 302 QString strName = tr("No preview"); 303 if (!m_machine.isNull()) 304 strName = m_machine.GetAccessible() ? m_machine.GetName() : 305 QApplication::translate("UIVMListView", "Inaccessible"); 306 /* Paint that name: */ 312 /* Paint preview name: */ 307 313 QFont font = pPainter->font(); 308 314 font.setBold(true); … … 318 324 font.setPixelSize((int)h); 319 325 pPainter->setFont(font); 320 r = pPainter->boundingRect(m_vRect, fFlags, strName);326 r = pPainter->boundingRect(m_vRect, fFlags, m_strPreviewName); 321 327 } 322 328 while ((r.height() > m_vRect.height() || r.width() > m_vRect.width()) && cMax-- != 0); 323 329 pPainter->setPen(Qt::white); 324 pPainter->drawText(m_vRect, fFlags, strName);330 pPainter->drawText(m_vRect, fFlags, m_strPreviewName); 325 331 } 326 332 } -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGMachinePreview.h
r50041 r50924 113 113 QPixmap *m_pbgFullImage; 114 114 QImage *m_pPreviewImg; 115 QString m_strPreviewName; 115 116 static UpdateIntervalMap m_intervals; 116 117 };
Note:
See TracChangeset
for help on using the changeset viewer.