Draft : Show dialog if DXF libraries not found/not downloadable

This commit is contained in:
wood-galaxy 2015-02-13 16:10:59 +01:00 committed by Yorik van Havre
parent e551c4ef28
commit c516b2456e

View File

@ -84,7 +84,15 @@ if not libsok:
p = None p = None
p = ArchCommands.download(baseurl+f,force=True) p = ArchCommands.download(baseurl+f,force=True)
if not p: if not p:
FreeCAD.Console.PrintWarning("Download of dxf libraries failed. Please download them manually from\nhttps://github.com/yorikvanhavre/Draft-dxf-importer\nand place them in your macros folder\n") message = ('Download of dxf libraries failed.\n'
'Please download them manually from :\n'
'https://github.com/yorikvanhavre/Draft-dxf-importer\n'
'and place them in your macros folder.\n')
if gui:
from PySide import QtGui, QtCore
QtGui.QMessageBox.information(None,"",message)
else:
FreeCAD.Console.PrintWarning(message)
break break
progressbar.stop() progressbar.stop()
@ -95,11 +103,17 @@ if not libsok:
dxfReader = None dxfReader = None
dxfLibrary = None dxfLibrary = None
else: else:
FreeCAD.Console.PrintWarning("The DXF import/export libraries needed by FreeCAD to handle the DXF format\n") message = ('The DXF import/export libraries needed by FreeCAD to handle the DXF format'
FreeCAD.Console.PrintWarning("were not found on this system. Please either enable FreeCAD to download these\n") ' were not found on this system.\nPlease either enable FreeCAD to download these'
FreeCAD.Console.PrintWarning("libraries (menu Edit > Preferences > Import-Export > DXF > Enable downloads) or download\n") ' libraries :\n 1 - Load Draft workbench\n'
FreeCAD.Console.PrintWarning("these libraries manually, as explained on\n") ' 2 - Menu Edit > Preferences > Import-Export > DXF > Enable downloads)\n'
FreeCAD.Console.PrintWarning("https://github.com/yorikvanhavre/Draft-dxf-importer\n") 'Or download these libraries manually, as explained on\n'
'https://github.com/yorikvanhavre/Draft-dxf-importer\n')
if gui:
from PySide import QtGui, QtCore
QtGui.QMessageBox.information(None,"",message)
else:
FreeCAD.Console.PrintWarning(message)
dxfReader = None dxfReader = None
dxfLibrary = None dxfLibrary = None
@ -1925,4 +1939,3 @@ def readPreferences():
dxfFillMode = p.GetBool("fillmode",True) dxfFillMode = p.GetBool("fillmode",True)
dxfBrightBackground = isBrightBackground() dxfBrightBackground = isBrightBackground()
dxfDefaultColor = getColor() dxfDefaultColor = getColor()