![]() |
#31 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 823
Karma: 2536588
Join Date: Jan 2017
Location: Poland
Device: Various
|
There is certainly a solution. Leave Tk, but encourage the development of new plugins with PySide6. More complex dialogs always require more work.
Additional incentives for those who would like to start writing their own plugins: * Maybe an extension of the QtSigilPluginTemplate to add more controls. * You should probably also update the first four posts in Plugin Development. For example, the versions of the launcher in post #3 (it's a LOT of work if new features were additionally described) or the Plugin Framework (currently rev14) in post #4. * Add interesting, proven features to the Post Your Useful Plugin Code Fragments Here thread. Of course, these are just loose suggestions. |
![]() |
![]() |
![]() |
#32 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,583
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Actually Post #3 is so out of date we should delete it. The wrapper.py version to Sigil version can actually be found by using our github site tags much more easily.
As for Post #4, nothing much has changed since the Sigil 1.0 timeframe in the plugin frameworks. That plugin dev manual is still valid. The plugin interface has been and continues to be backwards compatible. There are a few recent additions (I count 6 addition since 2019) but the fundamentals are unchanged. Even the current guide (14) does not include really recent changes. As with any dev project, the best way is to learn it is to read the source and see examples and we have quite a large number of python plugins for people to learn from. Update: Actually, the rev 14 version of the manual is up to date except for the latest commit that was introduced in Sigil 2.2 that allowed the plugin to see what if any font mangling algorithm was set to be used by the plugin. See: https://github.com/Sigil-Ebook/Sigil...2bf385c18f3ebb I will further update it to rev 15 with that one missing interface call, and then remove all of the references to python 2.7 that still exist and maybe make it clearer that python 3.4 in the plugin.xml file only specifies the very minimum python version. Update 2: ----------- Added an out of date notice on Post #3 with a pointer to using github on the wrapper.py file for any specific Sigil release tag they might be interested in. Added Sigil Plugin Framework at rev15 (consistent with current Sigil) and added it to Post #4. Last edited by KevinH; 05-30-2025 at 12:58 PM. Reason: Update about changes made |
![]() |
![]() |
![]() |
#33 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 823
Karma: 2536588
Join Date: Jan 2017
Location: Poland
Device: Various
|
This is a non-negotiable matter – analyzing the code of existing plugins is the best lesson.
|
![]() |
![]() |
![]() |
#34 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,495
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I have no problem with leaving tkinter in the bundles. Doing so on Linux and Windows is not that difficult. But I would like to strongly discourage its use for new plugins.
I never warmed up to tkinter gui programming. In fact, I probably hate it. Getting it to do the things I wanted it to do (in a consistent cross-platform manner) was as painful to me as I imagine self-dentistry would be. I consider it vastly more difficult to work with than PySide/PyQt. But perhaps that's because I understand Qt from the C++ side. There's no real pressure to make a decision on this, so why don't we let it stew a bit, and upgrade the plugins that are under our control to PySide6? Offer help to those who show an interest in migrating. I figure the more PySide plugin code out there, the more likely it is that plugin devs will use that code for their new plugins. I know a lot of people used my first tkinter plugins as templates/guidelines. I would have done the same in their shoes. We only had tkinter for while. That's why I bit the bullet and learned a bit about it. But when we started including PyQt, I jumped ship pretty quickly. Last edited by DiapDealer; 05-29-2025 at 04:29 PM. |
![]() |
![]() |
![]() |
#35 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,583
Karma: 5703586
Join Date: Nov 2009
Device: many
|
That sounds like a plan. Perhaps I should add a paragraph on PySide6 to the latest plugin dev manual and try to also discourage Tk there as well.
Quote:
|
|
![]() |
![]() |
![]() |
#36 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,938
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Elephant in the room!
What does this do to to folk who are stuck at older versions of Sigil because their OS is 32bit or other reasons? +1 on discourage use of TK in new ones.(as in it will NOT be added to the Plugin index ![]() |
![]() |
![]() |
![]() |
#37 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,583
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Well many of the older machines were Linux based, and DiapDealer's AppImage brought them kicking and screaming into the present!
As for 32 bit only users, Qt left them behind long ago. And really old Sigil users (pre 0.7.2 through 0.8.x) do not have support for plugins at all, so no worries there. And no one is removing current plugins if the Sigil version they have supports them. That said, if a user has a cpu capable of 64 bits but running a 32 bit version of their OS, I would strongly recommend upgrading to Linux. So I do not think deprecating Tk but not removing it will have much of an impact on users of Sigil. |
![]() |
![]() |
![]() |
#38 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,495
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
And with the ability to use an external Python installation for plugins, Sigil users can create just about any Python environment for plugin use that they want for their aging versions of Sigil. The only limitation would be not being able to use plugins that use features not yet implemented in their version of Sigil. But that limitation affects them now even with the bundled Python.
They may not always be able to get the very latest updates for some plugins, but that's always been a risk already too. So I don't think people would be affected that adversely by any potential change in this direction. |
![]() |
![]() |
![]() |
#39 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,699
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
I've got a cosmetic Sigil Qt question. When using file open/save dialog code such as the following code:
Code:
app = QtWidgets.QApplication(sys.argv)
fpath, seleted_filter = QtWidgets.QFileDialog.getSaveFileName(None, 'Save ePub3 as ...', suggest, "ePubs (*.epub)")
app.quit()
Apparently, this can be prevented by specifying the parent control instead of None. How do I get the parent control? |
![]() |
![]() |
![]() |
#40 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,495
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
https://github.com/dougmassay/sigil-...s_light.py#L56 |
|
![]() |
![]() |
![]() |
#41 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,699
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Since my plugin only has one QFileDialog importing the whole plugin_utils_light.py library might be a bit overkill.
I put a valid plugin.ico file in the plugin folder and used the following code, but the taskbar icon is still shown. Spoiler:
What other parts of plugin_utils_light.py will I also need to add to get rid of the icon? |
![]() |
![]() |
![]() |
#42 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,583
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Quote:
|
|
![]() |
![]() |
![]() |
#43 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,495
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
I don't see any app.exec() though. So I'm not sure your QApplication (and its icon) is technically being utilized. Try inserting it (app.exec())after the call to ensure_windows_taskbar_icon(). Last edited by DiapDealer; 06-01-2025 at 01:50 PM. |
|
![]() |
![]() |
![]() |
#44 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,495
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
You can also try using an empty QWidget:
w=QWidget() and using that as the parent parameter in getOpenFileName() I do something similar in my KindleImport plugin (which also only uses the FileOpen widget): https://github.com/dougmassay/kindle...ilities.py#L45 It uses the wrapped QApplication from plugin_utils.py, but that should not be strictly necessary to get things to work. |
![]() |
![]() |
![]() |
#45 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,699
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Feat. Req. Discussion: Adding Markdown Support to KOReader | spectas | KOReader | 1 | 10-27-2024 07:03 PM |
[Metadata Source plugins] Calibre internal plugins fail | igorius | Plugins | 1 | 05-28-2023 11:42 AM |
[Discussion] Update plugins from GitHub release page | xxyzz | Plugins | 6 | 11-23-2020 04:54 AM |
Systemwide installation of plugins / Discovery of installed plugins via pkg_resources | t-8ch | Development | 8 | 11-14-2020 09:25 AM |
No Module name Tkinter on plugin import | foghat | Plugins | 1 | 11-11-2010 07:11 PM |