mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Add tweak to control behavior of double clicking on the books list
This commit is contained in:
commit
55ecbdb763
@ -211,3 +211,9 @@ generate_cover_title_font = None
|
||||
# Absolute path to a TTF font file to use as the font for the footer in the
|
||||
# default cover
|
||||
generate_cover_foot_font = None
|
||||
|
||||
|
||||
# Behavior of doubleclick on the books list. Choices:
|
||||
# open_viewer, do_nothing, edit_cell. Default: open_viewer.
|
||||
# Example: doubleclick_on_library_view = 'do_nothing'
|
||||
doubleclick_on_library_view = 'open_viewer'
|
||||
|
@ -51,6 +51,10 @@ class BooksView(QTableView): # {{{
|
||||
QTableView.__init__(self, parent)
|
||||
|
||||
self.setEditTriggers(self.SelectedClicked|self.EditKeyPressed)
|
||||
if tweaks['doubleclick_on_library_view'] == 'edit_cell':
|
||||
self.setEditTriggers(self.DoubleClicked|self.editTriggers())
|
||||
elif tweaks['doubleclick_on_library_view'] == 'open_viewer':
|
||||
self.doubleClicked.connect(parent.iactions['View'].view_triggered)
|
||||
|
||||
self.drag_allowed = True
|
||||
self.setDragEnabled(True)
|
||||
@ -100,8 +104,6 @@ class BooksView(QTableView): # {{{
|
||||
self._model.about_to_be_sorted.connect(self.about_to_be_sorted)
|
||||
self._model.sorting_done.connect(self.sorting_done)
|
||||
|
||||
self.doubleClicked.connect(parent.iactions['View'].view_triggered)
|
||||
|
||||
# Column Header Context Menu {{{
|
||||
def column_header_context_handler(self, action=None, column=None):
|
||||
if not action or not column:
|
||||
|
Loading…
x
Reference in New Issue
Block a user