summaryrefslogtreecommitdiff
path: root/wizards
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2012-10-08 22:28:55 +0200
committerXisco Fauli <anistenis@gmail.com>2012-10-08 22:35:28 +0200
commit4d9ab30c7dbe944d5bf268d64b493ced957bb9f3 (patch)
treec29e1d5d729705d3c9013adca5505e1067e50338 /wizards
parent48b2d6adccee986390c923ff1acb4dd101a05595 (diff)
pyfax: Don't show "the file already exists" when it doesn't do
Change-Id: Iab496836b692d47be75bb617b0b28835acf01713
Diffstat (limited to 'wizards')
-rw-r--r--wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py15
-rw-r--r--wizards/com/sun/star/wizards/ui/PathSelection.py6
-rw-r--r--wizards/com/sun/star/wizards/ui/WizardDialog.py9
-rw-r--r--wizards/com/sun/star/wizards/ui/XPathSelectionListener.py24
4 files changed, 13 insertions, 41 deletions
diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py
index ae738009839e..0547ea1b5f7a 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 6d5762d7910d..b468004a0d91 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 ebc401e17ec5..ea7cab844dca 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 474efc00b3f1..000000000000
--- 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