VirtualBox

Changeset 27008 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Mar 4, 2010 9:58:43 AM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4: new core: partly reverted r58316

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp

    r27007 r27008  
    127127                              .arg(VBOX_BLEEDING_EDGE);
    128128#endif
    129 }
    130 
    131 void UIMachineWindow::sltMediumChange(const CMediumAttachment &attachment)
    132 {
    133     KDeviceType type = attachment.GetType();
    134     if (type == KDeviceType_HardDisk)
    135         updateAppearanceOf(UIVisualElement_HDStuff);
    136     if (type == KDeviceType_DVD)
    137         updateAppearanceOf(UIVisualElement_CDStuff);
    138     if (type == KDeviceType_Floppy)
    139         updateAppearanceOf(UIVisualElement_FDStuff);
    140 }
    141 
    142 void UIMachineWindow::sltUSBControllerChange()
    143 {
    144     updateAppearanceOf(UIVisualElement_USBStuff);
    145 }
    146 
    147 void UIMachineWindow::sltUSBDeviceStateChange()
    148 {
    149     updateAppearanceOf(UIVisualElement_USBStuff);
    150 }
    151 
    152 void UIMachineWindow::sltNetworkAdapterChange()
    153 {
    154     updateAppearanceOf(UIVisualElement_NetworkStuff);
    155 }
    156 
    157 void UIMachineWindow::sltSharedFolderChange()
    158 {
    159     updateAppearanceOf(UIVisualElement_SharedFolderStuff);
    160129}
    161130
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h

    r27007 r27008  
    3535/* Local forwards */
    3636class CSession;
    37 class CMediumAttachment;
    3837class UISession;
    3938class UIMachineLogic;
     
    5554    virtual QWidget* machineWindow() { return m_pMachineWindow; }
    5655    virtual UIMachineView* machineView() { return m_pMachineView; }
    57 
    58 protected slots:
    59 
    60     /* Console callback handlers: */
    61     virtual void sltMediumChange(const CMediumAttachment &attachment);
    62     virtual void sltUSBControllerChange();
    63     virtual void sltUSBDeviceStateChange();
    64     virtual void sltNetworkAdapterChange();
    65     virtual void sltSharedFolderChange();
    6656
    6757protected:
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp

    r27007 r27008  
    8484}
    8585
     86void UIMachineWindowFullscreen::sltMachineStateChanged()
     87{
     88    UIMachineWindow::sltMachineStateChanged();
     89}
     90
     91void UIMachineWindowFullscreen::sltMediumChange(const CMediumAttachment &attachment)
     92{
     93    KDeviceType type = attachment.GetType();
     94    if (type == KDeviceType_HardDisk)
     95        updateAppearanceOf(UIVisualElement_HDStuff);
     96    if (type == KDeviceType_DVD)
     97        updateAppearanceOf(UIVisualElement_CDStuff);
     98    if (type == KDeviceType_Floppy)
     99        updateAppearanceOf(UIVisualElement_FDStuff);
     100}
     101
     102void UIMachineWindowFullscreen::sltUSBControllerChange()
     103{
     104    updateAppearanceOf(UIVisualElement_USBStuff);
     105}
     106
     107void UIMachineWindowFullscreen::sltUSBDeviceStateChange()
     108{
     109    updateAppearanceOf(UIVisualElement_USBStuff);
     110}
     111
     112void UIMachineWindowFullscreen::sltNetworkAdapterChange()
     113{
     114    updateAppearanceOf(UIVisualElement_NetworkStuff);
     115}
     116
     117void UIMachineWindowFullscreen::sltSharedFolderChange()
     118{
     119    updateAppearanceOf(UIVisualElement_SharedFolderStuff);
     120}
     121
     122void UIMachineWindowFullscreen::sltTryClose()
     123{
     124    UIMachineWindow::sltTryClose();
     125}
     126
     127void UIMachineWindowFullscreen::sltProcessGlobalSettingChange(const char * /* aPublicName */, const char * /* aName */)
     128{
     129}
     130
    86131void UIMachineWindowFullscreen::retranslateUi()
    87132{
     
    97142}
    98143
     144void UIMachineWindowFullscreen::updateAppearanceOf(int iElement)
     145{
     146    /* Update parent-class window: */
     147    UIMachineWindow::updateAppearanceOf(iElement);
     148}
     149
    99150bool UIMachineWindowFullscreen::event(QEvent *pEvent)
    100151{
    101152    return QIWithRetranslateUI<QIMainDialog>::event(pEvent);
    102 
    103153    // TODO_NEW_CORE
    104154    switch (pEvent->type())
     
    109159            if (!isMaximized())
    110160            {
    111 //                m_normalGeometry.setSize(pResizeEvent->size());
     161                m_normalGeometry.setSize(pResizeEvent->size());
    112162#ifdef VBOX_WITH_DEBUGGER_GUI
    113163                // TODO: Update debugger window size!
     
    121171            if (!isMaximized())
    122172            {
    123 //                m_normalGeometry.moveTo(geometry().x(), geometry().y());
     173                m_normalGeometry.moveTo(geometry().x(), geometry().y());
    124174#ifdef VBOX_WITH_DEBUGGER_GUI
    125175                // TODO: Update debugger window position!
     
    162212}
    163213
     214void UIMachineWindowFullscreen::prepareConsoleConnections()
     215{
     216    /* Base-class connections: */
     217    UIMachineWindow::prepareConsoleConnections();
     218
     219    /* Medium change updater: */
     220    connect(machineLogic()->uisession(), SIGNAL(sigMediumChange(const CMediumAttachment &)),
     221            this, SLOT(sltMediumChange(const CMediumAttachment &)));
     222
     223    /* USB controller change updater: */
     224    connect(machineLogic()->uisession(), SIGNAL(sigUSBControllerChange()),
     225            this, SLOT(sltUSBControllerChange()));
     226
     227    /* USB device state-change updater: */
     228    connect(machineLogic()->uisession(), SIGNAL(sigUSBDeviceStateChange(const CUSBDevice &, bool, const CVirtualBoxErrorInfo &)),
     229            this, SLOT(sltUSBDeviceStateChange()));
     230
     231    /* Network adapter change updater: */
     232    connect(machineLogic()->uisession(), SIGNAL(sigNetworkAdapterChange(const CNetworkAdapter &)),
     233            this, SLOT(sltNetworkAdapterChange()));
     234
     235    /* Shared folder change updater: */
     236    connect(machineLogic()->uisession(), SIGNAL(sigSharedFolderChange()),
     237            this, SLOT(sltSharedFolderChange()));
     238}
     239
    164240void UIMachineWindowFullscreen::prepareMenu()
    165241{
     
    204280void UIMachineWindowFullscreen::loadWindowSettings()
    205281{
     282    /* Load normal window settings: */
     283//    CMachine machine = session().GetMachine();
     284
    206285    /* Toggle console to manual resize mode. */
    207286//    m_pMachineView->setMachineWindowResizeIgnored(true);
     
    223302    move(0, 0);
    224303
     304//    m_pMachineView->normalizeGeometry(true);
    225305//    ((UIMachineViewFullscreen*)m_pMachineView)->sltPerformGuestResize(maximumSize());
    226 //    m_pMachineView->setGuestAutoresizeEnabled();
     306
     307//    QRect r = geometry();
     308    /* Load global settings: */
     309    {
     310//        VBoxGlobalSettings settings = vboxGlobal().settings();
     311//        menuBar()->setHidden(settings.isFeatureActive("noMenuBar"));
     312    }
    227313}
    228314
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h

    r27007 r27008  
    4040#endif /* Q_WS_MAC */
    4141
     42/* Local forwards */
     43class CMediumAttachment;
     44
    4245class UIMachineWindowFullscreen : public QIWithRetranslateUI<QIMainDialog>, public UIMachineWindow
    4346{
     
    5053    virtual ~UIMachineWindowFullscreen();
    5154
     55private slots:
     56
     57    /* Console callback handlers: */
     58    void sltMachineStateChanged();
     59    void sltMediumChange(const CMediumAttachment &attachment);
     60    void sltUSBControllerChange();
     61    void sltUSBDeviceStateChange();
     62    void sltNetworkAdapterChange();
     63    void sltSharedFolderChange();
     64
     65    /* LED connections: */
     66    void sltProcessGlobalSettingChange(const char *aPublicName, const char *aName);
     67
     68    /* Close window reimplementation: */
     69    void sltTryClose();
     70
    5271private:
    5372
    5473    /* Translate routine: */
    5574    void retranslateUi();
     75
     76    /* Update routines: */
     77    void updateAppearanceOf(int aElement);
    5678
    5779    /* Event handlers: */
     
    6385
    6486    /* Prepare helpers: */
    65 //    void prepareConsoleConnections();
     87    void prepareConsoleConnections();
    6688    void prepareMenu();
    6789    void prepareConnections();
     
    7698    //void cleanupConsoleConnections() {}
    7799
     100    /* Other members: */
     101    QRect m_normalGeometry;
     102
    78103    /* Factory support: */
    79104    friend class UIMachineWindow;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r27007 r27008  
    9797}
    9898
     99void UIMachineWindowNormal::sltMachineStateChanged()
     100{
     101    UIMachineWindow::sltMachineStateChanged();
     102}
     103
     104void UIMachineWindowNormal::sltMediumChange(const CMediumAttachment &attachment)
     105{
     106    KDeviceType type = attachment.GetType();
     107    if (type == KDeviceType_HardDisk)
     108        updateAppearanceOf(UIVisualElement_HDStuff);
     109    if (type == KDeviceType_DVD)
     110        updateAppearanceOf(UIVisualElement_CDStuff);
     111    if (type == KDeviceType_Floppy)
     112        updateAppearanceOf(UIVisualElement_FDStuff);
     113}
     114
     115void UIMachineWindowNormal::sltUSBControllerChange()
     116{
     117    updateAppearanceOf(UIVisualElement_USBStuff);
     118}
     119
     120void UIMachineWindowNormal::sltUSBDeviceStateChange()
     121{
     122    updateAppearanceOf(UIVisualElement_USBStuff);
     123}
     124
     125void UIMachineWindowNormal::sltNetworkAdapterChange()
     126{
     127    updateAppearanceOf(UIVisualElement_NetworkStuff);
     128}
     129
     130void UIMachineWindowNormal::sltSharedFolderChange()
     131{
     132    updateAppearanceOf(UIVisualElement_SharedFolderStuff);
     133}
     134
    99135void UIMachineWindowNormal::sltTryClose()
    100136{
     
    285321    /* Base-class connections: */
    286322    UIMachineWindow::prepareConsoleConnections();
     323
     324    /* Medium change updater: */
     325    connect(machineLogic()->uisession(), SIGNAL(sigMediumChange(const CMediumAttachment &)),
     326            this, SLOT(sltMediumChange(const CMediumAttachment &)));
     327
     328    /* USB controller change updater: */
     329    connect(machineLogic()->uisession(), SIGNAL(sigUSBControllerChange()),
     330            this, SLOT(sltUSBControllerChange()));
     331
     332    /* USB device state-change updater: */
     333    connect(machineLogic()->uisession(), SIGNAL(sigUSBDeviceStateChange(const CUSBDevice &, bool, const CVirtualBoxErrorInfo &)),
     334            this, SLOT(sltUSBDeviceStateChange()));
     335
     336    /* Network adapter change updater: */
     337    connect(machineLogic()->uisession(), SIGNAL(sigNetworkAdapterChange(const CNetworkAdapter &)),
     338            this, SLOT(sltNetworkAdapterChange()));
     339
     340    /* Shared folder change updater: */
     341    connect(machineLogic()->uisession(), SIGNAL(sigSharedFolderChange()),
     342            this, SLOT(sltSharedFolderChange()));
    287343}
    288344
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h

    r27007 r27008  
    3737
    3838/* Local forwards */
     39class CMediumAttachment;
    3940class UIIndicatorsPool;
    4041class QIStateIndicator;
     
    5152
    5253private slots:
     54
     55    /* Console callback handlers: */
     56    void sltMachineStateChanged();
     57    void sltMediumChange(const CMediumAttachment &attachment);
     58    void sltUSBControllerChange();
     59    void sltUSBDeviceStateChange();
     60    void sltNetworkAdapterChange();
     61    void sltSharedFolderChange();
    5362
    5463    /* LED connections: */
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