Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 04-19-2011, 01:12 PM   #16
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by kovidgoyal View Post
Use

self.gui.device_signals.signal_name.connect(...
while making sure you are running the most recent source from trunk.
chaley is offline   Reply With Quote
Old 04-19-2011, 01:21 PM   #17
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
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?

It doesn't seem to matter if its in genesis or initialization complete. I didn't even know about initialization complete - should I be using it instead of genesis.
meme is offline   Reply With Quote
Advert
Old 04-19-2011, 01:22 PM   #18
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Yeah, that's fine, I misremembered. Using genesis is fine. You typically only use initialization_complete if something your plugin does depends on initialization being completed.
kovidgoyal is online now   Reply With Quote
Old 04-19-2011, 01:25 PM   #19
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by meme View Post
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.
chaley is offline   Reply With Quote
Old 04-19-2011, 03:27 PM   #20
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
Its working well, and quite fun to test Maybe I should go back to 7.55 to give me more time to check before metadata is read

Many thanks.
meme is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre not detecting device Bureaucromancer Kobo Reader 3 09-19-2010 12:16 AM
Re-detecting a device such as iPad gandor62 Calibre 1 06-18-2010 08:21 PM
Calibre not detecting device prs500 Miri Calibre 10 06-13-2010 01:46 PM
Detecting device mpetry Calibre 3 04-16-2010 09:05 PM
Multi-Device Sync? Sonist Calibre 6 02-03-2010 03:49 PM


All times are GMT -4. The time now is 01:11 PM.


MobileRead.com is a privately owned, operated and funded community.