View Single Post
Old 01-20-2018, 11:15 AM   #7
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,716
Karma: 205039118
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
I am still not sure if I understand the issue. I view all input plugins as equivalent to the user opening an .epub file in Sigil, and all output plugins as equivalent to the user doing a Save-As inside Sigil.

Doing a Save-as is basically telling Sigil to take the current state inside Sigil (not what is in the .epub file itself) and save it. That is how I view output plugins.
Not quite. A Save-As saves the current state to a new epub AND updates Sigil's current content with that of the new saved epub. The new epub is saved and the epub open in sigil is in a saved state that matches. Nothing is left in a dirty state with a Save As. An output plugin currently saves a new document (or folder in this case), but maintains it's current content connected to its previous save location. If the current content was unsaved before, it is still unsaved after. But that's neither here nor there RE my suggestion.

Quote:
Originally Posted by KevinH View Post
Then the question becomes, should the successful completion of an output plugin clear the "dirty" flag. My thoughts were no since that flag just is there to protect the .epub file from lost changes to it.
My thoughts are no, too. My suggestion has nothing to do with altering the current contents of the epub Sigil has open, or the saving of, or the clearing of Sigil's dirty flag. It has everything to with allowing a plugin to know that Sigil's dirty flag IS set.

Quote:
Originally Posted by KevinH View Post
As for running output plugins when the user has unsaved changes, I am happy it does, as it is equivalent to a Save-As. I would not want the user to have to do a Save or Save-as inside Sigil just to run an output plugin that should effectively be doing the same thing.
I'm happy it does that, too (though I've already pointed out the slight discrepancies to the "Save As" analogy). I'm talking about merely warning the user that their epub has unsaved edits before running the output plugin; not stopping them from running the plugin.

If you don't think your output plugin needs such a warning, then that's your choice. I merely thought it might be handy in case people hadn't noticed their epub had unsaved edits before they exported via FolderOut. But regardless of all that, I still find it reasonable that other plugin devs might want to know Sigil's dirty flag is set before processing anything.

Last edited by DiapDealer; 01-20-2018 at 11:30 AM.
DiapDealer is offline   Reply With Quote