Changeset 72813 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 3, 2018 9:41:00 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 123357
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/UITakeSnapshotDialog.cpp
r72022 r72813 58 58 } 59 59 60 void UITakeSnapshotDialog::setPixmap(const QPixmap &pixmap) 61 { 62 m_pLabelIcon->setPixmap(pixmap); 60 void UITakeSnapshotDialog::setIcon(const QIcon &icon) 61 { 62 m_icon = icon; 63 updatePixmap(); 63 64 } 64 65 … … 76 77 { 77 78 return m_pEditorDescription->toPlainText(); 79 } 80 81 bool UITakeSnapshotDialog::event(QEvent *pEvent) 82 { 83 /* Handle know event types: */ 84 switch (pEvent->type()) 85 { 86 case QEvent::Show: 87 case QEvent::ScreenChangeInternal: 88 { 89 /* Update pixmap: */ 90 updatePixmap(); 91 break; 92 } 93 default: 94 break; 95 } 96 97 /* Call to base-class: */ 98 return QIWithRetranslateUI<QIDialog>::event(pEvent); 78 99 } 79 100 … … 273 294 } 274 295 } 296 297 void UITakeSnapshotDialog::updatePixmap() 298 { 299 const int iIconMetric = QApplication::style()->pixelMetric(QStyle::PM_LargeIconSize); 300 m_pLabelIcon->setPixmap(m_icon.pixmap(windowHandle(), QSize(iIconMetric, iIconMetric))); 301 } -
trunk/src/VBox/Frontends/VirtualBox/src/UITakeSnapshotDialog.h
r72022 r72813 18 18 #ifndef ___UITakeSnapshotDialog_h___ 19 19 #define ___UITakeSnapshotDialog_h___ 20 21 /* Qt includes: */ 22 #include <QIcon> 20 23 21 24 /* GUI includes: */ … … 43 46 UITakeSnapshotDialog(QWidget *pParent, const CMachine &comMachine); 44 47 45 /** Defines snapshot @a pixmap. */46 void set Pixmap(const QPixmap &pixmap);48 /** Defines snapshot @a icon. */ 49 void setIcon(const QIcon &icon); 47 50 48 51 /** Defines snapshot @a strName. */ … … 55 58 56 59 protected: 60 61 /** Handles any Qt @a pEvent. */ 62 virtual bool event(QEvent *pEvent) /* override */; 57 63 58 64 /** Handles translation event. */ … … 71 77 void prepareContents(); 72 78 79 /** Updates pixmap. */ 80 void updatePixmap(); 81 73 82 /** Holds the wrapper of machine to take snapshot for. */ 74 83 const CMachine &m_comMachine; 84 85 /** Holds the snapshot icon. */ 86 QIcon m_icon; 75 87 76 88 /** Holds the amount of immutable attachments. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r71374 r72813 1690 1690 /* Assign corresponding icon: */ 1691 1691 if (uisession() && uisession()->machineWindowIcon()) 1692 { 1693 const int iIconMetric = QApplication::style()->pixelMetric(QStyle::PM_LargeIconSize); 1694 pDlg->setPixmap(uisession()->machineWindowIcon()->pixmap(QSize(iIconMetric, iIconMetric))); 1695 } 1692 pDlg->setIcon(*uisession()->machineWindowIcon()); 1696 1693 1697 1694 /* Search for the max available filter index: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotPane.cpp
r72215 r72813 1604 1604 1605 1605 /* Assign corresponding icon: */ 1606 Q Pixmap pixmap = vboxGlobal().vmUserPixmapDefault(comMachine);1607 if ( pixmap.isNull())1608 pixmap = vboxGlobal().vmGuestOSTypePixmapDefault(comMachine.GetOSTypeId());1609 pDlg->set Pixmap(pixmap);1606 QIcon icon = vboxGlobal().vmUserIcon(comMachine); 1607 if (icon.isNull()) 1608 icon = vboxGlobal().vmGuestOSTypeIcon(comMachine.GetOSTypeId()); 1609 pDlg->setIcon(icon); 1610 1610 1611 1611 /* Assign corresponding snapshot name: */
Note:
See TracChangeset
for help on using the changeset viewer.