This commit is contained in:
Georgy Litvinov 2020-04-23 14:33:18 +02:00
parent 75fd6c8192
commit eca9f9f41b
6 changed files with 37 additions and 9 deletions

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> <!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Clean" script:language="StarBasic">Sub mark43 <script:module xmlns:script="http://openoffice.org/2000/script" script:name="Clean" script:language="StarBasic">Sub mark44
End Sub End Sub

View file

@ -71,10 +71,13 @@ Private Sub quietStartDialog
Dim buttonNameOk As String Dim buttonNameOk As String
Dim buttonNameStop As String Dim buttonNameStop As String
Dim buttonNameLoad As String Dim buttonNameLoad As String
Dim dialogTitle As String
description = getTranslation(lang,&quot;startQuietCleaningDescription&quot;) description = getTranslation(lang,&quot;startQuietCleaningDescription&quot;)
buttonNameOk = getTranslation(lang,&quot;buttonOk&quot;) buttonNameOk = getTranslation(lang,&quot;buttonOk&quot;)
buttonNameStop = getTranslation(lang,&quot;buttonStop&quot;) buttonNameStop = getTranslation(lang,&quot;buttonStop&quot;)
buttonNameLoad = getTranslation(lang,&quot;buttonLoad&quot;) buttonNameLoad = getTranslation(lang,&quot;buttonLoad&quot;)
dialogTitle = getTranslation(lang,&quot;quietStartCleaningTitle&quot;)
dialog.Title = dialogTitle
dialog.getControl(&quot;Description&quot;).setText(description) dialog.getControl(&quot;Description&quot;).setText(description)
dialog.getControl(&quot;buttonOk&quot;).Label = buttonNameOk dialog.getControl(&quot;buttonOk&quot;).Label = buttonNameOk
dialog.getControl(&quot;buttonStop&quot;).Label = buttonNameStop dialog.getControl(&quot;buttonStop&quot;).Label = buttonNameStop
@ -102,14 +105,20 @@ Private Sub noStylesFileDialog
lang = GetStarOfficeLocale().Language lang = GetStarOfficeLocale().Language
Dim description As String Dim description As String
Dim buttonName As String Dim buttonName As String
Dim dialogTitle As String
Dim buttonTemplateNotFoundSkip As String
dialogTitle = getTranslation(lang,&quot;noStylesFileDialogTitle&quot;)
description = getTranslation(lang,&quot;noFileWithStylesFound&quot;) description = getTranslation(lang,&quot;noFileWithStylesFound&quot;)
buttonName = getTranslation(lang,&quot;buttonNameToSelectFileWithStyles&quot;) buttonName = getTranslation(lang,&quot;buttonNameToSelectFileWithStyles&quot;)
buttonTemplateNotFoundSkip = getTranslation(lang,&quot;buttonTemplateNotFoundSkip&quot;)
dialog.Title = dialogTitle
dialog.getControl(&quot;Description&quot;).setText(description) dialog.getControl(&quot;Description&quot;).setText(description)
dialog.getControl(&quot;FileSelection&quot;).Label = buttonName dialog.getControl(&quot;FileSelection&quot;).Label = buttonName
dialog.setVisible(true) dialog.getControl(&quot;buttonOk&quot;).Label = buttonTemplateNotFoundSkip
dialog.setVisible(true)
Select Case dialog.Execute() Select Case dialog.Execute()
Case 1 Case 1
setDeafultTemplate(selectedTemplate) setDeafultTemplate()
Case 0 Case 0
End Select End Select
@ -123,9 +132,10 @@ End Sub
Sub setDeafultTemplate() Sub setDeafultTemplate()
Dim selectedTemplate As String Dim selectedTemplate As String
selectedTemplate = getFileURLDialog() selectedTemplate = getFileURLDialog()
If IsEmpty(selectedTemplate) Then oSimpleFileAccess = CreateUnoService( &quot;com.sun.star.ucb.SimpleFileAccess&quot; )
Exit sub If NOT (oSimpleFileAccess.exists( selectedTemplate ) AND NOT oSimpleFileAccess.isFolder( selectedTemplate ) ) Then
EndIf Exit sub
End If
Dim fileName As String Dim fileName As String
Dim config As Object Dim config As Object
config = initRedactionConfiguration() config = initRedactionConfiguration()

View file

@ -2,9 +2,9 @@
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd"> <!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="NoStyleFile" dlg:left="140" dlg:top="101" dlg:width="239" dlg:height="98" dlg:help-text="&amp;5.NoStyleFile.HelpText" dlg:closeable="true" dlg:moveable="true" dlg:title="&amp;6.NoStyleFile.Title"> <dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="NoStyleFile" dlg:left="140" dlg:top="101" dlg:width="239" dlg:height="98" dlg:help-text="&amp;5.NoStyleFile.HelpText" dlg:closeable="true" dlg:moveable="true" dlg:title="&amp;6.NoStyleFile.Title">
<dlg:bulletinboard> <dlg:bulletinboard>
<dlg:button dlg:id="CommandButton1" dlg:tab-index="0" dlg:left="138" dlg:top="75" dlg:width="60" dlg:height="13" dlg:help-text="&amp;13.NoStyleFile.CommandButton1.HelpText" dlg:value="&amp;14.NoStyleFile.CommandButton1.Label" dlg:button-type="cancel"/>
<dlg:button dlg:id="CommandButton2" dlg:tab-index="1" dlg:left="167" dlg:top="139" dlg:width="1" dlg:height="0" dlg:help-text="&amp;15.NoStyleFile.CommandButton2.HelpText" dlg:value="&amp;16.NoStyleFile.CommandButton2.Label"/> <dlg:button dlg:id="CommandButton2" dlg:tab-index="1" dlg:left="167" dlg:top="139" dlg:width="1" dlg:height="0" dlg:help-text="&amp;15.NoStyleFile.CommandButton2.HelpText" dlg:value="&amp;16.NoStyleFile.CommandButton2.Label"/>
<dlg:button dlg:id="FileSelection" dlg:tab-index="2" dlg:left="46" dlg:top="75" dlg:width="60" dlg:height="13" dlg:help-text="&amp;19.NoStyleFile.FileSelection.HelpText" dlg:value="&amp;20.NoStyleFile.FileSelection.Label" dlg:button-type="ok"/> <dlg:button dlg:id="FileSelection" dlg:tab-index="2" dlg:left="46" dlg:top="75" dlg:width="60" dlg:height="13" dlg:help-text="&amp;19.NoStyleFile.FileSelection.HelpText" dlg:value="&amp;20.NoStyleFile.FileSelection.Label" dlg:button-type="ok"/>
<dlg:text dlg:id="Description" dlg:tab-index="3" dlg:left="23" dlg:top="13" dlg:width="192" dlg:height="52" dlg:help-text="&amp;27.NoStyleFile.Description.HelpText" dlg:value="&amp;28.NoStyleFile.Description.Label"/> <dlg:text dlg:id="Description" dlg:tab-index="3" dlg:left="23" dlg:top="13" dlg:width="192" dlg:height="52" dlg:help-text="&amp;27.NoStyleFile.Description.HelpText" dlg:value="&amp;28.NoStyleFile.Description.Label"/>
<dlg:button dlg:id="buttonOk" dlg:tab-index="0" dlg:left="138" dlg:top="75" dlg:width="60" dlg:height="13" dlg:help-text="&amp;13.NoStyleFile.CommandButton1.HelpText" dlg:value="ok" dlg:button-type="cancel"/>
</dlg:bulletinboard> </dlg:bulletinboard>
</dlg:window> </dlg:window>

View file

@ -6,7 +6,7 @@
<dlg:button dlg:id="buttonOk" dlg:tab-index="1" dlg:left="15" dlg:top="71" dlg:width="52" dlg:height="17" dlg:help-text="&amp;55.StartQuietCleaning.buttonOk.HelpText" dlg:value="&amp;56.StartQuietCleaning.buttonOk.Label" dlg:button-type="ok"/> <dlg:button dlg:id="buttonOk" dlg:tab-index="1" dlg:left="15" dlg:top="71" dlg:width="52" dlg:height="17" dlg:help-text="&amp;55.StartQuietCleaning.buttonOk.HelpText" dlg:value="&amp;56.StartQuietCleaning.buttonOk.Label" dlg:button-type="ok"/>
<dlg:button dlg:id="buttonStop" dlg:tab-index="3" dlg:left="84" dlg:top="71" dlg:width="52" dlg:height="17" dlg:help-text="&amp;57.StartQuietCleaning.buttonStop.HelpText" dlg:value="&amp;58.StartQuietCleaning.buttonStop.Label" dlg:button-type="cancel"/> <dlg:button dlg:id="buttonStop" dlg:tab-index="3" dlg:left="84" dlg:top="71" dlg:width="52" dlg:height="17" dlg:help-text="&amp;57.StartQuietCleaning.buttonStop.HelpText" dlg:value="&amp;58.StartQuietCleaning.buttonStop.Label" dlg:button-type="cancel"/>
<dlg:button dlg:id="buttonLoad" dlg:tab-index="2" dlg:left="156" dlg:top="71" dlg:width="52" dlg:height="17" dlg:help-text="&amp;59.StartQuietCleaning.buttonLoad.HelpText" dlg:value="&amp;60.StartQuietCleaning.buttonLoad.Label"> <dlg:button dlg:id="buttonLoad" dlg:tab-index="2" dlg:left="156" dlg:top="71" dlg:width="52" dlg:height="17" dlg:help-text="&amp;59.StartQuietCleaning.buttonLoad.HelpText" dlg:value="&amp;60.StartQuietCleaning.buttonLoad.Label">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Redaction.Configuration.noStylesFileDialog?language=Basic&amp;location=application" script:language="Script"/> <script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Redaction.Configuration.setDeafultTemplate?language=Basic&amp;location=application" script:language="Script"/>
</dlg:button> </dlg:button>
</dlg:bulletinboard> </dlg:bulletinboard>
</dlg:window> </dlg:window>

View file

@ -23,6 +23,15 @@ Function getRussian(identifier As String) As String
Case &quot;buttonOk&quot; Case &quot;buttonOk&quot;
getRussian = &quot;Да&quot; getRussian = &quot;Да&quot;
Exit Function Exit Function
Case &quot;quietStartCleaningTitle&quot;
getRussian = &quot;Подтверждение запуска чистки&quot;
Exit Function
Case &quot;noStylesFileDialogTitle&quot;
getRussian = &quot;Файл со стилями не найден&quot;
Exit Function
Case &quot;buttonTemplateNotFoundSkip&quot;
getRussian = &quot;Продолжить&quot;
Exit Function
Case &quot;buttonStop&quot; Case &quot;buttonStop&quot;
getRussian = &quot;Нет&quot; getRussian = &quot;Нет&quot;
Exit Function Exit Function
@ -46,6 +55,15 @@ Function getEnglish(identifier As String) As String
Case &quot;startQuietCleaningDescription&quot; Case &quot;startQuietCleaningDescription&quot;
getEnglish = &quot;Do you want to start document cleaning?&quot; &amp; chr(10) &amp; &quot;You can choose template with styles to load them in process of the cleaning.&quot; getEnglish = &quot;Do you want to start document cleaning?&quot; &amp; chr(10) &amp; &quot;You can choose template with styles to load them in process of the cleaning.&quot;
Exit Function Exit Function
Case &quot;noStylesFileDialogTitle&quot;
getEnglish = &quot;Template file not found&quot;
Exit Function
Case &quot;quietStartCleaningTitle&quot;
getEnglish = &quot;Confirmation&quot;
Exit Function
Case &quot;buttonTemplateNotFoundSkip&quot;
getRussian = &quot;Proceed&quot;
Exit Function
Case &quot;buttonOk&quot; Case &quot;buttonOk&quot;
getEnglish = &quot;Ok&quot; getEnglish = &quot;Ok&quot;
Exit Function Exit Function

View file

@ -3,7 +3,7 @@
xmlns:dep="http://openoffice.org/extensions/description/2006" xmlns:dep="http://openoffice.org/extensions/description/2006"
xmlns:xlink="http://www.w3.org/1999/xlink"> xmlns:xlink="http://www.w3.org/1999/xlink">
<identifier value="pro.litvinovg.Redaction" /> <identifier value="pro.litvinovg.Redaction" />
<version value="0.7.1" /> <version value="0.7.2" />
<platform value="all" /> <platform value="all" />
<display-name> <display-name>
<name lang="en">Cleaning and validation documents for publishing in html and epub with pagination</name> <name lang="en">Cleaning and validation documents for publishing in html and epub with pagination</name>