Changeset 43138 in vbox
- Timestamp:
- Aug 31, 2012 1:26:04 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 80511
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r42998 r43138 1200 1200 } 1201 1201 1202 bool UIMessageCenter::cannotStartWithoutNetworkIf(const QString &strMachineName, 1203 const QString &strIfNames) 1204 { 1205 return messageOkCancel(mainMachineWindowShown(), Error, 1206 tr("<p>Could not start the machine <b>%1</b> because the " 1207 "following physical network interfaces were not found:</p>" 1208 "<p><b>%2</b></p>" 1209 "<p>You can either change the machine's network " 1210 "settings or stop the machine.</p>") 1211 .arg(strMachineName) 1212 .arg(strIfNames), 1213 0, /* pcszAutoConfirmId */ 1214 tr("Change Network Settings"), 1215 tr("Close Virtual Machine")); 1216 } 1217 1202 1218 void UIMessageCenter::cannotSwitchScreenInSeamless(quint64 uMinVRAM) 1203 1219 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r42998 r43138 250 250 int cannotEnterFullscreenMode(ULONG uWidth, ULONG uHeight, 251 251 ULONG uBpp, ULONG64 uMinVRAM); 252 bool cannotStartWithoutNetworkIf(const QString &strMachineName, const QString &strIfNames); 252 253 void cannotSwitchScreenInSeamless(quint64 uMinVRAM); 253 254 int cannotSwitchScreenInFullscreen(quint64 uMinVRAM); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r42949 r43138 73 73 bool isPreventAutoClose() const { return m_fIsPreventAutoClose; } 74 74 void setPreventAutoClose(bool fIsPreventAutoClose) { m_fIsPreventAutoClose = fIsPreventAutoClose; } 75 76 /* Wrapper to open Machine settings / Network page: */ 77 void openNetworkAdaptersDialog() { sltOpenNetworkAdaptersDialog(); } 75 78 76 79 #ifdef Q_WS_MAC -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r43004 r43138 20 20 /* Qt includes: */ 21 21 #include <QApplication> 22 #include <QNetworkInterface> 22 23 #include <QWidget> 23 24 #include <QTimer> … … 154 155 155 156 /* Prepare powerup: */ 156 preparePowerUp(); 157 bool fPrepared = preparePowerUp(); 158 if (!fPrepared) 159 return; 157 160 158 161 /* Get current machine/console: */ … … 1093 1096 } 1094 1097 1095 voidUISession::preparePowerUp()1098 bool UISession::preparePowerUp() 1096 1099 { 1097 1100 /* Notify user about mouse&keyboard auto-capturing: */ … … 1113 1116 wzd.exec(); 1114 1117 } 1118 1119 /* Skip further checks if VM in saved state */ 1120 if (isSaved()) 1121 return true; 1122 1123 /* Make sure all the attached and enabled network 1124 * adapters are present on the host. This check makes sense 1125 * in two cases only - when attachement type is Bridged Network 1126 * or Host-only Interface. NOTE: Only currently enabled 1127 * attachement type is checked (incorrect parameters check for 1128 * currently disabled attachement types is skipped). */ 1129 QStringList failedInterfaceNames; 1130 ulong cCount = vboxGlobal().virtualBox().GetSystemProperties().GetMaxNetworkAdapters(machine.GetChipsetType()); 1131 for (ulong uAdapterIndex = 0; uAdapterIndex < cCount; ++uAdapterIndex) 1132 { 1133 CNetworkAdapter na = machine.GetNetworkAdapter(uAdapterIndex); 1134 if (na.GetEnabled() && 1135 (na.GetAttachmentType() == KNetworkAttachmentType_Bridged || 1136 na.GetAttachmentType() == KNetworkAttachmentType_HostOnly)) 1137 { 1138 QStringList ifNames; 1139 ifNames << na.GetBridgedInterface() 1140 << na.GetHostOnlyInterface(); 1141 1142 foreach (const QString &strIfName, ifNames) 1143 { 1144 if (!strIfName.isEmpty() && 1145 !QNetworkInterface::interfaceFromName(strIfName).isValid()) 1146 { 1147 LogFlow(("Found invalid network interface: %s\n", strIfName.toStdString().c_str())); 1148 failedInterfaceNames << QString("%1 (adapter %2)").arg(strIfName).arg(uAdapterIndex + 1); 1149 break; 1150 } 1151 } 1152 } 1153 } 1154 /* Check failed? */ 1155 if (!failedInterfaceNames.isEmpty()) 1156 { 1157 if (msgCenter().UIMessageCenter::cannotStartWithoutNetworkIf(machine.GetName(), failedInterfaceNames.join(", "))) 1158 machineLogic()->openNetworkAdaptersDialog(); 1159 else 1160 { 1161 QTimer::singleShot(0, this, SLOT(sltCloseVirtualSession())); 1162 return false; 1163 } 1164 } 1165 1166 return true; 1115 1167 } 1116 1168 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r41689 r43138 228 228 void setPointerShape(const uchar *pShapeData, bool fHasAlpha, uint uXHot, uint uYHot, uint uWidth, uint uHeight); 229 229 void reinitMenuPool(); 230 voidpreparePowerUp();230 bool preparePowerUp(); 231 231 232 232 #ifdef VBOX_GUI_WITH_KEYS_RESET_HANDLER
Note:
See TracChangeset
for help on using the changeset viewer.