VirtualBox

Changeset 51004 in vbox


Ignore:
Timestamp:
Apr 8, 2014 5:13:43 PM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: 7340: Make GUI VM process task-bar icon configurable (Windows/Linux hosts).

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.cpp

    r49779 r51004  
    5151
    5252/* Machine-window definitions: */
     53#ifndef Q_WS_MAC
     54const char* UIDefs::GUI_MachineWindowIcons = "GUI/MachineWindowIcons";
     55#endif /* !Q_WS_MAC */
    5356const char* UIDefs::GUI_RestrictedRuntimeMenus = "GUI/RestrictedRuntimeMenus";
    5457#ifdef Q_WS_MAC
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h

    r49779 r51004  
    120120
    121121    /* Machine-window declarations: */
     122#ifndef Q_WS_MAC
     123    extern const char* GUI_MachineWindowIcons;
     124#endif /* !Q_WS_MAC */
    122125    extern const char* GUI_RestrictedRuntimeMenus;
    123126#ifdef Q_WS_MAC
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r50935 r51004  
    40844084}
    40854085
     4086#ifndef Q_WS_MAC
     4087/* static */
     4088QStringList VBoxGlobal::machineWindowIconNames(CMachine &machine)
     4089{
     4090    /* Return result: */
     4091    return machine.GetExtraDataStringList(GUI_MachineWindowIcons);
     4092}
     4093#endif /* !Q_WS_MAC */
     4094
    40864095#ifdef RT_OS_LINUX
    40874096/* static */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r50935 r51004  
    397397    static QList<GlobalSettingsPageType> restrictedGlobalSettingsPages(CVirtualBox &vbox);
    398398    static QList<MachineSettingsPageType> restrictedMachineSettingsPages(CMachine &machine);
     399#ifndef Q_WS_MAC
     400    /** Loads redefined machine-window icon names. */
     401    static QStringList machineWindowIconNames(CMachine &machine);
     402#endif /* !Q_WS_MAC */
    399403
    400404#ifdef RT_OS_LINUX
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp

    r50631 r51004  
    174174{
    175175#ifndef Q_WS_MAC
    176     /* On Mac OS X application icon referenced in info.plist is used. */
    177 
    178     /* Set default application icon (will be changed to VM-specific icon little bit later): */
     176    /* On Mac OS X window icon referenced in info.plist is used. */
     177
     178    /* Set default window icon (will be changed to VM-specific icon little bit later): */
    179179    setWindowIcon(QIcon(":/VirtualBox_48px.png"));
    180180
    181     /* Set VM-specific application icon: */
    182     setWindowIcon(vboxGlobal().vmGuestOSTypeIcon(machine().GetOSTypeId()));
     181    /* Set redefined machine-window icon if any: */
     182    QIcon *pMachineWidnowIcon = uisession()->machineWindowIcon();
     183    if (pMachineWidnowIcon)
     184        setWindowIcon(*pMachineWidnowIcon);
     185    /* Or set default machine-window icon: */
     186    else
     187        setWindowIcon(vboxGlobal().vmGuestOSTypeIcon(machine().GetOSTypeId()));
    183188#endif /* !Q_WS_MAC */
    184189}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r50801 r51004  
    130130    , m_machineStatePrevious(KMachineState_Null)
    131131    , m_machineState(session().GetMachine().GetState())
     132#ifndef Q_WS_MAC
     133    , m_pMachineWindowIcon(0)
     134#endif /* !Q_WS_MAC */
    132135    , m_fIsExtensionPackUsable(false)
    133136    , m_requestedVisualStateType(UIVisualStateType_Invalid)
     
    11171120        QString strSettings;
    11181121
     1122#ifndef Q_WS_MAC
     1123        /* Load/prepare user's machine-window icon: */
     1124        QIcon icon;
     1125        foreach (const QString &strIconName, VBoxGlobal::machineWindowIconNames(machine))
     1126            if (!strIconName.isEmpty())
     1127                icon.addFile(strIconName);
     1128        if (!icon.isNull())
     1129            m_pMachineWindowIcon = new QIcon(icon);
     1130#endif /* !Q_WS_MAC */
     1131
    11191132        /* Is there should be First RUN Wizard? */
    11201133        strSettings = machine.GetExtraData(GUI_FirstRun);
     
    11791192# endif /* Q_WS_WIN */
    11801193#endif
     1194
     1195#ifndef Q_WS_MAC
     1196        /* Cleanup user's machine-window icon: */
     1197        delete m_pMachineWindowIcon;
     1198        m_pMachineWindowIcon = 0;
     1199#endif /* !Q_WS_MAC */
    11811200    }
    11821201}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r50490 r51004  
    4141class CNetworkAdapter;
    4242class CMediumAttachment;
     43#ifndef Q_WS_MAC
     44class QIcon;
     45#endif /* !Q_WS_MAC */
    4346
    4447/* CConsole callback event types: */
     
    9497    QCursor cursor() const { return m_cursor; }
    9598
     99#ifndef Q_WS_MAC
     100    /** @name Branding stuff.
     101     ** @{ */
     102    /** Returns redefined machine-window icon. */
     103    QIcon* machineWindowIcon() const { return m_pMachineWindowIcon; }
     104    /** @} */
     105#endif /* !Q_WS_MAC */
     106
    96107    /** @name Extension Pack stuff.
    97108     ** @{ */
     
    330341    QCursor m_cursor;
    331342
     343#ifndef Q_WS_MAC
     344    /** @name Branding variables.
     345     ** @{ */
     346    /** Holds redefined machine-window icon. */
     347    QIcon *m_pMachineWindowIcon;
     348    /** @} */
     349#endif /* !Q_WS_MAC */
     350
    332351    /** @name Extension Pack variables.
    333352     ** @{ */
Note: See TracChangeset for help on using the changeset viewer.

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