09-29-2018, 07:47 PM | #1 |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
[2 Bugs] + [Enhancement] Book Browser, CSS, URLs, Oh My!
I attached an example EPUB at the end of this post.
Sigil 0.9.10. Windows 10, 64-bit. Bug #1 (Book Browser) Explanation Use Ctrl+Click to highlight multiple files (with a gap in between, not consecutive files). Drag/Drop to new location. Only first file moves. The others stay exactly where they were. Steps to Reproduce Step 1. Ctrl+Click Section0002.xhtml + Section0004.xhtml in the Book Browser: Code:
- Section0001.xhtml - Section0002.xhtml <--- Ctrl+Click - Section0003.xhtml - Section0004.xhtml <--- Ctrl+Click Get: Code:
- Section0002.xhtml <--- Moved - Section0001.xhtml - Section0003.xhtml - Section0004.xhtml <--- Didn't move Code:
- Section0002.xhtml - Section0004.xhtml - Section0001.xhtml - Section0003.xhtml Explanation Only 1 out of 2 CSS files delete when a file is open in Book View. Note #1: This doesn't seem to effect Code View. Note #2: This only occurs when the HTML file has multiple CSS files attached to it. (?) (See Section0004.xhtml, only 1 of the stylesheets are linked. Bug does not occur.) Steps to Reproduce Step 1. Have Book View open on Section0001.xhtml. Step 2. Shift+Click to highlight both CSS files. Right-Click + Delete: Step 3. In the Delete menu, make sure both checkboxes are set and push "Delete marked files": Only stylesheet1.css will delete. Potential Enhancement (Open/Copy Link) Would be helpful if a link could be right-clickable in the Preview/Book View, then get an "Open Link" + "Copy Link"... Like in Firefox/Chrome: This would allow you to copy/paste links easily. In Sigil, you can only left-click the link to open in your default browser. And if you right-click, all that appears in the menu is "Inspect Element": Why This Would Be Helpful I was recently working on a book with 1000+ URLs. I was testing a lot of them in the Book View, and it would have been nice to copy/paste links. |
09-29-2018, 11:52 PM | #2 |
Sigil Developer
Posts: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Bug number 1 can not be recreated on Mac OSX at all. This generally means the bug is in Qt someplace. BTW, your bug 1is almost identical to an earlier bug report that turned out to be KDE / Qt related. I will look at your second bug when I get a free moment later tomorrow.
|
Advert | |
|
09-30-2018, 03:19 AM | #3 |
Grand Sorcerer
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
I was able to reproduce bug number 1 on my 64bit Arch Linux machine. (Sigil built from source yesterday, Qt 5.11.2.)
(I wasn't able to reproduce the second bug on my Linux machine.) Last edited by Doitsu; 09-30-2018 at 03:31 AM. |
09-30-2018, 06:59 AM | #4 |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Interesting results when testing bug #1 on my Windows/Linux machines: I get different results when dragging the selected files down rather than up. Looks like a Qt bug for sure. Luckily, reordering non-contiguous blocks of files isn't something most users are likely to attempt.
I also couldn't duplicate #2 in my preliminary testing. |
09-30-2018, 11:37 AM | #5 | ||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Quote:
Add Existing Files adds them to the very end, alphabetically... so I've been having to drag stuff like: Before: Code:
- cover.xhtml - Chapter01.xhtml - [...] - EndBook.xhtml - copyright.xhtml <--- - newbackmatter.xhtml - newbackmatter2.xhtml - titlepage.xhtml <--- Code:
- cover.xhtml - titlepage.xhtml <--- - copyright.xhtml <--- - Chapter01.xhtml - [...] - EndBook.xhtml - newbackmatter.xhtml At least one good thing came out of not being able to overwrite... I found these bugs! |
||
Advert | |
|
09-30-2018, 01:41 PM | #6 |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I've tracked bug #1 down to my commit for fixing the cosmetic disappearing icons when reordering files in Book Browser (Linux/Windows only).
Reverting the change alleviates the issue of reordering multiple (but non-contiguous) files in Book Browser. If I can't find a solution that will accommodate both, I'll revert the cosmetic fix and some people will have to deal with disappearing icons after drag and drop operations. I have some ideas and leads to follow up on, so hopefully I can find a unifying fix. |
10-01-2018, 09:33 AM | #7 |
Sigil Developer
Posts: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
|
FWIW, I was wrong about Bug 1 not existing on a Mac.. I dragged down and not up. I tried again by dragging up and sure enough section 4 was not properly moved.
So this bug does exist on Mac OS X as well. |
10-01-2018, 09:40 AM | #8 |
Sigil Developer
Posts: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Okay, I finally got a chance to test Bug 2 on my Mac dev machine. This time I followed the instructions to the letter. I can not recreate Bug 2 at all. Every time I tried, both CSS files were deleted and only Section 1 was showing in BookView according to the instructions.
This is with my dev machine which has been updated to Qt 5.11.x in preparation for a future release. Perhaps this is a bug that exists in Qt 5.6.2 that has been fixed in Qt 5.11.x. |
10-01-2018, 05:27 PM | #9 | |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
|
|
10-02-2018, 11:07 AM | #10 |
Sigil Developer
Posts: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
|
So that pretty much leaves bug 1 to focus on. Your added Refresh reinitializes the entire model which is good except when it happens to be in the middle of multiple calls to remove rows and so loses the second dnd row movement. It only generates multiple calls because the files that were moved are non-contiguous.
So we either need to wait until all row removes are done and then Refresh (although I am not sure a signal exists from the model itself that will do that) or fire a signal that says run Refresh after a time delay, or try to manually fix the icon itself in the target rows be capturing the rowsAdded signal and manually filling in the proper icon in any new row. |
10-02-2018, 11:40 AM | #11 | |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
I really think this disappearing icon is a Qt bug, though. Does it happen on Mac? I know it used to happen on Linux, but I've not seen it in a while with later versions of Qt. Both columns really should be maintained via Qt's normal internal drag & drop, I think. Last edited by DiapDealer; 10-02-2018 at 11:45 AM. |
|
10-02-2018, 11:47 AM | #12 |
Sigil Developer
Posts: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Hi DiapDealer,
Please try what I just committed. It simply overwrites/rewrites the proper icon when rebuilding the HTML Reading Order as all of the info we need is there at that time and it is invoked right before your added Refresh() which I removed based on your messages here. For me (Mac OSX, built from master just now, Qt 5.11.x) the icon now does not get lost during drag and drop and it seems to fix bug 1 as well. Please let me know if it does the trick for Bug 1 for Linux and Windows if and when you get a chance. |
10-02-2018, 12:02 PM | #13 |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
It's still building in Appveyor, but your change looks like it should work.
I should be able to try it after lunch sometime. |
10-02-2018, 12:59 PM | #14 | |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Your fix will probably be much more efficient, as well. A complete clearing/rebuilding of the entire model was included with the Refresh(). |
|
10-02-2018, 02:58 PM | #15 |
Sigil Developer
Posts: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Thanks. Good to know. And yes I agree that the lost icon bug when dragging and dropping is a Qt bug. But getting Qt to fix any bugs seems to be an impossible dream. I just had a serious use after free bug closed by Qt where they claimed they needed more info but my initial report included a step by step instructions to reproduce the bug using their own official QtCreator and even provided the resulting guard malloc backtrace.
You could not supply any more info period. No one ever even read the bug report or looked at it. I checked and the bug still exists. I can't even find my bug password any more to reopen the damn thing. Sad really. We do not need a Qt 5.12 or higher, we need a stable bug fixed 5.11 that actually gets fixes. Oh well. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
bugs in book browser | Reinhard | Sigil | 25 | 07-31-2018 02:07 PM |
Possible Error / Enhancement - Book Editor, Spell Check Right-Click Sub-Menu | WizkidTX | Editor | 7 | 07-22-2015 09:33 PM |
PRS-T1 Two tiny bugs when reading a book | opitzs | Sony Reader | 10 | 07-08-2013 07:10 PM |
[Program Enhancement] Adding Empty Book | Gunnerp245 | Calibre | 3 | 12-24-2012 07:32 AM |
Enhancement (Delete formats from Book Details Panel) | JohnnyBook | Library Management | 5 | 07-21-2012 08:17 AM |