10-12-2017, 09:31 PM | #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 09:42 PM. |
10-12-2017, 09:44 PM | #2 |
Sigil Developer
Posts: 8,158
Karma: 5450818
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 10:29 PM. |
Advert | |
|
10-12-2017, 09:56 PM | #3 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
duplicate
Last edited by slowsmile; 10-12-2017 at 10:06 PM. |
10-12-2017, 10:02 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 10:07 PM. |
10-12-2017, 10:09 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 | |
|
10-12-2017, 10:31 PM | #6 |
Sigil Developer
Posts: 8,158
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Both tkinter and pyqt are supported and should continue to be for the forseeable future.
|
10-12-2017, 10:35 PM | #7 |
Grand Sorcerer
Posts: 28,040
Karma: 199464182
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. |
10-13-2017, 02:01 AM | #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.
|
10-13-2017, 03:52 AM | #9 | |
Grand Sorcerer
Posts: 5,640
Karma: 23191067
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-19-2017, 12:02 PM | #10 |
Guru
Posts: 677
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
|
10-19-2017, 12:14 PM | #11 |
Grand Sorcerer
Posts: 28,040
Karma: 199464182
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.
|
10-19-2017, 08:47 PM | #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.
|
10-20-2017, 01:38 AM | #13 | |
Guru
Posts: 677
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 01:42 AM. |
|
10-20-2017, 02:43 AM | #14 |
Grand Sorcerer
Posts: 5,640
Karma: 23191067
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. |
10-22-2017, 02:42 PM | #15 |
Guru
Posts: 677
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Prefs Error | MrKonan | Calibre | 2 | 10-07-2017 03:39 AM |
Sync Calibre Prefs between Win 10 and macOS Sierra | saluli | Library Management | 0 | 06-05-2017 09:33 PM |
Can I access the database from a metadata source plugin? | Jellby | Development | 7 | 02-03-2015 04:29 AM |
Change Search Prefs | stevejoung | Kindle Developer's Corner | 12 | 10-10-2014 08:30 AM |
Where are toolbar prefs saved? | copyrite | Calibre | 2 | 05-01-2014 01:44 PM |