VirtualBox

Changeset 8845 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 15, 2008 12:32:16 PM (17 years ago)
Author:
vboxsync
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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//
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