Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 05-26-2012, 04:23 PM   #1
filipexim
Junior Member
filipexim began at the beginning.
 
Posts: 4
Karma: 10
Join Date: May 2012
Device: kindle
Deleting book

Hi, I'm doing my first contribution to an open source community, and I choose calibre to start. I'm looking for something simple to begin. I noticed that when you delete a book its cover doesn't disappear from the right side bar. I want to change this behavior and automatically select the next book on list to have it's cover shown on this bar.

I'm looking at the calibre/gui2/actions/delete.py file. I have some questions:

1 - Where can I see the available methods and variables for self.gui? I understood that this is used to access the gui elements, but i couldn't find what it's available to be used.

2 - To do what I'm pretending to do, where else in the code should I be also looking?

Thanks.
filipexim is offline   Reply With Quote
Old 05-26-2012, 05:17 PM   #2
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: 26,338
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
If you want to see what methods are available on any python object just insert a

print (vars(obj))

and run calibre with

calibre-debug -g

The self.gui class is defined in gui2/ui.py
kovidgoyal is offline   Reply With Quote
 
Advertisement
Old 05-27-2012, 09:42 AM   #3
filipexim
Junior Member
filipexim began at the beginning.
 
Posts: 4
Karma: 10
Join Date: May 2012
Device: kindle
Also in the delete.py file:

I can't find the methods for library_view variable in

Code:
self.gui.library_view
Already tried:

Code:
print (vars(self.gui.library_view))
filipexim is offline   Reply With Quote
Old 05-27-2012, 10:03 AM   #4
filipexim
Junior Member
filipexim began at the beginning.
 
Posts: 4
Karma: 10
Join Date: May 2012
Device: kindle
I'm guessing this is something from QT library.
filipexim is offline   Reply With Quote
Old 05-27-2012, 10:36 AM   #5
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: 26,338
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
library/views.py
kovidgoyal is offline   Reply With Quote
Old 05-27-2012, 12:28 PM   #6
filipexim
Junior Member
filipexim began at the beginning.
 
Posts: 4
Karma: 10
Join Date: May 2012
Device: kindle
Great!
It's working. Just one more thing:
When you delete all books from calibre, the cover of the last selected book still appears on the right side bar. How can I set this image to switch to the "default_cover" instead?
filipexim is offline   Reply With Quote
Old 05-27-2012, 01:36 PM   #7
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: 26,338
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
gui2/book_details.py
kovidgoyal is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Troubleshooting Deleting a book with annotations, will it warn me? Gary King Amazon Kindle 3 01-08-2012 04:14 PM
deleting a book StickMaker Amazon Kindle 9 09-18-2011 04:40 PM
Deleting book from sig joycedb Feedback 19 09-12-2011 10:47 AM
Deleting a Book..?? Cpl Punishment Nook Color & Nook Tablet 2 01-30-2011 09:48 PM
Troubleshooting Help deleting book from Kindle 3 jocampo Amazon Kindle 6 12-10-2010 11:27 AM


All times are GMT -4. The time now is 04:56 PM.


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