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 02-27-2014, 04:58 PM   #1
jgoguen
Generally Awesome Person
jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.
 
Posts: 1,100
Karma: 2191133
Join Date: Jan 2013
Location: /dev/kmem
Device: Kobo Clara HD, Kindle Oasis
UI plugin detect device connected?

Is there a way, with a plugin other than a device interface plugin, to detect when a device is connected and get at the instance of the device plugin object? What I'm looking to accomplish is to have a plugin that, when a device is connected, checks to see if it's a subclass of the KoboTouch class and display information about the device.
jgoguen is offline   Reply With Quote
Old 02-27-2014, 06:54 PM   #2
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Have a look at my Kobo Utilities plugin. I do that already. And there is code that triggers a job when the device is connected. And if you are considering what I think you are, it's something that could be added to the plugin. As Kovid always says, "Patches are welcome"
davidfor is offline   Reply With Quote
Old 02-27-2014, 07:18 PM   #3
jgoguen
Generally Awesome Person
jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.
 
Posts: 1,100
Karma: 2191133
Join Date: Jan 2013
Location: /dev/kmem
Device: Kobo Clara HD, Kindle Oasis
Quote:
Originally Posted by davidfor View Post
And if you are considering what I think you are, it's something that could be added to the plugin.
Guess it's a little obvious when I get an idea in my head

Send me a link to the latest source, or should I just use the code in the current plugin release?
jgoguen is offline   Reply With Quote
Old 02-27-2014, 08:03 PM   #4
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by jgoguen View Post
Guess it's a little obvious when I get an idea in my head
In this case, yes. I had just played with the URL and was thinking about it as well.
Quote:
Send me a link to the latest source, or should I just use the code in the current plugin release?
The current version is good. I have some changes, but nothing that will affect you or a merge.
davidfor is offline   Reply With Quote
Old 02-28-2014, 03:53 AM   #5
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: 12,364
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Off topic, but perhaps of interest for you kobo folks. We added an interface to the device driver system to permit a device to update (sync) book-on-device info to the calibre db during book matching. I have vague memories of discussions about people wanting to do that with kobo shelves (?). Look at devices.interface.synchronize_with_db. You can see an example of its use in devices.smart_device_app.driver, where an "is_read" indication and date are synced.
chaley is offline   Reply With Quote
Old 02-28-2014, 05:26 AM   #6
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Am I allowed to say "Now you tell me"? I have a reading status fetch in my Kobo utilities plugin, but that looks like it could have gone into the driver with no real performance penalty. I'll have a look at it.
davidfor is offline   Reply With Quote
Old 02-28-2014, 05:42 AM   #7
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: 12,364
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by davidfor View Post
Am I allowed to say "Now you tell me"? I have a reading status fetch in my Kobo utilities plugin, but that looks like it could have gone into the driver with no real performance penalty. I'll have a look at it.
We put it in this week.

As for performance, of course YMMV depending on what you do but my experience when using the new DB methods is that the penalty is minimal. No syncing needed == nanoseconds. Syncing calibre to device probably incurs no penalty. Syncing device to calibre incurs only the calls to the DB methods to set calibre's data, which are fast.
chaley is offline   Reply With Quote
Old 02-28-2014, 06:13 AM   #8
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by chaley View Post
We put it in this week.
That makes me feel better Though I didn't notice anything in changelog. But, I just found the commits with some comments.
Quote:
As for performance, of course YMMV depending on what you do but my experience when using the new DB methods is that the penalty is minimal. No syncing needed == nanoseconds. Syncing calibre to device probably incurs no penalty. Syncing device to calibre incurs only the calls to the DB methods to set calibre's data, which are fast.
Yes, I would expect any performance hit to be only noticeable with a lot of books on the device. When I have a play, I'll see.
davidfor is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
'Reading list' plugin disappears when Kindle is connected Kraftwerk Plugins 3 01-31-2012 10:56 AM
[Old Thread] Android plugin 0.8.3 does not detect Samsung Galaxy SII I9100 hakan42 Devices 22 08-28-2011 03:37 AM
Device management really slow when device = connected folder nickdma Calibre 5 12-27-2010 02:41 PM
Caliber does not detect my Shinebook device edalm Calibre 8 04-06-2010 10:30 AM
No device is connected pope_a Calibre 18 09-20-2009 12:29 PM


All times are GMT -4. The time now is 01:00 AM.


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