Restore choose library position at bottom of menu if there are few libraries

This commit is contained in:
Kovid Goyal 2017-08-03 11:46:06 +05:30
parent a74d0546eb
commit 56ef1cbd63
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -428,6 +428,7 @@ class CopyToLibraryAction(InterfaceAction):
return return
db = self.gui.library_view.model().db db = self.gui.library_view.model().db
locations = list(self.stats.locations(db)) locations = list(self.stats.locations(db))
if len(locations) > 5:
self.menu.addAction(_('Choose library...'), self.choose_library) self.menu.addAction(_('Choose library...'), self.choose_library)
self.menu.addSeparator() self.menu.addSeparator()
for name, loc in locations: for name, loc in locations:
@ -437,6 +438,8 @@ class CopyToLibraryAction(InterfaceAction):
self.menu.addAction(name + ' ' + _('(delete after copy)'), self.menu.addAction(name + ' ' + _('(delete after copy)'),
partial(self.copy_to_library, loc, delete_after=True)) partial(self.copy_to_library, loc, delete_after=True))
self.menu.addSeparator() self.menu.addSeparator()
if len(locations) <= 5:
self.menu.addAction(_('Choose library...'), self.choose_library)
self.qaction.setVisible(bool(locations)) self.qaction.setVisible(bool(locations))
if isosx: if isosx: