VirtualBox

Ignore:
Timestamp:
Apr 8, 2016 3:54:41 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8249: Import Appliance Wizard: Dismiss import-appliance wizard if user rejects certificate and fix for issue with dialog's button-box events.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic2.cpp

    r60359 r60395  
    8787
    8888            pButtonBox->button(QDialogButtonBox::Yes)->setShortcut(Qt::Key_Enter);
    89             connect(pButtonBox, SIGNAL(accepted()), this, SLOT(close()));
     89            connect(pButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
    9090
    9191            //pButtonBox->button(QDialogButtonBox::No)->setShortcut(Qt::Key_Esc);
    92             connect(pButtonBox, SIGNAL(rejected()), this, SLOT(close()));
     92            connect(pButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
    9393
    9494            /* Add button-box into layout: */
     
    246246
    247247            /* Show viewer in modal mode: */
    248             pDialog->exec();
    249 
    250 /** @todo
    251  *
    252  * Must dismiss the wizard if dialog was rejected!
    253  * Must dismiss the wizard if dialog was rejected!
    254  * Must dismiss the wizard if dialog was rejected!
    255  *
    256  * Someone with clue try figure out how.
    257  *
    258  */
     248            int iResultCode = pDialog->exec();
    259249
    260250            /* Leave if destroyed prematurely: */
    261251            if (!pDialog)
    262                 return; /** @todo r=bird: what happened to this dialog in that case?? */
    263 
    264             /* Delete viewer finally: */
    265             delete pDialog;
    266             pDialog = NULL;
     252                return; /** @todo r=bird: what happened to this dialog in that case??, will check this case later. */
     253            /* Delete viewer: */
     254            if (pDialog)
     255            {
     256                delete pDialog;
     257                pDialog = NULL;
     258            }
     259
     260            /* Dismiss the entire import-appliance wizard if user rejects certificate: */
     261            if (iResultCode == QDialog::Rejected)
     262                wizard()->reject();
    267263        }
    268264    }
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