feat: Added selected template info on cleaning dialogs
This commit is contained in:
parent
c98848aae4
commit
003e1d4033
8 changed files with 163 additions and 71 deletions
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Configuration" script:language="StarBasic" script:moduleType="normal">Public Const redactionExtensionName = "cleanAndValidate"
|
||||
Public Const redactionExtensionVersion = "0.9.38"
|
||||
Public Const redactionExtensionVersion = "0.10.0"
|
||||
Public Const template_name_monography = "Монография"
|
||||
Public Const template_name_pj = "Философский журнал"
|
||||
Public Const template_name_pq = "Вопросы философии"
|
||||
|
@ -123,39 +123,81 @@ Private Sub configurationDialog
|
|||
Exit sub
|
||||
End Sub
|
||||
|
||||
Dim queitCleaningDialog As Object
|
||||
|
||||
Private Sub quietStartDialog
|
||||
Dim dialog As Object
|
||||
DialogLibraries.LoadLibrary("Redaction")
|
||||
dialog = CreateUnoDialog(DialogLibraries.Redaction.StartQuietCleaning)
|
||||
Dim description As String
|
||||
queitCleaningDialog = CreateUnoDialog(DialogLibraries.Redaction.StartQuietCleaning)
|
||||
|
||||
Dim buttonNameOk As String
|
||||
Dim buttonNameStop As String
|
||||
Dim buttonNameLoad As String
|
||||
Dim dialogTitle As String
|
||||
description = getTranslation("startQuietCleaningDescription")
|
||||
buttonNameOk = getTranslation("buttonYes")
|
||||
buttonNameStop = getTranslation("buttonStop")
|
||||
buttonNameLoad = getTranslation("buttonLoad")
|
||||
dialogTitle = getTranslation("quietStartCleaningTitle")
|
||||
dialog.Title = dialogTitle
|
||||
dialog.getControl("Description").setText(description)
|
||||
dialog.getControl("buttonOk").Label = buttonNameOk
|
||||
dialog.getControl("buttonStop").Label = buttonNameStop
|
||||
dialog.getControl("buttonLoad").Label = buttonNameLoad
|
||||
dialog.setVisible(true)
|
||||
Select Case dialog.Execute()
|
||||
queitCleaningDialog.Title = dialogTitle
|
||||
setQuietDialogDescription()
|
||||
queitCleaningDialog.getControl("buttonOk").Label = buttonNameOk
|
||||
queitCleaningDialog.getControl("buttonStop").Label = buttonNameStop
|
||||
queitCleaningDialog.getControl("buttonLoad").Label = buttonNameLoad
|
||||
queitCleaningDialog.setVisible(true)
|
||||
Select Case queitCleaningDialog.Execute()
|
||||
Case 1
|
||||
dialog.setVisible(false)
|
||||
dialog.dispose()
|
||||
queitCleaningDialog.setVisible(false)
|
||||
queitCleaningDialog.dispose()
|
||||
quietCleaning
|
||||
Case 0
|
||||
dialog.setVisible(false)
|
||||
dialog.dispose()
|
||||
queitCleaningDialog.setVisible(false)
|
||||
queitCleaningDialog.dispose()
|
||||
End Select
|
||||
|
||||
Exit sub
|
||||
End Sub
|
||||
|
||||
Function setAdvancedDialogDescription()
|
||||
If IsNull(advancedCleaningDialog) Then
|
||||
Exit Function
|
||||
EndIf
|
||||
Dim config As Object
|
||||
Dim description As String
|
||||
Dim predefined As String
|
||||
Dim customFile As String
|
||||
config = initRedactionConfiguration()
|
||||
predefined = config.getPropertyValue("predefined_template")
|
||||
customFile = config.getPropertyValue("defaultTemplate")
|
||||
If predefined = "false" Then
|
||||
description = getTranslation("templateNotSelected")
|
||||
ElseIf predefined = template_manual Then
|
||||
description = getTranslation("templateChosen") & " «" & customFile & "»"
|
||||
Else
|
||||
description = getTranslation("templateChosen") & " «" & predefined & "»"
|
||||
EndIf
|
||||
advancedCleaningDialog.getControl("description").setText(description)
|
||||
End Function
|
||||
|
||||
Function setQuietDialogDescription()
|
||||
If IsNull(queitCleaningDialog) Then
|
||||
Exit Function
|
||||
EndIf
|
||||
Dim config As Object
|
||||
Dim description As String
|
||||
Dim predefined As String
|
||||
Dim customFile As String
|
||||
config = initRedactionConfiguration()
|
||||
predefined = config.getPropertyValue("predefined_template")
|
||||
customFile = config.getPropertyValue("defaultTemplate")
|
||||
If predefined = "false" Then
|
||||
description = getTranslation("startQuietCleaningDescription1") & " " & getTranslation("startQuietCleaningDescription2")
|
||||
ElseIf predefined = template_manual Then
|
||||
description = getTranslation("startQuietCleaningDescription1") & " «" & customFile & "» " & getTranslation("startQuietCleaningDescription2")
|
||||
Else
|
||||
description = getTranslation("startQuietCleaningDescription1") & " «" & predefined & "» " & getTranslation("startQuietCleaningDescription2")
|
||||
EndIf
|
||||
queitCleaningDialog.getControl("Description").setText(description)
|
||||
End Function
|
||||
|
||||
Dim styleFileDialog As Object
|
||||
|
||||
Private Sub configureStyleFileDialog
|
||||
|
@ -185,8 +227,11 @@ Private Sub configureStyleFileDialog
|
|||
Select Case styleFileDialog.Execute()
|
||||
Case 0
|
||||
End Select
|
||||
setQuietDialogDescription()
|
||||
setAdvancedDialogDescription()
|
||||
styleFileDialog.setVisible(false)
|
||||
styleFileDialog.dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue