diff options
author | Behrend Cornelius <bc@openoffice.org> | 2002-11-27 14:33:34 +0000 |
---|---|---|
committer | Behrend Cornelius <bc@openoffice.org> | 2002-11-27 14:33:34 +0000 |
commit | c6f392c64b1d3cda31e08dbe15862b6c4ea858cd (patch) | |
tree | 72431aade403437fe7b1e97819a164b30945fa7a /wizards/source | |
parent | 6da26523364dc0f1f00f025db93996888ac89cc9 (diff) |
#105421# Overwrite Dialog added
Diffstat (limited to 'wizards/source')
-rw-r--r-- | wizards/source/tools/DlgOverwriteAll.xdl | 17 | ||||
-rw-r--r-- | wizards/source/tools/Misc.xba | 4 | ||||
-rw-r--r-- | wizards/source/tools/ModuleControls.xba | 49 | ||||
-rw-r--r-- | wizards/source/tools/dialog.xlb | 4 | ||||
-rw-r--r-- | wizards/source/tools/script.xlb | 4 |
5 files changed, 73 insertions, 5 deletions
diff --git a/wizards/source/tools/DlgOverwriteAll.xdl b/wizards/source/tools/DlgOverwriteAll.xdl new file mode 100644 index 000000000000..8cef0d04b55b --- /dev/null +++ b/wizards/source/tools/DlgOverwriteAll.xdl @@ -0,0 +1,17 @@ +<?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="DlgOverwriteAll" dlg:left="138" dlg:top="75" dlg:width="230" dlg:height="69" dlg:closeable="true" dlg:moveable="true"> + <dlg:bulletinboard> + <dlg:text dlg:id="lblQueryforSave" dlg:tab-index="0" dlg:left="6" dlg:top="6" dlg:width="218" dlg:height="35" dlg:value="lblQueryforSave" dlg:multiline="true"/> + <dlg:button dlg:id="cmdYes" dlg:tab-index="1" dlg:left="6" dlg:top="49" dlg:width="50" dlg:height="14" dlg:value="cmdYes"> + <script:event script:event-name="on-performaction" script:location="application" script:macro-name="Tools.ModuleControls.SetOVERWRITEToQuery" script:language="StarBasic"/> + </dlg:button> + <dlg:button dlg:id="cmdYesToAll" dlg:tab-index="2" dlg:left="62" dlg:top="49" dlg:width="50" dlg:height="14" dlg:value="cmdYesToAll"> + <script:event script:event-name="on-performaction" script:location="application" script:macro-name="Tools.ModuleControls.SetOVERWRITEToAlways" script:language="StarBasic"/> + </dlg:button> + <dlg:button dlg:id="cmdNo" dlg:tab-index="3" dlg:left="118" dlg:top="49" dlg:width="50" dlg:height="14" dlg:value="cmdNo"> + <script:event script:event-name="on-performaction" script:location="application" script:macro-name="Tools.ModuleControls.SetOVERWRITEToNever" script:language="StarBasic"/> + </dlg:button> + <dlg:button dlg:id="cmdCancel" dlg:tab-index="4" dlg:left="174" dlg:top="49" dlg:width="50" dlg:height="14" dlg:value="cmdCancel" dlg:button-type="cancel"/> + </dlg:bulletinboard> +</dlg:window>
\ No newline at end of file diff --git a/wizards/source/tools/Misc.xba b/wizards/source/tools/Misc.xba index fa0722097305..30881aba9c18 100644 --- a/wizards/source/tools/Misc.xba +++ b/wizards/source/tools/Misc.xba @@ -113,7 +113,7 @@ Dim sProdName as String oProdNameAccess = GetRegistryKeyContent("org.openoffice.Setup/Product") sProdName = oProdNameAccess.getByName("ooName") sVersion = oProdNameAccess.getByName("ooSetupVersion") - GetProductName = sProdName & sVersion + GetProductName = sProdName & " " & sVersion End Function @@ -807,4 +807,4 @@ Dim oFrame as Object End If End Sub -</script:module> +</script:module>
\ No newline at end of file diff --git a/wizards/source/tools/ModuleControls.xba b/wizards/source/tools/ModuleControls.xba index 37a5e23204ab..a94f0a9977af 100644 --- a/wizards/source/tools/ModuleControls.xba +++ b/wizards/source/tools/ModuleControls.xba @@ -2,6 +2,16 @@ <!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> <script:module xmlns:script="http://openoffice.org/2000/script" script:name="ModuleControls" script:language="StarBasic">Option Explicit +Public DlgOverwrite as Object +Public Const SBOVERWRITEUNDEFINED as Integer = 0 +Public Const SBOVERWRITECANCEL as Integer = 2 +Public Const SBOVERWRITEQUERY as Integer = 7 +Public Const SBOVERWRITEALWAYS as Integer = 6 +Public Const SBOVERWRITENEVER as Integer = 8 +Public iGeneralOverwrite as Integer + + + ' Accepts the name of a control and returns the respective control model as object ' The Container can either be a whole document or a specific sheet of a Calc-Document ' 'CName' is the name of the Control @@ -297,4 +307,43 @@ Dim oWindowPointer as Object oWindowPointer.SetType(com.sun.star.awt.SystemPointer.WAIT) End If oWindowPeer.SetPointer(oWindowPointer) +End Sub + + +Sub ShowOverwriteAllDialog(FilePath as String, sTitle as String) +Dim QueryString as String +Dim LocRetValue as Integer + If InitResources("", "com") Then + DlgOverwrite = LoadDialog("Tools", "DlgOverwriteAll") + DlgOverwrite.Title = sTitle + QueryString = "Das Dokument '<PATH>' existiert bereits.<BR><BR>Möchten Sie Datei(en) überschreiben?" + QueryString = ReplaceString(QueryString, ConvertFromUrl(FilePath), "<PATH>") + QueryString = ReplaceString(QueryString, chr(13), "<BR>") + DlgOverwrite.Model.lblQueryforSave.Label = QueryString + LocRetValue = DlgOverwrite.execute() + If LocRetValue = 0 Then + iGeneralOverwrite = SBOVERWRITECANCEL + End If + DlgOverwrite.dispose() + Else + iGeneralOverwrite = SBOVERWRITECANCEL + End If +End Sub + + +Sub SetOVERWRITEToQuery() + iGeneralOverwrite = SBOVERWRITEQUERY + DlgOverwrite.EndExecute() +End Sub + + +Sub SetOVERWRITEToAlways() + iGeneralOverwrite = SBOVERWRITEALWAYS + DlgOverwrite.EndExecute() +End Sub + + +Sub SetOVERWRITEToNever() + iGeneralOverwrite = SBOVERWRITENEVER + DlgOverwrite.EndExecute() End Sub</script:module>
\ No newline at end of file diff --git a/wizards/source/tools/dialog.xlb b/wizards/source/tools/dialog.xlb index 2666aa54567e..77170b682b93 100644 --- a/wizards/source/tools/dialog.xlb +++ b/wizards/source/tools/dialog.xlb @@ -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="Tools" library:readonly="true" library:passwordprotected="false"/> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="Tools" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="DlgOverwriteAll"/> +</library:library>
\ No newline at end of file diff --git a/wizards/source/tools/script.xlb b/wizards/source/tools/script.xlb index c107f2c9bfb6..7e46dfbe680c 100644 --- a/wizards/source/tools/script.xlb +++ b/wizards/source/tools/script.xlb @@ -1,10 +1,10 @@ <?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="Tools" library:readonly="true" library:passwordprotected="false"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="Tools" library:readonly="false" library:passwordprotected="false"> <library:element library:name="ModuleControls"/> <library:element library:name="Strings"/> <library:element library:name="Misc"/> <library:element library:name="UCB"/> <library:element library:name="Listbox"/> <library:element library:name="Debug"/> -</library:library> +</library:library>
\ No newline at end of file |