VirtualBox

Changeset 91142 in vbox


Ignore:
Timestamp:
Sep 7, 2021 5:20:19 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10067: Moving Network Manager messages from UIMessageCenter to UINotificationCenter; A bit of refactoring for UIMessageCenter and UINotificationMessage stuff as well.

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

Legend:

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

    r91132 r91142  
    10691069}
    10701070
    1071 
    10721071int UIMessageCenter::confirmSnapshotRestoring(const QString &strSnapshotName, bool fAlsoCreateNewSnapshot) const
    10731072{
     
    12271226}
    12281227
    1229 void UIMessageCenter::cannotAcquireHardDiskLocation(const CMedium &comMedium, QWidget *pParent /* = 0 */) const
    1230 {
    1231     /* Show the error: */
    1232     error(pParent, MessageType_Error,
    1233           tr("Failed to acquire hard disk location."), UIErrorString::formatErrorInfo(comMedium));
    1234 }
    1235 
    1236 void UIMessageCenter::cannotDeleteHardDiskStorage(const CMedium &medium, const QString &strLocation, QWidget *pParent /* = 0*/) const
    1237 {
    1238     error(pParent, MessageType_Error,
    1239           tr("Failed to delete the storage unit of the hard disk <b>%1</b>.")
    1240              .arg(strLocation),
    1241           UIErrorString::formatErrorInfo(medium));
    1242 }
    1243 
    1244 void UIMessageCenter::cannotDeleteHardDiskStorage(const CProgress &progress, const QString &strLocation, QWidget *pParent /* = 0*/) const
    1245 {
    1246     error(pParent, MessageType_Error,
    1247           tr("Failed to delete the storage unit of the hard disk <b>%1</b>.")
    1248              .arg(strLocation),
    1249           UIErrorString::formatErrorInfo(progress));
    1250 }
    1251 
    1252 void UIMessageCenter::cannotTakeSnapshot(const CMachine &machine, const QString &strMachineName, QWidget *pParent /* = 0*/) const
    1253 {
    1254     error(pParent, MessageType_Error,
    1255           tr("Failed to create a snapshot of the virtual machine <b>%1</b>.")
    1256              .arg(strMachineName),
    1257           UIErrorString::formatErrorInfo(machine));
    1258 }
    1259 
    1260 void UIMessageCenter::cannotTakeSnapshot(const CProgress &progress, const QString &strMachineName, QWidget *pParent /* = 0*/) const
    1261 {
    1262     error(pParent, MessageType_Error,
    1263           tr("Failed to create a snapshot of the virtual machine <b>%1</b>.")
    1264              .arg(strMachineName),
    1265           UIErrorString::formatErrorInfo(progress));
    1266 }
    1267 
    1268 void UIMessageCenter::cannotFindSnapshotByName(const CMachine &comMachine,
    1269                                                const QString &strName,
    1270                                                QWidget *pParent /* = 0 */) const
    1271 {
    1272     error(pParent, MessageType_Error,
    1273           tr("Can't find snapshot named <b>%1</b>.")
    1274              .arg(strName),
    1275           UIErrorString::formatErrorInfo(comMachine));
    1276 }
    1277 
    1278 bool UIMessageCenter::cannotRestoreSnapshot(const CMachine &machine, const QString &strSnapshotName, const QString &strMachineName) const
    1279 {
    1280     error(0, MessageType_Error,
    1281           tr("Failed to restore the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
    1282              .arg(strSnapshotName, strMachineName),
    1283           UIErrorString::formatErrorInfo(machine));
    1284     return false;
    1285 }
    1286 
    1287 bool UIMessageCenter::cannotRestoreSnapshot(const CProgress &progress, const QString &strSnapshotName, const QString &strMachineName) const
    1288 {
    1289     error(0, MessageType_Error,
    1290           tr("Failed to restore the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
    1291              .arg(strSnapshotName, strMachineName),
    1292           UIErrorString::formatErrorInfo(progress));
    1293     return false;
    1294 }
    1295 
    1296 bool UIMessageCenter::confirmNATNetworkRemoval(const QString &strName, QWidget *pParent /* = 0*/) const
    1297 {
    1298     return questionBinary(pParent, MessageType_Question,
    1299                           tr("<p>Do you want to remove the NAT network <nobr><b>%1</b>?</nobr></p>"
    1300                              "<p>If this network is in use by one or more virtual "
    1301                              "machine network adapters these adapters will no longer be "
    1302                              "usable until you correct their settings by either choosing "
    1303                              "a different network name or a different adapter attachment "
    1304                              "type.</p>")
    1305                              .arg(strName),
    1306                           0 /* auto-confirm id */,
    1307                           tr("Remove") /* ok button text */,
    1308                           QString() /* cancel button text */,
    1309                           false /* ok button by default? */);
    1310 }
    1311 
    13121228bool UIMessageCenter::confirmHostOnlyInterfaceRemoval(const QString &strName, QWidget *pParent /* = 0 */) const
    13131229{
     
    13281244}
    13291245
    1330 void UIMessageCenter::cannotAcquireHostNetworkInterfaces(const CHost &comHost, QWidget *pParent /* = 0 */) const
    1331 {
    1332     error(pParent, MessageType_Error,
    1333           tr("Failed to acquire host network interfaces."),
    1334           UIErrorString::formatErrorInfo(comHost));
    1335 }
    1336 
    1337 void UIMessageCenter::cannotFindHostNetworkInterface(const CHost &comHost, const QString &strInterfaceName, QWidget *pParent /* = 0 */) const
    1338 {
    1339     error(pParent, MessageType_Error,
    1340           tr("Unable to find the host network interface <b>%1</b>.")
    1341              .arg(strInterfaceName),
    1342           UIErrorString::formatErrorInfo(comHost));
    1343 }
    1344 
    1345 void UIMessageCenter::cannotCreateHostNetworkInterface(const CHost &comHost, QWidget *pParent /* = 0 */) const
    1346 {
    1347     error(pParent, MessageType_Error,
    1348           tr("Failed to create a host network interface."),
    1349           UIErrorString::formatErrorInfo(comHost));
    1350 }
    1351 
    1352 void UIMessageCenter::cannotCreateHostNetworkInterface(const CProgress &progress, QWidget *pParent /* = 0 */) const
    1353 {
    1354     error(pParent, MessageType_Error,
    1355           tr("Failed to create a host network interface."),
     1246bool UIMessageCenter::confirmNATNetworkRemoval(const QString &strName, QWidget *pParent /* = 0*/) const
     1247{
     1248    return questionBinary(pParent, MessageType_Question,
     1249                          tr("<p>Do you want to remove the NAT network <nobr><b>%1</b>?</nobr></p>"
     1250                             "<p>If this network is in use by one or more virtual "
     1251                             "machine network adapters these adapters will no longer be "
     1252                             "usable until you correct their settings by either choosing "
     1253                             "a different network name or a different adapter attachment "
     1254                             "type.</p>")
     1255                             .arg(strName),
     1256                          0 /* auto-confirm id */,
     1257                          tr("Remove") /* ok button text */,
     1258                          QString() /* cancel button text */,
     1259                          false /* ok button by default? */);
     1260}
     1261
     1262void UIMessageCenter::cannotAcquireHardDiskLocation(const CMedium &comMedium, QWidget *pParent /* = 0 */) const
     1263{
     1264    /* Show the error: */
     1265    error(pParent, MessageType_Error,
     1266          tr("Failed to acquire hard disk location."), UIErrorString::formatErrorInfo(comMedium));
     1267}
     1268
     1269void UIMessageCenter::cannotDeleteHardDiskStorage(const CMedium &medium, const QString &strLocation, QWidget *pParent /* = 0*/) const
     1270{
     1271    error(pParent, MessageType_Error,
     1272          tr("Failed to delete the storage unit of the hard disk <b>%1</b>.")
     1273             .arg(strLocation),
     1274          UIErrorString::formatErrorInfo(medium));
     1275}
     1276
     1277void UIMessageCenter::cannotDeleteHardDiskStorage(const CProgress &progress, const QString &strLocation, QWidget *pParent /* = 0*/) const
     1278{
     1279    error(pParent, MessageType_Error,
     1280          tr("Failed to delete the storage unit of the hard disk <b>%1</b>.")
     1281             .arg(strLocation),
    13561282          UIErrorString::formatErrorInfo(progress));
    13571283}
    13581284
    1359 void UIMessageCenter::cannotRemoveHostNetworkInterface(const CHost &comHost, const QString &strInterfaceName, QWidget *pParent /* = 0 */) const
    1360 {
    1361     error(pParent, MessageType_Error,
    1362           tr("Failed to remove the host network interface <b>%1</b>.")
    1363              .arg(strInterfaceName),
    1364           UIErrorString::formatErrorInfo(comHost));
    1365 }
    1366 
    1367 void UIMessageCenter::cannotRemoveHostNetworkInterface(const CProgress &progress, const QString &strInterfaceName, QWidget *pParent /* = 0 */) const
    1368 {
    1369     error(pParent, MessageType_Error,
    1370           tr("Failed to remove the host network interface <b>%1</b>.")
    1371              .arg(strInterfaceName),
     1285void UIMessageCenter::cannotTakeSnapshot(const CMachine &machine, const QString &strMachineName, QWidget *pParent /* = 0*/) const
     1286{
     1287    error(pParent, MessageType_Error,
     1288          tr("Failed to create a snapshot of the virtual machine <b>%1</b>.")
     1289             .arg(strMachineName),
     1290          UIErrorString::formatErrorInfo(machine));
     1291}
     1292
     1293void UIMessageCenter::cannotTakeSnapshot(const CProgress &progress, const QString &strMachineName, QWidget *pParent /* = 0*/) const
     1294{
     1295    error(pParent, MessageType_Error,
     1296          tr("Failed to create a snapshot of the virtual machine <b>%1</b>.")
     1297             .arg(strMachineName),
    13721298          UIErrorString::formatErrorInfo(progress));
    13731299}
    13741300
    1375 void UIMessageCenter::cannotAcquireHostNetworkInterfaceParameter(const CHostNetworkInterface &comInterface, QWidget *pParent /* = 0 */) const
    1376 {
    1377     error(pParent, MessageType_Error,
    1378           tr("Failed to acquire host network interface parameter."),
    1379           UIErrorString::formatErrorInfo(comInterface));
    1380 }
    1381 
    1382 void UIMessageCenter::cannotSaveHostNetworkInterfaceParameter(const CHostNetworkInterface &comInterface, QWidget *pParent /* = 0 */) const
    1383 {
    1384     error(pParent, MessageType_Error,
    1385           tr("Failed to save host network interface parameter."),
    1386           UIErrorString::formatErrorInfo(comInterface));
    1387 }
    1388 
    1389 void UIMessageCenter::cannotCreateDHCPServer(const CVirtualBox &comVBox, const QString &strInterfaceName, QWidget *pParent /* = 0 */) const
    1390 {
    1391     error(pParent, MessageType_Error,
    1392           tr("Failed to create a DHCP server for the network interface <b>%1</b>.")
    1393              .arg(strInterfaceName),
    1394           UIErrorString::formatErrorInfo(comVBox));
    1395 }
    1396 
    1397 void UIMessageCenter::cannotRemoveDHCPServer(const CVirtualBox &comVBox, const QString &strInterfaceName, QWidget *pParent /* = 0 */) const
    1398 {
    1399     error(pParent, MessageType_Error,
    1400           tr("Failed to remove the DHCP server for the network interface <b>%1</b>.")
    1401              .arg(strInterfaceName),
    1402           UIErrorString::formatErrorInfo(comVBox));
    1403 }
    1404 
    1405 void UIMessageCenter::cannotAcquireDHCPServerParameter(const CDHCPServer &comServer, QWidget *pParent /* = 0 */) const
    1406 {
    1407     error(pParent, MessageType_Error,
    1408           tr("Failed to acquire DHCP server parameter."),
    1409           UIErrorString::formatErrorInfo(comServer));
    1410 }
    1411 
    1412 void UIMessageCenter::cannotSaveDHCPServerParameter(const CDHCPServer &comServer, QWidget *pParent /* = 0 */) const
    1413 {
    1414     error(pParent, MessageType_Error,
    1415           tr("Failed to save DHCP server parameter."),
    1416           UIErrorString::formatErrorInfo(comServer));
    1417 }
    1418 
    1419 void UIMessageCenter::warnAboutDHCPServerIsNotEnabled(const QString &strName, QWidget *pParent /* = 0 */) const
    1420 {
    1421     alert(pParent, MessageType_Error,
    1422           tr("Host interface <nobr><b>%1</b></nobr> is set to obtain the address "
    1423              "automatically but the corresponding DHCP server is not enabled.").arg(strName));
    1424 }
    1425 
    1426 void UIMessageCenter::warnAboutInvalidIPv4Address(const QString &strName, QWidget *pParent /* = 0 */) const
    1427 {
    1428     alert(pParent, MessageType_Error,
    1429           tr("Host interface <nobr><b>%1</b></nobr> does not "
    1430              "currently have a valid IPv4 address.").arg(strName));
    1431 }
    1432 
    1433 void UIMessageCenter::warnAboutInvalidIPv4Mask(const QString &strName, QWidget *pParent /* = 0 */) const
    1434 {
    1435     alert(pParent, MessageType_Error,
    1436           tr("Host interface <nobr><b>%1</b></nobr> does not "
    1437              "currently have a valid IPv4 network mask.").arg(strName));
    1438 }
    1439 
    1440 void UIMessageCenter::warnAboutInvalidIPv6Address(const QString &strName, QWidget *pParent /* = 0 */) const
    1441 {
    1442     alert(pParent, MessageType_Error,
    1443           tr("Host interface <nobr><b>%1</b></nobr> does not "
    1444              "currently have a valid IPv6 address.").arg(strName));
    1445 }
    1446 
    1447 void UIMessageCenter::warnAboutInvalidIPv6PrefixLength(const QString &strName, QWidget *pParent /* = 0 */) const
    1448 {
    1449     alert(pParent, MessageType_Error,
    1450           tr("Host interface <nobr><b>%1</b></nobr> does not "
    1451              "currently have a valid IPv6 prefix length.").arg(strName));
    1452 }
    1453 
    1454 void UIMessageCenter::warnAboutInvalidDHCPServerAddress(const QString &strName, QWidget *pParent /* = 0 */) const
    1455 {
    1456     alert(pParent, MessageType_Error,
    1457           tr("Host interface <nobr><b>%1</b></nobr> does not "
    1458              "currently have a valid DHCP server address.").arg(strName));
    1459 }
    1460 
    1461 void UIMessageCenter::warnAboutInvalidDHCPServerMask(const QString &strName, QWidget *pParent /* = 0 */) const
    1462 {
    1463     alert(pParent, MessageType_Error,
    1464           tr("Host interface <nobr><b>%1</b></nobr> does not "
    1465              "currently have a valid DHCP server mask.").arg(strName));
    1466 }
    1467 
    1468 void UIMessageCenter::warnAboutInvalidDHCPServerLowerAddress(const QString &strName, QWidget *pParent /* = 0 */) const
    1469 {
    1470     alert(pParent, MessageType_Error,
    1471           tr("Host interface <nobr><b>%1</b></nobr> does not "
    1472              "currently have a valid DHCP server lower address bound.").arg(strName));
    1473 }
    1474 
    1475 void UIMessageCenter::warnAboutInvalidDHCPServerUpperAddress(const QString &strName, QWidget *pParent /* = 0 */) const
    1476 {
    1477     alert(pParent, MessageType_Error,
    1478           tr("Host interface <nobr><b>%1</b></nobr> does not "
    1479              "currently have a valid DHCP server upper address bound.").arg(strName));
    1480 }
    1481 
    1482 void UIMessageCenter::cannotAcquireNATNetworks(const CVirtualBox &comVBox, QWidget *pParent /* = 0 */) const
    1483 {
    1484     error(pParent, MessageType_Error,
    1485           tr("Failed to acquire NAT networks."),
    1486           UIErrorString::formatErrorInfo(comVBox));
    1487 }
    1488 
    1489 void UIMessageCenter::cannotAcquireNATNetworkParameter(const CNATNetwork &comNetwork, QWidget *pParent /* = 0 */) const
    1490 {
    1491     error(pParent, MessageType_Error,
    1492           tr("Failed to acquire NAT network parameter."),
    1493           UIErrorString::formatErrorInfo(comNetwork));
    1494 }
    1495 
    1496 void UIMessageCenter::cannotCreateNATNetwork(const CVirtualBox &comVBox, QWidget *pParent /* = 0 */)
    1497 {
    1498     error(pParent, MessageType_Error,
    1499           tr("Failed to create a NAT network."),
    1500           UIErrorString::formatErrorInfo(comVBox));
    1501 }
    1502 
    1503 void UIMessageCenter::cannotSaveNATNetworkParameter(const CNATNetwork &comNetwork, QWidget *pParent /* = 0 */) const
    1504 {
    1505     error(pParent, MessageType_Error,
    1506           tr("Failed to save NAT network parameter."),
    1507           UIErrorString::formatErrorInfo(comNetwork));
    1508 }
    1509 
    1510 void UIMessageCenter::cannotFindNATNetwork(const CVirtualBox &comVBox, const QString &strNetworkName, QWidget *pParent /* = 0 */) const
    1511 {
    1512     error(pParent, MessageType_Error,
    1513           tr("Unable to find the NAT network <b>%1</b>.")
    1514              .arg(strNetworkName),
    1515           UIErrorString::formatErrorInfo(comVBox));
    1516 }
    1517 
    1518 void UIMessageCenter::cannotRemoveNATNetwork(const CVirtualBox &comVBox, const QString &strNetworkName, QWidget *pParent /* = 0 */) const
    1519 {
    1520     error(pParent, MessageType_Error,
    1521           tr("Failed to remove the NAT network <b>%1</b>.")
    1522              .arg(strNetworkName),
    1523           UIErrorString::formatErrorInfo(comVBox));
    1524 }
    1525 
    1526 void UIMessageCenter::warnAboutNoNameSpecified(const QString &strName, QWidget *pParent /* = 0 */)
    1527 {
    1528     alert(pParent, MessageType_Error,
    1529           tr("No new name specified for the NAT network previously called <b>%1</b>.").arg(strName));
    1530 }
    1531 
    1532 void UIMessageCenter::warnAboutNameAlreadyBusy(const QString &strName, QWidget *pParent /* = 0 */)
    1533 {
    1534     alert(pParent, MessageType_Error,
    1535           tr("The name <b>%1</b> is being used for several NAT networks.").arg(strName));
    1536 }
    1537 
    1538 void UIMessageCenter::warnAboutNoIPv4PrefixSpecified(const QString &strName, QWidget *pParent /* = 0 */)
    1539 {
    1540     alert(pParent, MessageType_Error,
    1541           tr("No IPv4 prefix specified for the NAT network <b>%1</b>.").arg(strName));
    1542 }
    1543 
    1544 void UIMessageCenter::warnAboutNoIPv6PrefixSpecified(const QString &strName, QWidget *pParent /* = 0 */)
    1545 {
    1546     alert(pParent, MessageType_Error,
    1547           tr("No IPv6 prefix specified for the NAT network <b>%1</b>.").arg(strName));
    1548 }
    1549 
    1550 void UIMessageCenter::warnAboutInvalidCIDRSpecified(const QString &strCIDR, const QString &strName, QWidget *pParent /* = 0 */)
    1551 {
    1552     alert(pParent, MessageType_Error,
    1553           tr("Invalid CIDR specified (<i>%1</i>) for the NAT network <b>%2</b>.").arg(strCIDR, strName));
     1301void UIMessageCenter::cannotFindSnapshotByName(const CMachine &comMachine,
     1302                                               const QString &strName,
     1303                                               QWidget *pParent /* = 0 */) const
     1304{
     1305    error(pParent, MessageType_Error,
     1306          tr("Can't find snapshot named <b>%1</b>.")
     1307             .arg(strName),
     1308          UIErrorString::formatErrorInfo(comMachine));
     1309}
     1310
     1311bool UIMessageCenter::cannotRestoreSnapshot(const CMachine &machine, const QString &strSnapshotName, const QString &strMachineName) const
     1312{
     1313    error(0, MessageType_Error,
     1314          tr("Failed to restore the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
     1315             .arg(strSnapshotName, strMachineName),
     1316          UIErrorString::formatErrorInfo(machine));
     1317    return false;
     1318}
     1319
     1320bool UIMessageCenter::cannotRestoreSnapshot(const CProgress &progress, const QString &strSnapshotName, const QString &strMachineName) const
     1321{
     1322    error(0, MessageType_Error,
     1323          tr("Failed to restore the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
     1324             .arg(strSnapshotName, strMachineName),
     1325          UIErrorString::formatErrorInfo(progress));
     1326    return false;
    15541327}
    15551328
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r91132 r91142  
    344344    /** @} */
    345345
     346    /** @name VirtualBox Manager / Network Manager warnings.
     347      * @{ */
     348        bool confirmHostOnlyInterfaceRemoval(const QString &strName, QWidget *pParent = 0) const;
     349        bool confirmNATNetworkRemoval(const QString &strName, QWidget *pParent = 0) const;
     350    /** @} */
     351
    346352    /** @name VirtualBox Manager / New VM wizard warnings.
    347353      * @{ */
     
    363369        bool cannotRestoreSnapshot(const CProgress &progress, const QString &strSnapshotName, const QString &strMachineName) const;
    364370    /** @} */
    365 
    366     /* API: Network Manager warnings: */
    367     bool confirmNATNetworkRemoval(const QString &strName, QWidget *pParent = 0) const;
    368     bool confirmHostOnlyInterfaceRemoval(const QString &strName, QWidget *pParent = 0) const;
    369     void cannotAcquireHostNetworkInterfaces(const CHost &comHost, QWidget *pParent = 0) const;
    370     void cannotFindHostNetworkInterface(const CHost &comHost, const QString &strInterfaceName, QWidget *pParent = 0) const;
    371     void cannotCreateHostNetworkInterface(const CHost &comHost, QWidget *pParent = 0) const;
    372     void cannotCreateHostNetworkInterface(const CProgress &progress, QWidget *pParent = 0) const;
    373     void cannotRemoveHostNetworkInterface(const CHost &comHost, const QString &strInterfaceName, QWidget *pParent = 0) const;
    374     void cannotRemoveHostNetworkInterface(const CProgress &progress, const QString &strInterfaceName, QWidget *pParent = 0) const;
    375     void cannotAcquireHostNetworkInterfaceParameter(const CHostNetworkInterface &comInterface, QWidget *pParent = 0) const;
    376     void cannotSaveHostNetworkInterfaceParameter(const CHostNetworkInterface &comInterface, QWidget *pParent = 0) const;
    377     void cannotCreateDHCPServer(const CVirtualBox &comVBox, const QString &strInterfaceName, QWidget *pParent = 0) const;
    378     void cannotRemoveDHCPServer(const CVirtualBox &comVBox, const QString &strInterfaceName, QWidget *pParent = 0) const;
    379     void cannotAcquireDHCPServerParameter(const CDHCPServer &comServer, QWidget *pParent = 0) const;
    380     void cannotSaveDHCPServerParameter(const CDHCPServer &comServer, QWidget *pParent = 0) const;
    381     void warnAboutDHCPServerIsNotEnabled(const QString &strName, QWidget *pParent = 0) const;
    382     void warnAboutInvalidIPv4Address(const QString &strName, QWidget *pParent = 0) const;
    383     void warnAboutInvalidIPv4Mask(const QString &strName, QWidget *pParent = 0) const;
    384     void warnAboutInvalidIPv6Address(const QString &strName, QWidget *pParent = 0) const;
    385     void warnAboutInvalidIPv6PrefixLength(const QString &strName, QWidget *pParent = 0) const;
    386     void warnAboutInvalidDHCPServerAddress(const QString &strName, QWidget *pParent = 0) const;
    387     void warnAboutInvalidDHCPServerMask(const QString &strName, QWidget *pParent = 0) const;
    388     void warnAboutInvalidDHCPServerLowerAddress(const QString &strName, QWidget *pParent = 0) const;
    389     void warnAboutInvalidDHCPServerUpperAddress(const QString &strName, QWidget *pParent = 0) const;
    390     void cannotAcquireNATNetworks(const CVirtualBox &comVBox, QWidget *pParent = 0) const;
    391     void cannotAcquireNATNetworkParameter(const CNATNetwork &comNetwork, QWidget *pParent = 0) const;
    392     void cannotCreateNATNetwork(const CVirtualBox &comVBox, QWidget *pParent = 0);
    393     void cannotSaveNATNetworkParameter(const CNATNetwork &comNetwork, QWidget *pParent = 0) const;
    394     void cannotFindNATNetwork(const CVirtualBox &comVBox, const QString &strNetworkName, QWidget *pParent = 0) const;
    395     void cannotRemoveNATNetwork(const CVirtualBox &comVBox, const QString &strNetworkName, QWidget *pParent = 0) const;
    396     void warnAboutNoNameSpecified(const QString &strName, QWidget *pParent = 0);
    397     void warnAboutNameAlreadyBusy(const QString &strName, QWidget *pParent = 0);
    398     void warnAboutNoIPv4PrefixSpecified(const QString &strName, QWidget *pParent = 0);
    399     void warnAboutNoIPv6PrefixSpecified(const QString &strName, QWidget *pParent = 0);
    400     void warnAboutInvalidCIDRSpecified(const QString &strCIDR, const QString &strName, QWidget *pParent = 0);
    401371
    402372    /* API: Cloud Profile Manager warnings: */
  • trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UIDetailsWidgetHostNetwork.cpp

    r87306 r91142  
    3333#include "UIMessageCenter.h"
    3434#include "UINetworkManagerUtils.h"
     35#include "UINotificationCenter.h"
    3536
    3637/* Other VBox includes: */
     
    7879        && !m_newData.m_dhcpserver.m_fEnabled)
    7980    {
    80         msgCenter().warnAboutDHCPServerIsNotEnabled(m_newData.m_interface.m_strName);
     81        UINotificationMessage::warnAboutDHCPServerIsNotEnabled(m_newData.m_interface.m_strName);
    8182        return false;
    8283    }
     
    8687            || RTNetStrIsIPv4AddrAny(m_newData.m_interface.m_strAddress.toUtf8().constData())))
    8788    {
    88         msgCenter().warnAboutInvalidIPv4Address(m_newData.m_interface.m_strName);
     89        UINotificationMessage::warnAboutInvalidIPv4Address(m_newData.m_interface.m_strName);
    8990        return false;
    9091    }
     
    9495            || RTNetStrIsIPv4AddrAny(m_newData.m_interface.m_strMask.toUtf8().constData())))
    9596    {
    96         msgCenter().warnAboutInvalidIPv4Mask(m_newData.m_interface.m_strName);
     97        UINotificationMessage::warnAboutInvalidIPv4Mask(m_newData.m_interface.m_strName);
    9798        return false;
    9899    }
     
    103104            || RTNetStrIsIPv6AddrAny(m_newData.m_interface.m_strAddress6.toUtf8().constData())))
    104105    {
    105         msgCenter().warnAboutInvalidIPv6Address(m_newData.m_interface.m_strName);
     106        UINotificationMessage::warnAboutInvalidIPv6Address(m_newData.m_interface.m_strName);
    106107        return false;
    107108    }
     
    114115            || iMaskPrefixLength > 128))
    115116    {
    116         msgCenter().warnAboutInvalidIPv6PrefixLength(m_newData.m_interface.m_strName);
     117        UINotificationMessage::warnAboutInvalidIPv6PrefixLength(m_newData.m_interface.m_strName);
    117118        return false;
    118119    }
     
    123124            || RTNetStrIsIPv4AddrAny(m_newData.m_dhcpserver.m_strAddress.toUtf8().constData())))
    124125    {
    125         msgCenter().warnAboutInvalidDHCPServerAddress(m_newData.m_interface.m_strName);
     126        UINotificationMessage::warnAboutInvalidDHCPServerAddress(m_newData.m_interface.m_strName);
    126127        return false;
    127128    }
     
    130131            || RTNetStrIsIPv4AddrAny(m_newData.m_dhcpserver.m_strMask.toUtf8().constData())))
    131132    {
    132         msgCenter().warnAboutInvalidDHCPServerMask(m_newData.m_interface.m_strName);
     133        UINotificationMessage::warnAboutInvalidDHCPServerMask(m_newData.m_interface.m_strName);
    133134        return false;
    134135    }
     
    137138            || RTNetStrIsIPv4AddrAny(m_newData.m_dhcpserver.m_strLowerAddress.toUtf8().constData())))
    138139    {
    139         msgCenter().warnAboutInvalidDHCPServerLowerAddress(m_newData.m_interface.m_strName);
     140        UINotificationMessage::warnAboutInvalidDHCPServerLowerAddress(m_newData.m_interface.m_strName);
    140141        return false;
    141142    }
     
    144145            || RTNetStrIsIPv4AddrAny(m_newData.m_dhcpserver.m_strUpperAddress.toUtf8().constData())))
    145146    {
    146         msgCenter().warnAboutInvalidDHCPServerUpperAddress(m_newData.m_interface.m_strName);
     147        UINotificationMessage::warnAboutInvalidDHCPServerUpperAddress(m_newData.m_interface.m_strName);
    147148        return false;
    148149    }
  • trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UIDetailsWidgetNATNetwork.cpp

    r88750 r91142  
    3535#include "UIMessageCenter.h"
    3636#include "UINetworkManagerUtils.h"
     37#include "UINotificationCenter.h"
    3738
    3839/* Other VBox includes: */
     
    8687    if (m_newData.m_strName.isEmpty())
    8788    {
    88         msgCenter().warnAboutNoNameSpecified(m_oldData.m_strName);
     89        UINotificationMessage::warnAboutNoNameSpecified(m_oldData.m_strName);
    8990        return false;
    9091    }
     
    9495        if (m_busyNames.contains(m_newData.m_strName))
    9596        {
    96             msgCenter().warnAboutNameAlreadyBusy(m_newData.m_strName);
     97            UINotificationMessage::warnAboutNameAlreadyBusy(m_newData.m_strName);
    9798            return false;
    9899        }
     
    102103    if (m_newData.m_strPrefixIPv4.isEmpty())
    103104    {
    104         msgCenter().warnAboutNoIPv4PrefixSpecified(m_newData.m_strName);
     105        UINotificationMessage::warnAboutNoIPv4PrefixSpecified(m_newData.m_strName);
    105106        return false;
    106107    }
     
    108109    if (m_newData.m_fSupportsIPv6 && m_newData.m_strPrefixIPv6.isEmpty())
    109110    {
    110         msgCenter().warnAboutNoIPv6PrefixSpecified(m_newData.m_strName);
     111        UINotificationMessage::warnAboutNoIPv6PrefixSpecified(m_newData.m_strName);
    111112        return false;
    112113    }
  • trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UINetworkManager.cpp

    r90564 r91142  
    409409    /* Show error message if necessary: */
    410410    if (!comInterface.isOk())
    411         msgCenter().cannotAcquireHostNetworkInterfaceParameter(comInterface);
     411        UINotificationMessage::cannotAcquireHostNetworkInterfaceParameter(comInterface);
    412412    else
    413413    {
     
    422422        /* Show error message if necessary: */
    423423        if (!comVBox.isOk() || comServer.isNull())
    424             msgCenter().cannotCreateDHCPServer(comVBox, strNetworkName, this);
     424            UINotificationMessage::cannotCreateDHCPServer(comVBox, strNetworkName);
    425425
    426426        /* Add interface to the tree: */
     
    462462    /* Show error message if necessary: */
    463463    if (!comHost.isOk() || comInterface.isNull())
    464         msgCenter().cannotFindHostNetworkInterface(comHost, strInterfaceName, this);
     464        UINotificationMessage::cannotFindHostNetworkInterface(comHost, strInterfaceName);
    465465    else
    466466    {
     
    476476        /* Show error message if necessary: */
    477477        if (!comInterface.isOk())
    478             msgCenter().cannotAcquireHostNetworkInterfaceParameter(comInterface, this);
     478            UINotificationMessage::cannotAcquireHostNetworkInterfaceParameter(comInterface);
    479479        else
    480480        {
     
    491491                /* Show error message if necessary: */
    492492                if (!comVBox.isOk())
    493                     msgCenter().cannotRemoveDHCPServer(comVBox, strInterfaceName, this);
     493                    UINotificationMessage::cannotRemoveDHCPServer(comVBox, strInterfaceName);
    494494            }
    495495
     
    576576    /* Show error message if necessary: */
    577577    if (!comVBox.isOk())
    578         msgCenter().cannotCreateNATNetwork(comVBox, this);
     578        UINotificationMessage::cannotCreateNATNetwork(comVBox);
    579579    else
    580580    {
     
    600600        /* Show error message if necessary: */
    601601        if (!comNetwork.isOk())
    602             msgCenter().cannotSaveNATNetworkParameter(comNetwork, this);
     602            UINotificationMessage::cannotChangeNATNetworkParameter(comNetwork);
    603603
    604604        /* Add network to the tree: */
     
    640640    /* Show error message if necessary: */
    641641    if (!comVBox.isOk() || comNetwork.isNull())
    642         msgCenter().cannotFindNATNetwork(comVBox, strNetworkName, this);
     642        UINotificationMessage::cannotFindNATNetwork(comVBox, strNetworkName);
    643643    else
    644644    {
     
    648648        /* Show error message if necessary: */
    649649        if (!comVBox.isOk())
    650             msgCenter().cannotRemoveNATNetwork(comVBox, strNetworkName, this);
     650            UINotificationMessage::cannotRemoveNATNetwork(comVBox, strNetworkName);
    651651        else
    652652        {
     
    847847        /* Show error message if necessary: */
    848848        if (!comHost.isOk() || comInterface.isNull())
    849             msgCenter().cannotFindHostNetworkInterface(comHost, oldData.m_interface.m_strName, this);
     849            UINotificationMessage::cannotFindHostNetworkInterface(comHost, oldData.m_interface.m_strName);
    850850        else
    851851        {
     
    877877            /* Show error message if necessary: */
    878878            if (!comInterface.isOk())
    879                 msgCenter().cannotSaveHostNetworkInterfaceParameter(comInterface, this);
     879                UINotificationMessage::cannotChangeHostNetworkInterfaceParameter(comInterface);
    880880            else
    881881            {
     
    885885                /* Show error message if necessary: */
    886886                if (!comInterface.isOk())
    887                     msgCenter().cannotAcquireHostNetworkInterfaceParameter(comInterface, this);
     887                    UINotificationMessage::cannotAcquireHostNetworkInterfaceParameter(comInterface);
    888888                else
    889889                {
     
    898898                    /* Show error message if necessary: */
    899899                    if (!comVBox.isOk() || comServer.isNull())
    900                         msgCenter().cannotCreateDHCPServer(comVBox, strNetworkName, this);
     900                        UINotificationMessage::cannotCreateDHCPServer(comVBox, strNetworkName);
    901901                    else
    902902                    {
     
    917917                        /* Show error message if necessary: */
    918918                        if (!comServer.isOk())
    919                             msgCenter().cannotSaveDHCPServerParameter(comServer, this);
     919                            UINotificationMessage::cannotChangeDHCPServerParameter(comServer);
    920920                    }
    921921                }
     
    929929                /* Show error message if necessary: */
    930930                if (!comHost.isOk() || comInterface.isNull())
    931                     msgCenter().cannotFindHostNetworkInterface(comHost, oldData.m_interface.m_strName, this);
     931                    UINotificationMessage::cannotFindHostNetworkInterface(comHost, oldData.m_interface.m_strName);
    932932            }
    933933
     
    10331033        /* Show error message if necessary: */
    10341034        if (!comVBox.isOk() || comNetwork.isNull())
    1035             msgCenter().cannotFindNATNetwork(comVBox, oldData.m_strName, this);
     1035            UINotificationMessage::cannotFindNATNetwork(comVBox, oldData.m_strName);
    10361036        else
    10371037        {
     
    11021102            /* Show error message if necessary: */
    11031103            if (!comNetwork.isOk())
    1104                 msgCenter().cannotSaveNATNetworkParameter(comNetwork, this);
     1104                UINotificationMessage::cannotChangeNATNetworkParameter(comNetwork);
    11051105
    11061106            /* Update network in the tree: */
     
    13851385    /* Show error message if necessary: */
    13861386    if (!comHost.isOk())
    1387         msgCenter().cannotAcquireHostNetworkInterfaces(comHost, this);
     1387        UINotificationMessage::cannotAcquireHostParameter(comHost);
    13881388    else
    13891389    {
     
    14331433    /* Show error message if necessary: */
    14341434    if (!comInterface.isOk())
    1435         msgCenter().cannotAcquireHostNetworkInterfaceParameter(comInterface, this);
     1435        UINotificationMessage::cannotAcquireHostNetworkInterfaceParameter(comInterface);
    14361436
    14371437    /* Get VBox for further activities: */
     
    14451445    /* Show error message if necessary: */
    14461446    if (!comVBox.isOk() || comServer.isNull())
    1447         msgCenter().cannotCreateDHCPServer(comVBox, strNetworkName, this);
     1447        UINotificationMessage::cannotCreateDHCPServer(comVBox, strNetworkName);
    14481448    else
    14491449    {
     
    14621462        /* Show error message if necessary: */
    14631463        if (!comServer.isOk())
    1464             return msgCenter().cannotAcquireDHCPServerParameter(comServer, this);
     1464            return UINotificationMessage::cannotAcquireDHCPServerParameter(comServer);
    14651465    }
    14661466}
     
    14831483    /* Show error message if necessary: */
    14841484    if (!comVBox.isOk())
    1485         msgCenter().cannotAcquireNATNetworks(comVBox, this);
     1485        UINotificationMessage::cannotAcquireVirtualBoxParameter(comVBox);
    14861486    else
    14871487    {
     
    15731573    /* Show error message if necessary: */
    15741574    if (!comNetwork.isOk())
    1575         msgCenter().cannotAcquireNATNetworkParameter(comNetwork, this);
     1575        UINotificationMessage::cannotAcquireNATNetworkParameter(comNetwork);
    15761576}
    15771577
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp

    r91132 r91142  
    3737#include "CAudioAdapter.h"
    3838#include "CConsole.h"
     39#include "CDHCPServer.h"
    3940#include "CGraphicsAdapter.h"
     41#include "CHostNetworkInterface.h"
    4042#include "CEmulatedUSB.h"
    4143#include "CMediumAttachment.h"
     44#include "CNATNetwork.h"
    4245#include "CNetworkAdapter.h"
    4346#include "CVRDEServer.h"
     
    159162        QApplication::translate("UIMessageCenter", "Failed to open the public key file <nobr><b>%1</b></nobr>. Check file "
    160163                                                   "permissions.").arg(strPath));
     164}
     165
     166/* static */
     167void UINotificationMessage::warnAboutDHCPServerIsNotEnabled(const QString &strName)
     168{
     169    createMessage(
     170        QApplication::translate("UIMessageCenter", "DHCP server isn't enabled ..."),
     171        QApplication::translate("UIMessageCenter", "Host interface <nobr><b>%1</b></nobr> is set to obtain the address "
     172                                                   "automatically but the corresponding DHCP server is not enabled.")
     173                                                   .arg(strName));
     174}
     175
     176/* static */
     177void UINotificationMessage::warnAboutInvalidIPv4Address(const QString &strName)
     178{
     179    createMessage(
     180        QApplication::translate("UIMessageCenter", "Invalid IPv4 address ..."),
     181        QApplication::translate("UIMessageCenter", "Host interface <nobr><b>%1</b></nobr> does not "
     182                                                   "currently have a valid IPv4 address.")
     183                                                   .arg(strName));
     184}
     185
     186/* static */
     187void UINotificationMessage::warnAboutInvalidIPv4Mask(const QString &strName)
     188{
     189    createMessage(
     190        QApplication::translate("UIMessageCenter", "Invalid IPv4 mask ..."),
     191        QApplication::translate("UIMessageCenter", "Host interface <nobr><b>%1</b></nobr> does not "
     192                                                   "currently have a valid IPv4 network mask.")
     193                                                   .arg(strName));
     194}
     195
     196/* static */
     197void UINotificationMessage::warnAboutInvalidIPv6Address(const QString &strName)
     198{
     199    createMessage(
     200        QApplication::translate("UIMessageCenter", "Invalid IPv6 address ..."),
     201        QApplication::translate("UIMessageCenter", "Host interface <nobr><b>%1</b></nobr> does not "
     202                                                   "currently have a valid IPv6 address.")
     203                                                   .arg(strName));
     204}
     205
     206/* static */
     207void UINotificationMessage::warnAboutInvalidIPv6PrefixLength(const QString &strName)
     208{
     209    createMessage(
     210        QApplication::translate("UIMessageCenter", "Invalid IPv6 prefix length ..."),
     211        QApplication::translate("UIMessageCenter", "Host interface <nobr><b>%1</b></nobr> does not "
     212                                                   "currently have a valid IPv6 prefix length.")
     213                                                   .arg(strName));
     214}
     215
     216/* static */
     217void UINotificationMessage::warnAboutInvalidDHCPServerAddress(const QString &strName)
     218{
     219    createMessage(
     220        QApplication::translate("UIMessageCenter", "Invalid DHCP server address ..."),
     221        QApplication::translate("UIMessageCenter", "Host interface <nobr><b>%1</b></nobr> does not "
     222                                                   "currently have a valid DHCP server address.")
     223                                                   .arg(strName));
     224}
     225
     226/* static */
     227void UINotificationMessage::warnAboutInvalidDHCPServerMask(const QString &strName)
     228{
     229    createMessage(
     230        QApplication::translate("UIMessageCenter", "Invalid DHCP server mask ..."),
     231        QApplication::translate("UIMessageCenter", "Host interface <nobr><b>%1</b></nobr> does not "
     232                                                   "currently have a valid DHCP server mask.")
     233                                                   .arg(strName));
     234}
     235
     236/* static */
     237void UINotificationMessage::warnAboutInvalidDHCPServerLowerAddress(const QString &strName)
     238{
     239    createMessage(
     240        QApplication::translate("UIMessageCenter", "Invalid DHCP lower address ..."),
     241        QApplication::translate("UIMessageCenter", "Host interface <nobr><b>%1</b></nobr> does not "
     242                                                   "currently have a valid DHCP server lower address bound.")
     243                                                   .arg(strName));
     244}
     245
     246/* static */
     247void UINotificationMessage::warnAboutInvalidDHCPServerUpperAddress(const QString &strName)
     248{
     249    createMessage(
     250        QApplication::translate("UIMessageCenter", "Invalid DHCP upper address ..."),
     251        QApplication::translate("UIMessageCenter", "Host interface <nobr><b>%1</b></nobr> does not "
     252                                                   "currently have a valid DHCP server upper address bound.")
     253                                                   .arg(strName));
     254}
     255
     256/* static */
     257void UINotificationMessage::warnAboutNoNameSpecified(const QString &strName)
     258{
     259    createMessage(
     260        QApplication::translate("UIMessageCenter", "No name specified ..."),
     261        QApplication::translate("UIMessageCenter", "No new name specified for the NAT network previously called <b>%1</b>.")
     262                                                   .arg(strName));
     263}
     264
     265/* static */
     266void UINotificationMessage::warnAboutNameAlreadyBusy(const QString &strName)
     267{
     268    createMessage(
     269        QApplication::translate("UIMessageCenter", "Name already busy ..."),
     270        QApplication::translate("UIMessageCenter", "The name <b>%1</b> is being used for several NAT networks.")
     271                                                   .arg(strName));
     272}
     273
     274/* static */
     275void UINotificationMessage::warnAboutNoIPv4PrefixSpecified(const QString &strName)
     276{
     277    createMessage(
     278        QApplication::translate("UIMessageCenter", "No IPv4 prefix specified ..."),
     279        QApplication::translate("UIMessageCenter", "No IPv4 prefix specified for the NAT network <b>%1</b>.")
     280                                                   .arg(strName));
     281}
     282
     283/* static */
     284void UINotificationMessage::warnAboutNoIPv6PrefixSpecified(const QString &strName)
     285{
     286    createMessage(
     287        QApplication::translate("UIMessageCenter", "No IPv6 prefix specified ..."),
     288        QApplication::translate("UIMessageCenter", "No IPv6 prefix specified for the NAT network <b>%1</b>.")
     289                                                   .arg(strName));
    161290}
    162291
     
    301430
    302431/* static */
     432void UINotificationMessage::cannotAcquireHostParameter(const CHost &comHost)
     433{
     434    createMessage(
     435        QApplication::translate("UIMessageCenter", "Host failure ..."),
     436        QApplication::translate("UIMessageCenter", "Failed to acquire host parameter.") +
     437        UIErrorString::formatErrorInfo(comHost));
     438}
     439
     440/* static */
    303441void UINotificationMessage::cannotAcquireMediumParameter(const CMedium &comMedium)
    304442{
     
    346484
    347485/* static */
     486void UINotificationMessage::cannotAcquireDHCPServerParameter(const CDHCPServer &comServer)
     487{
     488    createMessage(
     489        QApplication::translate("UIMessageCenter", "DHCP server failure ..."),
     490        QApplication::translate("UIMessageCenter", "Failed to acquire DHCP server parameter.") +
     491        UIErrorString::formatErrorInfo(comServer));
     492}
     493
     494/* static */
     495void UINotificationMessage::cannotAcquireHostNetworkInterfaceParameter(const CHostNetworkInterface &comInterface)
     496{
     497    createMessage(
     498        QApplication::translate("UIMessageCenter", "Host network interface failure ..."),
     499        QApplication::translate("UIMessageCenter", "Failed to acquire host network interface parameter.") +
     500        UIErrorString::formatErrorInfo(comInterface));
     501}
     502
     503/* static */
     504void UINotificationMessage::cannotAcquireNATNetworkParameter(const CNATNetwork &comNetwork)
     505{
     506    createMessage(
     507        QApplication::translate("UIMessageCenter", "NAT network failure ..."),
     508        QApplication::translate("UIMessageCenter", "Failed to acquire NAT network parameter.") +
     509        UIErrorString::formatErrorInfo(comNetwork));
     510}
     511
     512/* static */
    348513void UINotificationMessage::cannotChangeMediumParameter(const CMedium &comMedium)
    349514{
    350515    createMessage(
    351516        QApplication::translate("UIMessageCenter", "Medium failure ..."),
    352         QApplication::translate("UIMessageCenter", "Failed to change the attribute of the medium <b>%1</b>.")
     517        QApplication::translate("UIMessageCenter", "Failed to change the parameter of the medium <b>%1</b>.")
    353518                                                   .arg(CMedium(comMedium).GetLocation()) +
    354519        UIErrorString::formatErrorInfo(comMedium));
     
    360525    createMessage(
    361526        QApplication::translate("UIMessageCenter", "Machine failure ..."),
    362         QApplication::translate("UIMessageCenter", "Failed to change the attribute of the virtual machine <b>%1</b>.")
     527        QApplication::translate("UIMessageCenter", "Failed to change the parameter of the virtual machine <b>%1</b>.")
    363528                                                   .arg(CMachine(comMachine).GetName()) +
    364529        UIErrorString::formatErrorInfo(comMachine));
     
    370535    createMessage(
    371536        QApplication::translate("UIMessageCenter", "Graphics adapter failure ..."),
    372         QApplication::translate("UIMessageCenter", "Failed to change graphics adapter attribute.") +
     537        QApplication::translate("UIMessageCenter", "Failed to change graphics adapter parameter.") +
    373538        UIErrorString::formatErrorInfo(comAdapter));
    374539}
     
    379544    createMessage(
    380545        QApplication::translate("UIMessageCenter", "Audio adapter failure ..."),
    381         QApplication::translate("UIMessageCenter", "Failed to change audio adapter attribute.") +
     546        QApplication::translate("UIMessageCenter", "Failed to change audio adapter parameter.") +
    382547        UIErrorString::formatErrorInfo(comAdapter));
    383548}
     
    388553    createMessage(
    389554        QApplication::translate("UIMessageCenter", "Network adapter failure ..."),
    390         QApplication::translate("UIMessageCenter", "Failed to change network adapter attribute.") +
     555        QApplication::translate("UIMessageCenter", "Failed to change network adapter parameter.") +
    391556        UIErrorString::formatErrorInfo(comAdapter));
     557}
     558
     559/* static */
     560void UINotificationMessage::cannotChangeDHCPServerParameter(const CDHCPServer &comServer)
     561{
     562    createMessage(
     563        QApplication::translate("UIMessageCenter", "DHCP server failure ..."),
     564        QApplication::translate("UIMessageCenter", "Failed to change DHCP server parameter.") +
     565        UIErrorString::formatErrorInfo(comServer));
     566}
     567
     568/* static */
     569void UINotificationMessage::cannotChangeHostNetworkInterfaceParameter(const CHostNetworkInterface &comInterface)
     570{
     571    createMessage(
     572        QApplication::translate("UIMessageCenter", "Host network interface failure ..."),
     573        QApplication::translate("UIMessageCenter", "Failed to change host network interface parameter.") +
     574        UIErrorString::formatErrorInfo(comInterface));
     575}
     576
     577/* static */
     578void UINotificationMessage::cannotChangeNATNetworkParameter(const CNATNetwork &comNetwork)
     579{
     580    createMessage(
     581        QApplication::translate("UIMessageCenter", "NAT network failure ..."),
     582        QApplication::translate("UIMessageCenter", "Failed to change NAT network parameter.") +
     583        UIErrorString::formatErrorInfo(comNetwork));
    392584}
    393585
     
    475667
    476668/* static */
     669void UINotificationMessage::cannotCreateDHCPServer(const CVirtualBox &comVBox, const QString &strInterfaceName)
     670{
     671    createMessage(
     672        QApplication::translate("UIMessageCenter", "Can't create DHCP server ..."),
     673        QApplication::translate("UIMessageCenter", "Failed to create a DHCP server for the network interface <b>%1</b>.")
     674                                                   .arg(strInterfaceName) +
     675        UIErrorString::formatErrorInfo(comVBox));
     676}
     677
     678/* static */
     679void UINotificationMessage::cannotRemoveDHCPServer(const CVirtualBox &comVBox, const QString &strInterfaceName)
     680{
     681    createMessage(
     682        QApplication::translate("UIMessageCenter", "Can't remove DHCP server ..."),
     683        QApplication::translate("UIMessageCenter", "Failed to remove the DHCP server for the network interface <b>%1</b>.")
     684                                                   .arg(strInterfaceName) +
     685        UIErrorString::formatErrorInfo(comVBox));
     686}
     687
     688/* static */
     689void UINotificationMessage::cannotCreateNATNetwork(const CVirtualBox &comVBox)
     690{
     691    createMessage(
     692        QApplication::translate("UIMessageCenter", "Can't create NAT network ..."),
     693        QApplication::translate("UIMessageCenter", "Failed to create a NAT network.") +
     694        UIErrorString::formatErrorInfo(comVBox));
     695}
     696
     697/* static */
     698void UINotificationMessage::cannotRemoveNATNetwork(const CVirtualBox &comVBox, const QString &strNetworkName)
     699{
     700    createMessage(
     701        QApplication::translate("UIMessageCenter", "Can't remove NAT network ..."),
     702        QApplication::translate("UIMessageCenter", "Failed to remove the NAT network <b>%1</b>.")
     703                                                   .arg(strNetworkName) +
     704        UIErrorString::formatErrorInfo(comVBox));
     705}
     706
     707/* static */
    477708void UINotificationMessage::cannotCloseMedium(const CMedium &comMedium)
    478709{
     
    525756                                                   .arg(strSnapshotName, strMachineName) +
    526757        UIErrorString::formatErrorInfo(comSnapshot));
     758}
     759
     760/* static */
     761void UINotificationMessage::cannotFindHostNetworkInterface(const CHost &comHost, const QString &strInterfaceName)
     762{
     763    createMessage(
     764        QApplication::translate("UIMessageCenter", "Can't find host network interface ..."),
     765        QApplication::translate("UIMessageCenter", "Unable to find the host network interface <b>%1</b>.")
     766                                                   .arg(strInterfaceName) +
     767        UIErrorString::formatErrorInfo(comHost));
     768}
     769
     770/* static */
     771void UINotificationMessage::cannotFindNATNetwork(const CVirtualBox &comVBox, const QString &strNetworkName)
     772{
     773    createMessage(
     774        QApplication::translate("UIMessageCenter", "Can't find NAT network ..."),
     775        QApplication::translate("UIMessageCenter", "Unable to find the NAT network <b>%1</b>.")
     776                                                   .arg(strNetworkName) +
     777        UIErrorString::formatErrorInfo(comVBox));
    527778}
    528779
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h

    r91132 r91142  
    9090        static void cannotResolveCollisionAutomatically(const QString &strCollisionName, const QString &strGroupName);
    9191
    92         /** Notifies about inability to remove machine.
    93           * @param  comMachine  Brings machine being removed. */
     92        /** Notifies about public key path is empty. */
    9493        static void warnAboutPublicKeyFilePathIsEmpty();
    95         /** Notifies about inability to remove machine.
    96           * @param  comMachine  Brings machine being removed. */
     94        /** Notifies about public key file doesn't exist.
     95          * @param  strPath  Brings the path being checked. */
    9796        static void warnAboutPublicKeyFileDoesntExist(const QString &strPath);
    98         /** Notifies about inability to remove machine.
    99           * @param  comMachine  Brings machine being removed. */
     97        /** Notifies about public key file is of too large size.
     98          * @param  strPath  Brings the path being checked. */
    10099        static void warnAboutPublicKeyFileIsOfTooLargeSize(const QString &strPath);
    101         /** Notifies about inability to remove machine.
    102           * @param  comMachine  Brings machine being removed. */
     100        /** Notifies about public key file isn't readable.
     101          * @param  strPath  Brings the path being checked. */
    103102        static void warnAboutPublicKeyFileIsntReadable(const QString &strPath);
     103
     104        /** Notifies about DHCP server isn't enabled.
     105          * @param  strName  Brings the interface name. */
     106        static void warnAboutDHCPServerIsNotEnabled(const QString &strName);
     107        /** Notifies about invalid IPv4 address.
     108          * @param  strName  Brings the interface name. */
     109        static void warnAboutInvalidIPv4Address(const QString &strName);
     110        /** Notifies about invalid IPv4 mask.
     111          * @param  strName  Brings the interface name. */
     112        static void warnAboutInvalidIPv4Mask(const QString &strName);
     113        /** Notifies about invalid IPv6 address.
     114          * @param  strName  Brings the interface name. */
     115        static void warnAboutInvalidIPv6Address(const QString &strName);
     116        /** Notifies about invalid IPv6 prefix length.
     117          * @param  strName  Brings the interface name. */
     118        static void warnAboutInvalidIPv6PrefixLength(const QString &strName);
     119        /** Notifies about invalid DHCP server address.
     120          * @param  strName  Brings the interface name. */
     121        static void warnAboutInvalidDHCPServerAddress(const QString &strName);
     122        /** Notifies about invalid DHCP server mask.
     123          * @param  strName  Brings the interface name. */
     124        static void warnAboutInvalidDHCPServerMask(const QString &strName);
     125        /** Notifies about invalid DHCP server lower address.
     126          * @param  strName  Brings the interface name. */
     127        static void warnAboutInvalidDHCPServerLowerAddress(const QString &strName);
     128        /** Notifies about invalid DHCP server upper address.
     129          * @param  strName  Brings the interface name. */
     130        static void warnAboutInvalidDHCPServerUpperAddress(const QString &strName);
     131        /** Notifies about no name specified.
     132          * @param  strName  Brings the interface name. */
     133        static void warnAboutNoNameSpecified(const QString &strName);
     134        /** Notifies about name already busy.
     135          * @param  strName  Brings the interface name. */
     136        static void warnAboutNameAlreadyBusy(const QString &strName);
     137        /** Notifies about no IPv4 prefix specified.
     138          * @param  strName  Brings the interface name. */
     139        static void warnAboutNoIPv4PrefixSpecified(const QString &strName);
     140        /** Notifies about no IPv6 prefix specified.
     141          * @param  strName  Brings the interface name. */
     142        static void warnAboutNoIPv6PrefixSpecified(const QString &strName);
    104143    /** @} */
    105144
     
    142181          * @param  comVBox  Brings the object parameter get acquired from. */
    143182        static void cannotAcquireVirtualBoxParameter(const CVirtualBox &comVBox);
     183        /** Notifies about inability to acquire IHost parameter.
     184          * @param  comHost  Brings the object parameter get acquired from. */
     185        static void cannotAcquireHostParameter(const CHost &comHost);
    144186        /** Notifies about inability to acquire IMedium parameter.
    145187          * @param  comMedium  Brings the object parameter get acquired from. */
     
    157199          * @param  comAttachment  Brings the object parameter get acquired from. */
    158200        static void cannotAcquireAttachmentParameter(const CMediumAttachment &comAttachment);
     201        /** Notifies about inability to acquire IDHCPServer parameter.
     202          * @param  comServer  Brings the object parameter get acquired from. */
     203        static void cannotAcquireDHCPServerParameter(const CDHCPServer &comServer);
     204        /** Notifies about inability to acquire IHostNetworkInterface parameter.
     205          * @param  comInterface  Brings the object parameter get acquired from. */
     206        static void cannotAcquireHostNetworkInterfaceParameter(const CHostNetworkInterface &comInterface);
     207        /** Notifies about inability to acquire INATNetwork parameter.
     208          * @param  comNetwork  Brings the object parameter get acquired from. */
     209        static void cannotAcquireNATNetworkParameter(const CNATNetwork &comNetwork);
    159210
    160211        /** Notifies about inability to change IMedium parameter.
     
    173224          * @param  comAdapter  Brings the object parameter being changed for. */
    174225        static void cannotChangeNetworkAdapterParameter(const CNetworkAdapter &comAdapter);
     226        /** Notifies about inability to change IDHCPServer parameter.
     227          * @param  comServer  Brings the object parameter being changed for. */
     228        static void cannotChangeDHCPServerParameter(const CDHCPServer &comServer);
     229        /** Notifies about inability to change IHostNetworkInterface parameter.
     230          * @param  comInterface  Brings the object parameter being changed for. */
     231        static void cannotChangeHostNetworkInterfaceParameter(const CHostNetworkInterface &comInterface);
     232        /** Notifies about inability to change INATNetwork parameter.
     233          * @param  comNetwork  Brings the object parameter being changed for. */
     234        static void cannotChangeNATNetworkParameter(const CNATNetwork &comNetwork);
    175235
    176236        /** Notifies about inability to enumerate host USB devices.
     
    203263          * @param  strLocation  Brings the machine location. */
    204264        static void cannotOpenMachine(const CVirtualBox &comVBox, const QString &strLocation);
     265        /** Notifies about inability to create DHCP server.
     266          * @param  comVBox           Brings common VBox object trying to create DHCP server.
     267          * @param  strInterfaceName  Brings the interface name. */
     268        static void cannotCreateDHCPServer(const CVirtualBox &comVBox, const QString &strInterfaceName);
     269        /** Notifies about inability to remove DHCP server.
     270          * @param  comVBox           Brings common VBox object trying to remove DHCP server.
     271          * @param  strInterfaceName  Brings the interface name. */
     272        static void cannotRemoveDHCPServer(const CVirtualBox &comVBox, const QString &strInterfaceName);
     273        /** Notifies about inability to create NAT network.
     274          * @param  comVBox  Brings common VBox object trying to create NAT network. */
     275        static void cannotCreateNATNetwork(const CVirtualBox &comVBox);
     276        /** Notifies about inability to remove NAT network.
     277          * @param  comVBox         Brings common VBox object trying to remove DHCP server.
     278          * @param  strNetworkName  Brings the network name. */
     279        static void cannotRemoveNATNetwork(const CVirtualBox &comVBox, const QString &strNetworkName);
    205280
    206281        /** Notifies about inability to open machine.
     
    224299          * @param  strMachineName   Brings machine name. */
    225300        static void cannotChangeSnapshot(const CSnapshot &comSnapshot, const QString &strSnapshotName, const QString &strMachineName);
     301
     302        /** Notifies about inability to find host network interface.
     303          * @param  comHost  Brings the host being search through.
     304          * @param  strInterfaceName  Brings interface name. */
     305        static void cannotFindHostNetworkInterface(const CHost &comHost, const QString &strInterfaceName);
     306        /** Notifies about inability to find NAT network.
     307          * @param  comVBox         Brings common VBox object being search through.
     308          * @param  strNetworkName  Brings network name. */
     309        static void cannotFindNATNetwork(const CVirtualBox &comVBox, const QString &strNetworkName);
    226310    /** @} */
    227311
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