Changeset 53291 in vbox for trunk/src/VBox
- Timestamp:
- Nov 10, 2014 1:36:52 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 96870
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r52733 r53291 1104 1104 } 1105 1105 1106 voidUIMessageCenter::warnAboutIncorrectPort(QWidget *pParent /* = 0*/) const1106 bool UIMessageCenter::warnAboutIncorrectPort(QWidget *pParent /* = 0*/) const 1107 1107 { 1108 1108 alert(pParent, MessageType_Error, 1109 1109 tr("The current port forwarding rules are not valid. " 1110 1110 "None of the host or guest port values may be set to zero.")); 1111 return false; 1112 } 1113 1114 bool UIMessageCenter::warnAboutNameShouldBeUnique(QWidget *pParent /* = 0 */) const 1115 { 1116 alert(pParent, MessageType_Error, 1117 tr("The current port forwarding rules are not valid. " 1118 "Rule names should be unique.")); 1119 return false; 1111 1120 } 1112 1121 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r52727 r53291 230 230 int confirmRemovingOfLastDVDDevice(QWidget *pParent = 0) const; 231 231 void cannotAttachDevice(const CMachine &machine, UIMediumType type, const QString &strLocation, const StorageSlot &storageSlot, QWidget *pParent = 0); 232 void warnAboutIncorrectPort(QWidget *pParent = 0) const; 232 bool warnAboutIncorrectPort(QWidget *pParent = 0) const; 233 bool warnAboutNameShouldBeUnique(QWidget *pParent = 0) const; 233 234 bool confirmCancelingPortForwardingDialog(QWidget *pParent = 0) const; 234 235 void cannotCreateSharedFolder(const CMachine &machine, const QString &strName, const QString &strPath, QWidget *pParent = 0); -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.cpp
r53290 r53291 640 640 { 641 641 /* Validate table: */ 642 QSet<QString> usedNames; 642 643 for (int i = 0; i < m_pModel->rowCount(); ++i) 643 644 { … … 645 646 if (m_pModel->data(m_pModel->index(i, UIPortForwardingModel::UIPortForwardingDataType_HostPort), Qt::EditRole).value<PortData>().value() == 0 || 646 647 m_pModel->data(m_pModel->index(i, UIPortForwardingModel::UIPortForwardingDataType_GuestPort), Qt::EditRole).value<PortData>().value() == 0) 647 { 648 msgCenter().warnAboutIncorrectPort(window()); 649 return false; 650 } 648 return msgCenter().warnAboutIncorrectPort(window()); 649 650 /* Make sure non of the names were previosly used: */ 651 const QString strName = m_pModel->data(m_pModel->index(i, UIPortForwardingModel::UIPortForwardingDataType_Name), Qt::EditRole).value<NameData>(); 652 if (!usedNames.contains(strName)) 653 usedNames << strName; 654 else 655 return msgCenter().warnAboutNameShouldBeUnique(window()); 651 656 } 652 657 /* True by default: */
Note:
See TracChangeset
for help on using the changeset viewer.