Fixes #2122. Warning dialog on Win and Mac when user has not choice.

This commit is contained in:
ziajka
2017-07-07 11:54:27 +02:00
parent b9318dfe6a
commit 8fd3f67378
2 changed files with 15 additions and 1 deletions

3
.gitignore vendored
View File

@@ -60,3 +60,6 @@ keys
updates
.cache
__pycache__
# Virtualenv
env

View File

@@ -128,6 +128,9 @@ class ApplianceWizard(QtWidgets.QWizard, Ui_ApplianceWizard):
self.uiInfoTreeWidget.addTopLevelItem(item)
elif self.page(page_id) == self.uiServerWizardPage:
is_mac = ComputeManager.instance().localPlatform().startswith("darwin")
is_win = ComputeManager.instance().localPlatform().startswith("win")
self.uiRemoteServersComboBox.clear()
if len(ComputeManager.instance().remoteComputes()) == 0:
self.uiRemoteRadioButton.setEnabled(False)
@@ -141,7 +144,7 @@ class ApplianceWizard(QtWidgets.QWizard, Ui_ApplianceWizard):
if ComputeManager.instance().localPlatform() is None:
self.uiLocalRadioButton.setEnabled(False)
elif (ComputeManager.instance().localPlatform().startswith("darwin") or ComputeManager.instance().localPlatform().startswith("win")):
elif is_mac or is_win:
if type == "qemu":
# Qemu has issues on OSX and Windows we disallow usage of the local server
if not LocalConfig.instance().experimental():
@@ -158,6 +161,14 @@ class ApplianceWizard(QtWidgets.QWizard, Ui_ApplianceWizard):
else:
self.uiRemoteRadioButton.setChecked(False)
if is_mac or is_win:
if not self.uiRemoteRadioButton.isEnabled() \
and not self.uiVMRadioButton.isEnabled() \
and not self.uiLocalRadioButton.isEnabled():
QtWidgets.QMessageBox.warning(
self, "No GNS3 VM available.",
"GNS3 VM is not available, please configure GNS3 VM before adding new Appliance.")
elif self.page(page_id) == self.uiFilesWizardPage:
self._registry.getRemoteImageList(self._appliance.emulator(), self._compute_id)