Ask to retry download or configure installs if MC download fails

This commit is contained in:
David Vierra 2016-08-25 17:08:03 -10:00
parent 446c4de243
commit ac42eae1a8

View File

@ -209,18 +209,37 @@ class MCInstallGroup(QtCore.QObject):
:return:
:rtype:
"""
while True:
requiredVersion = self.findVersionWithAssets()
if not requiredVersion:
self.downloadVersionWithAssets()
else:
break
requiredVersion = self.findVersionWithAssets()
if not requiredVersion:
# msgBox = QtGui.QMessageBox()
# msgBox.setWindowTitle("Minecraft not found.")
# msgBox.setText("MCEdit requires an installed Minecraft version 1.9 or greater to "
# "access block textures, models, and metadata.")
#
# msgBox.exec_()
# installsWidget = MinecraftInstallsDialog()
# installsWidget.exec_()
msgBox = QtGui.QMessageBox()
msgBox.setWindowTitle("Minecraft not found.")
msgBox.setText("MCEdit requires an installed Minecraft version 1.9 or greater to "
"access block textures, models, and metadata.")
download = msgBox.addButton(self.tr("Download Minecraft"), QtGui.QMessageBox.AcceptRole)
configure = msgBox.addButton(self.tr("Configure Installs"), QtGui.QMessageBox.ActionRole)
exit_ = msgBox.addButton(self.tr("Exit MCEdit"), QtGui.QMessageBox.RejectRole)
msgBox.exec_()
result = msgBox.clickedButton()
log.info("Result: %s", result)
if result == download:
continue
if result == configure:
installsWidget = MinecraftInstallsDialog()
installsWidget.exec_()
continue
if result == exit_:
raise SystemExit
else:
break
@property
def mmcInstalls(self):