mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Edit book: Fix trying to import an html file/css file via the add new file button always resulting in a blank file
This commit is contained in:
parent
d821b2ddb7
commit
f17f6886a6
@ -667,12 +667,13 @@ class NewFileDialog(QDialog): # {{{
|
|||||||
name, ext = name.rpartition('.')[0::2]
|
name, ext = name.rpartition('.')[0::2]
|
||||||
name = (name + '.' + ext.lower()).replace('\\', '/')
|
name = (name + '.' + ext.lower()).replace('\\', '/')
|
||||||
mt = guess_type(name)
|
mt = guess_type(name)
|
||||||
if mt in OEB_DOCS:
|
if not self.file_data:
|
||||||
self.file_data = template_for('html').encode('utf-8')
|
if mt in OEB_DOCS:
|
||||||
self.using_template = True
|
self.file_data = template_for('html').encode('utf-8')
|
||||||
elif mt in OEB_STYLES:
|
self.using_template = True
|
||||||
self.file_data = template_for('css').encode('utf-8')
|
elif mt in OEB_STYLES:
|
||||||
self.using_template = True
|
self.file_data = template_for('css').encode('utf-8')
|
||||||
|
self.using_template = True
|
||||||
self.file_name = name
|
self.file_name = name
|
||||||
QDialog.accept(self)
|
QDialog.accept(self)
|
||||||
# }}}
|
# }}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user