Changeset 66656 in vbox
- Timestamp:
- Apr 24, 2017 1:16:40 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 115025
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
r66648 r66656 188 188 189 189 /* Set redefined machine-window icon if any: */ 190 const QIcon *pMachineWindowIcon = uisession()->machineWindowIcon();191 if (pMachineWi ndowIcon)192 setWindowIcon(*pMachineWi ndowIcon);190 QIcon *pMachineWidnowIcon = uisession()->machineWindowIcon(); 191 if (pMachineWidnowIcon) 192 setWindowIcon(*pMachineWidnowIcon); 193 193 /* Or set default machine-window icon: */ 194 194 else … … 346 346 console().GetGuestEnteredACPIMode(), 347 347 restrictedCloseActions); 348 #ifndef VBOX_WS_MAC349 /* Configure close-dialog: */350 const QIcon *pMachineWindowIcon = uisession()->machineWindowIcon();351 if (pMachineWindowIcon)352 pCloseDlg->setPixmap(pMachineWindowIcon->pixmap(QSize(32, 32)));353 #endif /* !VBOX_WS_MAC */354 348 355 349 /* Make sure close-dialog is valid: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r66647 r66656 1290 1290 1291 1291 #ifndef VBOX_WS_MAC 1292 /* Check whether we have overriding machine-window icon: */ 1293 { 1294 /* Prepare null icon: */ 1295 QIcon icon; 1296 1297 /* 1. Load icon from IMachine extra-data: */ 1298 if (icon.isNull()) 1299 foreach (const QString &strIconName, gEDataManager->machineWindowIconNames(strMachineID)) 1300 if (!strIconName.isEmpty() && QFile::exists(strIconName)) 1301 icon.addFile(strIconName); 1302 1303 /* 2. Load icon from IMachine interface: */ 1304 if (icon.isNull()) 1305 { 1306 const QVector<BYTE> byteVector = machine().GetIcon(); 1307 const QByteArray byteArray = QByteArray::fromRawData(reinterpret_cast<const char*>(byteVector.constData()), byteVector.size()); 1308 const QImage image = QImage::fromData(byteArray); 1309 if (!image.isNull()) 1310 { 1311 QPixmap pixmap = QPixmap::fromImage(image); 1312 const int iMinimumLength = qMin(pixmap.width(), pixmap.height()); 1313 pixmap = pixmap.scaled(QSize(iMinimumLength, iMinimumLength), Qt::IgnoreAspectRatio, Qt::SmoothTransformation); 1314 icon.addPixmap(pixmap); 1315 } 1316 } 1317 1318 /* Finally, store the icon dynamically if overriden: */ 1319 if (!icon.isNull()) 1320 m_pMachineWindowIcon = new QIcon(icon); 1321 } 1292 /* Load/prepare user's machine-window icon: */ 1293 QIcon icon; 1294 foreach (const QString &strIconName, gEDataManager->machineWindowIconNames(strMachineID)) 1295 if (!strIconName.isEmpty() && QFile::exists(strIconName)) 1296 icon.addFile(strIconName); 1297 if (!icon.isNull()) 1298 m_pMachineWindowIcon = new QIcon(icon); 1322 1299 1323 1300 /* Load user's machine-window name postfix: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIVMCloseDialog.cpp
r66647 r66656 70 70 } 71 71 72 void UIVMCloseDialog::setPixmap(const QPixmap &pixmap)73 {74 /* Make sure pixmap is valid: */75 if (pixmap.isNull())76 return;77 78 /* Assign new pixmap: */79 m_pIcon->setPixmap(pixmap);80 }81 82 72 void UIVMCloseDialog::sltUpdateWidgetAvailability() 83 73 { … … 113 103 /* Hide the dialog: */ 114 104 hide(); 105 } 106 107 void UIVMCloseDialog::setPixmap(const QPixmap &pixmap) 108 { 109 /* Make sure pixmap is valid: */ 110 if (pixmap.isNull()) 111 return; 112 113 /* Assign new pixmap: */ 114 m_pIcon->setPixmap(pixmap); 115 115 } 116 116 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIVMCloseDialog.h
r66647 r66656 44 44 bool isValid() const { return m_fValid; } 45 45 46 /* API: Pixmap stuff: */47 void setPixmap(const QPixmap &pixmap);48 49 46 private slots: 50 47 … … 56 53 57 54 private: 55 56 /* API: Pixmap stuff: */ 57 void setPixmap(const QPixmap &pixmap); 58 58 59 59 /* API: Detach-button stuff: */
Note:
See TracChangeset
for help on using the changeset viewer.