b9c0596
From 63c568821277e16db6b972b58b57c50d809df416 Mon Sep 17 00:00:00 2001
0027d5f
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
0027d5f
Date: Tue, 4 Mar 2014 13:31:41 +0000
0027d5f
Subject: [PATCH] actively search for wizards dir in all internal templates
0027d5f
0027d5f
Change-Id: I4ef6da4d9d1931917e0aaa6e110fd273bd917b26
0027d5f
---
b9c0596
 wizards/com/sun/star/wizards/ui/WizardDialog.py | 12 ++++++++++--
b9c0596
 1 file changed, 10 insertions(+), 2 deletions(-)
0027d5f
0027d5f
diff --git a/wizards/com/sun/star/wizards/ui/WizardDialog.py b/wizards/com/sun/star/wizards/ui/WizardDialog.py
b9c0596
index 239644b..08a8c2d 100644
0027d5f
--- a/wizards/com/sun/star/wizards/ui/WizardDialog.py
0027d5f
+++ b/wizards/com/sun/star/wizards/ui/WizardDialog.py
b9c0596
@@ -23,6 +23,7 @@ from .UnoDialog2 import UnoDialog2, Desktop, PropertyNames, UIConsts, \
b9c0596
 from .event.CommonListener import TerminateListenerProcAdapter
0027d5f
 from ..common.Resource import Resource
0027d5f
 from ..common.HelpIds import HelpIds
0027d5f
+from ..common.FileAccess import FileAccess
b9c0596
 from ..document.OfficeDocument import OfficeDocument
b9c0596
 from ..text.TextDocument import TextDocument
0027d5f
 
b9c0596
@@ -114,10 +115,17 @@ class WizardDialog(UnoDialog2):
0027d5f
     def initializePaths(self):
0027d5f
         xPropertySet = \
0027d5f
             self.xMSF.createInstance("com.sun.star.util.PathSettings")
0027d5f
-        self.sTemplatePath = \
0027d5f
-            xPropertySet.getPropertyValue("Template_internal")[0]
0027d5f
         self.sUserTemplatePath = \
0027d5f
             xPropertySet.getPropertyValue("Template_writable")
0027d5f
+        myFA = FileAccess(self.xMSF)
0027d5f
+        aInternalPaths = xPropertySet.getPropertyValue("Template_internal")
0027d5f
+        self.sTemplatePath = ""
0027d5f
+        for path in aInternalPaths:
0027d5f
+            if myFA.exists(path + "/wizard", False):
0027d5f
+                self.sTemplatePath = path
0027d5f
+                break
0027d5f
+        if self.sTemplatePath == "":
0027d5f
+            raise Exception("could not find wizard templates")
0027d5f
             
0027d5f
     def addRoadmap(self):
0027d5f
         try:
0027d5f
-- 
0027d5f
1.8.5.3
0027d5f