mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix for a Qt 5 regression that caused the Copy to Library right click menu to be empty on OS X. Fixes #1360069 [Missing "Copy to Library" submenu](https://bugs.launchpad.net/calibre/+bug/1360069)
This commit is contained in:
parent
3f57f71c5a
commit
4debe239b1
@ -15,6 +15,7 @@ from PyQt5.Qt import (
|
|||||||
QToolButton, QDialog, QGridLayout, QIcon, QLabel, QDialogButtonBox, QApplication,
|
QToolButton, QDialog, QGridLayout, QIcon, QLabel, QDialogButtonBox, QApplication,
|
||||||
QFormLayout, QCheckBox, QWidget, QScrollArea, QVBoxLayout, Qt, QListWidgetItem, QListWidget)
|
QFormLayout, QCheckBox, QWidget, QScrollArea, QVBoxLayout, Qt, QListWidgetItem, QListWidget)
|
||||||
|
|
||||||
|
from calibre.constants import isosx
|
||||||
from calibre.gui2.actions import InterfaceAction
|
from calibre.gui2.actions import InterfaceAction
|
||||||
from calibre.gui2 import (error_dialog, Dispatcher, warning_dialog, gprefs,
|
from calibre.gui2 import (error_dialog, Dispatcher, warning_dialog, gprefs,
|
||||||
info_dialog, choose_dir)
|
info_dialog, choose_dir)
|
||||||
@ -359,6 +360,9 @@ class CopyToLibraryAction(InterfaceAction):
|
|||||||
if len(locations) <= 50:
|
if len(locations) <= 50:
|
||||||
self.menu.addAction(_('Choose library by path...'), self.choose_library)
|
self.menu.addAction(_('Choose library by path...'), self.choose_library)
|
||||||
self.qaction.setVisible(bool(locations))
|
self.qaction.setVisible(bool(locations))
|
||||||
|
if isosx:
|
||||||
|
# The cloned action has to have its menu updated
|
||||||
|
self.qaction.changed.emit()
|
||||||
|
|
||||||
def choose_library(self):
|
def choose_library(self):
|
||||||
d = ChooseLibrary(self.gui)
|
d = ChooseLibrary(self.gui)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user