mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-11-03 19:17:02 -05: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]
 | 
			
		||||
    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
 | 
			
		||||
    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,
 | 
			
		||||
                    )
 | 
			
		||||
    fd.setParent(None)
 | 
			
		||||
 | 
			
		||||
@ -927,9 +927,9 @@ class Cover(ImageView): # {{{
 | 
			
		||||
        return sz
 | 
			
		||||
 | 
			
		||||
    def select_cover(self, *args):
 | 
			
		||||
        files = choose_images(self, 'change cover dialog',
 | 
			
		||||
                             _('Choose cover for ') +
 | 
			
		||||
                             self.dialog.title.current_val)
 | 
			
		||||
        files = choose_images(
 | 
			
		||||
            self, 'change cover dialog', _('Choose cover for ') + self.dialog.title.current_val,
 | 
			
		||||
            formats=('png', 'gif', 'jpg', 'jpeg'))
 | 
			
		||||
        if not files:
 | 
			
		||||
            return
 | 
			
		||||
        _file = files[0]
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user