mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Clicking on the current Virtual library in the dropdown menu now closes the virtual library. Fixes #1864229 [[Enhancement] Close VL when clicking on the VL in the VL menu](https://bugs.launchpad.net/calibre/+bug/1864229)
This commit is contained in:
parent
20cba609fc
commit
42d055e511
@ -421,8 +421,12 @@ class SearchRestrictionMixin(object):
|
||||
|
||||
virt_libs = db.prefs.get('virtual_libraries', {})
|
||||
for vl in sorted(virt_libs.keys(), key=sort_key):
|
||||
a = m.addAction(self.checked if vl == current_lib else self.empty, vl.replace('&', '&&'))
|
||||
a.triggered.connect(partial(self.apply_virtual_library, library=vl))
|
||||
is_current = vl == current_lib
|
||||
a = m.addAction(self.checked if is_current else self.empty, vl.replace('&', '&&'))
|
||||
if is_current:
|
||||
a.triggered.connect(self.clear_vl.click)
|
||||
else:
|
||||
a.triggered.connect(partial(self.apply_virtual_library, library=vl))
|
||||
|
||||
def virtual_library_menu_about_to_show(self):
|
||||
self.build_virtual_library_menu(self.virtual_library_menu)
|
||||
|
Loading…
x
Reference in New Issue
Block a user