VirtualBox

Ignore:
Timestamp:
Apr 5, 2013 1:46:55 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: Message-center: Parent choosing rule simplification.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r45368 r45371  
    317317{
    318318    /* It may happen that this method is called during VBoxGlobal
    319      * initialization or even after it failed (for example, to show some
    320      * error message). Return no main window in this case: */
     319     * initialization or even after it failed (for example, to show some error message).
     320     * Return no main window in this case: */
    321321    if (!vboxGlobal().isValid())
    322322        return 0;
    323323
     324    /* For VM console process: */
    324325    if (vboxGlobal().isVMConsoleProcess())
    325326    {
    326         if (vboxGlobal().vmWindow() && vboxGlobal().vmWindow()->isVisible()) /* VM window is visible */
    327             return vboxGlobal().vmWindow(); /* return that window */
    328     }
     327        /* It will be currently active machine window if visible: */
     328        if (vboxGlobal().vmWindow()->isVisible())
     329            return vboxGlobal().vmWindow();
     330    }
     331    /* Otherwise: */
    329332    else
    330333    {
    331         if (vboxGlobal().selectorWnd().isVisible()) /* VM selector is visible */
    332             return &vboxGlobal().selectorWnd(); /* return that window */
    333     }
    334 
     334        /* It will be the selector window if visible: */
     335        if (vboxGlobal().selectorWnd().isVisible())
     336            return &vboxGlobal().selectorWnd();
     337    }
     338
     339    /* Nothing by default: */
    335340    return 0;
    336341}
    337342
    338 QWidget* UIMessageCenter::mainMachineWindowShown() const
    339 {
    340     /* It may happen that this method is called during VBoxGlobal
    341      * initialization or even after it failed (for example, to show some
    342      * error message). Return no main window in this case: */
    343     if (!vboxGlobal().isValid())
    344         return 0;
    345 
    346     if (vboxGlobal().vmWindow() && vboxGlobal().vmWindow()->isVisible()) /* VM window is visible */
    347         return vboxGlobal().vmWindow(); /* return that window */
    348 
    349     return 0;
    350 }
    351 
    352343QWidget* UIMessageCenter::networkManagerOrMainWindowShown() const
    353344{
    354345    return gNetworkManager->window()->isVisible() ? gNetworkManager->window() : mainWindowShown();
    355 }
    356 
    357 QWidget* UIMessageCenter::networkManagerOrMainMachineWindowShown() const
    358 {
    359     return gNetworkManager->window()->isVisible() ? gNetworkManager->window() : mainMachineWindowShown();
    360346}
    361347
     
    877863void UIMessageCenter::cannotTakeSnapshot(const CConsole &console, const QString &strMachineName, QWidget *pParent /*= 0*/) const
    878864{
    879     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     865    error(pParent, MessageType_Error,
    880866          tr("Failed to create a snapshot of the virtual machine <b>%1</b>.")
    881867             .arg(strMachineName),
     
    885871void UIMessageCenter::cannotTakeSnapshot(const CProgress &progress, const QString &strMachineName, QWidget *pParent /*= 0*/) const
    886872{
    887     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     873    error(pParent, MessageType_Error,
    888874          tr("Failed to create a snapshot of the virtual machine <b>%1</b>.")
    889875             .arg(strMachineName),
     
    893879void UIMessageCenter::cannotRestoreSnapshot(const CConsole &console, const QString &strSnapshotName, const QString &strMachineName, QWidget *pParent /*= 0*/) const
    894880{
    895     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     881    error(pParent, MessageType_Error,
    896882          tr("Failed to restore the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
    897883             .arg(strSnapshotName, strMachineName),
     
    901887void UIMessageCenter::cannotRestoreSnapshot(const CProgress &progress, const QString &strSnapshotName, const QString &strMachineName, QWidget *pParent /*= 0*/) const
    902888{
    903     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     889    error(pParent, MessageType_Error,
    904890          tr("Failed to restore the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
    905891             .arg(strSnapshotName, strMachineName),
     
    925911bool UIMessageCenter::confirmHostInterfaceRemoval(const QString &strName, QWidget *pParent /*= 0*/) const
    926912{
    927     return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
     913    return questionBinary(pParent, MessageType_Question,
    928914                          tr("<p>Deleting this host-only network will remove "
    929915                             "the host-only interface this network is based on. Do you want to "
     
    941927void UIMessageCenter::cannotCreateHostInterface(const CHost &host, QWidget *pParent /*= 0*/)
    942928{
    943     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     929    error(pParent, MessageType_Error,
    944930          tr("Failed to create the host network interface."),
    945931          formatErrorInfo(host));
     
    948934void UIMessageCenter::cannotCreateHostInterface(const CProgress &progress, QWidget *pParent /*= 0*/)
    949935{
    950     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     936    error(pParent, MessageType_Error,
    951937          tr("Failed to create the host network interface."),
    952938          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     
    955941void UIMessageCenter::cannotRemoveHostInterface(const CHost &host, const QString &strName, QWidget *pParent /*= 0*/)
    956942{
    957     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     943    error(pParent, MessageType_Error,
    958944          tr("Failed to remove the host network interface <b>%1</b>.")
    959945             .arg(strName),
     
    963949void UIMessageCenter::cannotRemoveHostInterface(const CProgress &progress, const QString &strName, QWidget *pParent /*= 0*/)
    964950{
    965     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     951    error(pParent, MessageType_Error,
    966952          tr("Failed to remove the host network interface <b>%1</b>.")
    967953             .arg(strName),
     
    971957void UIMessageCenter::cannotSetSystemProperties(const CSystemProperties &properties, QWidget *pParent /*= 0*/) const
    972958{
    973     error(pParent ? pParent : mainWindowShown(), MessageType_Critical,
     959    error(pParent, MessageType_Critical,
    974960          tr("Failed to set global VirtualBox properties."),
    975961          formatErrorInfo(properties));
     
    985971        return;
    986972    /* Show the error: */
    987     error(pParent ? pParent : mainWindowShown(), res.isWarning() ? MessageType_Warning : MessageType_Error,
     973    error(pParent, res.isWarning() ? MessageType_Warning : MessageType_Error,
    988974          tr("Failed to access the USB subsystem."),
    989975          formatErrorInfo(res),
     
    997983    setWarningShown("warnAboutUnsupportedUSB2", true);
    998984
    999     alert(pParent ? pParent : mainMachineWindowShown(), MessageType_Warning,
     985    alert(pParent, MessageType_Warning,
    1000986          tr("<p>USB 2.0 is currently enabled for this virtual machine. "
    1001987             "However, this requires the <b><nobr>%1</nobr></b> to be installed.</p>"
     
    10151001    setWarningShown("warnAboutStateChange", true);
    10161002    /* Show the error: */
    1017     alert(pParent ? pParent : mainWindowShown(), MessageType_Warning,
     1003    alert(pParent, MessageType_Warning,
    10181004          tr("The virtual machine that you are changing has been started. "
    10191005             "Only certain settings can be changed while a machine is running. "
     
    10251011bool UIMessageCenter::confirmSettingsReloading(QWidget *pParent /*= 0*/) const
    10261012{
    1027     return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
     1013    return questionBinary(pParent, MessageType_Question,
    10281014                          tr("<p>The machine settings were changed while you were editing them. "
    10291015                             "You currently have unsaved setting changes.</p>"
     
    10351021int UIMessageCenter::confirmHardDiskAttachmentCreation(const QString &strControllerName, QWidget *pParent /*= 0*/) const
    10361022{
    1037     return questionTrinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
     1023    return questionTrinary(pParent, MessageType_Question,
    10381024                           tr("<p>You are about to add a virtual hard disk to controller <b>%1</b>.</p>"
    10391025                              "<p>Would you like to create a new, empty file to hold the disk contents or select an existing one?</p>")
     
    10461032int UIMessageCenter::confirmOpticalAttachmentCreation(const QString &strControllerName, QWidget *pParent /*= 0*/) const
    10471033{
    1048     return questionTrinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
     1034    return questionTrinary(pParent, MessageType_Question,
    10491035                           tr("<p>You are about to add a new CD/DVD drive to controller <b>%1</b>.</p>"
    10501036                              "<p>Would you like to choose a virtual CD/DVD disk to put in the drive "
     
    10581044int UIMessageCenter::confirmFloppyAttachmentCreation(const QString &strControllerName, QWidget *pParent /*= 0*/) const
    10591045{
    1060     return questionTrinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
     1046    return questionTrinary(pParent, MessageType_Question,
    10611047                           tr("<p>You are about to add a new floppy drive to controller <b>%1</b>.</p>"
    10621048                              "<p>Would you like to choose a virtual floppy disk to put in the drive "
     
    10701056int UIMessageCenter::confirmRemovingOfLastDVDDevice(QWidget *pParent /*= 0*/) const
    10711057{
    1072     return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Info,
     1058    return questionBinary(pParent, MessageType_Info,
    10731059                          tr("<p>Are you sure you want to delete the CD/DVD-ROM device?</p>"
    10741060                             "<p>You will not be able to mount any CDs or ISO images "
     
    11061092            break;
    11071093    }
    1108     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1094    error(pParent, MessageType_Error,
    11091095          strMessage, formatErrorInfo(machine));
    11101096}
     
    11121098void UIMessageCenter::warnAboutIncorrectPort(QWidget *pParent /*= 0*/) const
    11131099{
    1114     alert(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1100    alert(pParent, MessageType_Error,
    11151101          tr("The current port forwarding rules are not valid. "
    11161102             "None of the host or guest port values may be set to zero."));
     
    11191105bool UIMessageCenter::confirmCancelingPortForwardingDialog(QWidget *pParent /*= 0*/) const
    11201106{
    1121     return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
     1107    return questionBinary(pParent, MessageType_Question,
    11221108                          tr("<p>There are unsaved changes in the port forwarding configuration.</p>"
    11231109                             "<p>If you proceed your changes will be discarded.</p>"));
     
    11281114                                               QWidget *pParent /*= 0*/)
    11291115{
    1130     error(pParent ? pParent : mainMachineWindowShown(), MessageType_Error,
     1116    error(pParent, MessageType_Error,
    11311117          tr("Failed to create the shared folder <b>%1</b> (pointing to "
    11321118             "<nobr><b>%2</b></nobr>) for the virtual machine <b>%3</b>.")
     
    11391125                                               QWidget *pParent /*= 0*/)
    11401126{
    1141     error(pParent ? pParent : mainMachineWindowShown(), MessageType_Error,
     1127    error(pParent, MessageType_Error,
    11421128          tr("Failed to create the shared folder <b>%1</b> (pointing to "
    11431129             "<nobr><b>%2</b></nobr>) for the virtual machine <b>%3</b>.")
     
    11501136                                               QWidget *pParent /*= 0*/)
    11511137{
    1152     error(pParent ? pParent : mainMachineWindowShown(), MessageType_Error,
     1138    error(pParent, MessageType_Error,
    11531139          tr("<p>Failed to remove the shared folder <b>%1</b> (pointing to "
    11541140             "<nobr><b>%2</b></nobr>) from the virtual machine <b>%3</b>.</p>"
     
    11631149                                               QWidget *pParent /*= 0*/)
    11641150{
    1165     error(pParent ? pParent : mainMachineWindowShown(), MessageType_Error,
     1151    error(pParent, MessageType_Error,
    11661152          tr("<p>Failed to remove the shared folder <b>%1</b> (pointing to "
    11671153             "<nobr><b>%2</b></nobr>) from the virtual machine <b>%3</b>.</p>"
     
    11771163    COMResult res(machine);
    11781164    /* Show the error: */
    1179     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1165    error(pParent, MessageType_Error,
    11801166          tr("Failed to save the settings of the virtual machine <b>%1</b> to <b><nobr>%2</nobr></b>.")
    11811167             .arg(machine.GetName(), machine.GetSettingsFilePath()),
     
    11861172                                             QWidget *pParent /*= 0*/) const
    11871173{
    1188     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1174    error(pParent, MessageType_Error,
    11891175          tr("<p>Error changing medium type from <b>%1</b> to <b>%2</b>.</p>")
    11901176             .arg(gpConverter->toString(oldMediumType)).arg(gpConverter->toString(newMediumType)),
     
    12201206    }
    12211207    /* Show the question: */
    1222     return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
     1208    return questionBinary(pParent, MessageType_Question,
    12231209                          strMessage.arg(medium.location(), strUsage),
    12241210                          0 /* auto-confirm id */, tr("Release", "detach medium"));
     
    12701256    }
    12711257    /* Show the question: */
    1272     return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
     1258    return questionBinary(pParent, MessageType_Question,
    12731259                          strMessage.arg(medium.location()),
    12741260                          "confirmMediumRemoval" /* auto-confirm id */, tr("Remove", "medium"));
     
    12771263int UIMessageCenter::confirmDeleteHardDiskStorage(const QString &strLocation, QWidget *pParent /*= 0*/) const
    12781264{
    1279     return questionTrinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
     1265    return questionTrinary(pParent, MessageType_Question,
    12801266                           tr("<p>Do you want to delete the storage unit of the hard disk "
    12811267                              "<nobr><b>%1</b></nobr>?</p>"
     
    12951281void UIMessageCenter::cannotDeleteHardDiskStorage(const CMedium &medium, const QString &strLocation, QWidget *pParent /*= 0*/) const
    12961282{
    1297     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1283    error(pParent, MessageType_Error,
    12981284          tr("Failed to delete the storage unit of the hard disk <b>%1</b>.")
    12991285             .arg(strLocation),
     
    13031289void UIMessageCenter::cannotDeleteHardDiskStorage(const CProgress &progress, const QString &strLocation, QWidget *pParent /*= 0*/) const
    13041290{
    1305     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1291    error(pParent, MessageType_Error,
    13061292          tr("Failed to delete the storage unit of the hard disk <b>%1</b>.")
    13071293             .arg(strLocation),
     
    13391325    }
    13401326    /* Show the error: */
    1341     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1327    error(pParent, MessageType_Error,
    13421328          strMessage, strErrorInfo);
    13431329}
     
    13881374    /* Show the messsage: */
    13891375    if (fRetry)
    1390         return errorWithQuestion(pParent ? pParent : mainWindowShown(), MessageType_Question,
     1376        return errorWithQuestion(pParent, MessageType_Question,
    13911377                                 strMessage.arg(medium.isHostDrive() ? medium.name() : medium.location()).arg(machine.GetName()),
    13921378                                 strErrorInfo,
    13931379                                 0 /* Auto Confirm ID */,
    13941380                                 tr("Force Unmount"));
    1395     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1381    error(pParent, MessageType_Error,
    13961382          strMessage.arg(medium.isHostDrive() ? medium.name() : medium.location()).arg(machine.GetName()),
    13971383          strErrorInfo);
     
    14241410    }
    14251411    /* Show the error: */
    1426     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1412    error(pParent, MessageType_Error,
    14271413          strMessage.arg(strLocation), formatErrorInfo(vbox));
    14281414}
     
    14531439    }
    14541440    /* Show the error: */
    1455     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1441    error(pParent, MessageType_Error,
    14561442          strMessage.arg(medium.location()), formatErrorInfo(rc));
    14571443}
     
    14591445bool UIMessageCenter::confirmHardDisklessMachine(QWidget *pParent /*= 0*/) const
    14601446{
    1461     return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Warning,
     1447    return questionBinary(pParent, MessageType_Warning,
    14621448                          tr("You are about to create a new virtual machine without a hard drive. "
    14631449                             "You will not be able to install an operating system on the machine "
     
    14711457void UIMessageCenter::cannotCreateMachine(const CVirtualBox &vbox, QWidget *pParent /*= 0*/) const
    14721458{
    1473     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1459    error(pParent, MessageType_Error,
    14741460          tr("Failed to create a new virtual machine."),
    14751461          formatErrorInfo(vbox));
     
    14781464void UIMessageCenter::cannotRegisterMachine(const CVirtualBox &vbox, const QString &strMachineName, QWidget *pParent /*= 0*/) const
    14791465{
    1480     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1466    error(pParent, MessageType_Error,
    14811467          tr("Failed to register the virtual machine <b>%1</b>.")
    14821468             .arg(strMachineName),
     
    14891475    QString strErrorInfo = formatErrorInfo(machine);
    14901476    /* Show the error: */
    1491     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1477    error(pParent, MessageType_Error,
    14921478          tr("Failed to clone the virtual machine <b>%1</b>.")
    14931479             .arg(machine.GetName()),
     
    14971483void UIMessageCenter::cannotCreateClone(const CProgress &progress, const QString &strMachineName, QWidget *pParent /*= 0*/) const
    14981484{
    1499     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1485    error(pParent, MessageType_Error,
    15001486          tr("Failed to clone the virtual machine <b>%1</b>.")
    15011487             .arg(strMachineName),
     
    15051491void UIMessageCenter::cannotOverwriteHardDiskStorage(const QString &strLocation, QWidget *pParent /*= 0*/) const
    15061492{
    1507     alert(pParent ? pParent : mainWindowShown(), MessageType_Info,
     1493    alert(pParent, MessageType_Info,
    15081494          tr("<p>The hard disk storage unit at location <b>%1</b> already exists. "
    15091495             "You cannot create a new virtual hard disk that uses this location "
     
    15151501void UIMessageCenter::cannotCreateHardDiskStorage(const CVirtualBox &vbox, const QString &strLocation, QWidget *pParent /*= 0*/) const
    15161502{
    1517     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1503    error(pParent, MessageType_Error,
    15181504          tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr>")
    15191505             .arg(strLocation),
     
    15231509void UIMessageCenter::cannotCreateHardDiskStorage(const CMedium &medium, const QString &strLocation, QWidget *pParent /*= 0*/) const
    15241510{
    1525     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1511    error(pParent, MessageType_Error,
    15261512          tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr>")
    15271513             .arg(strLocation),
     
    15311517void UIMessageCenter::cannotCreateHardDiskStorage(const CProgress &progress, const QString &strLocation, QWidget *pParent /*= 0*/) const
    15321518{
    1533     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1519    error(pParent, MessageType_Error,
    15341520          tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr>")
    15351521             .arg(strLocation),
     
    15401526{
    15411527    QFileInfo fi(strFolderName);
    1542     alert(pParent ? pParent : mainWindowShown(), MessageType_Critical,
     1528    alert(pParent, MessageType_Critical,
    15431529          tr("<p>Cannot remove the machine folder <nobr><b>%1</b>.</nobr></p>"
    15441530             "<p>Please check that this folder really exists and that you have permissions to remove it.</p>")
     
    15491535{
    15501536    QFileInfo fi(strFolderName);
    1551     alert(pParent ? pParent : mainWindowShown(), MessageType_Critical,
     1537    alert(pParent, MessageType_Critical,
    15521538          tr("<p>Cannot create the machine folder <b>%1</b> in the parent folder <nobr><b>%2</b>.</nobr></p>"
    15531539             "<p>This folder already exists and possibly belongs to another machine.</p>")
     
    15581544{
    15591545    QFileInfo fi(strFolderName);
    1560     alert(pParent ? pParent : mainWindowShown(), MessageType_Critical,
     1546    alert(pParent, MessageType_Critical,
    15611547          tr("<p>Cannot create the machine folder <b>%1</b> in the parent folder <nobr><b>%2</b>.</nobr></p>"
    15621548             "<p>Please check that the parent really exists and that you have permissions to create the machine folder.</p>")
     
    15751561        strWarningInfo = "<br />" + strWarningInfo;
    15761562    /* Show the error: */
    1577     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1563    error(pParent, MessageType_Error,
    15781564          tr("Failed to open/interpret appliance <b>%1</b>.")
    15791565             .arg(appliance.GetPath()),
     
    15831569void UIMessageCenter::cannotImportAppliance(const CProgress &progress, const QString &strPath, QWidget *pParent /*= 0*/) const
    15841570{
    1585     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1571    error(pParent, MessageType_Error,
    15861572          tr("Failed to import appliance <b>%1</b>.")
    15871573             .arg(strPath),
     
    15911577void UIMessageCenter::cannotCheckFiles(const CProgress &progress, QWidget *pParent /*= 0*/) const
    15921578{
    1593     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1579    error(pParent, MessageType_Error,
    15941580          tr("Failed to check files."),
    15951581          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     
    15981584void UIMessageCenter::cannotRemoveFiles(const CProgress &progress, QWidget *pParent /*= 0*/) const
    15991585{
    1600     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1586    error(pParent, MessageType_Error,
    16011587          tr("Failed to remove file."),
    16021588          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     
    16051591bool UIMessageCenter::confirmExportMachinesInSaveState(const QStringList &machineNames, QWidget *pParent /*= 0*/) const
    16061592{
    1607     return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Warning,
     1593    return questionBinary(pParent, MessageType_Warning,
    16081594                          tr("<p>The %n following virtual machine(s) are currently in a saved state: <b>%1</b></p>"
    16091595                             "<p>If you continue the runtime state of the exported machine(s) will be discarded. "
     
    16221608    QString strErrorInfo = formatErrorInfo(appliance);
    16231609    /* Show the error: */
    1624     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1610    error(pParent, MessageType_Error,
    16251611          tr("Failed to prepare the export of the appliance <b>%1</b>.")
    16261612             .arg(appliance.GetPath()),
     
    16301616void UIMessageCenter::cannotExportAppliance(const CMachine &machine, const QString &strPath, QWidget *pParent /*= 0*/) const
    16311617{
    1632     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1618    error(pParent, MessageType_Error,
    16331619          tr("Failed to prepare the export of the appliance <b>%1</b>.")
    16341620             .arg(strPath),
     
    16381624void UIMessageCenter::cannotExportAppliance(const CProgress &progress, const QString &strPath, QWidget *pParent /*= 0*/) const
    16391625{
    1640     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1626    error(pParent, MessageType_Error,
    16411627          tr("Failed to export appliance <b>%1</b>.")
    16421628             .arg(strPath),
     
    16461632void UIMessageCenter::cannotFindSnapshotByName(const CMachine &machine, const QString &strName, QWidget *pParent /*= 0*/) const
    16471633{
    1648     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     1634    error(pParent, MessageType_Error,
    16491635          tr("Can't find snapshot named <b>%1</b>.")
    16501636             .arg(strName),
     
    17131699    if (type == MessageType_Critical)
    17141700    {
    1715         error(mainMachineWindowShown(), type,
     1701        error(mainWindowShown(), type,
    17161702              tr("<p>A fatal error has occurred during virtual machine execution! "
    17171703                 "The virtual machine will be powered off. Please copy the following error message "
     
    17211707    else if (type == MessageType_Error)
    17221708    {
    1723         error(mainMachineWindowShown(), type,
     1709        error(mainWindowShown(), type,
    17241710              tr("<p>An error has occurred during virtual machine execution! "
    17251711                 "The error details are shown below. You may try to correct the error "
     
    17291715    else
    17301716    {
    1731         error(mainMachineWindowShown(), type,
     1717        error(mainWindowShown(), type,
    17321718              tr("<p>The virtual machine execution may run into an error condition as described below. "
    17331719                 "We suggest that you take an appropriate action to avert the error.</p>"),
     
    17461732bool UIMessageCenter::remindAboutGuruMeditation(const QString &strLogFolder)
    17471733{
    1748     return questionBinary(mainMachineWindowShown(), MessageType_GuruMeditation,
     1734    return questionBinary(mainWindowShown(), MessageType_GuruMeditation,
    17491735                          tr("<p>A critical error has occurred while running the virtual "
    17501736                             "machine and the machine execution has been stopped.</p>"
     
    17731759{
    17741760    if (fHWVirtExSupported)
    1775         return questionBinary(mainMachineWindowShown(), MessageType_Error,
     1761        return questionBinary(mainWindowShown(), MessageType_Error,
    17761762                              tr("<p>VT-x/AMD-V hardware acceleration has been enabled, but is "
    17771763                                 "not operational. Your 64-bit guest will fail to detect a "
     
    17821768                              tr("Close VM"), tr("Continue"));
    17831769    else
    1784         return questionBinary(mainMachineWindowShown(), MessageType_Error,
     1770        return questionBinary(mainWindowShown(), MessageType_Error,
    17851771                              tr("<p>VT-x/AMD-V hardware acceleration is not available on your system. "
    17861772                                 "Your 64-bit guest will fail to detect a 64-bit CPU and will "
     
    17931779{
    17941780    if (fHWVirtExSupported)
    1795         return questionBinary(mainMachineWindowShown(), MessageType_Error,
     1781        return questionBinary(mainWindowShown(), MessageType_Error,
    17961782                              tr("<p>VT-x/AMD-V hardware acceleration has been enabled, but is not operational. "
    17971783                                 "Certain guests (e.g. OS/2 and QNX) require this feature.</p>"
     
    18001786                              tr("Close VM"), tr("Continue"));
    18011787    else
    1802         return questionBinary(mainMachineWindowShown(), MessageType_Error,
     1788        return questionBinary(mainWindowShown(), MessageType_Error,
    18031789                              tr("<p>VT-x/AMD-V hardware acceleration is not available on your system. "
    18041790                                 "Certain guests (e.g. OS/2 and QNX) require this feature and will fail to boot without it.</p>"),
     
    18091795bool UIMessageCenter::cannotStartWithoutNetworkIf(const QString &strMachineName, const QString &strIfNames) const
    18101796{
    1811     return questionBinary(mainMachineWindowShown(), MessageType_Error,
     1797    return questionBinary(mainWindowShown(), MessageType_Error,
    18121798                          tr("<p>Could not start the machine <b>%1</b> because the following "
    18131799                             "physical network interfaces were not found:</p><p><b>%2</b></p>"
     
    18201806void UIMessageCenter::cannotStartMachine(const CConsole &console, const QString &strName) const
    18211807{
    1822     error(mainMachineWindowShown(), MessageType_Error,
     1808    error(mainWindowShown(), MessageType_Error,
    18231809          tr("Failed to start the virtual machine <b>%1</b>.")
    18241810             .arg(strName),
     
    18281814void UIMessageCenter::cannotStartMachine(const CProgress &progress, const QString &strName) const
    18291815{
    1830     error(mainMachineWindowShown(), MessageType_Error,
     1816    error(mainWindowShown(), MessageType_Error,
    18311817          tr("Failed to start the virtual machine <b>%1</b>.")
    18321818             .arg(strName),
     
    18361822void UIMessageCenter::cannotSendACPIToMachine() const
    18371823{
    1838     alert(mainMachineWindowShown(),  MessageType_Warning,
     1824    alert(mainWindowShown(),  MessageType_Warning,
    18391825          tr("You are trying to shut down the guest with the ACPI power button. "
    18401826             "This is currently not possible because the guest does not support software shutdown."));
     
    18431829bool UIMessageCenter::confirmInputCapture(bool &fAutoConfirmed) const
    18441830{
    1845     int rc = question(mainMachineWindowShown(), MessageType_Info,
     1831    int rc = question(mainWindowShown(), MessageType_Info,
    18461832                      tr("<p>You have <b>clicked the mouse</b> inside the Virtual Machine display or pressed the <b>host key</b>. "
    18471833                         "This will cause the Virtual Machine to <b>capture</b> the host mouse pointer (only if the mouse pointer "
     
    18681854void UIMessageCenter::remindAboutAutoCapture() const
    18691855{
    1870     alert(mainMachineWindowShown(), MessageType_Info,
     1856    alert(mainWindowShown(), MessageType_Info,
    18711857          tr("<p>You have the <b>Auto capture keyboard</b> option turned on. "
    18721858             "This will cause the Virtual Machine to automatically <b>capture</b> "
     
    19031889    if (fSupportsAbsolute)
    19041890    {
    1905         alert(mainMachineWindowShown(), MessageType_Info,
     1891        alert(mainWindowShown(), MessageType_Info,
    19061892              tr("<p>The Virtual Machine reports that the guest OS supports <b>mouse pointer integration</b>. "
    19071893                 "This means that you do not need to <i>capture</i> the mouse pointer to be able to use it in your guest OS -- "
     
    19171903    else
    19181904    {
    1919         alert(mainMachineWindowShown(), MessageType_Info,
     1905        alert(mainWindowShown(), MessageType_Info,
    19201906              tr("<p>The Virtual Machine reports that the guest OS does not support <b>mouse pointer integration</b> "
    19211907                 "in the current video mode. You need to capture the mouse (by clicking over the VM display "
     
    19301916void UIMessageCenter::remindAboutPausedVMInput() const
    19311917{
    1932     alert(mainMachineWindowShown(), MessageType_Info,
     1918    alert(mainWindowShown(), MessageType_Info,
    19331919          tr("<p>The Virtual Machine is currently in the <b>Paused</b> state and "
    19341920             "not able to see any keyboard or mouse input. If you want to "
     
    19401926bool UIMessageCenter::confirmGoingFullscreen(const QString &strHotKey) const
    19411927{
    1942     return questionBinary(mainMachineWindowShown(), MessageType_Info,
     1928    return questionBinary(mainWindowShown(), MessageType_Info,
    19431929                          tr("<p>The virtual machine window will be now switched to <b>fullscreen</b> mode. "
    19441930                             "You can go back to windowed mode at any time by pressing <b>%1</b>.</p>"
     
    19531939bool UIMessageCenter::confirmGoingSeamless(const QString &strHotKey) const
    19541940{
    1955     return questionBinary(mainMachineWindowShown(), MessageType_Info,
     1941    return questionBinary(mainWindowShown(), MessageType_Info,
    19561942                          tr("<p>The virtual machine window will be now switched to <b>Seamless</b> mode. "
    19571943                             "You can go back to windowed mode at any time by pressing <b>%1</b>.</p>"
     
    19661952bool UIMessageCenter::confirmGoingScale(const QString &strHotKey) const
    19671953{
    1968     return questionBinary(mainMachineWindowShown(), MessageType_Info,
     1954    return questionBinary(mainWindowShown(), MessageType_Info,
    19691955                          tr("<p>The virtual machine window will be now switched to <b>Scale</b> mode. "
    19701956                             "You can go back to windowed mode at any time by pressing <b>%1</b>.</p>"
     
    19791965bool UIMessageCenter::cannotEnterFullscreenMode(ULONG /* uWidth */, ULONG /* uHeight */, ULONG /* uBpp */, ULONG64 uMinVRAM) const
    19801966{
    1981     return questionBinary(mainMachineWindowShown(), MessageType_Warning,
     1967    return questionBinary(mainWindowShown(), MessageType_Warning,
    19821968                          tr("<p>Could not switch the guest display to fullscreen mode due to insufficient guest video memory.</p>"
    19831969                             "<p>You should configure the virtual machine to have at least <b>%1</b> of video memory.</p>"
     
    19901976void UIMessageCenter::cannotEnterSeamlessMode(ULONG /* uWidth */, ULONG /* uHeight */, ULONG /* uBpp */, ULONG64 uMinVRAM) const
    19911977{
    1992     alert(mainMachineWindowShown(), MessageType_Error,
     1978    alert(mainWindowShown(), MessageType_Error,
    19931979          tr("<p>Could not enter seamless mode due to insufficient guest "
    19941980             "video memory.</p>"
     
    20001986bool UIMessageCenter::cannotSwitchScreenInFullscreen(quint64 uMinVRAM) const
    20011987{
    2002     return questionBinary(mainMachineWindowShown(), MessageType_Warning,
     1988    return questionBinary(mainWindowShown(), MessageType_Warning,
    20031989                          tr("<p>Could not change the guest screen to this host screen due to insufficient guest video memory.</p>"
    20041990                             "<p>You should configure the virtual machine to have at least <b>%1</b> of video memory.</p>"
     
    20111997void UIMessageCenter::cannotSwitchScreenInSeamless(quint64 uMinVRAM) const
    20121998{
    2013     alert(mainMachineWindowShown(), MessageType_Error,
     1999    alert(mainWindowShown(), MessageType_Error,
    20142000          tr("<p>Could not change the guest screen to this host screen "
    20152001             "due to insufficient guest video memory.</p>"
     
    20242010    QString strErrorInfo = formatErrorInfo(console);
    20252011    /* Show the error: */
    2026     error(mainMachineWindowShown(), MessageType_Error,
     2012    error(mainWindowShown(), MessageType_Error,
    20272013          tr("Failed to attach the USB device <b>%1</b> to the virtual machine <b>%2</b>.")
    20282014             .arg(strDevice, console.GetMachine().GetName()),
     
    20322018void UIMessageCenter::cannotAttachUSBDevice(const CVirtualBoxErrorInfo &errorInfo, const QString &strDevice, const QString &strMachineName) const
    20332019{
    2034     error(mainMachineWindowShown(), MessageType_Error,
     2020    error(mainWindowShown(), MessageType_Error,
    20352021          tr("Failed to attach the USB device <b>%1</b> to the virtual machine <b>%2</b>.")
    20362022             .arg(strDevice, strMachineName),
     
    20432029    QString strErrorInfo = formatErrorInfo(console);
    20442030    /* Show the error: */
    2045     error(mainMachineWindowShown(), MessageType_Error,
     2031    error(mainWindowShown(), MessageType_Error,
    20462032          tr("Failed to detach the USB device <b>%1</b> from the virtual machine <b>%2</b>.")
    20472033             .arg(strDevice, console.GetMachine().GetName()),
     
    20512037void UIMessageCenter::cannotDetachUSBDevice(const CVirtualBoxErrorInfo &errorInfo, const QString &strDevice, const QString &strMachineName) const
    20522038{
    2053     error(mainMachineWindowShown(), MessageType_Error,
     2039    error(mainWindowShown(), MessageType_Error,
    20542040          tr("Failed to detach the USB device <b>%1</b> from the virtual machine <b>%2</b>.")
    20552041             .arg(strDevice, strMachineName),
     
    20592045void UIMessageCenter::remindAboutGuestAdditionsAreNotActive(QWidget *pParent /*= 0*/) const
    20602046{
    2061     alert(pParent ? pParent : mainMachineWindowShown(), MessageType_Warning,
     2047    alert(pParent, MessageType_Warning,
    20622048          tr("<p>The VirtualBox Guest Additions do not appear to be available on this virtual machine, "
    20632049             "and shared folders cannot be used without them. To use shared folders inside the virtual machine, "
     
    21012087bool UIMessageCenter::cannotFindGuestAdditions() const
    21022088{
    2103     return questionBinary(mainMachineWindowShown(), MessageType_Question,
     2089    return questionBinary(mainWindowShown(), MessageType_Question,
    21042090                          tr("<p>Could not find the <b>VirtualBox Guest Additions</b> CD image.</p>"
    21052091                             "<p>Do you wish to download this CD image from the Internet?</p>"),
     
    21112097{
    21122098    QLocale loc(VBoxGlobal::languageId());
    2113     return questionBinary(networkManagerOrMainMachineWindowShown(), MessageType_Question,
     2099    return questionBinary(networkManagerOrMainWindowShown(), MessageType_Question,
    21142100                          tr("<p>Are you sure you want to download the <b>VirtualBox Guest Additions</b> CD image "
    21152101                             "from <nobr><a href=\"%1\">%1</a></nobr> (size %2 bytes)?</p>")
     
    21212107void UIMessageCenter::cannotSaveGuestAdditions(const QString &strURL, const QString &strTarget) const
    21222108{
    2123     alert(networkManagerOrMainMachineWindowShown(), MessageType_Error,
     2109    alert(networkManagerOrMainWindowShown(), MessageType_Error,
    21242110          tr("<p>The <b>VirtualBox Guest Additions</b> CD image has been successfully downloaded "
    21252111             "from <nobr><a href=\"%1\">%1</a></nobr> "
     
    21312117bool UIMessageCenter::proposeMountGuestAdditions(const QString &strUrl, const QString &strSrc) const
    21322118{
    2133     return questionBinary(networkManagerOrMainMachineWindowShown(), MessageType_Question,
     2119    return questionBinary(networkManagerOrMainWindowShown(), MessageType_Question,
    21342120                          tr("<p>The <b>VirtualBox Guest Additions</b> CD image has been successfully downloaded "
    21352121                             "from <nobr><a href=\"%1\">%1</a></nobr> "
     
    21432129void UIMessageCenter::cannotMountGuestAdditions(const QString &strMachineName) const
    21442130{
    2145     alert(mainMachineWindowShown(), MessageType_Error,
     2131    alert(mainWindowShown(), MessageType_Error,
    21462132          tr("<p>Could not insert the <b>VirtualBox Guest Additions</b> CD image into the virtual machine <b>%1</b>, "
    21472133             "as the machine has no CD/DVD-ROM drives. Please add a drive using the storage page of the "
     
    21522138void UIMessageCenter::cannotUpdateGuestAdditions(const CProgress &progress) const
    21532139{
    2154     error(mainMachineWindowShown(), MessageType_Error,
     2140    error(mainWindowShown(), MessageType_Error,
    21552141          tr("Failed to update Guest Additions. "
    21562142             "The Guest Additions installation image will be mounted to provide a manual installation."),
     
    22452231                                                  const QString &strPackDescription, QWidget *pParent /*= 0*/) const
    22462232{
    2247     return questionBinary(pParent ? pParent : mainWindowShown(),
    2248                           MessageType_Question,
     2233    return questionBinary(pParent, MessageType_Question,
    22492234                          tr("<p>You are about to install a VirtualBox extension pack. "
    22502235                             "Extension packs complement the functionality of VirtualBox and can contain system level software "
     
    22792264    bool fRc;
    22802265    if (iVerCmp > 0)
    2281         fRc = questionBinary(pParent ? pParent : mainWindowShown(),
    2282                              MessageType_Question,
     2266        fRc = questionBinary(pParent, MessageType_Question,
    22832267                             tr("<p>An older version of the extension pack is already installed, would you like to upgrade? "
    22842268                                "<p>%1</p>"
     
    22932277                             tr("&Upgrade"));
    22942278    else if (iVerCmp < 0)
    2295         fRc = questionBinary(pParent ? pParent : mainWindowShown(),
    2296                              MessageType_Question,
     2279        fRc = questionBinary(pParent, MessageType_Question,
    22972280                             tr("<p>An newer version of the extension pack is already installed, would you like to downgrade? "
    22982281                                "<p>%1</p>"
     
    23072290                             tr("&Downgrade"));
    23082291    else
    2309         fRc = questionBinary(pParent ? pParent : mainWindowShown(),
    2310                              MessageType_Question,
     2292        fRc = questionBinary(pParent, MessageType_Question,
    23112293                             tr("<p>The extension pack is already installed with the same version, would you like reinstall it? "
    23122294                                "<p>%1</p>"
     
    23242306bool UIMessageCenter::confirmRemoveExtensionPack(const QString &strPackName, QWidget *pParent /*= 0*/) const
    23252307{
    2326     return questionBinary(pParent ? pParent : mainWindowShown(),
    2327                           MessageType_Question,
     2308    return questionBinary(pParent, MessageType_Question,
    23282309                          tr("<p>You are about to remove the VirtualBox extension pack <b>%1</b>.</p>"
    23292310                             "<p>Are you sure you want to proceed?</p>")
     
    23352316void UIMessageCenter::cannotOpenExtPack(const QString &strFilename, const CExtPackManager &extPackManager, QWidget *pParent /*= 0*/) const
    23362317{
    2337     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     2318    error(pParent, MessageType_Error,
    23382319          tr("Failed to open the Extension Pack <b>%1</b>.").arg(strFilename),
    23392320          formatErrorInfo(extPackManager));
     
    23422323void UIMessageCenter::warnAboutBadExtPackFile(const QString &strFilename, const CExtPackFile &extPackFile, QWidget *pParent /*= 0*/) const
    23432324{
    2344     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     2325    error(pParent, MessageType_Error,
    23452326          tr("Failed to open the Extension Pack <b>%1</b>.").arg(strFilename),
    23462327          "<!--EOM-->" + extPackFile.GetWhyUnusable());
     
    23492330void UIMessageCenter::cannotInstallExtPack(const CExtPackFile &extPackFile, const QString &strFilename, QWidget *pParent /*= 0*/) const
    23502331{
    2351     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     2332    error(pParent, MessageType_Error,
    23522333          tr("Failed to install the Extension Pack <b>%1</b>.")
    23532334             .arg(strFilename),
     
    23572338void UIMessageCenter::cannotInstallExtPack(const CProgress &progress, const QString &strFilename, QWidget *pParent /*= 0*/) const
    23582339{
    2359     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     2340    error(pParent, MessageType_Error,
    23602341          tr("Failed to install the Extension Pack <b>%1</b>.")
    23612342             .arg(strFilename),
     
    23652346void UIMessageCenter::cannotUninstallExtPack(const CExtPackManager &extPackManager, const QString &strPackName, QWidget *pParent /*= 0*/) const
    23662347{
    2367     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     2348    error(pParent, MessageType_Error,
    23682349          tr("Failed to uninstall the Extension Pack <b>%1</b>.")
    23692350             .arg(strPackName),
     
    23732354void UIMessageCenter::cannotUninstallExtPack(const CProgress &progress, const QString &strPackName, QWidget *pParent /*= 0*/) const
    23742355{
    2375     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     2356    error(pParent, MessageType_Error,
    23762357          tr("Failed to uninstall the Extension Pack <b>%1</b>.")
    23772358             .arg(strPackName),
     
    23812362void UIMessageCenter::warnAboutExtPackInstalled(const QString &strPackName, QWidget *pParent /*= 0*/) const
    23822363{
    2383     alert(pParent ? pParent : mainWindowShown(), MessageType_Info,
     2364    alert(pParent, MessageType_Info,
    23842365          tr("The extension pack <br><nobr><b>%1</b><nobr><br> was installed successfully.")
    23852366             .arg(strPackName));
     
    23892370void UIMessageCenter::cannotDropData(const CGuest &guest, QWidget *pParent /*= 0*/) const
    23902371{
    2391     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     2372    error(pParent, MessageType_Error,
    23922373          tr("Failed to drop data."),
    23932374          formatErrorInfo(guest));
     
    23962377void UIMessageCenter::cannotDropData(const CProgress &progress, QWidget *pParent /*= 0*/) const
    23972378{
    2398     error(pParent ? pParent : mainWindowShown(), MessageType_Error,
     2379    error(pParent, MessageType_Error,
    23992380          tr("Failed to drop data."),
    24002381          !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
     
    24042385void UIMessageCenter::cannotOpenLicenseFile(const QString &strPath, QWidget *pParent /*= 0*/) const
    24052386{
    2406     alert(pParent ? pParent : mainWindowShown(), MessageType_Error,
     2387    alert(pParent, MessageType_Error,
    24072388          tr("Failed to open the license file <nobr><b>%1</b></nobr>. Check file permissions.")
    24082389             .arg(strPath));
     
    26422623    }
    26432624
    2644     alert(mainMachineWindowShown(), MessageType_Info,
     2625    alert(mainWindowShown(), MessageType_Info,
    26452626          tr("<p>The virtual machine window is optimized to work in "
    26462627             "<b>%1&nbsp;bit</b> color mode but the "
     
    28502831
    28512832    /* Create message-box: */
    2852     QWidget *pMessageBoxParent = mwManager().realParentWindow(pParent);
     2833    QWidget *pMessageBoxParent = mwManager().realParentWindow(pParent ? pParent : mainWindowShown());
    28532834    QPointer<QIMessageBox> pMessageBox = new QIMessageBox(title, strMessage, icon,
    28542835                                                          iButton1, iButton2, iButton3,
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r45368 r45371  
    155155    /* API: Main window stuff: */
    156156    QWidget* mainWindowShown() const;
    157     QWidget* mainMachineWindowShown() const;
    158157    QWidget* networkManagerOrMainWindowShown() const;
    159     QWidget* networkManagerOrMainMachineWindowShown() const;
    160158
    161159    /* API: Main (startup) warnings: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r45325 r45371  
    49594959     * otherwise we better show the progress... */
    49604960    int iSpawningDuration = 60000;
    4961     msgCenter().showModalProgressDialog(progress, machine.GetName(), "", mainWindow(), iSpawningDuration);
     4961    msgCenter().showModalProgressDialog(progress, machine.GetName(), "", msgCenter().mainWindowShown(), iSpawningDuration);
    49624962    if (!progress.isOk() || progress.GetResultCode() != 0)
    49634963        msgCenter().cannotOpenSession(progress, machine.GetName());
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloaderAdditions.cpp

    r45342 r45371  
    103103        /* Ask the user for another location for the additions-image file: */
    104104        QString strTarget = QIFileDialog::getExistingDirectory(QFileInfo(target()).absolutePath(),
    105                                                                msgCenter().networkManagerOrMainMachineWindowShown(),
     105                                                               msgCenter().networkManagerOrMainWindowShown(),
    106106                                                               tr("Select folder to save Guest Additions image to"), true);
    107107
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIUpdateManager.cpp

    r45342 r45371  
    443443        /* Warn the user about extension pack was downloaded and saved, propose to install it: */
    444444        if (msgCenter().proposeInstallExtentionPack(GUI_ExtPackName, strSource, QDir::toNativeSeparators(strTarget)))
    445             UIGlobalSettingsExtension::doInstallation(strTarget, strDigest, msgCenter().mainWindowShown(), NULL);
     445            UIGlobalSettingsExtension::doInstallation(strTarget, strDigest, msgCenter().networkManagerOrMainWindowShown(), NULL);
    446446    }
    447447};
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r45368 r45371  
    506506    {
    507507        msgCenter().showModalProgressDialog(progressInstall, tr("Updating Guest Additions"), ":/progress_install_guest_additions_90px.png",
    508                                             mainMachineWindow(), 500 /* 500ms delay. */);
     508                                            machineLogic()->activeMachineWindow(), 500 /* 500ms delay. */);
    509509        if (progressInstall.GetCanceled())
    510510            return;
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r45362 r45371  
    609609            /* Show machine state saving progress: */
    610610            CMachine machine = session.GetMachine();
    611             msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_state_save_90px.png", this);
     611            msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_state_save_90px.png");
    612612            if (!progress.isOk() || progress.GetResultCode() != 0)
    613613                msgCenter().cannotSaveMachineState(progress, machine.GetName());
     
    699699            /* Show machine power down progress: */
    700700            CMachine machine = session.GetMachine();
    701             msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_poweroff_90px.png", this);
     701            msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_poweroff_90px.png");
    702702            if (!progress.isOk() || progress.GetResultCode() != 0)
    703703                msgCenter().cannotPowerDownMachine(progress, machine.GetName());
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.cpp

    r45328 r45371  
    607607    if (console.isOk())
    608608    {
    609         msgCenter().showModalProgressDialog(progress, mMachine.GetName(), ":/progress_snapshot_restore_90px.png",
    610                                             msgCenter().mainWindowShown(), true);
     609        msgCenter().showModalProgressDialog(progress, mMachine.GetName(), ":/progress_snapshot_restore_90px.png");
    611610        if (progress.GetResultCode() != 0)
    612611            msgCenter().cannotRestoreSnapshot(progress, snapshot.GetName(), mMachine.GetName());
     
    656655    {
    657656        /* Show the progress dialog */
    658         msgCenter().showModalProgressDialog(progress, mMachine.GetName(), ":/progress_snapshot_discard_90px.png",
    659                                             msgCenter().mainWindowShown(), true);
     657        msgCenter().showModalProgressDialog(progress, mMachine.GetName(), ":/progress_snapshot_discard_90px.png");
    660658
    661659        if (progress.GetResultCode() != 0)
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