![]() |
#1 |
Witchman
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
Easier access to plugin prefs
Would it be possible to have a button in the Sigil toolbar which, when clicked, allows selection and display -- via dialog + Sigil tab -- of the selected plugin prefs .json file for editing. Apps like Sublime already have this facility for setting their own prefs.
This change would make it much easier for Sigil users to access and set plugin prefs(where applicable). Is this possible? Last edited by slowsmile; 10-12-2017 at 08:42 PM. |
![]() |
![]() |
![]() |
#2 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
Join Date: Nov 2009
Device: many
|
The plugin code should be separate from the Sigil codebase to the extent possible. So I recommend plugin developers build a simple gui with pyqt or the built in python gui to handle editing their own prefs. We could create a canned generic module that should work the same for any plugin.
I do not think this role should be done by Sigil itself. Last edited by KevinH; 10-12-2017 at 09:29 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Witchman
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
duplicate
Last edited by slowsmile; 10-12-2017 at 09:06 PM. |
![]() |
![]() |
![]() |
#4 |
Witchman
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
duplicate
Last edited by slowsmile; 10-12-2017 at 09:07 PM. |
![]() |
![]() |
![]() |
#5 |
Witchman
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
Thanks Kevin. I'll look into writing a plugin for this when I'm up to speed on PyQT. Can it be done in Tkinter or is tk usage now discouraged for plugins?
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
Join Date: Nov 2009
Device: many
|
Both tkinter and pyqt are supported and should continue to be for the forseeable future.
|
![]() |
![]() |
![]() |
#7 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27,818
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I've no plans to remove tkinter at this time.
Many of my plugins include gui code (both tkinter and pyqt) to allow the user to edit the plugin's preferences if you're looking for examples. |
![]() |
![]() |
![]() |
#8 |
Witchman
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
Thanks for that, and I will have a peek at DiapDealer's pyqt examples for sure. I already have Winpython 3.4(with PyQT5 and Qt Designer) installed on my computer.
|
![]() |
![]() |
![]() |
#9 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,635
Karma: 23190435
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
BTW, users can easily access the plugin_prefs folder via: Edit > Preferences > Open Preferences Location > plugins_prefs Windows users can also access a specific preferences folder via the Windows Run dialog box. For example:
|
|
![]() |
![]() |
![]() |
#10 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 673
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
|
![]() |
![]() |
![]() |
#11 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27,818
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
No it doesn't. The plugin framework only creates the json file if one isn't already present. If individual settings within the json are being changed/reset when a plugin is updated, then that's on the plugin dev. My plugins' preferences will certainly persist through a plugin update--no matter how the json file gets edited. If they don't, then I need to know.
|
![]() |
![]() |
![]() |
#12 |
Witchman
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
As DiapDealer says, the json file is not deleted when you update a plugin -- it is preserved in a separate plugin_prefs directory. If you want to reset plugin prefs to its default or initial settings then all you have to do is just delete the json file or delete its directory from plugin_prefs.
|
![]() |
![]() |
![]() |
#13 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 673
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Quote:
Had to re-edit the json to change the default thumbnail size. Unless I screwed up removing the older version first. Last edited by AlanHK; 10-20-2017 at 12:42 AM. |
|
![]() |
![]() |
![]() |
#14 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,635
Karma: 23190435
Join Date: Dec 2010
Device: Kindle PW2
|
Older KindleGen versions used an .ini file whose settings were indeed lost when I switched to json-based preferences.
The default thumbnail size was never a preference setting; changing it always required modifying plugin.py. |
![]() |
![]() |
![]() |
#15 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 673
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Prefs Error | MrKonan | Calibre | 2 | 10-07-2017 02:39 AM |
Sync Calibre Prefs between Win 10 and macOS Sierra | saluli | Library Management | 0 | 06-05-2017 08:33 PM |
Can I access the database from a metadata source plugin? | Jellby | Development | 7 | 02-03-2015 03:29 AM |
Change Search Prefs | stevejoung | Kindle Developer's Corner | 12 | 10-10-2014 07:30 AM |
Where are toolbar prefs saved? | copyrite | Calibre | 2 | 05-01-2014 12:44 PM |