Closed JZH106 closed 3 years ago
Probably this line is unnecessary that checks the existence of the media:
void MainWindow::InsertFileDialog()
{
if (m_MediaList.isEmpty()) return;
EDIT: And something else, because it is not possible to insert another file.
The tooltip clearly indicates that the feature is to be used to insert media files that already exist in the book into an xhtml file. It's not intended to be used to add new external media to an epub. Remember that PageEdit is an xhtml editor and not an epub editor. Use Sigil to add media files to your epub, and then launch PageEdit if you need to use a WYSIWYG editor to insert said image into an xhtml file.
Thank you, Becky and Doug. I searched the html code of all files, cannot find this line. In Sigil, the fold of Image is not empty, there are several pictures in. I can add images in Sigil. In PageEdit, there is just no response to click the Inserting icon.
PageEdit includes no ability to add new files to an epub.
There is no response because there are no media files in your epub TO add to the xhtml. The dialog will only appear if there are already media files in your epub (and the existed in your epub BEFORE launching PageEdit).
Again: you cannot use PageEdit to add new media files to an epub. You can only use PageEdit to insert media files that are already a part of the epub into an xhtml file.
If there are indeed images in your epub, then what I suspect you're running into is that you're loading an xhtml file into PageEdit instead of launching PageEdit with the OPF file open. The latter will give you access to all of the epub's media files. The former will not.
When you launch PageEdit with a single html file, you have no access to anything other than that html file. When you launch PageEdit with the OPF file open, PageEdit has access to all of the Epub's html files and media resources.
I confirm. In the case of a single file, it will probably be better to disable this function in the menu and the icon on the toolbar.
Thank you, Becky. Yes, the function in the manual and the icon are somewhat confusing for use PageEdit with Sigil.
Thank you, Doug, for the explanation. I added images in Sigil, and used PageEdit to move them around, which worked well.
In the case of a single file, it will probably be better to disable this function in the menu and the icon on the toolbar.
Noted.
I'll leave this open to remember about disabling the insert media actions when no media files have been detected in what was passed to PageEdit.
@kevinhendricks : We're currently setting up and enabling/disabling the widgets and menu items/actions before the SetupFileList() routine (which populates the m_MediaList QStringList ). It would be trivial to accommodate this functionality if that order of events were to be reversed. Do you see any issue with running SetupFileList() just before SetupView()? Or would that screw up the firing of signals?
We could pretty easily disable those items whenever the passed in filepath is not an opf file, but that would be somewhat incomplete (in the case of an opf file being passed in that had no media files manifested).
We just need to start with it depending on m_MediaList being empty or not and then after any load check if it needs to be enabled or disabled in the same way.
I have made that change and pushed it to master and removed all of the damn tabs that slipped in. Closing this.
Gotcha. I was overthinking it. :)
I am new to PageEdit (1.5.0) for use with Sigil (1.5.1) in MacBook (11.0.1). When I click Insert ->File or the small Icon for Inserting at ToolBar, there is no response. How can I fix the problem? Please help.