mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Fix #802773 (popularity-sort not affected by sub-cat scheme)
This commit is contained in:
commit
a6d1de1cc9
@ -12,7 +12,7 @@ from functools import partial
|
|||||||
from itertools import izip
|
from itertools import izip
|
||||||
|
|
||||||
from PyQt4.Qt import (QItemDelegate, Qt, QTreeView, pyqtSignal, QSize, QIcon,
|
from PyQt4.Qt import (QItemDelegate, Qt, QTreeView, pyqtSignal, QSize, QIcon,
|
||||||
QApplication, QMenu, QPoint, QModelIndex)
|
QApplication, QMenu, QPoint, QModelIndex, QToolTip, QCursor)
|
||||||
|
|
||||||
from calibre.gui2.tag_browser.model import (TagTreeItem, TAG_SEARCH_STATES,
|
from calibre.gui2.tag_browser.model import (TagTreeItem, TAG_SEARCH_STATES,
|
||||||
TagsModel)
|
TagsModel)
|
||||||
@ -493,10 +493,25 @@ class TagsView(QTreeView): # {{{
|
|||||||
pa.setCheckable(True)
|
pa.setCheckable(True)
|
||||||
pa.setChecked(True)
|
pa.setChecked(True)
|
||||||
|
|
||||||
|
if config['sort_tags_by'] != "name":
|
||||||
|
fla.setEnabled(False)
|
||||||
|
m.hovered.connect(self.collapse_menu_hovered)
|
||||||
|
fla.setToolTip(_('First letter is usable only when sorting by name'))
|
||||||
|
# Apparently one cannot set a tooltip to empty, so use a star and
|
||||||
|
# deal with it in the hover method
|
||||||
|
da.setToolTip('*')
|
||||||
|
pa.setToolTip('*')
|
||||||
|
|
||||||
if not self.context_menu.isEmpty():
|
if not self.context_menu.isEmpty():
|
||||||
self.context_menu.popup(self.mapToGlobal(point))
|
self.context_menu.popup(self.mapToGlobal(point))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def collapse_menu_hovered(self, action):
|
||||||
|
tip = action.toolTip()
|
||||||
|
if tip == '*':
|
||||||
|
tip = ''
|
||||||
|
QToolTip.showText(QCursor.pos(), tip)
|
||||||
|
|
||||||
def dragMoveEvent(self, event):
|
def dragMoveEvent(self, event):
|
||||||
QTreeView.dragMoveEvent(self, event)
|
QTreeView.dragMoveEvent(self, event)
|
||||||
self.setDropIndicatorShown(False)
|
self.setDropIndicatorShown(False)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user