Book lists: Do not start editing at any key press. Also double clicking now opens the viewer instead of editing. To edit, single click a selected row instead of double clicking or press the F2 key (Enter on OS X). Fixes #7364 (Mom mode tweak to prevent unintended title change)

This commit is contained in:
Kovid Goyal 2010-11-01 21:38:20 -06:00
parent 6528aa6fd1
commit 80079ebc0f
3 changed files with 9 additions and 1 deletions

View File

@ -35,7 +35,6 @@ class ViewAction(InterfaceAction):
self.qaction.setMenu(self.view_menu)
ac.triggered.connect(self.view_specific_format, type=Qt.QueuedConnection)
def location_selected(self, loc):
enabled = loc == 'library'
for action in list(self.view_menu.actions())[1:]:
@ -134,6 +133,9 @@ class ViewAction(InterfaceAction):
rows = self.gui.current_view().selectionModel().selectedRows()
self._view_books(rows)
def view_triggered(self, index):
self._view_books([index])
def view_specific_book(self, index):
self._view_books([index])

View File

@ -50,6 +50,8 @@ class BooksView(QTableView): # {{{
def __init__(self, parent, modelcls=BooksModel):
QTableView.__init__(self, parent)
self.setEditTriggers(self.SelectedClicked|self.EditKeyPressed)
self.drag_allowed = True
self.setDragEnabled(True)
self.setDragDropOverwriteMode(False)
@ -98,6 +100,8 @@ 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:

View File

@ -338,6 +338,8 @@ Calibre has several keyboard shortcuts to save you time and mouse movement. Thes
* - Keyboard Shortcut
- Action
* - :kbd:`F2 (Enter in OS X)`
- Edit the metadata of the currently selected field in the book list.
* - :kbd:`A`
- Add Books
* - :kbd:`C`