VirtualBox

Changeset 45274 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Apr 1, 2013 1:50:01 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: Message-center cleanup (part 11).

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

Legend:

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

    r45271 r45274  
    644644void UIMessageCenter::cannotSetGroups(const CMachine &machine)
    645645{
     646    /* Preserve error-info: */
    646647    COMResult res(machine);
    647     QString name = machine.GetName();
    648     if (name.isEmpty())
    649         name = QFileInfo(machine.GetSettingsFilePath()).baseName();
    650 
     648    /* Compose machine name: */
     649    QString strName = machine.GetName();
     650    if (strName.isEmpty())
     651        strName = QFileInfo(machine.GetSettingsFilePath()).baseName();
     652    /* Show the message: */
    651653    message(mainWindowShown(), MessageType_Error,
    652             tr("Failed to set groups of the virtual machine <b>%1</b>.").arg(name),
     654            tr("Failed to set groups of the virtual machine <b>%1</b>.").arg(strName),
    653655            formatErrorInfo(res));
    654656}
     
    837839}
    838840
    839 void UIMessageCenter::cannotLoadMachineSettings(const CMachine &machine,
    840                                                 bool fStrict /* = true */,
    841                                                 QWidget *pParent /* = 0 */)
    842 {
    843     /* If COM result code is E_NOTIMPL, it means the requested object or
    844      * function is intentionally missing (as in the OSE version). Don't show
    845      * the error message in this case. */
     841void UIMessageCenter::cannotLoadMachineSettings(const CMachine &machine, bool fStrict /*= true*/, QWidget *pParent /*= 0*/)
     842{
     843    /* This function is NOT use currently.
     844     * We are keeping it here just for convinience with Save analog. */
     845
     846    /* Preserve error-info.
     847     * If COM result code is E_NOTIMPL, it means the requested
     848     * object or function is intentionally missing (as in the OSE version).
     849     * Don't show the error message in this case. */
    846850    COMResult res(machine);
    847851    if (!fStrict && res.rc() == E_NOTIMPL)
    848852        return;
    849853
     854    /* Show the message: */
    850855    message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    851              tr("Failed to load the settings of the virtual machine "
    852                  "<b>%1</b> from <b><nobr>%2</nobr></b>.")
    853                 .arg(machine.GetName(), machine.GetSettingsFilePath()),
    854              formatErrorInfo(res));
    855 }
    856 
    857 void UIMessageCenter::cannotSaveMachineSettings(const CMachine &machine, QWidget *pParent /* = 0 */)
    858 {
    859     /* preserve the current error info before calling the object again */
     856            tr("Failed to load the settings of the virtual machine "
     857               "<b>%1</b> from <b><nobr>%2</nobr></b>.")
     858               .arg(machine.GetName(), machine.GetSettingsFilePath()),
     859            formatErrorInfo(res));
     860}
     861
     862void UIMessageCenter::cannotSaveMachineSettings(const CMachine &machine, QWidget *pParent /*= 0*/)
     863{
     864    /* Preserve error-info: */
    860865    COMResult res(machine);
    861 
     866    /* Show the message: */
    862867    message(pParent ? pParent : mainWindowShown(), MessageType_Error,
    863              tr("Failed to save the settings of the virtual machine "
    864                  "<b>%1</b> to <b><nobr>%2</nobr></b>.")
    865                  .arg(machine.GetName(), machine.GetSettingsFilePath()),
    866              formatErrorInfo(res));
     868            tr("Failed to save the settings of the virtual machine "
     869               "<b>%1</b> to <b><nobr>%2</nobr></b>.")
     870               .arg(machine.GetName(), machine.GetSettingsFilePath()),
     871            formatErrorInfo(res));
    867872}
    868873
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp

    r45193 r45274  
    13541354        if (!machine.isOk())
    13551355        {
    1356             msgCenter().cannotSaveMachineSettings (machine);
     1356            msgCenter().cannotSaveMachineSettings(machine, this);
    13571357            success = false;
    13581358        }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r45224 r45274  
    15081508        machine.SaveSettings();
    15091509        if (!machine.isOk())
    1510             msgCenter().cannotSaveMachineSettings(machine);
     1510            msgCenter().cannotSaveMachineSettings(machine, activeMachineWindow());
    15111511    }
    15121512}
     
    15671567            machine.SaveSettings();
    15681568            if (!machine.isOk())
    1569                 msgCenter().cannotSaveMachineSettings(machine);
     1569                msgCenter().cannotSaveMachineSettings(machine, activeMachineWindow());
    15701570        }
    15711571    }
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp

    r45270 r45274  
    862862    /* If machine is NOT ok => show the error message: */
    863863    if (!m_machine.isOk())
    864         msgCenter().cannotSaveMachineSettings(m_machine);
     864        msgCenter().cannotSaveMachineSettings(m_machine, this);
    865865
    866866    /* Mark page processed: */
     
    10901090        return false;
    10911091
    1092     /* Show the machine error message for particular group if present.
    1093      * We don't use the generic cannotLoadMachineSettings()
    1094      * call here because we want this message to be suppressible. */
    10951092    switch (iPageId)
    10961093    {
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