VirtualBox

Changeset 10227

Show
Ignore:
Timestamp:
07/04/08 15:09:29 (6 months ago)
Author:
vboxsync
Message:

FE/Qt4: Make sure that all windows are properly closed if the main selector
window is closed. Also prevent the main window from closing if a QIMainDialog
is open (Mac OS X bug).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/VBox/Frontends/VirtualBox4/src/QIMainDialog.cpp

    r10157 r10227  
    5252    bool deleteOnClose = testAttribute (Qt::WA_DeleteOnClose); 
    5353    setAttribute (Qt::WA_DeleteOnClose, false); 
     54    bool wasShowModal = testAttribute (Qt::WA_ShowModal);  
     55    setAttribute (Qt::WA_ShowModal, true); 
    5456 
    5557    /* Create a local event loop */ 
     
    6769        return QDialog::Rejected; 
    6870    QDialog::DialogCode res = result(); 
     71    /* Set the old show modal attribute */  
     72    setAttribute (Qt::WA_ShowModal, wasShowModal); 
    6973    /* Delete us in the case we should do so on close */ 
    7074    if (deleteOnClose) 
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSelectorWnd.cpp

    r10167 r10227  
    752752void VBoxSelectorWnd::fileExit() 
    753753{ 
     754    /* We have to check if there are any open windows beside this mainwindow 
     755     * (e.g. VDM) and if so close them. Note that the default behavior is 
     756     * different to Qt3 where a *mainWidget* exists & if this going to close 
     757     * all other windows are closed automatically. We do the same below. */ 
     758    foreach (QWidget *widget, QApplication::topLevelWidgets())  
     759    { 
     760        if (widget->isVisible() &&  
     761            widget != this) 
     762            widget->close(); 
     763    } 
     764    /* We close this widget last. */ 
    754765    close(); 
    755766} 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy