Changeset 66660 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Apr 24, 2017 5:37:48 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 115033
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r66657 r66660 1554 1554 1555 1555 /* Assign corresponding icon: */ 1556 const QPixmap pixmap = vboxGlobal().vmGuestOSTypePixmapDefault(guest().GetOSTypeId());1557 pDlg->mLbIcon->setPixmap(pixmap);1556 if (uisession() && uisession()->machineWindowIcon()) 1557 pDlg->mLbIcon->setPixmap(uisession()->machineWindowIcon()->pixmap(QSize(32, 32))); 1558 1558 1559 1559 /* Search for the max available filter index: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
r66656 r66660 182 182 { 183 183 #ifndef VBOX_WS_MAC 184 /* On Mac OS X window icon referenced in info.plist is used. */ 185 186 /* Set default window icon (will be changed to VM-specific icon little bit later): */ 187 setWindowIcon(QIcon(":/VirtualBox_48px.png")); 188 189 /* Set redefined machine-window icon if any: */ 190 QIcon *pMachineWidnowIcon = uisession()->machineWindowIcon(); 191 if (pMachineWidnowIcon) 192 setWindowIcon(*pMachineWidnowIcon); 193 /* Or set default machine-window icon: */ 194 else 195 setWindowIcon(vboxGlobal().vmGuestOSTypeIcon(machine().GetOSTypeId())); 184 /* Set machine-window icon if any: */ 185 // On macOS window icon is referenced in info.plist. 186 if (uisession() && uisession()->machineWindowIcon()) 187 setWindowIcon(*uisession()->machineWindowIcon()); 196 188 #endif /* !VBOX_WS_MAC */ 197 189 } … … 346 338 console().GetGuestEnteredACPIMode(), 347 339 restrictedCloseActions); 340 /* Configure close-dialog: */ 341 if (uisession() && uisession()->machineWindowIcon()) 342 pCloseDlg->setPixmap(uisession()->machineWindowIcon()->pixmap(QSize(32, 32))); 348 343 349 344 /* Make sure close-dialog is valid: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r66656 r66660 957 957 , m_machineStatePrevious(KMachineState_Null) 958 958 , m_machineState(KMachineState_Null) 959 #ifndef VBOX_WS_MAC960 959 , m_pMachineWindowIcon(0) 961 #endif /* !VBOX_WS_MAC */962 960 , m_requestedVisualStateType(UIVisualStateType_Invalid) 963 961 #ifdef VBOX_WS_WIN … … 1289 1287 const QString strMachineID = vboxGlobal().managedVMUuid(); 1290 1288 1289 /* Prepare machine-window icon: */ 1290 { 1291 QIcon icon; 1291 1292 #ifndef VBOX_WS_MAC 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()) 1293 /* Load user machine-window icon: */ 1294 foreach (const QString &strIconName, gEDataManager->machineWindowIconNames(strMachineID)) 1295 if (!strIconName.isEmpty() && QFile::exists(strIconName)) 1296 icon.addFile(strIconName); 1297 #endif 1298 /* Use the OS type icon if user one was not set: */ 1299 if (icon.isNull()) 1300 icon = vboxGlobal().vmGuestOSTypeIcon(machine().GetOSTypeId()); 1301 /* Use the default icon if nothing else works: */ 1302 if (icon.isNull()) 1303 icon = QIcon(":/VirtualBox_48px.png"); 1304 /* Store the icon dynamically: */ 1298 1305 m_pMachineWindowIcon = new QIcon(icon); 1299 1306 } 1307 1308 #ifndef VBOX_WS_MAC 1300 1309 /* Load user's machine-window name postfix: */ 1301 1310 m_strMachineWindowNamePostfix = gEDataManager->machineWindowNamePostfix(strMachineID); 1302 #endif /* !VBOX_WS_MAC */1311 #endif 1303 1312 1304 1313 /* Is there should be First RUN Wizard? */ … … 1368 1377 } 1369 1378 1370 #ifndef VBOX_WS_MAC 1371 /* Cleanup user's machine-window icon: */ 1379 /* Cleanup machine-window icon: */ 1372 1380 delete m_pMachineWindowIcon; 1373 1381 m_pMachineWindowIcon = 0; 1374 #endif /* !VBOX_WS_MAC */1375 1382 } 1376 1383 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r64160 r66660 128 128 QCursor cursor() const { return m_cursor; } 129 129 130 #ifndef VBOX_WS_MAC131 130 /** @name Branding stuff. 132 131 ** @{ */ 133 /** Returns redefined machine-window icon. */ 134 QIcon* machineWindowIcon() const { return m_pMachineWindowIcon; } 132 /** Returns the cached machine-window icon. */ 133 QIcon *machineWindowIcon() const { return m_pMachineWindowIcon; } 134 #ifndef VBOX_WS_MAC 135 135 /** Returns redefined machine-window name postfix. */ 136 136 QString machineWindowNamePostfix() const { return m_strMachineWindowNamePostfix; } 137 /** @} */ 138 #endif /* !VBOX_WS_MAC*/137 #endif 138 /** @} */ 139 139 140 140 /** @name Host-screen configuration variables. … … 459 459 QCursor m_cursor; 460 460 461 #ifndef VBOX_WS_MAC462 461 /** @name Branding variables. 463 462 ** @{ */ 464 /** Holds redefined machine-window icon. */463 /** Holds the cached machine-window icon. */ 465 464 QIcon *m_pMachineWindowIcon; 465 #ifndef VBOX_WS_MAC 466 466 /** Holds redefined machine-window name postfix. */ 467 467 QString m_strMachineWindowNamePostfix; 468 /** @} */ 469 #endif /* !VBOX_WS_MAC*/468 #endif 469 /** @} */ 470 470 471 471 /** @name Visual-state configuration variables. -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIVMCloseDialog.cpp
r66657 r66660 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 72 82 void UIVMCloseDialog::sltUpdateWidgetAvailability() 73 83 { … … 103 113 /* Hide the dialog: */ 104 114 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 … … 317 317 KMachineState machineState = m_machine.GetState(); 318 318 319 /* Assign pixmap: */320 setPixmap(vboxGlobal().vmGuestOSTypePixmapDefault(m_machine.GetOSTypeId()));321 322 319 /* Check which close-actions are resticted: */ 323 320 bool fIsDetachAllowed = vboxGlobal().isSeparateProcess() && !(m_restictedCloseActions & MachineCloseAction_Detach); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIVMCloseDialog.h
r66656 r66660 44 44 bool isValid() const { return m_fValid; } 45 45 46 /* API: Pixmap stuff: */ 47 void setPixmap(const QPixmap &pixmap); 48 46 49 private slots: 47 50 … … 53 56 54 57 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.