![]() |
#1 |
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Aug 2025
Device: none
|
Sigil 2.6.0: Plugin template filename not used for initial save
Hello Sigil community,
I am using a plugin (Template2) to open eBook templates. In Sigil 2.4.2 and earlier, when I opened a template using the plugin, the "Save As" dialog would automatically suggest the template/plugin name (e.g., "Template2_.epub") as the default filename. Since Sigil 2.6.0, however, the save dialog always shows "untitled" as the default, even though the tab title correctly displays the template/plugin name. Steps to reproduce: 1. Install the Template2 plugin (or any similar plugin that opens a template and sets a book name). 2. Open a template using the plugin. 3. Observe that the tab shows the correct name (e.g., "bald_"). 4. Click "Save As" for the first time. 5. The suggested filename is "untitled" instead of the plugin-specified name. Expected behavior: - The save dialog should suggest the plugin/template filename as default, like in Sigil 2.4.2. Actual behavior: - The save dialog ignores the plugin name and shows "untitled". Is there a way to force Sigil 2.6.0 to use the plugin-specified filename for the initial save, or is this no longer possible with the current version? Thank you for your advice! |
![]() |
![]() |
![]() |
#2 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,893
Karma: 6120478
Join Date: Nov 2009
Device: many
|
The only recent change that impacts new file naming when untitled was here:
https://github.com/Sigil-Ebook/Sigil...d3185c06fc77c2 This change was made to look for better names in the MetaData of the book and using the book's title if it exists. This change may have had an unexpected impact on the Template plugins. I will look into it. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,893
Karma: 6120478
Join Date: Nov 2009
Device: many
|
Update:
That change is the issue in that if a m_CurrentFileName exists, it is no longer used to set the m_CurrentFilePath as it used to. This breaks all input plugins ability to set names. I will try to figure out a different approach to bring back input plugin file names if one already exists. Last edited by KevinH; Yesterday at 10:07 AM. |
![]() |
![]() |
![]() |
#4 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 876
Karma: 3501146
Join Date: Jan 2017
Location: Poland
Device: Various
|
I suggested this solution with the file name based on the title stored in the book's metadata, and I have been using it very often ever since.
However, I understand that what makes my life easier has broken the feature that suggests a file name based on the template name. I'm sure it can be fixed so that both sides are happy, I just need to think about it for a moment. I'm currently building a new version of Sigil, so I'll be testing it right away. |
![]() |
![]() |
![]() |
#5 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,893
Karma: 6120478
Join Date: Nov 2009
Device: many
|
Quote:
Then when you pull in the template, it should get assigned the name you want. Please give that a try. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 876
Karma: 3501146
Join Date: Jan 2017
Location: Poland
Device: Various
|
I think it worked.
I submitted a Pull Request. EDIT: If someone prefers the file name, I see no problem with that. The title from the metadata will work if the file does not yet have a name, but if it does, we will of course use the template name instead of "untitled.epub." Last edited by BeckyEbook; Yesterday at 10:42 AM. |
![]() |
![]() |
![]() |
#7 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,893
Karma: 6120478
Join Date: Nov 2009
Device: many
|
Quote:
If the m_CurrentFilePath is empty, then the book was loaded via a plugin or was created from scratch but never saved yet and no directory to save it in currently exists. To make it harder, the input plugin can assign just a filename that is meaningful as the TemplatePlugin does or a temporary one that is not meaningful like most other input plugins like FolderIn does. As far as I know there is no easy way to detect which has been done? So there is no easy solution, unless we change all input plugins to choose the exact same temporary meaningless name, so we can detect that case and use your proposed name in place. Let me check what FolderIn does. |
|
![]() |
![]() |
![]() |
#8 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,893
Karma: 6120478
Join Date: Nov 2009
Device: many
|
In the FolderIn case it just names the epub after the folder name it loads from.
That is great if you used FolderOut to save it to some folder you chose a good name for. It is not good when importing from a "src" folder like we do with the user guides and plugin index. So I do not think there will be solution that works for all cases. @BeckyEbook, I have made additional comments in your PR. Last edited by KevinH; Yesterday at 11:42 AM. |
![]() |
![]() |
![]() |
#9 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,893
Karma: 6120478
Join Date: Nov 2009
Device: many
|
@streetcatfighter,
A fix for your issue was created by BeckyEbook and has been pushed to master. This fix will appear in the next release of Sigil. Thank you for your bug report. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Filename template bug? | stasiana | Calibre | 12 | 11-23-2023 11:41 PM |
Save Template, is appending one tag to a filename possible? | chrisric | Library Management | 5 | 04-29-2023 12:52 PM |
Download Filename Template? | nqk | Server | 2 | 06-02-2020 04:19 AM |
Change filename template in Calibre's library | 8140david | Library Management | 3 | 09-25-2016 11:39 AM |
filename template feature | artbatista | Calibre | 0 | 08-23-2009 01:05 PM |