VirtualBox

Changeset 8845

Show
Ignore:
Timestamp:
05/15/08 14:32:16 (4 months ago)
Author:
vboxsync
Message:

FE/Qt4: If the vm is externally or internally powered off close the vm window in any case.

Files:

Legend:

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

    r8784 r8845  
    12431243        e->ignore(); 
    12441244 
    1245         /* Disable auto closure because we want to have a chance to show the 
    1246          * error dialog on save state / power off failure. */ 
    1247         no_auto_close = true; 
    1248  
    12491245        bool success = true; 
    12501246 
     
    12991295            if (dlg.exec() == QDialog::Accepted) 
    13001296            { 
     1297                /* Disable auto closure because we want to have a chance to show the 
     1298                 * error dialog on save state / power off failure. */ 
     1299                no_auto_close = true; 
     1300 
    13011301                CConsole cconsole = console->console(); 
    13021302 
     
    33673367{ 
    33683368#warning "port me" 
    3369     /* It seems that Qt4 closes all child widgets if the parent widget get 
    3370      * closed. So nothing to do here than to call close. */ 
    3371       
    3372      close(); 
    3373  
    3374     /* We have this to test on Windows and Mac or maybe I forgot something, so 
    3375      * we keep this as a reference: */ 
     3369    /* First close any open modal & popup widgets. Use a single shot with 
     3370     * timeout 0 to allow the widgets to cleany close and test then again. If 
     3371     * all open widgets are closed destroy ourself. */ 
     3372    QWidget *widget = QApplication::activeModalWidget(); 
     3373    if (widget) 
     3374    { 
     3375        widget->close(); 
     3376        QTimer::singleShot (0, this, SLOT (tryClose())); 
     3377    } 
     3378    else 
     3379    { 
     3380        widget = QApplication::activePopupWidget(); 
     3381        if (widget) 
     3382        { 
     3383            widget->close(); 
     3384            QTimer::singleShot (0, this, SLOT (tryClose())); 
     3385        } 
     3386        else 
     3387            close(); 
     3388    } 
     3389 
     3390    /* We have this to test on Windows or maybe I forgot something, so we keep 
     3391     * this as a reference: */ 
    33763392//    LogFlowFunc (("eventLoopLevel=%d\n", qApp->eventLoop()->loopLevel())); 
    33773393// 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy