mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Merge branch 'master' of https://github.com/cbhaley/calibre
This commit is contained in:
commit
059d3c9feb
@ -211,10 +211,11 @@ class BookInfo(QDialog):
|
|||||||
if library_path is not None:
|
if library_path is not None:
|
||||||
self.view = None
|
self.view = None
|
||||||
db = get_gui().library_broker.get_library(library_path)
|
db = get_gui().library_broker.get_library(library_path)
|
||||||
if not db.new_api.has_id(book_id):
|
dbn = db.new_api
|
||||||
|
if not dbn.has_id(book_id):
|
||||||
raise ValueError(_("Book {} doesn't exist").format(book_id))
|
raise ValueError(_("Book {} doesn't exist").format(book_id))
|
||||||
mi = db.new_api.get_metadata(book_id, get_cover=False)
|
mi = dbn.get_metadata(book_id, get_cover=False)
|
||||||
mi.cover_data = [None, db.new_api.cover(book_id, as_image=True)]
|
mi.cover_data = [None, dbn.cover(book_id, as_image=True)]
|
||||||
mi.path = None
|
mi.path = None
|
||||||
mi.format_files = dict()
|
mi.format_files = dict()
|
||||||
mi.formats = list()
|
mi.formats = list()
|
||||||
@ -227,6 +228,17 @@ class BookInfo(QDialog):
|
|||||||
if dialog_number == DialogNumbers.Slaved:
|
if dialog_number == DialogNumbers.Slaved:
|
||||||
self.slave_connected = True
|
self.slave_connected = True
|
||||||
self.view.model().new_bookdisplay_data.connect(self.slave)
|
self.view.model().new_bookdisplay_data.connect(self.slave)
|
||||||
|
if book_id:
|
||||||
|
db = get_gui().current_db
|
||||||
|
dbn = db.new_api
|
||||||
|
mi = dbn.get_metadata(book_id, get_cover=False)
|
||||||
|
mi.cover_data = [None, dbn.cover(book_id, as_image=True)]
|
||||||
|
mi.path = dbn._field_for('path', book_id)
|
||||||
|
mi.format_files = dbn.format_files(book_id)
|
||||||
|
mi.marked = db.data.get_marked(book_id)
|
||||||
|
mi.field_metadata = db.field_metadata
|
||||||
|
self.refresh(row, mi)
|
||||||
|
else:
|
||||||
self.refresh(row)
|
self.refresh(row)
|
||||||
|
|
||||||
ema = get_gui().iactions['Edit Metadata'].menuless_qaction
|
ema = get_gui().iactions['Edit Metadata'].menuless_qaction
|
||||||
|
@ -286,6 +286,7 @@ class Quickview(QDialog, Ui_Quickview):
|
|||||||
|
|
||||||
self.view_icon = QIcon.ic('view.png')
|
self.view_icon = QIcon.ic('view.png')
|
||||||
self.view_plugin = self.gui.iactions['View']
|
self.view_plugin = self.gui.iactions['View']
|
||||||
|
self.show_details_plugin = self.gui.iactions['Show Book Details']
|
||||||
self.edit_metadata_icon = QIcon.ic('edit_input.png')
|
self.edit_metadata_icon = QIcon.ic('edit_input.png')
|
||||||
self.quickview_icon = QIcon.ic('quickview.png')
|
self.quickview_icon = QIcon.ic('quickview.png')
|
||||||
self.select_book_icon = QIcon.ic('library.png')
|
self.select_book_icon = QIcon.ic('library.png')
|
||||||
@ -341,6 +342,8 @@ class Quickview(QDialog, Ui_Quickview):
|
|||||||
a = m.addAction(self.select_book_icon, _('Select this book in the library'),
|
a = m.addAction(self.select_book_icon, _('Select this book in the library'),
|
||||||
partial(self.select_book, book_id))
|
partial(self.select_book, book_id))
|
||||||
a.setEnabled(book_displayed)
|
a.setEnabled(book_displayed)
|
||||||
|
m.addAction(_('Open a locked book details window for this book'),
|
||||||
|
partial(self.show_book_details, book_id))
|
||||||
m.addAction(self.search_icon, _('Find item in the library'),
|
m.addAction(self.search_icon, _('Find item in the library'),
|
||||||
partial(self.do_search, follow_library_view=False))
|
partial(self.do_search, follow_library_view=False))
|
||||||
a = m.addAction(self.edit_metadata_icon, _('Edit metadata'),
|
a = m.addAction(self.edit_metadata_icon, _('Edit metadata'),
|
||||||
@ -761,6 +764,12 @@ class Quickview(QDialog, Ui_Quickview):
|
|||||||
finally:
|
finally:
|
||||||
self.follow_library_view = True
|
self.follow_library_view = True
|
||||||
|
|
||||||
|
def show_book_details(self, book_id):
|
||||||
|
try:
|
||||||
|
self.show_details_plugin.show_book_info(book_id=book_id, locked=True)
|
||||||
|
finally:
|
||||||
|
pass
|
||||||
|
|
||||||
def select_book(self, book_id):
|
def select_book(self, book_id):
|
||||||
'''
|
'''
|
||||||
Select a book in the library view without changing the QV lists
|
Select a book in the library view without changing the QV lists
|
||||||
|
Loading…
x
Reference in New Issue
Block a user