VirtualBox

Changeset 68679 in vbox for trunk


Ignore:
Timestamp:
Sep 6, 2017 1:42:56 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: Moving some more messages to UIPopupCenter

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

Legend:

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

    r68600 r68679  
    20332033             "least <b>%1</b> of video memory.</p>")
    20342034             .arg(VBoxGlobal::formatSize(uMinVRAM)));
    2035 }
    2036 
    2037 void UIMessageCenter::cannotMountGuestAdditions(const QString &strMachineName) const
    2038 {
    2039     alert(0, MessageType_Error,
    2040           tr("<p>Could not insert the <b>VirtualBox Guest Additions</b> disk image file into the virtual machine <b>%1</b>, "
    2041              "as the machine has no optical drives. Please add a drive using the storage page of the "
    2042              "virtual machine settings window.</p>")
    2043              .arg(strMachineName));
    20442035}
    20452036
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r68600 r68679  
    312312    bool cannotSwitchScreenInFullscreen(quint64 uMinVRAM) const;
    313313    void cannotSwitchScreenInSeamless(quint64 uMinVRAM) const;
    314     void cannotMountGuestAdditions(const QString &strMachineName) const;
    315314    void cannotAddDiskEncryptionPassword(const CConsole &console);
    316315
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.cpp

    r68600 r68679  
    629629}
    630630
     631void UIPopupCenter::cannotMountImage(QWidget *pParent, const QString &strMachineName, const QString &strMediumName)
     632{
     633    alert(pParent, "cannotMountImage",
     634          QApplication::translate("UIMessageCenter",
     635                                  "<p>Could not insert the <b>%1</b> disk image file into the virtual machine <b>%2</b>, "
     636                                  "as the machine has no optical drives. Please add a drive using the storage page of the "
     637                                  "virtual machine settings window.</p>")
     638                                  .arg(strMediumName, strMachineName));
     639}
     640
     641void UIPopupCenter::cannotOpenMedium(QWidget *pParent, const CVirtualBox &comVBox, UIMediumType /* enmType */, const QString &strLocation)
     642{
     643    alertWithDetails(pParent, "cannotOpenMedium",
     644                     QApplication::translate("UIMessageCenter",
     645                                             "Failed to open the disk image file <nobr><b>%1</b></nobr>.")
     646                                             .arg(strLocation),
     647                     UIErrorString::formatErrorInfo(comVBox));
     648}
     649
     650void UIPopupCenter::cannotSaveMachineSettings(QWidget *pParent, const CMachine &comMachine)
     651{
     652    alertWithDetails(pParent, "cannotSaveMachineSettings",
     653                     QApplication::translate("UIMessageCenter",
     654                                             "Failed to save the settings of the virtual machine <b>%1</b> to <b><nobr>%2</nobr></b>.")
     655                                             .arg(CMachine(comMachine).GetName(), CMachine(comMachine).GetSettingsFilePath()),
     656                     UIErrorString::formatErrorInfo(comMachine));
     657}
     658
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.h

    r68600 r68679  
    2424#include <QPointer>
    2525
     26/* GUI includes: */
     27#include "UIMediumDefs.h"
     28
    2629/* Forward declaration: */
    2730class QWidget;
     
    3235class CMachine;
    3336class CNetworkAdapter;
     37class CVirtualBox;
    3438class CVirtualBoxErrorInfo;
    3539class CVRDEServer;
     
    138142    void cannotToggleAudioInput(QWidget *pParent, const CAudioAdapter &comAdapter,
    139143                                const QString &strMachineName, bool fEnable);
     144    void cannotMountImage(QWidget *pParent, const QString &strMachineName, const QString &strMediumName);
     145    void cannotOpenMedium(QWidget *pParent, const CVirtualBox &comVBox, UIMediumType enmType, const QString &strLocation);
     146    void cannotSaveMachineSettings(QWidget *pParent, const CMachine &comMachine);
    140147
    141148private slots:
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r68663 r68679  
    18921892        if (!comVBox.isOk() || comMedium.isNull())
    18931893        {
    1894             msgCenter().cannotOpenMedium(comVBox, enmMediumType, strMediumName);
     1894            popupCenter().cannotOpenMedium(machineLogic()->activeMachineWindow(), comVBox, enmMediumType, strMediumName);
    18951895            return false;
    18961896        }
     
    19351935    if (sStorageSlots.isEmpty())
    19361936    {
    1937         msgCenter().cannotMountGuestAdditions(machineName());
     1937        popupCenter().cannotMountImage(machineLogic()->activeMachineWindow(), machineName(), strMediumName);
    19381938        return false;
    19391939    }
     
    19611961    if (!machine().isOk())
    19621962    {
    1963         msgCenter().cannotSaveMachineSettings(machine(), mainMachineWindow());
     1963        popupCenter().cannotSaveMachineSettings(machineLogic()->activeMachineWindow(), machine());
    19641964        return false;
    19651965    }
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