mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-07 09:01:38 -04:00
Merge from trunk
This commit is contained in:
commit
92767afa73
@ -28,7 +28,7 @@
|
||||
description: "To enable them go to Preferences->Metadata download and enable the 'Google Image' and 'Big Book Search' sources. Google Images is useful for finding larger covers as well as alternate versions of the cover. Big Book Search searches for alternate covers from amazon.com. It can occasionally find nicer covers than the direct Amazon source. Note that both these sources download multiple covers for a single book. Some of these covers can be wrong (i.e. they may be of a different book or not covers at all, so you should inspect the results and manually pick the best match). When bulk downloading, these sources are only used if the other sources find no covers."
|
||||
type: major
|
||||
|
||||
- title: "Content server: Allow specifying a reestriction to use for the server when embedding it as a WSGI app."
|
||||
- title: "Content server: Allow specifying a restriction to use for the server when embedding it as a WSGI app."
|
||||
tickets: [1167951]
|
||||
|
||||
- title: "Get Books: Add a plugin for the Koobe Polish book store"
|
||||
|
@ -10,8 +10,7 @@ from functools import partial
|
||||
from threading import Thread
|
||||
from contextlib import closing
|
||||
|
||||
from PyQt4.Qt import (QToolButton, QDialog, QGridLayout, QIcon, QLabel,
|
||||
QCheckBox, QDialogButtonBox)
|
||||
from PyQt4.Qt import (QToolButton, QDialog, QGridLayout, QIcon, QLabel, QDialogButtonBox)
|
||||
|
||||
from calibre.gui2.actions import InterfaceAction
|
||||
from calibre.gui2 import (error_dialog, Dispatcher, warning_dialog, gprefs,
|
||||
@ -71,8 +70,10 @@ class Worker(Thread): # {{{
|
||||
mi.timestamp = now()
|
||||
self.progress(i, mi.title)
|
||||
fmts = self.db.formats(x, index_is_id=True)
|
||||
if not fmts: fmts = []
|
||||
else: fmts = fmts.split(',')
|
||||
if not fmts:
|
||||
fmts = []
|
||||
else:
|
||||
fmts = fmts.split(',')
|
||||
paths = []
|
||||
for fmt in fmts:
|
||||
p = self.db.format(x, fmt, index_is_id=True,
|
||||
@ -146,12 +147,19 @@ class ChooseLibrary(QDialog): # {{{
|
||||
b.setToolTip(_('Browse for library'))
|
||||
b.clicked.connect(self.browse)
|
||||
l.addWidget(b, 0, 2)
|
||||
self.c = c = QCheckBox(_('&Delete after copy'))
|
||||
l.addWidget(c, 1, 0, 1, 3)
|
||||
self.bb = bb = QDialogButtonBox(QDialogButtonBox.Ok|QDialogButtonBox.Cancel)
|
||||
self.bb = bb = QDialogButtonBox(QDialogButtonBox.Cancel)
|
||||
bb.accepted.connect(self.accept)
|
||||
bb.rejected.connect(self.reject)
|
||||
l.addWidget(bb, 2, 0, 1, 3)
|
||||
self.delete_after_copy = False
|
||||
b = bb.addButton(_('&Copy'), bb.AcceptRole)
|
||||
b.setIcon(QIcon(I('edit-copy.png')))
|
||||
b.setToolTip(_('Copy to the specified library'))
|
||||
b2 = bb.addButton(_('&Move'), bb.AcceptRole)
|
||||
b2.clicked.connect(lambda: setattr(self, 'delete_after_copy', True))
|
||||
b2.setIcon(QIcon(I('edit-cut.png')))
|
||||
b2.setToolTip(_('Copy to the specified library and delete from the current library'))
|
||||
b.setDefault(True)
|
||||
l.addWidget(bb, 1, 0, 1, 3)
|
||||
le.setMinimumWidth(350)
|
||||
self.resize(self.sizeHint())
|
||||
|
||||
@ -163,7 +171,7 @@ class ChooseLibrary(QDialog): # {{{
|
||||
|
||||
@property
|
||||
def args(self):
|
||||
return (unicode(self.le.text()), self.c.isChecked())
|
||||
return (unicode(self.le.text()), self.delete_after_copy)
|
||||
# }}}
|
||||
|
||||
class CopyToLibraryAction(InterfaceAction):
|
||||
@ -214,6 +222,8 @@ class CopyToLibraryAction(InterfaceAction):
|
||||
d = ChooseLibrary(self.gui)
|
||||
if d.exec_() == d.Accepted:
|
||||
path, delete_after = d.args
|
||||
if not path:
|
||||
return
|
||||
db = self.gui.library_view.model().db
|
||||
current = os.path.normcase(os.path.abspath(db.library_path))
|
||||
if current == os.path.normcase(os.path.abspath(path)):
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user