Added configuration dialog
This commit is contained in:
parent
1045e9c871
commit
95f8ad6769
5 changed files with 57 additions and 8 deletions
|
@ -1,6 +1,6 @@
|
|||
<?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="Clean" script:language="StarBasic">Sub mark23
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Clean" script:language="StarBasic">Sub mark24
|
||||
|
||||
End Sub
|
||||
|
||||
|
@ -15,6 +15,9 @@ Sub cleanButton
|
|||
|
||||
End Sub
|
||||
|
||||
Sub makerUpMenu()
|
||||
End Sub
|
||||
|
||||
Private Sub quietCleaning
|
||||
Dim description As String
|
||||
Dim statusIndicator as Object
|
||||
|
|
10
Redaction/ConfigDialog.xdl
Normal file
10
Redaction/ConfigDialog.xdl
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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="ConfigDialog" dlg:left="196" dlg:top="109" dlg:width="157" dlg:height="64" dlg:closeable="true" dlg:moveable="true">
|
||||
<dlg:bulletinboard>
|
||||
<dlg:checkbox dlg:id="CB_complexity" dlg:tab-index="0" dlg:left="5" dlg:top="13" dlg:width="150" dlg:height="19" dlg:value="Включить расширенное управление чисткой" dlg:checked="false"/>
|
||||
<dlg:button dlg:id="OK" dlg:tab-index="1" dlg:left="9" dlg:top="45" dlg:width="59" dlg:height="13" dlg:value="Сохранить" dlg:button-type="ok"/>
|
||||
<dlg:button dlg:id="CommandButton1" dlg:tab-index="2" dlg:left="-132" dlg:top="41" dlg:width="2" dlg:height="0" dlg:value="CommandButton1"/>
|
||||
<dlg:button dlg:id="CANCEL" dlg:tab-index="3" dlg:left="77" dlg:top="45" dlg:width="59" dlg:height="13" dlg:value="Отмена" dlg:button-type="cancel"/>
|
||||
</dlg:bulletinboard>
|
||||
</dlg:window>
|
|
@ -1,6 +1,6 @@
|
|||
<?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 redactionExtenstionName As String = "cleanAndValidate"
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Configuration" script:language="StarBasic" script:moduleType="normal">Public Const redactionExtensionName As String = "cleanAndValidate"
|
||||
|
||||
Function initRedactionConfiguration()
|
||||
On Error Goto exceptionHandler
|
||||
|
@ -9,9 +9,9 @@ Function initRedactionConfiguration()
|
|||
Dim props(2) As New com.sun.star.beans.PropertyValue
|
||||
|
||||
regFactory = CreateUnoService("com.sun.star.ucb.Store")
|
||||
reg = regFactory.createPropertySetRegistry(redactionExtenstionName)
|
||||
reg = regFactory.createPropertySetRegistry(redactionExtensionName)
|
||||
|
||||
redactionProps = reg.openPropertySet(redactionExtenstionName, TRUE)
|
||||
redactionProps = reg.openPropertySet(redactionExtensionName, TRUE)
|
||||
redactionProps.addProperty("complexity", 128, "user")
|
||||
initConfigureation = redactionProps
|
||||
exceptionHandler:
|
||||
|
@ -19,9 +19,43 @@ Function initRedactionConfiguration()
|
|||
initRedactionConfiguration = redactionProps
|
||||
End Function
|
||||
|
||||
Sub setRedactionComplexity(complexityLevel)
|
||||
Private Sub setConfigFromDialog(dialog)
|
||||
Dim config As Object
|
||||
config = initRedactionConfiguration()
|
||||
config.setPropertyValue("complexity", complexityLevel)
|
||||
If dialog.getControl("CB_complexity").state = 1 Then
|
||||
config.setPropertyValue("complexity", "makerUp")
|
||||
Else
|
||||
config.setPropertyValue("complexity", "user")
|
||||
EndIf
|
||||
End Sub
|
||||
|
||||
Private Sub loadConfigToDialog(dialog)
|
||||
Dim config As Object
|
||||
config = initRedactionConfiguration()
|
||||
If config.getPropertyValue("complexity") = "makerUp" Then
|
||||
dialog.getControl("CB_complexity").state = 1
|
||||
Else
|
||||
dialog.getControl("CB_complexity").state = 0
|
||||
EndIf
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub configurationDialog
|
||||
Dim dialog As Object
|
||||
DialogLibraries.LoadLibrary("Redaction")
|
||||
dialog = CreateUnoDialog(DialogLibraries.Redaction.ConfigDialog)
|
||||
loadConfigToDialog(dialog)
|
||||
dialog.setVisible(true)
|
||||
Select Case dialog.Execute()
|
||||
Case 1
|
||||
setConfigFromDialog(dialog)
|
||||
Case 0
|
||||
End Select
|
||||
|
||||
dialog.setVisible(false)
|
||||
dialog.dispose()
|
||||
Exit sub
|
||||
|
||||
|
||||
End Sub
|
||||
</script:module>
|
|
@ -1,3 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
|
||||
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="Redaction" library:readonly="false" library:passwordprotected="false"/>
|
||||
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="Redaction" library:readonly="false" library:passwordprotected="false">
|
||||
<library:element library:name="ConfigDialog"/>
|
||||
</library:library>
|
Loading…
Add table
Reference in a new issue