mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Show full library path via tooltips in the change restrictions dialog
This commit is contained in:
parent
07e368873a
commit
8746416b5a
@ -426,12 +426,13 @@ class ChangeRestriction(QDialog):
|
|||||||
@items.setter
|
@items.setter
|
||||||
def items(self, val):
|
def items(self, val):
|
||||||
checked_libraries = frozenset(val)
|
checked_libraries = frozenset(val)
|
||||||
gui_libraries = frozenset(map(os.path.basename, load_gui_libraries(gprefs)))
|
library_paths = load_gui_libraries(gprefs)
|
||||||
|
gui_libraries = {os.path.basename(l):l for l in library_paths}
|
||||||
case_map = {l.lower():l for l in checked_libraries}
|
case_map = {l.lower():l for l in checked_libraries}
|
||||||
lchecked_libraries = {v:k for k, v in case_map.iteritems()}
|
lchecked_libraries = {v:k for k, v in case_map.iteritems()}
|
||||||
seen = set()
|
seen = set()
|
||||||
items = []
|
items = []
|
||||||
for x in checked_libraries | gui_libraries:
|
for x in checked_libraries | set(gui_libraries):
|
||||||
xl = x.lower()
|
xl = x.lower()
|
||||||
if xl not in seen:
|
if xl not in seen:
|
||||||
seen.add(xl)
|
seen.add(xl)
|
||||||
@ -442,6 +443,8 @@ class ChangeRestriction(QDialog):
|
|||||||
i = QListWidgetItem(l, self.libraries)
|
i = QListWidgetItem(l, self.libraries)
|
||||||
i.setCheckState(Qt.Checked if checked else Qt.Unchecked)
|
i.setCheckState(Qt.Checked if checked else Qt.Unchecked)
|
||||||
i.setFlags(i.flags() & ~Qt.ItemIsUserCheckable)
|
i.setFlags(i.flags() & ~Qt.ItemIsUserCheckable)
|
||||||
|
if l in gui_libraries:
|
||||||
|
i.setToolTip(gui_libraries[l])
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def restriction(self):
|
def restriction(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user