VirtualBox

Ignore:
Timestamp:
Aug 14, 2007 8:21:59 AM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
23624
Message:

2224: DVD attachments missed by the GUI:

GUI support for onDVDDriveChange() & onFloppyDriveChange() notifications implemented.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleView.h

    r4071 r4141  
    9797    void machineStateChanged (CEnums::MachineState state);
    9898    void additionsStateChanged (const QString &, bool, bool);
     99    void dvdfdChanged (VBoxDefs::DiskType aType);
    99100
    100101protected:
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h

    r4128 r4141  
    172172    void updateAdditionsState (const QString&, bool, bool);
    173173
     174    void updateDVDFDState (VBoxDefs::DiskType aType);
     175
    174176    void tryClose();
    175177
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxDefs.h

    r4071 r4141  
    129129        MachineStateChangeEventType,
    130130        AdditionsStateChangeEventType,
     131        DVDFDChangeEventType,
    131132        MachineDataChangeEventType,
    132133        MachineRegisteredEventType,
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp

    r4131 r4141  
    243243};
    244244
     245/** DVD/FD change event */
     246class DVDFDChangeEvent : public QEvent
     247{
     248public:
     249    DVDFDChangeEvent (VBoxDefs::DiskType aType)
     250        : QEvent ((QEvent::Type) VBoxDefs::DVDFDChangeEventType)
     251        , mType (aType) {}
     252    VBoxDefs::DiskType diskType() const { return mType; }
     253private:
     254    VBoxDefs::DiskType mType;
     255};
     256
    245257/** Menu activation event */
    246258class ActivateMenuEvent : public QEvent
     
    406418    STDMETHOD(OnDVDDriveChange)()
    407419    {
    408         LogTrace();
     420        LogFlowFunc (("DVD Drive changed\n"));
     421        QApplication::postEvent (mView, new DVDFDChangeEvent (VBoxDefs::CD));
    409422        return S_OK;
    410423    }
     
    412425    STDMETHOD(OnFloppyDriveChange)()
    413426    {
     427        LogFlowFunc (("Floppy Drive changed\n"));
     428        QApplication::postEvent (mView, new DVDFDChangeEvent (VBoxDefs::FD));
    414429        return S_OK;
    415430    }
     
    10831098                                            ge->additionActive(),
    10841099                                            ge->supportsSeamless());
     1100                return true;
     1101            }
     1102
     1103            case VBoxDefs::DVDFDChangeEventType:
     1104            {
     1105                DVDFDChangeEvent *ev = (DVDFDChangeEvent *) e;
     1106                LogFlowFunc (("DVDFDChangeEvent\n"));
     1107
     1108                emit dvdfdChanged (ev->diskType());
    10851109                return true;
    10861110            }
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp

    r4128 r4141  
    856856    connect (console, SIGNAL (additionsStateChanged (const QString&, bool, bool)),
    857857             this, SLOT (updateAdditionsState (const QString &, bool, bool)));
     858    connect (console, SIGNAL (dvdfdChanged (VBoxDefs::DiskType)),
     859             this, SLOT (updateDVDFDState (VBoxDefs::DiskType)));
    858860
    859861#ifdef Q_WS_MAC
     
    22252227                    vboxProblem().cannotSaveMachineSettings (m);
    22262228            }
    2227             updateAppearanceOf (FloppyStuff);
    22282229        }
    22292230    }
     
    22452246                vboxProblem().cannotSaveMachineSettings (m);
    22462247        }
    2247         updateAppearanceOf (FloppyStuff);
    22482248    }
    22492249}
     
    22712271                    vboxProblem().cannotSaveMachineSettings (m);
    22722272            }
    2273             updateAppearanceOf (DVDStuff);
    22742273        }
    22752274    }
     
    22932292                vboxProblem().cannotSaveMachineSettings (m);
    22942293        }
    2295         updateAppearanceOf (DVDStuff);
    22962294    }
    22972295}
     
    23962394    /// @todo (r=dmik) use VBoxProblemReporter::cannotMountMedia...
    23972395    AssertWrapperOk (drv);
    2398     if (drv.isOk())
    2399         updateAppearanceOf (DVDStuff);
    24002396}
    24012397
     
    26072603                vboxProblem().cannotSaveMachineSettings (m);
    26082604        }
    2609         updateAppearanceOf (FloppyStuff);
    26102605    }
    26112606}
     
    26352630                vboxProblem().cannotSaveMachineSettings (m);
    26362631        }
    2637         updateAppearanceOf (DVDStuff);
    26382632    }
    26392633}
     
    28962890}
    28972891
     2892void VBoxConsoleWnd::updateDVDFDState (VBoxDefs::DiskType aType)
     2893{
     2894    Assert (aType == VBoxDefs::CD || aType == VBoxDefs::FD);
     2895    updateAppearanceOf (aType == VBoxDefs::CD ? DVDStuff :
     2896                        aType == VBoxDefs::FD ? FloppyStuff : AllStuff);
     2897}
     2898
    28982899/**
    28992900 *  Helper to safely close the main console window.
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