mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-02-06 22:53:27 +01:00
Option to add book with no formats. Useful for organizing a collection even when they aren't acquired yet.
This commit is contained in:
parent
be1b29d35b
commit
b0ec329dc3
1 changed files with 13 additions and 0 deletions
|
|
@ -234,6 +234,8 @@ def __init__(self, listener, opts, actions, parent=None):
|
|||
self.add_menu.addAction(_('Add books from directories, including '
|
||||
'sub directories (Multiple books per directory, assumes every '
|
||||
'ebook file is a different book)'))
|
||||
self.add_menu.addAction(_('Add Empty book. (Book entry with no '
|
||||
'formats)'))
|
||||
self.action_add.setMenu(self.add_menu)
|
||||
QObject.connect(self.action_add, SIGNAL("triggered(bool)"),
|
||||
self.add_books)
|
||||
|
|
@ -243,6 +245,8 @@ def __init__(self, listener, opts, actions, parent=None):
|
|||
self.add_recursive_single)
|
||||
QObject.connect(self.add_menu.actions()[2], SIGNAL("triggered(bool)"),
|
||||
self.add_recursive_multiple)
|
||||
QObject.connect(self.add_menu.actions()[3], SIGNAL('triggered(bool)'),
|
||||
self.add_empty)
|
||||
QObject.connect(self.action_del, SIGNAL("triggered(bool)"),
|
||||
self.delete_books)
|
||||
QObject.connect(self.action_edit, SIGNAL("triggered(bool)"),
|
||||
|
|
@ -779,6 +783,15 @@ def add_recursive_multiple(self, checked):
|
|||
'''
|
||||
self.add_recursive(False)
|
||||
|
||||
def add_empty(self, checked):
|
||||
'''
|
||||
Add an empty book item to the library. This does not import any formats
|
||||
from a book file.
|
||||
'''
|
||||
from calibre.ebooks.metadata import MetaInformation
|
||||
self.library_view.model().db.import_book(MetaInformation(None), [])
|
||||
self.library_view.model().books_added(1)
|
||||
|
||||
def files_dropped(self, paths):
|
||||
to_device = self.stack.currentIndex() != 0
|
||||
self._add_books(paths, to_device)
|
||||
|
|
|
|||
Loading…
Reference in a new issue