mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Remake a change that shouldn't have been reverted.
This commit is contained in:
parent
ecb22f5e61
commit
8e22dd8822
@ -22,20 +22,19 @@ class ShowBookDetailsAction(InterfaceAction):
|
|||||||
|
|
||||||
def genesis(self):
|
def genesis(self):
|
||||||
self.qaction.triggered.connect(self.show_book_info)
|
self.qaction.triggered.connect(self.show_book_info)
|
||||||
self.memory = []
|
|
||||||
self.dialogs = [None, ]
|
self.dialogs = [None, ]
|
||||||
|
|
||||||
def show_book_info(self, *args, **kwargs):
|
def show_book_info(self, *args, **kwargs):
|
||||||
if self.gui.current_view() is not self.gui.library_view:
|
|
||||||
error_dialog(self.gui, _('No detailed info available'),
|
|
||||||
_('No detailed information is available for books '
|
|
||||||
'on the device.')).exec()
|
|
||||||
return
|
|
||||||
library_path = kwargs.get('library_path', None)
|
library_path = kwargs.get('library_path', None)
|
||||||
book_id = kwargs.get('book_id', None)
|
book_id = kwargs.get('book_id', None)
|
||||||
library_id = kwargs.get('library_id', None)
|
library_id = kwargs.get('library_id', None)
|
||||||
query = kwargs.get('query', None)
|
query = kwargs.get('query', None)
|
||||||
index = self.gui.library_view.currentIndex()
|
index = self.gui.library_view.currentIndex()
|
||||||
|
if self.gui.current_view() is not self.gui.library_view and not library_path:
|
||||||
|
error_dialog(self.gui, _('No detailed info available'),
|
||||||
|
_('No detailed information is available for books '
|
||||||
|
'on the device.')).exec()
|
||||||
|
return
|
||||||
if library_path or index.isValid():
|
if library_path or index.isValid():
|
||||||
# Window #0 is slaved to changes in the book list. As such
|
# Window #0 is slaved to changes in the book list. As such
|
||||||
# it must not be used for details from other libraries.
|
# it must not be used for details from other libraries.
|
||||||
@ -58,7 +57,6 @@ class ShowBookDetailsAction(InterfaceAction):
|
|||||||
|
|
||||||
d.open_cover_with.connect(self.gui.bd_open_cover_with, type=Qt.ConnectionType.QueuedConnection)
|
d.open_cover_with.connect(self.gui.bd_open_cover_with, type=Qt.ConnectionType.QueuedConnection)
|
||||||
self.dialogs[dn] = d
|
self.dialogs[dn] = d
|
||||||
self.memory.append(d)
|
|
||||||
d.closed.connect(self.closed, type=Qt.ConnectionType.QueuedConnection)
|
d.closed.connect(self.closed, type=Qt.ConnectionType.QueuedConnection)
|
||||||
d.show()
|
d.show()
|
||||||
|
|
||||||
@ -78,7 +76,6 @@ class ShowBookDetailsAction(InterfaceAction):
|
|||||||
try:
|
try:
|
||||||
d.closed.disconnect(self.closed)
|
d.closed.disconnect(self.closed)
|
||||||
self.dialogs[d.dialog_number] = None
|
self.dialogs[d.dialog_number] = None
|
||||||
self.memory.remove(d)
|
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user