mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Ensure inspector dock connect works
This commit is contained in:
parent
c238a249af
commit
9eba7a5f60
@ -320,9 +320,17 @@ class Inspector(QWidget):
|
|||||||
self.view = None
|
self.view = None
|
||||||
self.layout = QHBoxLayout(self)
|
self.layout = QHBoxLayout(self)
|
||||||
self.layout.setContentsMargins(0, 0, 0, 0)
|
self.layout.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.connection_attempts = 1
|
||||||
QTimer.singleShot(0, self.connect_to_dock)
|
QTimer.singleShot(0, self.connect_to_dock)
|
||||||
|
|
||||||
def connect_to_dock(self):
|
def connect_to_dock(self):
|
||||||
|
if 'inspector-dock' not in actions:
|
||||||
|
self.connection_attempts += 1
|
||||||
|
if self.connection_attempts < 10:
|
||||||
|
QTimer.singleShot(10, self.connect_to_dock)
|
||||||
|
else:
|
||||||
|
print('Failed to connect to inspector dock')
|
||||||
|
return
|
||||||
ac = actions['inspector-dock']
|
ac = actions['inspector-dock']
|
||||||
ac.toggled.connect(self.visibility_changed)
|
ac.toggled.connect(self.visibility_changed)
|
||||||
if ac.isChecked():
|
if ac.isChecked():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user