mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Edit metadata dialog: Dont allow choosing svg images for covers
This commit is contained in:
parent
b9159e5fe5
commit
63f5be20c8
@ -716,10 +716,11 @@ def choose_save_file(window, name, title, filters=[], all_files=True):
|
|||||||
ans = ans[0]
|
ans = ans[0]
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
def choose_images(window, name, title, select_only_single_file=True):
|
def choose_images(window, name, title, select_only_single_file=True,
|
||||||
|
formats=('png', 'gif', 'jpg', 'jpeg', 'svg')):
|
||||||
mode = QFileDialog.ExistingFile if select_only_single_file else QFileDialog.ExistingFiles
|
mode = QFileDialog.ExistingFile if select_only_single_file else QFileDialog.ExistingFiles
|
||||||
fd = FileDialog(title=title, name=name,
|
fd = FileDialog(title=title, name=name,
|
||||||
filters=[('Images', ['png', 'gif', 'jpeg', 'jpg', 'svg'])],
|
filters=[('Images', list(formats))],
|
||||||
parent=window, add_all_files_filter=False, mode=mode,
|
parent=window, add_all_files_filter=False, mode=mode,
|
||||||
)
|
)
|
||||||
fd.setParent(None)
|
fd.setParent(None)
|
||||||
|
@ -927,9 +927,9 @@ class Cover(ImageView): # {{{
|
|||||||
return sz
|
return sz
|
||||||
|
|
||||||
def select_cover(self, *args):
|
def select_cover(self, *args):
|
||||||
files = choose_images(self, 'change cover dialog',
|
files = choose_images(
|
||||||
_('Choose cover for ') +
|
self, 'change cover dialog', _('Choose cover for ') + self.dialog.title.current_val,
|
||||||
self.dialog.title.current_val)
|
formats=('png', 'gif', 'jpg', 'jpeg'))
|
||||||
if not files:
|
if not files:
|
||||||
return
|
return
|
||||||
_file = files[0]
|
_file = files[0]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user