04-19-2018, 06:21 PM | #1 |
Member
Posts: 11
Karma: 10
Join Date: Nov 2012
Device: Kindle Fire
|
SelectedItems in Ebook Editor
I am developing a renaming plugin that will do similar thing as request_change_ext function in the FileList class (https://github.com/kovidgoyal/calibr...k/file_list.py).
However, i don't seem to understand where is .selectedItems() coming from in request_rename_common? Can someone led some light on it, please? |
04-19-2018, 07:57 PM | #2 |
Member
Posts: 11
Karma: 10
Join Date: Nov 2012
Device: Kindle Fire
|
I looked into it closer now, is this the correct statement?
* self.build creates a container of names, categories, icons (https://github.com/kovidgoyal/calibr...e_list.py#L321) * the above leverages function get_state to get the array of selected items (https://github.com/kovidgoyal/calibr...e_list.py#L255) |
Advert | |
|
04-19-2018, 11:43 PM | #3 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
selectedItems() is a Qt method from the QTreeWidget class. self.build() populates the QTreeWidget. IIRC it only uses get_state() if the state before the build is to be preserved (i.e. the selected files and expanded nodes).
|
04-21-2018, 08:38 AM | #4 | |
Member
Posts: 11
Karma: 10
Join Date: Nov 2012
Device: Kindle Fire
|
Ok, i am able to get it working for one file at the time - getting the selected name with
Quote:
Also, my plugin is ONLY visible in menu and not on the toolbar (although allowed_in_toolbar=True and for_toolbar=True), do you know what could be the reason? |
|
04-21-2018, 08:47 AM | #5 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Use selected_names
And are you saying you cannot add your plugin to the toolbar? Look at the demo plugin or one of the other plugins to check what the difference is. |
Advert | |
|
04-21-2018, 08:41 PM | #6 | |||
Member
Posts: 11
Karma: 10
Join Date: Nov 2012
Device: Kindle Fire
|
I fixed the toolbar, but selected_names doesn't exist:
Quote:
Quote:
To add, this works, but with only one selected file: Quote:
|
|||
04-21-2018, 11:34 PM | #7 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
file_list.file_list.selected_names
|
04-23-2018, 06:49 AM | #8 |
Member
Posts: 11
Karma: 10
Join Date: Nov 2012
Device: Kindle Fire
|
|
Tags |
editor, extension, file list, filename |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Android eBook Metadata editor? | Freshenstein | Android Devices | 0 | 12-03-2015 10:56 PM |
Using ebook-editor in command line | Francois_C | Editor | 12 | 04-17-2015 10:17 AM |
Calibre Ebook Editor | filmo | Kobo Reader | 0 | 01-13-2014 10:11 AM |
eBook Editor - font size | GregTheGrate | Editor | 1 | 12-16-2013 01:13 AM |
Greetings from an ebook Anthology Editor! | chawkins | Introduce Yourself | 2 | 09-17-2011 05:42 PM |