[Libreoffice-commits] .: wizards/com

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Oct 8 13:36:26 PDT 2012


 wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py   |   15 +++++---
 wizards/com/sun/star/wizards/ui/PathSelection.py          |    6 +--
 wizards/com/sun/star/wizards/ui/WizardDialog.py           |    9 -----
 wizards/com/sun/star/wizards/ui/XPathSelectionListener.py |   24 --------------
 4 files changed, 13 insertions(+), 41 deletions(-)

New commits:
commit 4d9ab30c7dbe944d5bf268d64b493ced957bb9f3
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Mon Oct 8 22:28:55 2012 +0200

    pyfax: Don't show "the file already exists" when it doesn't do
    
    Change-Id: Iab496836b692d47be75bb617b0b28835acf01713

diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py
index ae73800..0547ea1 100644
--- a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py
+++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py
@@ -16,7 +16,8 @@
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
 import traceback
-from .FaxWizardDialog import FaxWizardDialog, Helper, PropertyNames, uno
+from .FaxWizardDialog import FaxWizardDialog, Helper, PropertyNames, uno, \
+    WizardDialog
 from .CGFaxWizard import CGFaxWizard
 from .FaxDocument import FaxDocument
 from .FaxWizardDialogConst import HID
@@ -103,7 +104,7 @@ class FaxWizardDialogImpl(FaxWizardDialog):
             self.initializeCommunication()
             self.__initializePaths()
 
-            #special Control fFrameor setting the save Path:
+            #special Control for setting the save Path:
             self.insertPathSelectionControl()
 
             self.initializeTemplates(xMSF)
@@ -157,7 +158,7 @@ class FaxWizardDialogImpl(FaxWizardDialog):
         try:
             fileAccess = FileAccess(self.xMSF)
             self.sPath = self.myPathSelection.getSelectedPath()
-            if self.sPath == "":
+            if not self.sPath:
                 self.myPathSelection.triggerPathPicker()
                 self.sPath = self.myPathSelection.getSelectedPath()
 
@@ -279,8 +280,7 @@ class FaxWizardDialogImpl(FaxWizardDialog):
         self.myPathSelection.sDefaultDirectory = self.UserTemplatePath
         self.myPathSelection.sDefaultName = "myFaxTemplate.ott"
         self.myPathSelection.sDefaultFilter = "writer8_template"
-        self.myPathSelection.addSelectionListener( \
-            self.myPathSelectionListener())
+        self.myPathSelection.addSelectionListener(self)
 
     def __initializePaths(self):
         try:
@@ -708,3 +708,8 @@ class FaxWizardDialogImpl(FaxWizardDialog):
         Helper.setUnoPropertyValue(BPaperItem,
             PropertyNames.PROPERTY_ENABLED, False)
 
+
+    def validatePath(self):
+        if self.myPathSelection.usedPathPicker:
+                self.filenameChanged = True
+        self.myPathSelection.usedPathPicker = False
diff --git a/wizards/com/sun/star/wizards/ui/PathSelection.py b/wizards/com/sun/star/wizards/ui/PathSelection.py
index 6d5762d..b468004 100644
--- a/wizards/com/sun/star/wizards/ui/PathSelection.py
+++ b/wizards/com/sun/star/wizards/ui/PathSelection.py
@@ -117,7 +117,7 @@ class PathSelection(object):
                         self.sDefaultName, self.sDefaultFilter)
                     sStorePath = myFilePickerDialog.sStorePath
                     if sStorePath is not None:
-                        myFA = FileAccess(self.xMSF);
+                        myFA = FileAccess(self.xMSF)
                         self.xSaveTextBox.Text = myFA.getPath(sStorePath, None)
                         self.sDefaultDirectory = \
                             FileAccess.getParentDir(sStorePath)
@@ -134,5 +134,5 @@ class PathSelection(object):
             traceback.print_exc()
 
     def callXPathSelectionListener(self):
-        if self.xAction != None:
-            self.xAction.validatePath()
+            if self.xAction is not None:
+                self.xAction.validatePath()      
diff --git a/wizards/com/sun/star/wizards/ui/WizardDialog.py b/wizards/com/sun/star/wizards/ui/WizardDialog.py
index ebc401e..ea7cab8 100644
--- a/wizards/com/sun/star/wizards/ui/WizardDialog.py
+++ b/wizards/com/sun/star/wizards/ui/WizardDialog.py
@@ -20,7 +20,6 @@ import traceback
 from abc import ABCMeta, abstractmethod
 from .UnoDialog2 import UnoDialog2, Desktop, PropertyNames, UIConsts, \
 	ItemListenerProcAdapter
-from .XPathSelectionListener import XPathSelectionListener
 from .event.CommonListener import TerminateListenerProcAdapter
 from ..common.Helper import Helper
 from ..common.Resource import Resource
@@ -501,11 +500,3 @@ class WizardDialog(UnoDialog2):
         OfficeDocument.attachEventCall(
             TextDocument.xTextDocument, "OnNew", "StarBasic",
             "macro:///Template.Correspondence.Database()")
-
-    class myPathSelectionListener(XPathSelectionListener):
-
-        def validatePath(self):
-            if self.myPathSelection.usedPathPicker:
-                self.filenameChanged = True
-
-            self.myPathSelection.usedPathPicker = False
diff --git a/wizards/com/sun/star/wizards/ui/XPathSelectionListener.py b/wizards/com/sun/star/wizards/ui/XPathSelectionListener.py
deleted file mode 100644
index 474efc0..0000000
--- a/wizards/com/sun/star/wizards/ui/XPathSelectionListener.py
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-#   Licensed to the Apache Software Foundation (ASF) under one or more
-#   contributor license agreements. See the NOTICE file distributed
-#   with this work for additional information regarding copyright
-#   ownership. The ASF licenses this file to you under the Apache
-#   License, Version 2.0 (the "License"); you may not use this file
-#   except in compliance with the License. You may obtain a copy of
-#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-from abc import ABCMeta, abstractmethod
-
-class XPathSelectionListener(object):
-
-    @abstractmethod
-    def validatePath(self):
-        pass


More information about the Libreoffice-commits mailing list