03-12-2022, 06:31 PM | #31 |
Junior Member
Posts: 4
Karma: 10
Join Date: Mar 2022
Device: Kobo
|
|
03-12-2022, 06:35 PM | #32 | |||
Junior Member
Posts: 4
Karma: 10
Join Date: Mar 2022
Device: Kobo
|
Quote:
Quote:
Quote:
Many thanks |
|||
Advert | |
|
03-14-2022, 02:43 PM | #33 |
Sigil Developer
Posts: 7,714
Karma: 5444398
Join Date: Nov 2009
Device: many
|
Toggle Line Wrap Mode
Okay, I have added a "Toggle Line Wrap Mode" to the CodeView pop-up context menu in my local tree.
See the attached screenshot with NoWrap set. This will tentatively be in the next release and pushed to master once we are 100% sure there is no need for a Sigil-1.9.3 anytime soon. Please note this really only helps show structure if the text does not already have inserted new lines in it. This is the issue with the Alice in Wonderland test epub I often use. So to make this useful in some epubs, you may have to use Mend and Prettify first so that ToggleLineWrapMode works as expected in these cases (as it replaces \n within p tags with a blank " " as that is what xhtml/html rules say should be displayed in these cases). ps. This has now been pushed to master and will be in the next release. Last edited by KevinH; 03-18-2022 at 12:15 PM. |
03-14-2022, 03:08 PM | #34 |
Addict
Posts: 311
Karma: 3196258
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
|
Exciting! Thank you as always, the tool is an absolute godsend.
|
03-14-2022, 05:50 PM | #35 |
Sigil Developer
Posts: 7,714
Karma: 5444398
Join Date: Nov 2009
Device: many
|
If others are interested:
I am contemplating a Saved Search "Counts Report" button that creates a modal dialog with a table with columns showing: Test Full Name, Find Regex, Target Files, Count All for each test in a Saved Search Group, with the option to save the table as a csv file. This would function as a Count Report for anything you wanted such as table tags, ordered lists, unordered lists, or anything you can create a regex for. If people are interested in seeing something like this added to Sigil for the next release, please let me know. |
Advert | |
|
03-14-2022, 06:55 PM | #36 |
Addict
Posts: 311
Karma: 3196258
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
|
+1 for me, that CSV output in particular sounds really useful.
|
03-15-2022, 05:16 PM | #37 |
Evangelist
Posts: 425
Karma: 77256
Join Date: Sep 2011
Device: none
|
Hello,
Mentioned before. After renaming some set of files, would it be possible for cursor focus to remain in the same panel? Then I can merely afterwords without needing tab or some mouse click use arrow keys to select the next set for rename. Typically I rename all files if needed so part and chapter number are in file name. So I can easily identify files for future editing. If a part begins with some non-chapter title or summary page, I will typically rename them to something like part03-00. In such cases, after sequentially renaming that part, I go back and change the part title page to suffix -00. I am not sure if some alternate possible future UI might make such easier, or if useful to others. Typically renaming all files takes a bit of time; maybe there is some way to make such easier. |
03-15-2022, 05:22 PM | #38 |
Sigil Developer
Posts: 7,714
Karma: 5444398
Join Date: Nov 2009
Device: many
|
Actually, BookBrowser uses an ItemDelegate and stores the current name in it. So after changing the name a whole set of files must be searched and links potentially updated, the opf changed, etc. The Context menu sets this all up. So it will never be as simple just movingto the next File and expecting to rename it with no special keys or mouse clicks.
That is why Sigil itself can block rename and add numbers to file names. For anything more elaborate use the ReRenamer (regex) tool to block rename files. Last edited by KevinH; 03-15-2022 at 09:35 PM. |
03-15-2022, 10:05 PM | #39 |
Evangelist
Posts: 425
Karma: 77256
Join Date: Sep 2011
Device: none
|
What I mean is that after some set of renames is completed, cursor focus moves out of that panel. Once renames are completed and I wish to rename another set of files, I first need to click in that panel merely to move cursor focus. Perhaps I’m missing something, but I don’t see any reason why focus and cursor position can’t remain. It could be that the tree view is entirely refreshed, yet isn’t it possible to lets say keep track that x file in the list is selected, and then restore selection?
At least with macOS table views, there are various APIs to perform such (as well as make selection visible on screen if scroll or element position changed); I’d imagine such exists also for other controls as well as on other platforms; perhaps too within Qt. Last edited by democrite; 03-15-2022 at 10:07 PM. |
03-15-2022, 10:09 PM | #40 |
Sigil Developer
Posts: 7,714
Karma: 5444398
Join Date: Nov 2009
Device: many
|
Have you actually tried the RERenamer and the normal Rename functions that works on sets of files?
And BookBrowser only gets a keyboard input cursor when in rename so I am still not sure exactly what it is you are asking for. Please be specific and show annotated screencaps as to what you think should happen. You can quickly rename all selected files to partXXXX.xhtml numbered if you like using Sigil's regular rename tool but since the file names themselves are not user facing, why bother. Or you can use Regex in the RERenamer to select and capture parts from current file names to create new file names. Perhaps you are trying to do everything using keyboard shortcuts and never use the mouse? If so you should note that shift-tab cycles the focus among existing widgets. So on my machine I can do the following: Click on first file to rename: Command-Alt-R rename it and hit enter Shit-Tab, Shift-Tab, Shift Tab Down Arrow Command-Alt-R ... repeat But wouldn't it be faster to: Click on first file to rename Command-Alt-R rename it and click on the next file to rename Command-Alt-R ... repeat But again there are many more efficient ways to rename a number of files. Just select a block and right click to Rename the block (and number them). Then use ReRenamer to use regex to to rebuild the files from the pieces any way you want. That is the whole point. Last edited by KevinH; 03-16-2022 at 01:42 PM. |
03-16-2022, 12:33 PM | #41 |
Sigil Developer
Posts: 7,714
Karma: 5444398
Join Date: Nov 2009
Device: many
|
@democrite
I took a closer look at the existing code and it already explicitly sets focus on BookBrowser after a single rename. See here: Code:
void BookBrowser::SelectRenamedResource() { if (m_RenamedResource == NULL) { return; } // Set the selection to the resource that was being renamed UpdateSelection(m_RenamedResource); // Make sure Book Browser has focus so keyboard navigation works as expected qobject_cast<QWidget *>(m_TreeView)->setFocus(); m_RenamedResource = NULL; } I will try to track down what and see why and if it can be changed. No promises. Last edited by KevinH; 03-16-2022 at 03:36 PM. |
03-16-2022, 01:39 PM | #42 |
Sigil Developer
Posts: 7,714
Karma: 5444398
Join Date: Nov 2009
Device: many
|
@democrite
It is a race between two different things trying to set focus. The CodeView with a strong focus setting, and BookBrowser trying to set the focus on just the renamed file. Sometimes one wins other times the other wins. Making the following simple change in BookBrowser.cpp to try to track this down actually slowed it down enough so that it lost the race (always came in second) and therefore won the war as it was the last focus set. Please give this a try on your own build and let me know if this is what you have been asking for above. Does it do the trick? If so, I can try to set a timer to add a delay to this routine to guarantee it always loses the race and sets Focus in BookBrowser after a single rename. Just let me know. Code:
diff --git a/src/MainUI/BookBrowser.cpp b/src/MainUI/BookBrowser.cpp index a461a4f0..d45e2d6a 100644 --- a/src/MainUI/BookBrowser.cpp +++ b/src/MainUI/BookBrowser.cpp @@ -183,6 +183,7 @@ void BookBrowser::SelectResources(QList<Resource *> resources) void BookBrowser::SelectRenamedResource() { + qDebug() << "In SelectRenamedResource"; if (m_RenamedResource == NULL) { return; } @@ -190,6 +191,7 @@ void BookBrowser::SelectRenamedResource() // Set the selection to the resource that was being renamed UpdateSelection(m_RenamedResource); // Make sure Book Browser has focus so keyboard navigation works as expected + qDebug() << "setting focus"; qobject_cast<QWidget *>(m_TreeView)->setFocus(); m_RenamedResource = NULL; } Last edited by KevinH; 03-16-2022 at 01:41 PM. |
03-16-2022, 06:12 PM | #43 |
Evangelist
Posts: 425
Karma: 77256
Join Date: Sep 2011
Device: none
|
Sigil Requested Changes Under Consideration post Sigil-1.9.2
Many thanks Kevin. Will give it a try.
As far as regex rename, missed that. I’ll give it a try next time. It might help in some cases. Last edited by democrite; 03-16-2022 at 07:21 PM. |
03-17-2022, 05:53 PM | #44 |
Evangelist
Posts: 425
Karma: 77256
Join Date: Sep 2011
Device: none
|
Kevin,
Apologies as I haven’t had a chance to try the patch. I was looking around a bit about focus lost on refresh. A few posts might help. This is one though I’m not sure if that works or is the best method. Maybe handling it in the function that does renames? Some event listener? https://stackoverflow.com/questions/...fresh/24716251 |
03-17-2022, 06:44 PM | #45 |
Sigil Developer
Posts: 7,714
Karma: 5444398
Join Date: Nov 2009
Device: many
|
That link is not Qt.
No, this is a race between two signals, one updating and reloading the opf, xhtml links, etc, and the other in BookBrowser to explicitly set focus. The patch is the thing to try. If that helps, I can add a short delay timer. Last edited by KevinH; 03-17-2022 at 07:11 PM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Possible To-Do List for Future Sigil Releases Post Sigil 1.8 | KevinH | Sigil | 143 | 02-05-2022 12:08 PM |
Icon Redesign for future 1.0 Release of Sigil | shorshe | Sigil | 38 | 06-06-2016 11:29 PM |
Sigil on Nook vs Sigil on Kobo vs Sigil on iBook | rosshalde | Sigil | 12 | 11-13-2014 09:34 AM |
Sigil’s Future Direction (Post 0.4.x) | user_none | Sigil | 90 | 10-11-2011 03:28 PM |
Sigil's Future | crutledge | Sigil | 36 | 07-26-2011 06:02 PM |