- fixed bug in opening PDF file from recent files list

This commit is contained in:
Marius Stanciu
2020-11-15 21:36:02 +02:00
committed by Marius
parent 141dd56816
commit 0ae849a72f
3 changed files with 18 additions and 12 deletions

View File

@@ -19,6 +19,7 @@ CHANGELOG for FlatCAM beta
- working in Milling Tool - working in Milling Tool
- updated the Calculators Tool such that now the Cut Z parameter for V-tip tool calculator can be calculated from the other parameters too - updated the Calculators Tool such that now the Cut Z parameter for V-tip tool calculator can be calculated from the other parameters too
- fixed a small issue in the Calculators Tool Cut Z default value; added a confirmation message for Electroplating calculator - fixed a small issue in the Calculators Tool Cut Z default value; added a confirmation message for Electroplating calculator
- fixed bug in opening PDF file from recent files list
14.11.2020 14.11.2020

View File

@@ -198,7 +198,8 @@ class ToolPDF(AppTool):
self.pdf_parsed[short_name]['pdf'] = self.parser.parse_pdf(pdf_content=self.pdf_decompressed[short_name]) self.pdf_parsed[short_name]['pdf'] = self.parser.parse_pdf(pdf_content=self.pdf_decompressed[short_name])
# we used it, now we delete it # we used it, now we delete it
self.pdf_decompressed[short_name] = '' if self.pdf_decompressed[short_name]:
self.pdf_decompressed[short_name] = None
# removal from list is done in a multithreaded way therefore not always the removal can be done # removal from list is done in a multithreaded way therefore not always the removal can be done
# try to remove until it's done # try to remove until it's done
@@ -276,7 +277,7 @@ class ToolPDF(AppTool):
self.app.inform.emit('[ERROR_NOTCL] %s' % _('Open PDF file failed.')) self.app.inform.emit('[ERROR_NOTCL] %s' % _('Open PDF file failed.'))
return return
# Register recent file # Register recent file
self.app.file_opened.emit("excellon", filename) self.app.file_opened.emit("pdf", filename)
# GUI feedback # GUI feedback
self.app.inform.emit('[success] %s: %s' % (_("Rendered"), outname)) self.app.inform.emit('[success] %s: %s' % (_("Rendered"), outname))
@@ -349,7 +350,7 @@ class ToolPDF(AppTool):
self.app.inform.emit('[ERROR_NOTCL] %s' % _('Open PDF file failed.')) self.app.inform.emit('[ERROR_NOTCL] %s' % _('Open PDF file failed.'))
return return
# Register recent file # Register recent file
self.app.file_opened.emit('gerber', filename) self.app.file_opened.emit('pdf', filename)
# GUI feedback # GUI feedback
self.app.inform.emit('[success] %s: %s' % (_("Rendered"), outname)) self.app.inform.emit('[success] %s: %s' % (_("Rendered"), outname))

View File

@@ -7445,7 +7445,7 @@ class App(QtCore.QObject):
'svg': self.f_handlers.import_svg, 'svg': self.f_handlers.import_svg,
'dxf': self.f_handlers.import_dxf, 'dxf': self.f_handlers.import_dxf,
'image': image_opener, 'image': image_opener,
'pdf': lambda fname: self.worker_task.emit({'fcn': self.pdf_tool.open_pdf, 'params': [fname]}) 'pdf': self.f_handlers.import_pdf
} }
# Open recent file for files # Open recent file for files
@@ -10210,6 +10210,10 @@ class MenuFileHandlers(QtCore.QObject):
# Register recent file # Register recent file
self.app.file_opened.emit("dxf", filename) self.app.file_opened.emit("dxf", filename)
def import_pdf(self, filename):
self.app.pdf_tool.periodic_check(1000)
self.worker_task.emit({'fcn': self.app.pdf_tool.open_pdf, 'params': [filename]})
def open_gerber(self, filename, outname=None, plot=True, from_tcl=False): def open_gerber(self, filename, outname=None, plot=True, from_tcl=False):
""" """
Opens a Gerber file, parses it and creates a new object for Opens a Gerber file, parses it and creates a new object for