mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Fix enhancement #1869550 to support double-clicking in a QV column to switch to viewing that column.
This commit is contained in:
parent
19a777d34a
commit
2ed484ee66
@ -418,24 +418,23 @@ class Quickview(QDialog, Ui_Quickview):
|
|||||||
def refresh(self, idx):
|
def refresh(self, idx):
|
||||||
'''
|
'''
|
||||||
Given a cell in the library view, display the information. This method
|
Given a cell in the library view, display the information. This method
|
||||||
converts the index into the lookup ken
|
converts the index into the lookup key
|
||||||
'''
|
'''
|
||||||
if self.lock_qv.isChecked():
|
if self.lock_qv.isChecked():
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
bv_row = idx.row()
|
|
||||||
from calibre.gui2.ui import get_gui
|
|
||||||
view = get_gui().library_view.alternate_views.current_view.__class__.__name__
|
|
||||||
self.current_column = (
|
self.current_column = (
|
||||||
self.view.column_map.index('authors') if view == 'GridView'
|
self.view.column_map.index('authors') if
|
||||||
else idx.column())
|
self.current_column is None and self.view.column_map[idx.column()] == 'title'
|
||||||
|
else idx.column())
|
||||||
key = self.view.column_map[self.current_column]
|
key = self.view.column_map[self.current_column]
|
||||||
book_id = self.view.model().id(bv_row)
|
book_id = self.view.model().id(idx.row())
|
||||||
if self.current_book_id == book_id and self.current_key == key:
|
if self.current_book_id == book_id and self.current_key == key:
|
||||||
return
|
return
|
||||||
self._refresh(book_id, key)
|
self._refresh(book_id, key)
|
||||||
except:
|
except:
|
||||||
|
traceback.print_exc()
|
||||||
self.indicate_no_items()
|
self.indicate_no_items()
|
||||||
|
|
||||||
def _refresh(self, book_id, key):
|
def _refresh(self, book_id, key):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user