|
|
#1 |
|
Member
![]() Posts: 11
Karma: 10
Join Date: Nov 2012
Device: Kindle Fire
|
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? |
|
|
|
|
|
#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 | |
|
|
|
|
#3 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609
Karma: 28549044
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).
|
|
|
|
|
|
#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? |
|
|
|
|
|
|
#5 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609
Karma: 28549044
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 | |
|
|
|
|
#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:
|
|||
|
|
|
|
|
#7 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609
Karma: 28549044
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
file_list.file_list.selected_names
|
|
|
|
|
|
#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 11:56 PM |
| Using ebook-editor in command line | Francois_C | Editor | 12 | 04-17-2015 11:17 AM |
| Calibre Ebook Editor | filmo | Kobo Reader | 0 | 01-13-2014 11:11 AM |
| eBook Editor - font size | GregTheGrate | Editor | 1 | 12-16-2013 02:13 AM |
| Greetings from an ebook Anthology Editor! | chawkins | Introduce Yourself | 2 | 09-17-2011 06:42 PM |