diff --git a/Common/DaisyAddinLib/ConverterSettingsForm.cs b/Common/DaisyAddinLib/ConverterSettingsForm.cs index a5807af..542bf1c 100644 --- a/Common/DaisyAddinLib/ConverterSettingsForm.cs +++ b/Common/DaisyAddinLib/ConverterSettingsForm.cs @@ -100,6 +100,90 @@ public ConverterSettingsForm() {"Brazil Southeast", "brazilsoutheast"}, }; + private static readonly Dictionary AzureRegionRevertDictionnary = new Dictionary() { + {"" , ""}, + {"eastus", "East US"}, + {"eastus2", "East US 2"}, + {"southcentralus", "South Central US"}, + {"westus2", "West US 2"}, + {"westus3", "West US 3"}, + {"australiaeast", "Australia East"}, + {"southeastasia", "Southeast Asia"}, + {"northeurope", "North Europe"}, + {"swedencentral", "Sweden Central"}, + {"uksouth", "UK South"}, + {"westeurope", "West Europe"}, + {"centralus", "Central US"}, + {"southafricanorth", "South Africa North"}, + {"centralindia", "Central India"}, + {"eastasia", "East Asia"}, + {"japaneast", "Japan East"}, + {"koreacentral", "Korea Central"}, + {"canadacentral", "Canada Central"}, + {"francecentral", "France Central"}, + {"germanywestcentral", "Germany West Central"}, + {"norwayeast", "Norway East"}, + {"switzerlandnorth", "Switzerland North"}, + {"uaenorth", "UAE North"}, + {"brazilsouth", "Brazil South"}, + {"centraluseuap", "Central US EUAP"}, + {"eastus2euap", "East US 2 EUAP"}, + {"qatarcentral", "Qatar Central"}, + {"centralusstage", "Central US (Stage)"}, + {"eastusstage", "East US (Stage)"}, + {"eastus2stage", "East US 2 (Stage)"}, + {"northcentralusstage", "North Central US (Stage)"}, + {"southcentralusstage", "South Central US (Stage)"}, + {"westusstage", "West US (Stage)"}, + {"westus2stage", "West US 2 (Stage)"}, + {"asia", "Asia"}, + {"asiapacific", "Asia Pacific"}, + {"australia", "Australia"}, + {"brazil", "Brazil"}, + {"canada", "Canada"}, + {"europe", "Europe"}, + {"france", "France"}, + {"germany", "Germany"}, + {"global", "Global"}, + {"india", "India"}, + {"japan", "Japan"}, + {"korea", "Korea"}, + {"norway", "Norway"}, + {"singapore", "Singapore"}, + {"southafrica", "South Africa"}, + {"switzerland", "Switzerland"}, + {"uae", "United Arab Emirates"}, + {"uk", "United Kingdom"}, + {"unitedstates", "United States"}, + {"unitedstateseuap", "United States EUAP"}, + {"eastasiastage", "East Asia (Stage)"}, + {"southeastasiastage", "Southeast Asia (Stage)"}, + {"brazilus", "Brazil US"}, + {"eastusstg", "East US STG"}, + {"northcentralus", "North Central US"}, + {"westus", "West US"}, + {"jioindiawest", "Jio India West"}, + {"devfabric", "devfabric"}, + {"westcentralus", "West Central US"}, + {"southafricawest", "South Africa West"}, + {"australiacentral", "Australia Central"}, + {"australiacentral2", "Australia Central 2"}, + {"australiasoutheast", "Australia Southeast"}, + {"japanwest", "Japan West"}, + {"jioindiacentral", "Jio India Central"}, + {"koreasouth", "Korea South"}, + {"southindia", "South India"}, + {"westindia", "West India"}, + {"canadaeast", "Canada East"}, + {"francesouth", "France South"}, + {"germanynorth", "Germany North"}, + {"norwaywest", "Norway West"}, + {"switzerlandwest", "Switzerland West"}, + {"ukwest", "UK West"}, + {"uaecentral", "UAE Central"}, + {"brazilsoutheast", "Brazil Southeast"}, + }; + private void Daisysettingsfrm_Load(object sender, EventArgs e) { notesNumberingStartValue.Mask = "000"; @@ -177,6 +261,9 @@ private void Daisysettingsfrm_Load(object sender, EventArgs e) notesNumberingStartValue.Text = GlobaleSettings.FootnotesStartValue.ToString(); notesNumberPrefixValue.Text = GlobaleSettings.FootnotesNumberingPrefix; notesNumberSuffixValue.Text = GlobaleSettings.FootnotesNumberingSuffix; + TTSConfigFilePath.Text = GlobaleSettings.TTSConfigFile; + AzureKeyValue.Text = GlobaleSettings.AzureSpeechKey; + AzureRegionValue.SelectedItem = AzureRegionRevertDictionnary[GlobaleSettings.AzureSpeechRegion ?? ""]; this.notesNumberingStartValue.Enabled = notesNumberingMap[(string)notesNumberingSelector.SelectedItem] == ConverterSettings.FootnotesNumberingChoice.Enum.Number; @@ -323,5 +410,13 @@ private void notesNumberingSelector_SelectedIndexChanged(object sender, EventArg this.notesNumberingStartValue.Enabled = notesNumberingMap[(string)notesNumberingSelector.SelectedItem] == ConverterSettings.FootnotesNumberingChoice.Enum.Number; } + private void TTSConfigFileBrowse_Click(object sender, EventArgs e) + { + if (TTSConfigFileSelect.ShowDialog(this) == DialogResult.OK) { + if(TTSConfigFileSelect.FileName.Length > 0) { + GlobaleSettings.TTSConfigFile = TTSConfigFilePath.Text = TTSConfigFileSelect.FileName; + } + }; + } } } \ No newline at end of file diff --git a/Common/DaisyAddinLib/ConverterSettingsForm.designer.cs b/Common/DaisyAddinLib/ConverterSettingsForm.designer.cs index 292230e..e7822b7 100644 --- a/Common/DaisyAddinLib/ConverterSettingsForm.designer.cs +++ b/Common/DaisyAddinLib/ConverterSettingsForm.designer.cs @@ -89,13 +89,14 @@ private void InitializeComponent() this.notesNumberSuffixLabel = new System.Windows.Forms.Label(); this.notesNumberSuffixValue = new System.Windows.Forms.TextBox(); this.TextToSpeechBox = new System.Windows.Forms.GroupBox(); - this.TTSConfigFileLabel = new System.Windows.Forms.Label(); - this.TTSConfigFilePath = new System.Windows.Forms.TextBox(); - this.TTSConfigFileBrowse = new System.Windows.Forms.Button(); - this.AzureRegionLabel = new System.Windows.Forms.Label(); - this.AzureRegionValue = new System.Windows.Forms.ComboBox(); - this.AzureKeyLabel = new System.Windows.Forms.Label(); this.AzureKeyValue = new System.Windows.Forms.TextBox(); + this.AzureKeyLabel = new System.Windows.Forms.Label(); + this.AzureRegionValue = new System.Windows.Forms.ComboBox(); + this.AzureRegionLabel = new System.Windows.Forms.Label(); + this.TTSConfigFileBrowse = new System.Windows.Forms.Button(); + this.TTSConfigFilePath = new System.Windows.Forms.TextBox(); + this.TTSConfigFileLabel = new System.Windows.Forms.Label(); + this.TTSConfigFileSelect = new System.Windows.Forms.OpenFileDialog(); this.grpbox_pgnum.SuspendLayout(); this.grpbox_charstyles.SuspendLayout(); this.grpbox_ImageSizes.SuspendLayout(); @@ -311,26 +312,15 @@ private void InitializeComponent() this.TextToSpeechBox.Name = "TextToSpeechBox"; this.TextToSpeechBox.TabStop = false; // - // TTSConfigFileLabel - // - resources.ApplyResources(this.TTSConfigFileLabel, "TTSConfigFileLabel"); - this.TTSConfigFileLabel.Name = "TTSConfigFileLabel"; - // - // TTSConfigFilePath - // - resources.ApplyResources(this.TTSConfigFilePath, "TTSConfigFilePath"); - this.TTSConfigFilePath.Name = "TTSConfigFilePath"; - // - // TTSConfigFileBrowse + // AzureKeyValue // - resources.ApplyResources(this.TTSConfigFileBrowse, "TTSConfigFileBrowse"); - this.TTSConfigFileBrowse.Name = "TTSConfigFileBrowse"; - this.TTSConfigFileBrowse.UseVisualStyleBackColor = true; + resources.ApplyResources(this.AzureKeyValue, "AzureKeyValue"); + this.AzureKeyValue.Name = "AzureKeyValue"; // - // AzureRegionLabel + // AzureKeyLabel // - resources.ApplyResources(this.AzureRegionLabel, "AzureRegionLabel"); - this.AzureRegionLabel.Name = "AzureRegionLabel"; + resources.ApplyResources(this.AzureKeyLabel, "AzureKeyLabel"); + this.AzureKeyLabel.Name = "AzureKeyLabel"; // // AzureRegionValue // @@ -421,15 +411,32 @@ private void InitializeComponent() resources.GetString("AzureRegionValue.Items80")}); this.AzureRegionValue.Name = "AzureRegionValue"; // - // AzureKeyLabel + // AzureRegionLabel // - resources.ApplyResources(this.AzureKeyLabel, "AzureKeyLabel"); - this.AzureKeyLabel.Name = "AzureKeyLabel"; + resources.ApplyResources(this.AzureRegionLabel, "AzureRegionLabel"); + this.AzureRegionLabel.Name = "AzureRegionLabel"; // - // AzureKeyValue + // TTSConfigFileBrowse // - resources.ApplyResources(this.AzureKeyValue, "AzureKeyValue"); - this.AzureKeyValue.Name = "AzureKeyValue"; + resources.ApplyResources(this.TTSConfigFileBrowse, "TTSConfigFileBrowse"); + this.TTSConfigFileBrowse.Name = "TTSConfigFileBrowse"; + this.TTSConfigFileBrowse.UseVisualStyleBackColor = true; + this.TTSConfigFileBrowse.Click += new System.EventHandler(this.TTSConfigFileBrowse_Click); + // + // TTSConfigFilePath + // + resources.ApplyResources(this.TTSConfigFilePath, "TTSConfigFilePath"); + this.TTSConfigFilePath.Name = "TTSConfigFilePath"; + // + // TTSConfigFileLabel + // + resources.ApplyResources(this.TTSConfigFileLabel, "TTSConfigFileLabel"); + this.TTSConfigFileLabel.Name = "TTSConfigFileLabel"; + // + // TTSConfigFileSelect + // + this.TTSConfigFileSelect.FileName = "SelectedTTSConfigFile"; + resources.ApplyResources(this.TTSConfigFileSelect, "TTSConfigFileSelect"); // // ConverterSettingsForm // @@ -438,11 +445,11 @@ private void InitializeComponent() this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.btnCancel; this.Controls.Add(this.FootnotesBox); - this.Controls.Add(this.btnCancel); this.Controls.Add(this.grpbox_ImageSizes); this.Controls.Add(this.grpbox_charstyles); this.Controls.Add(this.grpbox_pgnum); this.Controls.Add(this.TextToSpeechBox); + this.Controls.Add(this.btnCancel); this.Controls.Add(this.btn_ok); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.MaximizeBox = false; @@ -498,5 +505,6 @@ private void InitializeComponent() private System.Windows.Forms.ComboBox AzureRegionValue; private System.Windows.Forms.Label AzureKeyLabel; private System.Windows.Forms.TextBox AzureKeyValue; + private System.Windows.Forms.OpenFileDialog TTSConfigFileSelect; } } \ No newline at end of file diff --git a/Common/DaisyAddinLib/ConverterSettingsForm.resx b/Common/DaisyAddinLib/ConverterSettingsForm.resx index 38461b3..60a087e 100644 --- a/Common/DaisyAddinLib/ConverterSettingsForm.resx +++ b/Common/DaisyAddinLib/ConverterSettingsForm.resx @@ -337,7 +337,7 @@ Bottom, Right - 422, 613 + 531, 636 4, 4, 4, 4 @@ -376,7 +376,7 @@ 4, 4, 4, 4 - 623, 59 + 747, 74 11 @@ -394,7 +394,7 @@ $this - 4 + 3 Top, Left, Right @@ -409,7 +409,7 @@ 4, 4, 4, 4 - 623, 58 + 747, 73 12 @@ -427,7 +427,7 @@ $this - 3 + 2 Top, Left, Right @@ -442,7 +442,7 @@ 4, 4, 4, 4 - 623, 124 + 747, 155 13 @@ -460,13 +460,13 @@ $this - 2 + 1 Bottom, Right - 531, 613 + 423, 636 4, 4, 4, 4 @@ -490,7 +490,7 @@ $this - 1 + 5 Top, Left, Right @@ -643,7 +643,7 @@ 7, 277 - 623, 199 + 639, 199 15 @@ -706,7 +706,7 @@ 110, 21 - 500, 24 + 514, 24 0 @@ -784,7 +784,7 @@ 110, 51 - 500, 24 + 514, 24 3 @@ -847,7 +847,7 @@ 128, 81 - 482, 24 + 496, 24 5 @@ -907,7 +907,7 @@ 000 - 482, 22 + 496, 22 12 @@ -958,7 +958,7 @@ 128, 139 - 482, 22 + 496, 22 8 @@ -1012,7 +1012,7 @@ 128, 169 - 482, 22 + 496, 22 9 @@ -1048,7 +1048,7 @@ * - 470, 22 + 471, 22 6 @@ -1078,7 +1078,7 @@ 5, 88 - 120, 20 + 96, 16 5 @@ -1111,250 +1111,250 @@ - East US + Asia - East US 2 + Asia Pacific - South Central US + Australia - West US 2 + Australia Central - West US 3 + Australia Central 2 Australia East - Southeast Asia + Australia Southeast - North Europe + Brazil - Sweden Central + Brazil South - UK South + Brazil Southeast - West Europe + Brazil US - Central US + Canada - South Africa North + Canada Central - Central India + Canada East - East Asia + Central India - Japan East + Central US - Korea Central + Central US (Stage) - Canada Central + Central US EUAP - France Central + devfabric - Germany West Central + East Asia - Norway East + East Asia (Stage) - Switzerland North + East US - UAE North + East US (Stage) - Brazil South + East US 2 - Central US EUAP + East US 2 (Stage) East US 2 EUAP - Qatar Central + East US STG - Central US (Stage) + Europe - East US (Stage) + France - East US 2 (Stage) + France Central - North Central US (Stage) + France South - South Central US (Stage) + Germany - West US (Stage) + Germany North - West US 2 (Stage) + Germany West Central - Asia + Global - Asia Pacific + India - Australia + Japan - Brazil + Japan East - Canada + Japan West - Europe + Jio India Central - France + Jio India West - Germany + Korea - Global + Korea Central - India + Korea South - Japan + North Central US - Korea + North Central US (Stage) - Norway + North Europe - Singapore + Norway - South Africa + Norway East - Switzerland + Norway West - United Arab Emirates + Qatar Central - United Kingdom + Singapore - United States + South Africa - United States EUAP + South Africa North - East Asia (Stage) + South Africa West - Southeast Asia (Stage) + South Central US - Brazil US + South Central US (Stage) - East US STG + South India - North Central US + Southeast Asia - West US + Southeast Asia (Stage) - Jio India West + Sweden Central - devfabric + Switzerland - West Central US + Switzerland North - South Africa West + Switzerland West - Australia Central + UAE Central - Australia Central 2 + UAE North - Australia Southeast + UK South - Japan West + UK West - Jio India Central + United Arab Emirates - Korea South + United Kingdom - South India + United States - West India + United States EUAP - Canada East + West Central US - France South + West Europe - Germany North + West India - Norway West + West US - Switzerland West + West US (Stage) - UK West + West US 2 - UAE Central + West US 2 (Stage) - Brazil Southeast + West US 3 140, 53 - 470, 24 + 471, 24 4 @@ -1402,7 +1402,7 @@ Top, Right - 521, 24 + 522, 24 89, 23 @@ -1432,7 +1432,7 @@ 140, 25 - 375, 22 + 376, 22 1 @@ -1486,7 +1486,7 @@ 7, 482 - 623, 121 + 624, 121 16 @@ -1504,7 +1504,16 @@ $this - 5 + 4 + + + 17, 17 + + + TTS config (*.xml)|*.xml + + + Select a TTS configuration file True @@ -1513,7 +1522,7 @@ 8, 16 - 643, 654 + 643, 677 4, 4, 4, 4 @@ -1530,6 +1539,12 @@ SaveAsDAISY Settings + + TTSConfigFileSelect + + + System.Windows.Forms.OpenFileDialog, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + ConverterSettingsForm diff --git a/Common/DaisyAddinLib/GraphicalEventsHandler.cs b/Common/DaisyAddinLib/GraphicalEventsHandler.cs index edbf2fa..45a64cb 100644 --- a/Common/DaisyAddinLib/GraphicalEventsHandler.cs +++ b/Common/DaisyAddinLib/GraphicalEventsHandler.cs @@ -12,268 +12,345 @@ using static Daisy.SaveAsDAISY.ConversionProgress; using MSword = Microsoft.Office.Interop.Word; -namespace Daisy.SaveAsDAISY { +namespace Daisy.SaveAsDAISY +{ /// /// Conversion events handler using graphical interface (windows dialog) /// - public class GraphicalEventsHandler : IConversionEventsHandler - { - + public class GraphicalEventsHandler : IConversionEventsHandler + { #region Conversion progress dialog public ConversionProgress ProgressDialog { get; set; } public Thread DialogThread { get; set; } = null; public void TryInitializeProgress(string message, int maximum = 1, int step = 1) { - if(ProgressDialog != null && !ProgressDialog.IsDisposed) + if (ProgressDialog != null && !ProgressDialog.IsDisposed) { if ((DialogThread == null || !DialogThread.IsAlive)) { - DialogThread = new Thread( - () => { - ProgressDialog.ShowDialog(); - ProgressDialog.InitializeProgress(message, maximum, step); - }); + DialogThread = new Thread(() => + { + ProgressDialog.ShowDialog(); + ProgressDialog.InitializeProgress(message, maximum, step); + }); DialogThread.Start(); - while (!ProgressDialog.Visible) ; + while (!ProgressDialog.Visible) + ; } else { ProgressDialog.InitializeProgress(message, maximum, step); } } - } - private void TryShowMessage(string message, bool isProgress = false) { - if(ProgressDialog != null && !ProgressDialog.IsDisposed) + private void TryShowMessage(string message, bool isProgress = false) + { + if (ProgressDialog != null && !ProgressDialog.IsDisposed) { if ((DialogThread == null || !DialogThread.IsAlive)) { - DialogThread = new Thread( - () => { - ProgressDialog.ShowDialog(); - ProgressDialog.AddMessage(message, isProgress); - if (isProgress) ProgressDialog.Progress(); - }); + DialogThread = new Thread(() => + { + ProgressDialog.ShowDialog(); + ProgressDialog.AddMessage(message, isProgress); + if (isProgress) + ProgressDialog.Progress(); + }); DialogThread.Start(); - while (!ProgressDialog.Visible) ; + while (!ProgressDialog.Visible) + ; } else // Is already started and dialog is visible { ProgressDialog.AddMessage(message, isProgress); - if (isProgress) ProgressDialog.Progress(); + if (isProgress) + ProgressDialog.Progress(); } - } - } - private void TryClosingDialog() { + private void TryClosingDialog() + { +#if !DEBUG // keep the dialog opened for debugging if (DialogThread != null && DialogThread.IsAlive) { Thread.Sleep(2000); ProgressDialog.Close(); DialogThread.Join(); } +#endif } - #endregion - - public GraphicalEventsHandler() { +#endregion - } + public GraphicalEventsHandler() { } - public void LinkToProgressDialog(ref ConversionProgress progressDialog, int maximumValue = 2) { + public void LinkToProgressDialog( + ref ConversionProgress progressDialog, + int maximumValue = 2 + ) + { this.ProgressDialog = progressDialog; } - - #region Preprocessing - public void onDocumentPreprocessingStart(string inputPath) { + public void onDocumentPreprocessingStart(string inputPath) + { // Intialize progress bar for preprocessing (7 steps) TryInitializeProgress("Preprocessing " + inputPath, 7); - } - public void onPreprocessingCancel() { + public void onPreprocessingCancel() + { TryShowMessage("Preprocessing canceled "); TryClosingDialog(); } - public void onPreprocessingError(string inputPath, string errors) { + public void onPreprocessingError(string inputPath, string errors) + { + AddinLogger.Error("Some errors were reported during preprocessing: \r\n" + errors); TryShowMessage("Some errors were reported during preprocessing: \r\n" + errors); - MessageBox.Show(errors, "Preprocessing errors", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show( + errors, + "Preprocessing errors", + MessageBoxButtons.OK, + MessageBoxIcon.Error + ); } - public void onPreprocessingSuccess() { + public void onPreprocessingSuccess() + { TryShowMessage("Preprocessing done", true); } - public bool AskForTrackConfirmation() { - return MessageBox.Show(Labels.TrackConfirmation, "SaveAsDAISY", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes; + public bool AskForTrackConfirmation() + { + return MessageBox.Show( + Labels.TrackConfirmation, + "SaveAsDAISY", + MessageBoxButtons.YesNo, + MessageBoxIcon.Information + ) == DialogResult.Yes; } - public DialogResult documentMustBeRenamed(StringValidator authorizedNamePattern) { - string BoxText = authorizedNamePattern.UnauthorizedValueMessage + - "\r\n" + - "\r\nDo you want to save this document under a new name ?" + - "\r\nThe document with the original name will not be deleted." + - "\r\n" + - "\r\n(Click Yes to save the document under a new name and use the new one, " + - "No to continue with the current document, " + - "or Cancel to abort the conversion)"; - return MessageBox.Show(BoxText, "Unauthorized characters in the document filename", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning); + public DialogResult documentMustBeRenamed(StringValidator authorizedNamePattern) + { + string BoxText = + authorizedNamePattern.UnauthorizedValueMessage + + "\r\n" + + "\r\nDo you want to save this document under a new name ?" + + "\r\nThe document with the original name will not be deleted." + + "\r\n" + + "\r\n(Click Yes to save the document under a new name and use the new one, " + + "No to continue with the current document, " + + "or Cancel to abort the conversion)"; + return MessageBox.Show( + BoxText, + "Unauthorized characters in the document filename", + MessageBoxButtons.YesNoCancel, + MessageBoxIcon.Warning + ); } - public bool userIsRenamingDocument(ref object preprocessedObject) { + public bool userIsRenamingDocument(ref object preprocessedObject) + { object missing = Type.Missing; - MSword.Dialog dlg = ((MSword.Document)preprocessedObject).Application.Dialogs[MSword.WdWordDialog.wdDialogFileSaveAs]; + MSword.Dialog dlg = ((MSword.Document)preprocessedObject).Application.Dialogs[ + MSword.WdWordDialog.wdDialogFileSaveAs + ]; int saveResult = dlg.Show(ref missing); return saveResult == -1; // ok pressed, see https://docs.microsoft.com/fr-fr/dotnet/api/microsoft.office.interop.word.dialog.show?view=word-pia#Microsoft_Office_Interop_Word_Dialog_Show_System_Object__ } - public bool AskForTranslatingSubdocuments() { - DialogResult dialogResult = MessageBox.Show("Do you want to translate the current document along with sub documents?", "SaveAsDAISY", MessageBoxButtons.YesNo, MessageBoxIcon.Information); + public bool AskForTranslatingSubdocuments() + { + DialogResult dialogResult = MessageBox.Show( + "Do you want to translate the current document along with sub documents?", + "SaveAsDAISY", + MessageBoxButtons.YesNo, + MessageBoxIcon.Information + ); return dialogResult == DialogResult.Yes; } #endregion public void OnStop(string message) - { - OnStop(message,"SaveAsDAISY"); - } - - public void OnError(string errorMessage) - { - TryShowMessage("An error occured during conversion: \r\n" + errorMessage); - MessageBox.Show(errorMessage, "An error occured during conversion", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - - public void OnStop(string message, string title) - { - TryShowMessage(title + ": \r\n" + message); + { + OnStop(message, "SaveAsDAISY"); + } + + public void OnError(string errorMessage) + { + AddinLogger.Error("An error occured during conversion: \r\n" + errorMessage); + TryShowMessage("An error occured during conversion: \r\n" + errorMessage, true); + MessageBox.Show( + errorMessage, + "An error occured during conversion", + MessageBoxButtons.OK, + MessageBoxIcon.Error + ); + } + + public void OnStop(string message, string title) + { + TryShowMessage(title + ": \r\n" + message, true); MessageBox.Show(message, title, MessageBoxButtons.OK, MessageBoxIcon.Stop); - } + } #region Conversion to dtbook - public void onDocumentListConversionStart(List documentLists, ConversionParameters conversion) { - TryInitializeProgress("Starting documents list conversion", documentLists.Count + (conversion.PostProcessor != null ? 1 : 0)); - + public void onDocumentListConversionStart( + List documentLists, + ConversionParameters conversion + ) + { + TryInitializeProgress( + "Starting documents list conversion", + documentLists.Count + (conversion.PostProcessor != null ? 1 : 0) + ); } - public void onDocumentConversionStart(DocumentParameters document, ConversionParameters conversion) { - TryInitializeProgress("Converting document " + document.InputPath, conversion.PostProcessor != null ? 2 : 1); - + public void onDocumentConversionStart( + DocumentParameters document, + ConversionParameters conversion + ) + { + TryInitializeProgress( + "Converting document " + document.InputPath, + conversion.PostProcessor != null ? 2 : 1 + ); } - public void onDocumentListConversionSuccess(List documentLists, ConversionParameters conversion) { + public void onDocumentListConversionSuccess( + List documentLists, + ConversionParameters conversion + ) + { TryClosingDialog(); } - public void onDocumentConversionSuccess(DocumentParameters document, ConversionParameters conversion) { - TryShowMessage("Successful conversion of " + document.InputPath + " to " + document.OutputPath, true); - - + public void onDocumentConversionSuccess( + DocumentParameters document, + ConversionParameters conversion + ) + { + TryShowMessage( + "Successful conversion of " + document.InputPath + " to " + document.OutputPath, + true + ); } #endregion #region Post processing - public void onPostProcessingStart(ConversionParameters conversion) { - TryInitializeProgress("Starting pipeline processing", conversion.PostProcessor.StepsCount + 1); - - //conversion.PostProcessor.setPipelineErrorListener((string message) => { - // if (message != null) { - // ProgressDialog.AddMessage(message, true); - // } - //}); - //conversion.PostProcessor.setPipelineOutputListener((string message) => { - // if (message != null) { - // ProgressDialog.AddMessage(message,false); - // } - //}); - //conversion.PostProcessor.setPipelineProgressListener((string message) => { - // if (message != null) { - // ProgressDialog.AddMessage(message, true); - // } - //}); - } - - - - public void onPostProcessingSuccess(ConversionParameters conversion) { - TryShowMessage("Successfully processed or converted dtbook, result stored in " + conversion.OutputPath, true); + public void onPostProcessingStart(ConversionParameters conversion) + { + TryInitializeProgress( + "Starting pipeline processing", + conversion.PostProcessor.StepsCount + 1 + ); + + } + + public void onPostProcessingSuccess(ConversionParameters conversion) + { + TryShowMessage( + "Successfully processed or converted dtbook, result stored in " + + conversion.OutputPath, + true + ); TryClosingDialog(); } #endregion - public void onConversionCanceled() { + public void onConversionCanceled() + { TryShowMessage("Canceling conversion"); TryClosingDialog(); } - public void onProgressMessageReceived(object sender, EventArgs e) { + public void onProgressMessageReceived(object sender, EventArgs e) + { TryShowMessage(((DaisyEventArgs)e).Message, true); } - public void onFeedbackMessageReceived(object sender, EventArgs e) { + public void onFeedbackMessageReceived(object sender, EventArgs e) + { TryShowMessage(((DaisyEventArgs)e).Message); } - public void onFeedbackValidationMessageReceived(object sender, EventArgs e) { + public void onFeedbackValidationMessageReceived(object sender, EventArgs e) + { TryShowMessage(((DaisyEventArgs)e).Message); } - public void OnSuccessMasterSubValidation(string message) { + public void OnSuccessMasterSubValidation(string message) + { MasterSubValidation infoBox = new MasterSubValidation(message, "Success"); infoBox.ShowDialog(); } - public void OnUnknownError(string error) { - TryShowMessage("An error occured during conversion: \r\n" + error); + public void OnUnknownError(string error) + { + AddinLogger.Error("An error occured during conversion: \r\n" + error); + TryShowMessage("An error occured during conversion: \r\n" + error, true); MessageBox.Show(error, "Unknown error", MessageBoxButtons.OK, MessageBoxIcon.Error); } - public void OnUnknownError(string title, string details) { + public void OnUnknownError(string title, string details) + { InfoBox infoBox = new InfoBox(title, details, Labels.ResourceManager); infoBox.ShowDialog(); } - public void OnValidationErrors(List errors, string outputFile) { + public void OnValidationErrors(List errors, string outputFile) + { Validation validationDialog = new Validation( Labels.FailedLabel, - string.Join( - "\r\n", - errors.Select( - error => error.ToString() - ).ToArray() - ), + string.Join("\r\n", errors.Select(error => error.ToString()).ToArray()), outputFile, Labels.ResourceManager ); validationDialog.ShowDialog(); } - public void OnLostElements(string outputFile, ArrayList elements) { - Fidility fidilityDialog = new Fidility(Labels.FeedbackLabel, elements, outputFile, Labels.ResourceManager); + public void OnLostElements(string outputFile, ArrayList elements) + { + Fidility fidilityDialog = new Fidility( + Labels.FeedbackLabel, + elements, + outputFile, + Labels.ResourceManager + ); fidilityDialog.ShowDialog(); } - public bool IsContinueDTBookGenerationOnLostElements() { - DialogResult continueDTBookGenerationResult = MessageBox.Show("Do you want to create audio file", "SaveAsDAISY", MessageBoxButtons.YesNo, MessageBoxIcon.Question); + public bool IsContinueDTBookGenerationOnLostElements() + { + DialogResult continueDTBookGenerationResult = MessageBox.Show( + "Do you want to create audio file", + "SaveAsDAISY", + MessageBoxButtons.YesNo, + MessageBoxIcon.Question + ); return continueDTBookGenerationResult == DialogResult.Yes; } - public void OnSuccess() { + public void OnSuccess() + { TryClosingDialog(); - MessageBox.Show(Labels.SucessLabel, "SaveAsDAISY - Success", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information); + MessageBox.Show( + Labels.SucessLabel, + "SaveAsDAISY - Success", + System.Windows.Forms.MessageBoxButtons.OK, + System.Windows.Forms.MessageBoxIcon.Information + ); } - public void OnMasterSubValidationError(string error) { + public void OnMasterSubValidationError(string error) + { MasterSubValidation infoBox = new MasterSubValidation(error, "Validation"); infoBox.ShowDialog(); } - } -} \ No newline at end of file +} diff --git a/Common/DaisyConverterLib/Pipeline/ChainedScripts/CleanedDtbookToDaisy3.cs b/Common/DaisyConverterLib/Pipeline/ChainedScripts/CleanedDtbookToDaisy3.cs index 3ba3fdb..352e6f1 100644 --- a/Common/DaisyConverterLib/Pipeline/ChainedScripts/CleanedDtbookToDaisy3.cs +++ b/Common/DaisyConverterLib/Pipeline/ChainedScripts/CleanedDtbookToDaisy3.cs @@ -9,6 +9,8 @@ namespace Daisy.SaveAsDAISY.Conversion.Pipeline.ChainedScripts { public class CleanedDtbookToDaisy3 : Script { + private static ConverterSettings GlobaleSettings = ConverterSettings.Instance; + Script dtbookCleaner; Script dtbookToDaisy3; @@ -91,8 +93,8 @@ public CleanedDtbookToDaisy3(IConversionEventsHandler e): base(e) { {"tts-config", new ScriptParameter( "tts-config", "Text-to-speech configuration file", - new PathDataType(PathDataType.InputOrOutput.input,PathDataType.FileOrDirectory.File), - "", + new PathDataType(PathDataType.InputOrOutput.input,PathDataType.FileOrDirectory.File, "", GlobaleSettings.TTSConfigFile ?? ""), + GlobaleSettings.TTSConfigFile ?? "", false, "Configuration file for the text-to-speech.\r\n\r\n[More details on the configuration file format](http://daisy.github.io/pipeline/Get-Help/User-Guide/Text-To-Speech/).", true, @@ -191,22 +193,6 @@ public override void ExecuteScript(string inputPath, bool isQuite) { #endif dtbookToDaisy3.ExecuteScript(dtbookToDaisy3.Parameters["input"].ParameterValue.ToString()); - // Post processing : - // NP 2023/09/27 : I don't know why yet, but pipeline 2 w/ simpleAPI export images with their uri encoded names - // While pipeline 2 app and pipeline 2 internal job folder has the correct file names - string[] outputFiles = Directory.GetFiles((string)dtbookToDaisy3.Parameters["output"].ParameterValue, "*", SearchOption.AllDirectories); - foreach (var file in outputFiles) - { - string actualName = Path.GetFileName(file); - string expectedFile = Path.Combine( - Path.GetDirectoryName(file), - Uri.UnescapeDataString(actualName) - ); - if (!File.Exists(expectedFile)) - { - File.Move(file, expectedFile); - } - } } } } diff --git a/Common/DaisyConverterLib/Pipeline/ChainedScripts/CleanedDtbookToEpub3.cs b/Common/DaisyConverterLib/Pipeline/ChainedScripts/CleanedDtbookToEpub3.cs index b144f18..cae8b41 100644 --- a/Common/DaisyConverterLib/Pipeline/ChainedScripts/CleanedDtbookToEpub3.cs +++ b/Common/DaisyConverterLib/Pipeline/ChainedScripts/CleanedDtbookToEpub3.cs @@ -9,6 +9,8 @@ namespace Daisy.SaveAsDAISY.Conversion.Pipeline.ChainedScripts { public class CleanedDtbookToEpub3 : Script { + private static ConverterSettings GlobaleSettings = ConverterSettings.Instance; + Script dtbookCleaner; Script dtbookToEpub3; @@ -125,8 +127,8 @@ public CleanedDtbookToEpub3(IConversionEventsHandler e): base(e) { {"tts-config", new ScriptParameter( "tts-config", "Text-to-speech configuration file", - new PathDataType(PathDataType.InputOrOutput.input,PathDataType.FileOrDirectory.File), - "", + new PathDataType(PathDataType.InputOrOutput.input,PathDataType.FileOrDirectory.File, "", GlobaleSettings.TTSConfigFile ?? ""), + GlobaleSettings.TTSConfigFile ?? "", false, "Configuration file for the text-to-speech.\r\n\r\n[More details on the configuration file format](http://daisy.github.io/pipeline/Get-Help/User-Guide/Text-To-Speech/).", true, @@ -209,23 +211,6 @@ public override void ExecuteScript(string inputPath, bool isQuite) { dtbookToEpub3.ExecuteScript(dtbookToEpub3.Parameters["input"].ParameterValue.ToString()); - // Post processing : - // i don't know why yet, but pipeline 2 w/ simpleAPI export images with their uri encoded names - // need to take all images and decode back their names - string[] outputFiles = Directory.GetFiles((string)dtbookToEpub3.Parameters["output"].ParameterValue, "*", SearchOption.AllDirectories); - foreach (var file in outputFiles) - { - string actualName = Path.GetFileName(file); - string expectedFile = Path.Combine( - Path.GetDirectoryName(file), - Uri.UnescapeDataString(actualName) - ); - if (!File.Exists(expectedFile)) - { - File.Move(file, expectedFile); - } - - } } } } diff --git a/Common/DaisyConverterLib/Pipeline/ChainedScripts/CleanedDtbookToMp3.cs b/Common/DaisyConverterLib/Pipeline/ChainedScripts/CleanedDtbookToMp3.cs index 56d51b9..d53a270 100644 --- a/Common/DaisyConverterLib/Pipeline/ChainedScripts/CleanedDtbookToMp3.cs +++ b/Common/DaisyConverterLib/Pipeline/ChainedScripts/CleanedDtbookToMp3.cs @@ -9,6 +9,8 @@ namespace Daisy.SaveAsDAISY.Conversion.Pipeline.ChainedScripts { public class CleanedDtbookToMp3 : Script { + private static ConverterSettings GlobaleSettings = ConverterSettings.Instance; + Script dtbookCleaner; Script dtbookToDaisy3; Script daisy3ToMp3; @@ -94,8 +96,8 @@ public CleanedDtbookToMp3(IConversionEventsHandler e): base(e) { {"tts-config", new ScriptParameter( "tts-config", "Text-to-speech configuration file", - new PathDataType(PathDataType.InputOrOutput.input,PathDataType.FileOrDirectory.File), - "", + new PathDataType(PathDataType.InputOrOutput.input,PathDataType.FileOrDirectory.File, "", GlobaleSettings.TTSConfigFile ?? ""), + GlobaleSettings.TTSConfigFile ?? "", false, "Configuration file for the text-to-speech.\r\n\r\n[More details on the configuration file format](http://daisy.github.io/pipeline/Get-Help/User-Guide/Text-To-Speech/).", true, @@ -219,7 +221,6 @@ public override void ExecuteScript(string inputPath, bool isQuite) { } daisy3ToMp3.Parameters["output"].ParameterValue = Directory.CreateDirectory(Path.Combine(finalOutput, "MP3 files")).FullName; daisy3ToMp3.ExecuteScript((string)daisy3ToMp3.Parameters["input"].ParameterValue, true); - } } } diff --git a/Common/DaisyConverterLib/Pipeline/Pipeline2/Pipeline2Script.cs b/Common/DaisyConverterLib/Pipeline/Pipeline2/Pipeline2Script.cs index 87be48f..fe8d905 100644 --- a/Common/DaisyConverterLib/Pipeline/Pipeline2/Pipeline2Script.cs +++ b/Common/DaisyConverterLib/Pipeline/Pipeline2/Pipeline2Script.cs @@ -1,18 +1,21 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using Daisy.SaveAsDAISY.Conversion.Events; +using Daisy.SaveAsDAISY.Conversion.Pipeline.Pipeline2.Scripts; using org.daisy.jnet; -namespace Daisy.SaveAsDAISY.Conversion { - +namespace Daisy.SaveAsDAISY.Conversion +{ /// /// Abstract class for pipeline 2 scripts launch /// - public abstract class Pipeline2Script : Script { - - protected Pipeline2Script(IConversionEventsHandler e) : base(e) { } + public abstract class Pipeline2Script : Script + { + protected Pipeline2Script(IConversionEventsHandler e) + : base(e) { } //IntPtr currentJob = IntPtr.Zero; @@ -21,55 +24,65 @@ protected Pipeline2Script(IConversionEventsHandler e) : base(e) { } /// /// path to use for script main input /// - public override void ExecuteScript(string inputPath, bool isQuite) { - + public override void ExecuteScript(string inputPath, bool isQuite) + { Pipeline2 pipeline = Pipeline2.Instance; - Pipeline2.Instance.SetPipelineErrorListener((message) => { - this.EventsHandler.OnError(message); - }); - Pipeline2.Instance.SetPipelineOutputListener((message) => { - this.EventsHandler.onFeedbackMessageReceived(this, new DaisyEventArgs(message)); - this.EventsHandler.onProgressMessageReceived(this, new DaisyEventArgs(message)); - }); + Pipeline2.Instance.SetPipelineErrorListener( + (message) => + { + this.EventsHandler.OnError(message); + } + ); + Pipeline2.Instance.SetPipelineOutputListener( + (message) => + { + this.EventsHandler.onFeedbackMessageReceived(this, new DaisyEventArgs(message)); + } + ); if (Parameters.ContainsKey("input") && (string)Parameters["input"].ParameterValue == "") { Parameters["input"].ParameterValue = inputPath; } Dictionary parameters = new Dictionary(); - foreach(KeyValuePair v in Parameters) + foreach (KeyValuePair v in Parameters) { // avoid passing empty values - if( - !v.Value.IsParameterRequired && - ( + if ( + !v.Value.IsParameterRequired + && ( v.Value.ParameterDataType is StringDataType || v.Value.ParameterDataType is PathDataType - ) && - "" == (string)v.Value.ParameterValue - ) { + ) + && "" == (string)v.Value.ParameterValue + ) + { continue; } parameters[v.Value.Name] = v.Value.ParameterValue; } - IntPtr currentJob = Pipeline2.Instance.Start( - Name, - parameters - ); + IntPtr currentJob = Pipeline2.Instance.Start(Name, parameters); - if (currentJob != IntPtr.Zero) { + if (currentJob != IntPtr.Zero) + { //IntPtr context = pipeline.getContext(currentJob); IntPtr monitor = pipeline.getMonitor(currentJob); IntPtr messages = pipeline.getMessageAccessor(monitor); bool checkStatus = true; List errors; - while (checkStatus) { - foreach (string message in pipeline.getNewMessages()) { - this.EventsHandler.onFeedbackMessageReceived(this, new DaisyEventArgs(message)); + while (checkStatus) + { + foreach (string message in pipeline.getNewMessages()) + { + this.EventsHandler.onFeedbackMessageReceived( + this, + new DaisyEventArgs("DP2 > " + message) + ); } //Console.WriteLine(pipeline.getProgress(messages)); // TODO need to get jobs log //Console.WriteLine("checking status"); - switch (pipeline.getStatus(currentJob)) { + switch (pipeline.getStatus(currentJob)) + { case Pipeline2.JobStatus.IDLE: break; case Pipeline2.JobStatus.RUNNING: @@ -79,39 +92,77 @@ v.Value.ParameterDataType is StringDataType break; case Pipeline2.JobStatus.ERROR: errors = pipeline.getErros(currentJob); - throw new Exception(this.NiceName + " conversion job has finished in error :\r\n" + string.Join("\r\n", errors)); + string messageERROR = + " DP2 > " + + this.NiceName + + " conversion job has finished in error :\r\n" + + string.Join("\r\n", errors); + this.EventsHandler.OnError(messageERROR); + throw new Exception(messageERROR); case Pipeline2.JobStatus.FAIL: // open jobs folder errors = pipeline.getErros(currentJob); - throw new Exception( - this.NiceName + " conversion job failed :\r\n" + string.Join("\r\n",errors) - ); + string messageFAIL = + " DP2 > " + + this.NiceName + + " conversion job failed :\r\n" + + string.Join("\r\n", errors); + this.EventsHandler.OnError(messageFAIL); + throw new Exception(messageFAIL); default: break; } System.Threading.Thread.Sleep(1000); #if DEBUG - // Kill the instance and running jvm for pipeline debugging - try { - //Pipeline2.KillInstance(); - } catch (Exception e) { - this.EventsHandler.OnError(e.Message); - } - // + // Kill the instance and running jvm for pipeline debugging + try + { + //Pipeline2.KillInstance(); + } + catch (Exception e) + { + this.EventsHandler.OnError(e.Message); + } + // #else if (!isQuite && !string.IsNullOrEmpty(output)) System.Diagnostics.Process.Start(output); #endif } - } else { - throw new Exception("An unknown error occured while launching the script " + this.Name + " with the parameters " + - this.Parameters.Aggregate( - "", - (result, keyvalue) => result + keyvalue.Value.Name + "=" + keyvalue.Value.ParameterValue.ToString() +"\r\n" - ) + // Post processing : + // NP 2023/09/27 : I don't know why yet, but pipeline 2 w/ simpleAPI export files with their uri encoded names + // While pipeline 2 app and pipeline 2 internal job folder has the correct file names + if (Parameters.ContainsKey("output")) { + string[] outputFiles = Directory.GetFiles((string)this.Parameters["output"].ParameterValue, "*", SearchOption.AllDirectories); + foreach (var file in outputFiles) { + string actualName = Path.GetFileName(file); + string expectedFile = Path.Combine( + Path.GetDirectoryName(file), + Uri.UnescapeDataString(actualName) + ); + if (!File.Exists(expectedFile)) { + File.Move(file, expectedFile); + } + } + } + } + else + { + throw new Exception( + "DP2 > An unknown error occured while launching the script " + + this.Name + + " with the parameters " + + this.Parameters.Aggregate( + "", + (result, keyvalue) => + result + + keyvalue.Value.Name + + "=" + + keyvalue.Value.ParameterValue.ToString() + + "\r\n" + ) ); } - } } } diff --git a/Common/DaisyConverterLib/resources/xslts/Common.xsl b/Common/DaisyConverterLib/resources/xslts/Common.xsl index 494b1ca..4a77b3f 100644 --- a/Common/DaisyConverterLib/resources/xslts/Common.xsl +++ b/Common/DaisyConverterLib/resources/xslts/Common.xsl @@ -92,7 +92,7 @@ count(document('word/document.xml')//w:document/w:body/w:p[position() > 1]/w:pPr/w:pStyle[substring(@w:val,1,10)='Bodymatter'])=1 or count(document('word/document.xml')//w:document/w:body/w:p/w:r[position() > 1]/w:rPr/w:rStyle[substring(@w:val,1,10)='Bodymatter'])=1 "> - progress:Adding frontmatter content found in the document + progress:Adding Frontmatter content found in the document @@ -187,7 +187,7 @@ - progress:Adding any rearmatter content found in the document + progress:Adding Rearmatter content found in the document @@ -238,11 +238,12 @@ - progress:Parse hyperlinks + progress:Hyperlink found - - progress:Start parsing document for + progress:Start adding content in + @@ -251,7 +252,7 @@ - progress:Found element + progress:Converting element / + debug:Converting table of content @@ -535,9 +537,7 @@ - - - + @@ -574,9 +574,7 @@ debug in ParaHandler " - - test - + - required - @@ -1720,7 +1716,6 @@ debug in fldSimple - @@ -1894,7 +1889,6 @@ - @@ -1935,13 +1929,11 @@ - - @@ -2375,7 +2367,6 @@ - @@ -2602,6 +2593,7 @@ + debug:Converting table of content @@ -2696,7 +2688,6 @@ - @@ -2722,7 +2713,6 @@ - @@ -2734,7 +2724,6 @@ - @@ -2936,7 +2925,6 @@ - @@ -2992,7 +2980,6 @@ - @@ -3253,7 +3240,6 @@ " - progress:ParagraphStyle @@ -3943,7 +3929,7 @@ - progress:Checking for page styles + debug:Checking for page styles @@ -3983,21 +3969,21 @@ count(w:pPr/w:pStyle[substring(@w:val,1,11)='Frontmatter'])=1 or count(w:r/w:rPr/w:rStyle[substring(@w:val,1,11)='Frontmatter'])=1 )"> - progress:SetCurrentMatterType - Found Frontmatter + debug:SetCurrentMatterType - Found Frontmatter - progress:SetCurrentMatterType - Found Bodymatter + debug:SetCurrentMatterType - Found Bodymatter - progress:SetCurrentMatterType - Found Rearmatter + debug:SetCurrentMatterType - Found Rearmatter diff --git a/Common/DaisyConverterLib/resources/xslts/Common2.xsl b/Common/DaisyConverterLib/resources/xslts/Common2.xsl index e940605..5686946 100644 --- a/Common/DaisyConverterLib/resources/xslts/Common2.xsl +++ b/Common/DaisyConverterLib/resources/xslts/Common2.xsl @@ -54,15 +54,11 @@ xmlns:v="urn:schemas-microsoft-com:vml" - progress:Adding level + debug:Adding level - - - - - + @@ -385,9 +381,7 @@ xmlns:v="urn:schemas-microsoft-com:vml" - - progress:Closing level - + debug:Closing level @@ -395,9 +389,7 @@ xmlns:v="urn:schemas-microsoft-com:vml" - - progress:Closing paragraph - + debug:Closing paragraph @@ -636,7 +628,7 @@ xmlns:v="urn:schemas-microsoft-com:vml" - progress:closelist + debug closelist @@ -656,7 +648,6 @@ xmlns:v="urn:schemas-microsoft-com:vml" - " @@ -708,7 +699,7 @@ xmlns:v="urn:schemas-microsoft-com:vml" - progress:closelist + debug closelist @@ -727,7 +718,7 @@ xmlns:v="urn:schemas-microsoft-com:vml" - progress:closelist + debug:closelist @@ -853,10 +844,9 @@ xmlns:v="urn:schemas-microsoft-com:vml" " - progress:Table found + debug:Table found - @@ -893,10 +883,8 @@ xmlns:v="urn:schemas-microsoft-com:vml" - - - @@ -911,7 +899,6 @@ xmlns:v="urn:schemas-microsoft-com:vml" - @@ -919,10 +906,8 @@ xmlns:v="urn:schemas-microsoft-com:vml" - - - @@ -937,7 +922,6 @@ xmlns:v="urn:schemas-microsoft-com:vml" - @@ -945,10 +929,8 @@ xmlns:v="urn:schemas-microsoft-com:vml" - - - @@ -963,7 +945,6 @@ xmlns:v="urn:schemas-microsoft-com:vml" - @@ -1010,14 +991,12 @@ xmlns:v="urn:schemas-microsoft-com:vml" - - @@ -1037,17 +1016,14 @@ xmlns:v="urn:schemas-microsoft-com:vml" - - - @@ -1067,17 +1043,14 @@ xmlns:v="urn:schemas-microsoft-com:vml" - - - @@ -1120,13 +1093,11 @@ xmlns:v="urn:schemas-microsoft-com:vml" - - @@ -1138,7 +1109,6 @@ xmlns:v="urn:schemas-microsoft-com:vml" - diff --git a/Common/DaisyConverterLib/resources/xslts/Common3.xsl b/Common/DaisyConverterLib/resources/xslts/Common3.xsl index 8b07d38..ab84caa 100644 --- a/Common/DaisyConverterLib/resources/xslts/Common3.xsl +++ b/Common/DaisyConverterLib/resources/xslts/Common3.xsl @@ -52,7 +52,7 @@ - progress:footnote + debug:footnote @@ -112,13 +112,11 @@ - - progress:Insert endnote + debug:Insert endnote - @@ -147,7 +145,7 @@ - progressfootnote + debug:footnote @@ -156,12 +154,11 @@ - progress:Insert footnote + debug:Insert footnote - @@ -305,7 +302,6 @@ - @@ -348,7 +344,6 @@ - @@ -388,7 +383,6 @@ - @@ -416,7 +410,7 @@ - progress:picturehandler + debug:picturehandler @@ -639,7 +633,6 @@ - @@ -654,7 +647,6 @@ - @@ -734,7 +726,6 @@ - @@ -780,7 +771,6 @@ - @@ -823,7 +813,6 @@ - @@ -849,12 +838,11 @@ - progress:imagegroups + debug:imagegroups - @@ -871,7 +859,6 @@ - @@ -959,7 +946,6 @@ - @@ -1026,7 +1012,6 @@ - @@ -1041,7 +1026,6 @@ - @@ -1137,7 +1121,6 @@ - @@ -1151,7 +1134,6 @@ - @@ -1244,7 +1226,6 @@ - @@ -1259,7 +1240,6 @@ - @@ -1310,7 +1290,6 @@ - @@ -1412,7 +1391,6 @@ - @@ -1512,7 +1490,6 @@ - @@ -1663,7 +1640,6 @@ - @@ -1758,7 +1734,6 @@ debug in countpageTOC - diff --git a/Common/DaisyConverterLib/resources/xslts/TOC.xsl b/Common/DaisyConverterLib/resources/xslts/TOC.xsl index fce73e4..2fc4e02 100644 --- a/Common/DaisyConverterLib/resources/xslts/TOC.xsl +++ b/Common/DaisyConverterLib/resources/xslts/TOC.xsl @@ -20,10 +20,9 @@ - progress:Handling table of content + - @@ -46,7 +45,6 @@ - @@ -57,7 +55,6 @@ - pagenum @@ -83,7 +80,6 @@ - @@ -102,10 +98,8 @@ - - @@ -144,7 +138,6 @@ - " @@ -165,10 +158,8 @@ - - @@ -179,7 +170,6 @@ - pagenum @@ -196,10 +186,8 @@ - - diff --git a/Common/DaisyConverterLib/resources/xslts/oox2Daisy.xsl b/Common/DaisyConverterLib/resources/xslts/oox2Daisy.xsl index f2b50e1..0b922c0 100644 --- a/Common/DaisyConverterLib/resources/xslts/oox2Daisy.xsl +++ b/Common/DaisyConverterLib/resources/xslts/oox2Daisy.xsl @@ -151,9 +151,7 @@ - - progress:Creating the dtbook document - + progress:Creating the dtbook base document <?xml version='1.0' encoding='UTF-8'?> <?xml-stylesheet href="dtbookbasic.css" type="text/css"?> <!DOCTYPE dtbook SYSTEM 'dtbook-2005-3.dtd' @@ -374,6 +372,7 @@ --> + progress:Starting conversion of elements @@ -431,4 +430,4 @@ - + \ No newline at end of file