- added PDF file as type in the Recent File list and capability to load it from there

- PDF's can be drag & dropped on the GUI to be loaded
This commit is contained in:
Marius Stanciu 2019-04-22 19:18:23 +03:00
parent 7442af1b06
commit 8f1a0c1fdc
4 changed files with 11 additions and 2 deletions

View File

@ -1838,6 +1838,7 @@ class App(QtCore.QObject):
'mpf']
self.svg_list = ['svg']
self.dxf_list = ['dxf']
self.pdf_list = ['pdf']
self.prj_list = ['flatprj']
# global variable used by NCC Tool to signal that some polygons could not be cleared, if True
@ -7600,6 +7601,7 @@ class App(QtCore.QObject):
"project": "share/project16.png",
"svg": "share/geometry16.png",
"dxf": "share/dxf16.png",
"pdf": "share/pdf32.png",
"image": "share/image16.png"
}
@ -7612,7 +7614,8 @@ class App(QtCore.QObject):
'project': self.open_project,
'svg': self.import_svg,
'dxf': self.import_dxf,
'image': self.import_image
'image': self.import_image,
'pdf': lambda fname: self.worker_task.emit({'fcn': self.pdf_tool.open_pdf, 'params': [fname]})
}
# Open file

View File

@ -11,6 +11,8 @@ CAD program, and create G-Code for Isolation routing.
22.04.2019
- added PDF file as type in the Recent File list and capability to load it from there
- PDF's can be drag & dropped on the GUI to be loaded
- PDF import tool: added support for save/restore Graphics stack. Only for scale and offset transformations and for the linewidth. This is the final fix for Microsoft PDF printer who saves in PDF format 1.7
- PDF Import tool: added support for PDF files that embed multiple Gerber layers (top, bottom, outline, silkscreen etc). Each will be opened in it's own Gerber file. The requirement is that each one is drawn in a different color

View File

@ -3015,6 +3015,10 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.app.worker_task.emit({'fcn': self.app.import_dxf,
'params': [self.filename, object_type, None]})
if extension in self.app.pdf_list:
self.app.worker_task.emit({'fcn': self.app.pdf_tool.open_pdf,
'params': [self.filename]})
if extension in self.app.prj_list:
# self.app.open_project() is not Thread Safe
self.app.open_project(self.filename)

View File

@ -205,7 +205,7 @@ class ToolPDF(FlatCAMTool):
return
# Register recent file
self.app.file_opened.emit("gerber", new_name)
self.app.file_opened.emit("gerber", filename)
# GUI feedback
self.app.inform.emit(_("[success] Opened: %s") % filename)