VirtualBox

Ticket #3639: wined3d.diff

File wined3d.diff, 6.1 KB (added by Robert Millan, 15 years ago)
  • src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h

    Copyright (c) 2009  Robert Millan
    
    Permission is hereby granted, free of charge, to any person
    obtaining a copy of this software and associated documentation
    files (the "Software"), to deal in the Software without
    restriction, including without limitation the rights to use,
    copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the
    Software is furnished to do so, subject to the following
    conditions:
    
    The above copyright notice and this permission notice shall be
    included in all copies or substantial portions of the Software.
    
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
    OTHER DEALINGS IN THE SOFTWARE.
    
    private slots:  
    208208    void devicesSwitchVrdp (bool);
    209209    void devicesOpenSFDialog();
    210210    void devicesInstallGuestAdditions();
     211    void devicesInstallWineD3D();
    211212
    212213    void prepareFloppyMenu();
    213214    void prepareDVDMenu();
    private:  
    282283    QAction *mDevicesSwitchVrdpAction;
    283284    QAction *mDevicesSFDialogAction;
    284285    QAction *mDevicesInstallGuestToolsAction;
     286    QAction *mDevicesInstallWineD3DAction;
    285287
    286288#ifdef VBOX_WITH_DEBUGGER_GUI
    287289    /* Debugger actions */
  • src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp

    VBoxConsoleWnd (VBoxConsoleWnd **aSelf,  
    379379        VBoxGlobal::iconSet (":/guesttools_16px.png",
    380380                             ":/guesttools_disabled_16px.png"));
    381381
     382    mDevicesInstallWineD3DAction = new QAction (mRunningActions);
     383    mDevicesInstallWineD3DAction->setIcon (VBoxGlobal::iconSet (":/guesttools_16px.png",
     384                                                                     ":/guesttools_disabled_16px.png"));
     385
    382386#ifdef VBOX_WITH_DEBUGGER_GUI
    383387    if (vboxGlobal().isDebuggerEnabled())
    384388    {
    VBoxConsoleWnd (VBoxConsoleWnd **aSelf,  
    476480    mDevicesVRDPMenuSeparator = mDevicesMenu->addSeparator();
    477481
    478482    mDevicesMenu->addAction (mDevicesInstallGuestToolsAction);
     483    mDevicesMenu->addAction (mDevicesInstallWineD3DAction);
    479484
    480485    /* reset the "context menu" flag */
    481486    mDevicesMountFloppyMenu->menuAction()->setData (false);
    VBoxConsoleWnd (VBoxConsoleWnd **aSelf,  
    635640    connect (mDevicesSwitchVrdpAction, SIGNAL(toggled (bool)), this, SLOT(devicesSwitchVrdp (bool)));
    636641    connect (mDevicesSFDialogAction, SIGNAL(triggered()), this, SLOT(devicesOpenSFDialog()));
    637642    connect (mDevicesInstallGuestToolsAction, SIGNAL(triggered()), this, SLOT(devicesInstallGuestAdditions()));
     643    connect (mDevicesInstallWineD3DAction, SIGNAL(triggered()), this, SLOT(devicesInstallWineD3D()));
    638644
    639645
    640646    connect (mDevicesMountFloppyMenu, SIGNAL(aboutToShow()), this, SLOT(prepareFloppyMenu()));
    void VBoxConsoleWnd::retranslateUi()  
    17101716    mDevicesInstallGuestToolsAction->setStatusTip (
    17111717        tr ("Mount the Guest Additions installation image"));
    17121718
     1719    mDevicesInstallWineD3DAction->setText (tr ("Install &WineD3D (for Direct3D)..."));
     1720    mDevicesInstallWineD3DAction->setStatusTip (
     1721        tr ("Mount the WineD3D installation image. WineD3D provides Direct3D functionality on Windows guests."));
     1722
    17131723#ifdef VBOX_WITH_DEBUGGER_GUI
    17141724    /* Debug actions */
    17151725
    void VBoxConsoleWnd::devicesInstallGuest  
    28832893    }
    28842894}
    28852895
     2896/* Based on devicesInstallGuestAdditions() */
     2897void VBoxConsoleWnd::devicesInstallWineD3D()
     2898{
     2899#if defined (DEBUG_dmik) /* subscribe yourself here if you care for this behavior. */
     2900    QString src1 = qApp->applicationDirPath() + "/../../release/bin/wined3d.iso";
     2901    QString src2 = qApp->applicationDirPath() + "/../../release/bin/additions/wined3d.iso";
     2902#else
     2903    char szAppPrivPath [RTPATH_MAX];
     2904    int rc = RTPathAppPrivateNoArch (szAppPrivPath, sizeof (szAppPrivPath));
     2905    AssertRC (rc);
     2906
     2907    QString src1 = QString (szAppPrivPath) + "/wined3d.iso";
     2908    QString src2 = qApp->applicationDirPath() + "/additions/wined3d.iso";
     2909#endif
     2910
     2911    /* Check the standard image locations */
     2912    if (QFile::exists (src1))
     2913        return installGuestAdditionsFrom (src1);
     2914    else if (QFile::exists (src2))
     2915        return installGuestAdditionsFrom (src2);
     2916
     2917    /* Check for the already registered image */
     2918    CVirtualBox vbox = vboxGlobal().virtualBox();
     2919    QString name = QString ("wined3d.iso");
     2920
     2921    CDVDImage2Vector vec = vbox.GetDVDImages();
     2922    for (CDVDImage2Vector::ConstIterator it = vec.begin();
     2923         it != vec.end(); ++ it)
     2924    {
     2925        QString path = it->GetLocation();
     2926        /* Compare the name part ignoring the file case */
     2927        QString fn = QFileInfo (path).fileName();
     2928        if (RTPathCompare (name.toUtf8().constData(), fn.toUtf8().constData()) == 0)
     2929            return installGuestAdditionsFrom (path);
     2930    }
     2931
     2932    /* Download the required image */
     2933    {
     2934        QString source = QString ("http://download.savannah.nongnu.org/releases/wined3d/latest/wined3d.iso");
     2935        QString target = QDir (vboxGlobal().virtualBox().GetHomeFolder())
     2936                               .absoluteFilePath (name);
     2937
     2938        VBoxAdditionsDownloader *dl =
     2939            new VBoxAdditionsDownloader (source, target, mDevicesInstallWineD3DAction);
     2940        statusBar()->addWidget (dl, 0);
     2941        dl->start();
     2942    }
     2943}
     2944
    28862945void VBoxConsoleWnd::installGuestAdditionsFrom (const QString &aSource)
    28872946{
    28882947    CVirtualBox vbox = vboxGlobal().virtualBox();

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