Changeset 45274 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Apr 1, 2013 1:50:01 PM (12 years ago)
- 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 644 644 void UIMessageCenter::cannotSetGroups(const CMachine &machine) 645 645 { 646 /* Preserve error-info: */ 646 647 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: */ 651 653 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), 653 655 formatErrorInfo(res)); 654 656 } … … 837 839 } 838 840 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. */ 841 void 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. */ 846 850 COMResult res(machine); 847 851 if (!fStrict && res.rc() == E_NOTIMPL) 848 852 return; 849 853 854 /* Show the message: */ 850 855 message(pParent ? pParent : mainWindowShown(), MessageType_Error, 851 852 853 854 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 862 void UIMessageCenter::cannotSaveMachineSettings(const CMachine &machine, QWidget *pParent /*= 0*/) 863 { 864 /* Preserve error-info: */ 860 865 COMResult res(machine); 861 866 /* Show the message: */ 862 867 message(pParent ? pParent : mainWindowShown(), MessageType_Error, 863 864 865 866 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)); 867 872 } 868 873 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp
r45193 r45274 1354 1354 if (!machine.isOk()) 1355 1355 { 1356 msgCenter().cannotSaveMachineSettings (machine);1356 msgCenter().cannotSaveMachineSettings(machine, this); 1357 1357 success = false; 1358 1358 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r45224 r45274 1508 1508 machine.SaveSettings(); 1509 1509 if (!machine.isOk()) 1510 msgCenter().cannotSaveMachineSettings(machine );1510 msgCenter().cannotSaveMachineSettings(machine, activeMachineWindow()); 1511 1511 } 1512 1512 } … … 1567 1567 machine.SaveSettings(); 1568 1568 if (!machine.isOk()) 1569 msgCenter().cannotSaveMachineSettings(machine );1569 msgCenter().cannotSaveMachineSettings(machine, activeMachineWindow()); 1570 1570 } 1571 1571 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
r45270 r45274 862 862 /* If machine is NOT ok => show the error message: */ 863 863 if (!m_machine.isOk()) 864 msgCenter().cannotSaveMachineSettings(m_machine );864 msgCenter().cannotSaveMachineSettings(m_machine, this); 865 865 866 866 /* Mark page processed: */ … … 1090 1090 return false; 1091 1091 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. */1095 1092 switch (iPageId) 1096 1093 {
Note:
See TracChangeset
for help on using the changeset viewer.