mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-27 14:24:47 +01:00
Allow adding of multiple empty books
This commit is contained in:
parent
b664335be1
commit
1d14af27e5
1 changed files with 8 additions and 4 deletions
|
|
@ -18,7 +18,7 @@
|
|||
QModelIndex, QPixmap, QColor, QPainter, QMenu, QIcon, \
|
||||
QToolButton, QDialog, QDesktopServices, QFileDialog, \
|
||||
QSystemTrayIcon, QApplication, QKeySequence, QAction, \
|
||||
QMessageBox, QStackedLayout, QHelpEvent
|
||||
QMessageBox, QStackedLayout, QHelpEvent, QInputDialog
|
||||
from PyQt4.QtSvg import QSvgRenderer
|
||||
|
||||
from calibre import prints, patheq
|
||||
|
|
@ -869,9 +869,13 @@ 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)
|
||||
num, ok = QInputDialog.getInt(self, _('How many empty books?'),
|
||||
_('How many empty boks should be added?'), 1, 1, 100)
|
||||
if ok:
|
||||
from calibre.ebooks.metadata import MetaInformation
|
||||
for x in xrange(num):
|
||||
self.library_view.model().db.import_book(MetaInformation(None), [])
|
||||
self.library_view.model().books_added(num)
|
||||
|
||||
def files_dropped(self, paths):
|
||||
to_device = self.stack.currentIndex() != 0
|
||||
|
|
|
|||
Loading…
Reference in a new issue