diff options
author | Javier Fernandez <jfernandez@igalia.com> | 2013-05-04 11:59:14 +0000 |
---|---|---|
committer | Javier Fernandez <jfernandez@igalia.com> | 2013-05-08 09:36:41 +0000 |
commit | 9532335dd2c3f2bb9c3761bf8c4c879107f1538d (patch) | |
tree | 4aed9fe68e528d807e4438799b7ccb2ab920a2e8 /wizards | |
parent | 9c54d77fffc9b6fda1af3020c5d1d2212b8e96c2 (diff) |
PyWebWizard: Fixing bugs and implementation of mising features.
Properly terminate and dispose the Wizard dialogs.
Change-Id: Ia10419d3a7bbeb5ffd7dc1f6a5452eb9df906f63
Diffstat (limited to 'wizards')
6 files changed, 29 insertions, 9 deletions
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py index 4dea434da517..243365af3c49 100644 --- a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py +++ b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py @@ -26,6 +26,7 @@ from .CGAgenda import CGAgenda from ..ui.PathSelection import PathSelection from ..ui.event.UnoDataAware import UnoDataAware from ..ui.event.RadioDataAware import RadioDataAware +from ..ui.event.CommonListener import TerminateListenerProcAdapter from ..common.NoValidPathException import NoValidPathException from ..common.SystemDialog import SystemDialog from ..common.Desktop import Desktop @@ -84,9 +85,10 @@ class AgendaWizardDialogImpl(AgendaWizardDialog): self.initializePaths() # initialize the agenda template + self.terminateListener = TerminateListenerProcAdapter(self) self.myAgendaDoc = AgendaDocument( self.xMSF, self.agenda, self.resources, - self.templateConsts, self) + self.templateConsts, self.terminateListener) self.initializeTemplates() self.myAgendaDoc.load( diff --git a/wizards/com/sun/star/wizards/document/OfficeDocument.py b/wizards/com/sun/star/wizards/document/OfficeDocument.py index 97197ab2d478..eb6fb0a52736 100644 --- a/wizards/com/sun/star/wizards/document/OfficeDocument.py +++ b/wizards/com/sun/star/wizards/document/OfficeDocument.py @@ -123,7 +123,7 @@ class OfficeDocument(object): if listener is not None: xFF = xF.getFrames() xFF.remove(xFrame) - xF.addTerminateListener(TerminateListenerProcAdapter(listener)) + xF.addTerminateListener(listener) return xFrame @@ -174,8 +174,7 @@ class OfficeDocument(object): #and not part of the desktop tree. #You are alone with him .-) if listener is not None: - Desktop.getDesktop(xMSF).addTerminateListener( - TerminateListenerProcAdapter(listener)) + Desktop.getDesktop(xMSF).addTerminateListener(listener) return xFrame diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py index ead90e178806..9328757e3270 100644 --- a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py +++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py @@ -23,6 +23,7 @@ from .FaxDocument import FaxDocument from ..ui.PathSelection import PathSelection from ..ui.event.UnoDataAware import UnoDataAware from ..ui.event.RadioDataAware import RadioDataAware +from ..ui.event.CommonListener import TerminateListenerProcAdapter from ..text.TextFieldHandler import TextFieldHandler from ..text.TextElement import TextElement from ..common.Configuration import Configuration @@ -81,7 +82,8 @@ class FaxWizardDialogImpl(FaxWizardDialog): self.nMaxStep = 5 #instatiate The Document Frame for the Preview - self.myFaxDoc = FaxDocument(xMSF, self) + self.terminateListener = TerminateListenerProcAdapter(self) + self.myFaxDoc = FaxDocument(xMSF, self.terminateListener) #create the dialog: self.drawNaviBar() diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py index 8cf7c59fdcf0..1ff5f1cb5da4 100644 --- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py +++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py @@ -28,6 +28,7 @@ from ..common.Desktop import Desktop from ..ui.PathSelection import PathSelection from ..ui.event.UnoDataAware import UnoDataAware from ..ui.event.RadioDataAware import RadioDataAware +from ..ui.event.CommonListener import TerminateListenerProcAdapter from ..text.TextElement import TextElement from ..text.TextFieldHandler import TextFieldHandler from ..document.OfficeDocument import OfficeDocument @@ -89,7 +90,8 @@ class LetterWizardDialogImpl(LetterWizardDialog): self.nMaxStep = 6 #instatiate The Document Frame for the Preview - self.myLetterDoc = LetterDocument(xMSF, self) + self.terminateListener = TerminateListenerProcAdapter(self) + self.myLetterDoc = LetterDocument(xMSF, self.terminateListener) #create the dialog self.drawNaviBar() diff --git a/wizards/com/sun/star/wizards/ui/WizardDialog.py b/wizards/com/sun/star/wizards/ui/WizardDialog.py index 534122afac49..fc1ce41b047c 100644 --- a/wizards/com/sun/star/wizards/ui/WizardDialog.py +++ b/wizards/com/sun/star/wizards/ui/WizardDialog.py @@ -65,6 +65,14 @@ class WizardDialog(UnoDialog2): self.sMsgEndAutopilot = self.__oWizardResource.getResText( UIConsts.RID_DB_COMMON + 33) self.oRoadmap = None + self.terminateListener = None + + def activate(self): + try: + self.xUnoDialog.toFront() + except Exception: + pass + # do nothing; def itemStateChanged(self, itemEvent): try: @@ -445,8 +453,7 @@ class WizardDialog(UnoDialog2): def removeTerminateListener(self): if self.__bTerminateListenermustberemoved: - Desktop.getDesktop(self.xMSF).removeTerminateListener( \ - TerminateListenerProcAdapter(self)) + Desktop.getDesktop(self.xMSF).removeTerminateListener(self.terminateListener) self.__bTerminateListenermustberemoved = False ''' @@ -463,10 +470,16 @@ class WizardDialog(UnoDialog2): except Exception: traceback.print_exc() + def windowHidden(): + self.cancelWizard_1() + def queryTermination(self): self.activate() raise TerminationVetoException() + def disposing(arg0): + self.cancelWizard_1() + def optCreateFromTemplateItemChanged(self): self.bEditTemplate = False diff --git a/wizards/com/sun/star/wizards/web/WWD_Startup.py b/wizards/com/sun/star/wizards/web/WWD_Startup.py index 82959d1cfcda..6c5ccdfe7f60 100644 --- a/wizards/com/sun/star/wizards/web/WWD_Startup.py +++ b/wizards/com/sun/star/wizards/web/WWD_Startup.py @@ -31,6 +31,7 @@ from .data.CGSessionName import CGSessionName from ..ui.event.ListModelBinder import ListModelBinder from ..ui.event.UnoDataAware import UnoDataAware from ..ui.event.RadioDataAware import RadioDataAware +from ..ui.event.CommonListener import TerminateListenerProcAdapter from ..ui.DocumentPreview import DocumentPreview from ..ui.event.DataAware import DataAware from ..ui.event.Task import Task @@ -127,7 +128,8 @@ class WWD_Startup(WWD_General): self.buildStepX() self.xMSF = xmsf xDesktop = Desktop.getDesktop(xmsf) - self.myFrame = OfficeDocument.createNewFrame(xmsf, self) + self.terminateListener = TerminateListenerProcAdapter(self) + self.myFrame = OfficeDocument.createNewFrame(xmsf, self.terminateListener) doc = OfficeDocument.createNewDocument( self.myFrame, "swriter", False, True) self.loadSettings(doc) |