Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 08-11-2021, 12:46 PM   #16
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,630
Karma: 5433388
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by DiapDealer View Post
I agree. I don't know how feasible it would be, but the ability to continue (ignore) or abort in the event of a validation error would be optimal, I think.
So hopefully something along these lines:

Code:
bool MainWindow::Automate(const QStringList &commands)
{
    PluginDB *pdb = PluginDB::instance();
    QHash<QString, Plugin *> plugins = pdb->all_plugins();
    QStringList plugin_names = plugins.keys();

    foreach(QString cmd , commands) {
        bool success = false;
        QString plugin_type;
        int validation_error_count = 0;
        if (plugin_names.contains(cmd)) {
            ShowMessageOnStatusBar(cmd + " " + tr("running"));
            PluginRunner prunner(m_TabManager, this);
            prunner.exec(cmd);

            qApp->processEvents();

            success = prunner.getResult() == "success";
            plugin_type = prunner.getPluginType();
            if (plugin_type == "validation") {
                validation_error_count = prunner.getValidationErrorCount();
            }
        } else {
            ShowMessageOnStatusBar(tr("Missing or unknown plugin") + ": " + cmd);
            break;
        }
        if (!success) {
            ShowMessageOnStatusBar(cmd + " " + tr("failed"));
            break;
        }
        if (plugin_type == "validation" && (validation_error_count != 0)) {
            // Try to pause to see if can ignore or not in a non-modal way
            ShowMessageOnStatusBar(tr("Validation Plugin Found Errors") + ": " + cmd);
            QMessageBox msgBox;
            msgBox.setText(tr("Validation found errors - Abort or Ignore?"))
            QPushButton * abortButton = msgBox.addButton(QMessageBox::Abort);
            QPushButton * ignoreButton = msgBox.addButton(QMessageBox::Ignore);
            msgBox.show();
            if (msgBox.clickedButton() != ignoreButton) {
                break;
            }
        }
    
        qApp->processEvents();
    }
}
Not sure if this will even compile and that a non-Modal QMessageBox is even possible. But if so, the user can then decide to fix the validation errors before deciding on ignore or abort.

We then add 3 new icons and an automate toolbar to parse the 3 different automate0x.txt scripts and pass the results to the Automate routine above for processing.

Maybe?
KevinH is offline   Reply With Quote
Old 08-11-2021, 01:15 PM   #17
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,630
Karma: 5433388
Join Date: Nov 2009
Device: many
If this approach works we can look up individual commands in a list of MainWindow tools and run those tools as well so that a mixed list of plugins and tools can be run.

We would still need to modify all MainWindow C++ tools we want to allow to return success or failure similar to how we do with plugins and that would take more than a bit of work.

And then if that works finally design a dialog using checks to enable selections from a list of plugins and commands and perhaps some drag and drop to create an order that could be used to create the automate0x.txt lists.

But let's start simple with 3 lists of plugins edited by the user and see if this approach proves at all useful in the end.
KevinH is offline   Reply With Quote
Advert
Old 08-11-2021, 01:22 PM   #18
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,630
Karma: 5433388
Join Date: Nov 2009
Device: many
As for toolbar icons for the 3 Automate lists, how about a little robot person with a 1, 2, or 3 beside him/her in the svg icon?

Other suggestions welcome!

Donations of artwork once decided upon welcome as well. Perhaps we can convince BeckyEbook to help us here again once we figure out an idea!

Last edited by KevinH; 08-11-2021 at 01:33 PM.
KevinH is offline   Reply With Quote
Old 08-11-2021, 04:29 PM   #19
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,307
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Sounds good to me.
DNSB is offline   Reply With Quote
Old 08-11-2021, 09:44 PM   #20
Thasaidon
Hedge Wizard
Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.
 
Thasaidon's Avatar
 
Posts: 800
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
I would love such a feature.

I have tried to reproduce it in the past using various freeware macro programs, I usually could get them working but they were fragile and needed constant maintenance.
Thasaidon is offline   Reply With Quote
Advert
Old 08-12-2021, 05:41 AM   #21
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 689
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Kindle (Key3, PW2, PW3), Nook (ST, GLP), Kobo Touch, Tolino Vision 2
Working suggestions.

If any proposal will appeal – I will refine and prepare the final versions.
Attached Images
    
Attached Files
File Type: zip automate.zip (10.4 KB, 135 views)
BeckyEbook is online now   Reply With Quote
Old 08-12-2021, 08:17 AM   #22
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,630
Karma: 5433388
Join Date: Nov 2009
Device: many
I like them all! Thank you!

I do think the robot arm icon is the easier to read and understand. It seems to best represent the automation concept.

Does there already exist something appropriate for fluent and material icons we can use or would you refine one of these to match those sets?

Last edited by KevinH; 08-12-2021 at 08:19 AM.
KevinH is offline   Reply With Quote
Old 08-12-2021, 09:24 AM   #23
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 689
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Kindle (Key3, PW2, PW3), Nook (ST, GLP), Kobo Touch, Tolino Vision 2
I will prepare automate icons for all themes in next week.
BeckyEbook is online now   Reply With Quote
Old 08-12-2021, 09:26 AM   #24
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,630
Karma: 5433388
Join Date: Nov 2009
Device: many
Thank you!

Quote:
Originally Posted by BeckyEbook View Post
I will prepare automate icons for all themes in next week.
KevinH is offline   Reply With Quote
Old 08-12-2021, 10:17 AM   #25
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,630
Karma: 5433388
Join Date: Nov 2009
Device: many
Okay, I took the code pieces I had and BeckyEbook's robotic arm svg, and pushed to master a rough proof of concept for using automate lists of plugin names.

It only works with the main icon theme right now since it is just a proof of concept.

Sigil adds a Automate toolbar with 3 automate icons. These can have keyboard shortcuts assigned.

To use it, the user needs to create a list of plugin names (no version or .zip) one per line using any text editor and save the file as utf-8.

A '#' can be used to comment out a line.

And then save it in your Sigil Prefs directory under:

automate01.txt
automate02.txt
automate03.txt

I have tried to make the validation with errors block but still be non-modal so that errors can be fixed before choosing ignore or abort. But this may open a kettle of fish as it will be easy to lose the fact that a automation list is still in progress.

If you build your own, bug reports welcome.

If this appears to be useful, we will eventually expand the known commands to include some primary C++ based Sigil tools and then create a dialog to make it simple to edit and create these lists without having to use a separate text editor. Perhaps even making a plugin to edit these automation lists.

Last edited by KevinH; 08-12-2021 at 11:17 AM.
KevinH is offline   Reply With Quote
Old 08-12-2021, 10:20 AM   #26
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,779
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by KevinH View Post
I like them all! Thank you!

I do think the robot arm icon is the easier to read and understand. It seems to best represent the automation concept.

Does there already exist something appropriate for fluent and material icons we can use or would you refine one of these to match those sets?
The Robot arm was my choice also.
Gears, spanners are commonly used for settings
theducks is offline   Reply With Quote
Old 08-12-2021, 11:31 AM   #27
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,630
Karma: 5433388
Join Date: Nov 2009
Device: many
If anyone gives this a try, remember the plugin names used in the list must exactly match the plugin names as set in the Plugin menus. All are case sensitive.
KevinH is offline   Reply With Quote
Old 08-12-2021, 06:56 PM   #28
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,550
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
FWIW - Becky's first variant is the closest to the original cover of Asimov's "I Robot".

Click image for larger version

Name:	1.jpg
Views:	147
Size:	39.2 KB
ID:	188664

BR
BetterRed is offline   Reply With Quote
Old 08-13-2021, 10:54 AM   #29
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,630
Karma: 5433388
Join Date: Nov 2009
Device: many
FYI, I started the process of making selected tools from the MainWindow return values so that they can be used in the automate lists:

Right now these include:
  • UpdateManifestProperties
  • Save
  • WellFormedCheckEpub
  • MendPrettifyHTML
  • MendHTML
  • ValidateStylesheetsWithW3C
  • RepoCommit (Checkpoint)
  • GenerateNCXGuideFromNav
  • RemoveNCXGuideFromEpub3
  • DeleteUnusedMedia
  • DeleteUnusedStyles
  • StandardizeEpub (Restructure Epub to Sigil Norm)
  • SplitOnSGFSectionMarkers
  • AddCover

This leads to a couple of questions:

1. How should we deal with intl Sigil user/devs in these automate lists if at all?
In other words should we be treating them like shell/bat commands which are all English based like most programming and scripting languages?

2. Should shorthand notations for automate commands instead of actual C++ routine names (as provided above) be used (think unix like short command line tools)

3. How to deal with non-modal dialogs like Search Editor / SpellCheck, Edit TOC, Reports, Edit Metadata, etc? Should we wait until these dialogs are closed by the user before proceeding to the next command in the automate list?

4. How to deal with running a specifically named saved searches with replace? Or do we punt on this and require a plugin to do those types of things in an automated setting.

Perhaps the best way to deal with this is to make a mac/Win builds available for testers to report back before going any further. If these features turn out not to be that usable for real power users/devs it will end up being a waste of time for little to no gain.

Any Thoughts?

Last edited by KevinH; 08-14-2021 at 12:06 PM.
KevinH is offline   Reply With Quote
Old 08-13-2021, 12:11 PM   #30
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 689
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Kindle (Key3, PW2, PW3), Nook (ST, GLP), Kobo Touch, Tolino Vision 2
Ad 1. English names will be the best. translations sometimes change, not complete, etc., so it's asking for trouble. The Automate option is intended for advanced users, so creating "automateXX.txt" script with English names should be OK.

Ad 2. If it is well described in the documentation – a good idea.

Ad 3. Of course, we wait until these dialogs are closed.

Ad 4. Hmmm ... A difficult matter, because in Saved Searches we can do various actions: Find, Replace, Replace/Find, Replace All.

Maybe something as:
* "F&R-Find:GroupNameFromSavedSearches" (calling a search in the whole group, probably quote marks will be necessary)

* "F&R-ReplaceAll:GroupNameFromSavedSearches/Single Sample Replace" (Replace All In Single Search In Saved Searches)

-----

I would add an optional AutomateXX operation report (message box? logfile?):
Code:
Function Name or Plugin Name 1: passed
Function Name or Plugin Name 2: passed
Function Name or Plugin Name 3: passed with errors
Aborted by user
Personally, I built a new version and played around with this option (only plugins so far).
Despite my earlier doubts, it might come in handy for some repetitive operations on each file.

That's why I noticed that I missed a summary/report in which I could see that all the plugins "did their job" without errors. Now I have to look at the statusbar, because it is probably only there that we can see what is going on.
BeckyEbook is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Feature requested for Sigil 1.7 RbnJrg Sigil 23 08-06-2021 08:44 AM
Feature Requests for Adding Books toomuchreading Library Management 5 03-17-2015 03:15 PM
Parity feature with Sigil roger64 Editor 8 03-17-2014 11:28 AM
New to "Read in Store" feature: Limited Selection negris123 Barnes & Noble NOOK 4 06-09-2011 01:08 PM
New Inkmesh Feature: Limited Time Free Ebooks anurag News 11 02-25-2010 02:43 PM


All times are GMT -4. The time now is 04:51 AM.


MobileRead.com is a privately owned, operated and funded community.