VirtualBox

Changeset 66656 in vbox


Ignore:
Timestamp:
Apr 24, 2017 1:16:40 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
115025
Message:

FE/Qt: Reverting r114900 and r114897 as there will be more sane implementation.

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  
    188188
    189189    /* Set redefined machine-window icon if any: */
    190     const QIcon *pMachineWindowIcon = uisession()->machineWindowIcon();
    191     if (pMachineWindowIcon)
    192         setWindowIcon(*pMachineWindowIcon);
     190    QIcon *pMachineWidnowIcon = uisession()->machineWindowIcon();
     191    if (pMachineWidnowIcon)
     192        setWindowIcon(*pMachineWidnowIcon);
    193193    /* Or set default machine-window icon: */
    194194    else
     
    346346                                                                  console().GetGuestEnteredACPIMode(),
    347347                                                                  restrictedCloseActions);
    348 #ifndef VBOX_WS_MAC
    349         /* 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 */
    354348
    355349        /* Make sure close-dialog is valid: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r66647 r66656  
    12901290
    12911291#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);
    13221299
    13231300        /* Load user's machine-window name postfix: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIVMCloseDialog.cpp

    r66647 r66656  
    7070}
    7171
    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 
    8272void UIVMCloseDialog::sltUpdateWidgetAvailability()
    8373{
     
    113103    /* Hide the dialog: */
    114104    hide();
     105}
     106
     107void 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);
    115115}
    116116
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIVMCloseDialog.h

    r66647 r66656  
    4444    bool isValid() const { return m_fValid; }
    4545
    46     /* API: Pixmap stuff: */
    47     void setPixmap(const QPixmap &pixmap);
    48 
    4946private slots:
    5047
     
    5653
    5754private:
     55
     56    /* API: Pixmap stuff: */
     57    void setPixmap(const QPixmap &pixmap);
    5858
    5959    /* API: Detach-button stuff: */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette