mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Implement #1306 (More options for file type in File Selector when adding files)
This commit is contained in:
parent
ac1947f147
commit
cda1d00b13
@ -285,7 +285,7 @@ class FileDialog(QObject):
|
|||||||
self.fd.setFileMode(mode)
|
self.fd.setFileMode(mode)
|
||||||
self.fd.setIconProvider(_file_icon_provider)
|
self.fd.setIconProvider(_file_icon_provider)
|
||||||
self.fd.setModal(modal)
|
self.fd.setModal(modal)
|
||||||
self.fd.setFilter(ftext)
|
self.fd.setNameFilter(ftext)
|
||||||
self.fd.setWindowTitle(title)
|
self.fd.setWindowTitle(title)
|
||||||
state = dynamic[self.dialog_name]
|
state = dynamic[self.dialog_name]
|
||||||
if not state or not self.fd.restoreState(state):
|
if not state or not self.fd.restoreState(state):
|
||||||
|
@ -522,7 +522,18 @@ class Main(MainWindow, Ui_MainWindow):
|
|||||||
Add books from the local filesystem to either the library or the device.
|
Add books from the local filesystem to either the library or the device.
|
||||||
'''
|
'''
|
||||||
books = choose_files(self, 'add books dialog dir', 'Select books',
|
books = choose_files(self, 'add books dialog dir', 'Select books',
|
||||||
filters=[('Books', BOOK_EXTENSIONS)])
|
filters=[
|
||||||
|
(_('Books'), BOOK_EXTENSIONS),
|
||||||
|
(_('EPUB Books'), ['epub']),
|
||||||
|
(_('LRF Books'), ['lrf']),
|
||||||
|
(_('HTML Books'), ['htm', 'html', 'xhtm', 'xhtml']),
|
||||||
|
(_('LIT Books'), ['lit']),
|
||||||
|
(_('MOBI Books'), ['mobi', 'prc']),
|
||||||
|
(_('Text books'), ['txt', 'rtf']),
|
||||||
|
(_('PDF Books'), ['pdf']),
|
||||||
|
(_('Comics'), ['cbz', 'cbr']),
|
||||||
|
(_('Archives'), ['zip', 'rar']),
|
||||||
|
])
|
||||||
if not books:
|
if not books:
|
||||||
return
|
return
|
||||||
to_device = self.stack.currentIndex() != 0
|
to_device = self.stack.currentIndex() != 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user