Quote:
Originally Posted by meme
Got the most recent source, but it didn't work as self.gui. I noticed in the code that device_signals was a global so I used:
from calibre.gui2.device import device_signals
device_signals.device_metadata_available.connect(s elf.testconnect1)
device_signals.device_connection_changed.connect(s elf.testconnect)
And this works. Is this what you intended?
|
Yes.
FYI: the problem before is that signals cannot be declared in mixin classes. Well, they can be declared, but emitting one of them corrupts memory and the application falls over dead. Moving them to a global fixes it. Kovid mentioned that I also could have put them into the outer-level gui class, which would be the only solution if we had multiple gui instances.