Kaydet (Commit) 29f0cbff authored tarafından Xisco Fauli's avatar Xisco Fauli

pyagenda: fix finish wizard

Change-Id: Ic0a4c4491cfdf0070552f38f706aea0cb53178be
üst 66ec3084
...@@ -158,9 +158,6 @@ class AgendaTemplate(TextDocument): ...@@ -158,9 +158,6 @@ class AgendaTemplate(TextDocument):
self.redrawTitle("txtDate") self.redrawTitle("txtDate")
self.redrawTitle("txtTime") self.redrawTitle("txtTime")
self.redrawTitle("cbLocation") self.redrawTitle("cbLocation")
if AgendaTemplate.agenda.cp_TemplateName is None:
AgendaTemplate.agenda.cp_TemplateName = ""
self.setTemplateTitle(AgendaTemplate.agenda.cp_TemplateName)
'''redraws/rewrites the table which contains the given item '''redraws/rewrites the table which contains the given item
This method is called when the user checks/unchecks an item. This method is called when the user checks/unchecks an item.
...@@ -181,14 +178,6 @@ class AgendaTemplate(TextDocument): ...@@ -181,14 +178,6 @@ class AgendaTemplate(TextDocument):
traceback.print_exc() traceback.print_exc()
AgendaTemplate.xTextDocument.unlockControllers() AgendaTemplate.xTextDocument.unlockControllers()
'''update the documents title property to the given title
@param newTitle title.
'''
@synchronized(lock)
def setTemplateTitle(self, newTitle):
self.m_xDocProps.Title = newTitle
'''checks the data model if the '''checks the data model if the
item corresponding to the given string should be shown item corresponding to the given string should be shown
@param itemName a string representing an Item (name or heading). @param itemName a string representing an Item (name or heading).
...@@ -336,11 +325,6 @@ class AgendaTemplate(TextDocument): ...@@ -336,11 +325,6 @@ class AgendaTemplate(TextDocument):
AgendaTemplate.timeFormat = \ AgendaTemplate.timeFormat = \
AgendaTemplate.dateUtils.getFormat(TIME_HHMM) AgendaTemplate.dateUtils.getFormat(TIME_HHMM)
'''
get the document properties object.
'''
self.m_xDocProps = AgendaTemplate.xTextDocument.DocumentProperties
self.initItemsCache() self.initItemsCache()
AgendaTemplate._allItems = self.searchFillInItems(0) AgendaTemplate._allItems = self.searchFillInItems(0)
self.initializeTitles() self.initializeTitles()
......
...@@ -322,8 +322,7 @@ class AgendaWizardDialog(WizardDialog): ...@@ -322,8 +322,7 @@ class AgendaWizardDialog(WizardDialog):
(8, self.resources.reslblTemplateName_value, (8, self.resources.reslblTemplateName_value,
97, 62, 6, 602, 101)) 97, 62, 6, 602, 101))
self.txtTemplateName = self.insertTextField("txtTemplateName", self.txtTemplateName = self.insertTextField("txtTemplateName",
AgendaWizardDialogConst.TXTTEMPLATENAME_TEXT_CHANGED, None, self.PROPS_X,
self.PROPS_X,
(12, AgendaWizardDialogConst.TXTTEMPLATENAME_HID, (12, AgendaWizardDialogConst.TXTTEMPLATENAME_HID,
202, 60, 6, 603, 100), self) 202, 60, 6, 603, 100), self)
self.insertLabel("lblProceed", self.PROPS_TEXT, self.insertLabel("lblProceed", self.PROPS_TEXT,
......
...@@ -38,7 +38,6 @@ class AgendaWizardDialogConst: ...@@ -38,7 +38,6 @@ class AgendaWizardDialogConst:
CHKUSEOBSERVERS_ITEM_CHANGED = "chkUseObserversItemChanged" CHKUSEOBSERVERS_ITEM_CHANGED = "chkUseObserversItemChanged"
CHKUSERESOURCEPERSONS_ITEM_CHANGED = "chkUseResourcePersonsItemChanged" CHKUSERESOURCEPERSONS_ITEM_CHANGED = "chkUseResourcePersonsItemChanged"
LISTPAGEDESIGN_ACTION_PERFORMED = "pageDesignChanged" LISTPAGEDESIGN_ACTION_PERFORMED = "pageDesignChanged"
TXTTEMPLATENAME_TEXT_CHANGED = "templateTitleChanged"
BTNTEMPLATEPATH_ACTION_PERFORMED = "saveAs" BTNTEMPLATEPATH_ACTION_PERFORMED = "saveAs"
BTNINSERT_ACTION_PERFORMED = "insertRow" BTNINSERT_ACTION_PERFORMED = "insertRow"
BTNREMOVE_ACTION_PERFORMED = "removeRow" BTNREMOVE_ACTION_PERFORMED = "removeRow"
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
# the License at http://www.apache.org/licenses/LICENSE-2.0 . # the License at http://www.apache.org/licenses/LICENSE-2.0 .
# #
import traceback import traceback
from .AgendaWizardDialog import AgendaWizardDialog from .AgendaWizardDialog import AgendaWizardDialog, uno
from .AgendaWizardDialogConst import HID from .AgendaWizardDialogConst import HID
from .AgendaTemplate import AgendaTemplate, FileAccess from .AgendaTemplate import AgendaTemplate, FileAccess
from .TemplateConsts import TemplateConsts from .TemplateConsts import TemplateConsts
...@@ -30,6 +30,8 @@ from ..common.SystemDialog import SystemDialog ...@@ -30,6 +30,8 @@ from ..common.SystemDialog import SystemDialog
from ..common.Desktop import Desktop from ..common.Desktop import Desktop
from ..common.HelpIds import HelpIds from ..common.HelpIds import HelpIds
from ..common.Configuration import Configuration from ..common.Configuration import Configuration
from ..document.OfficeDocument import OfficeDocument
from ..text.ViewHandler import ViewHandler
from com.sun.star.view.DocumentZoomType import OPTIMAL from com.sun.star.view.DocumentZoomType import OPTIMAL
from com.sun.star.awt.VclWindowPeerAttribute import YES_NO, DEF_NO from com.sun.star.awt.VclWindowPeerAttribute import YES_NO, DEF_NO
...@@ -255,14 +257,6 @@ class AgendaWizardDialogImpl(AgendaWizardDialog): ...@@ -255,14 +257,6 @@ class AgendaWizardDialogImpl(AgendaWizardDialog):
except Exception: except Exception:
traceback.print_exc() traceback.print_exc()
'''
last page, template title changed...
'''
def templateTitleChanged(self):
title = Helper.getUnoPropertyValue(getModel(txtTemplateName), "Text")
self.agendaTemplate.setTemplateTitle(title)
#textFields listeners #textFields listeners
def txtTitleTextChanged(self): def txtTitleTextChanged(self):
AgendaTemplate.redrawTitle("txtTitle") AgendaTemplate.redrawTitle("txtTitle")
...@@ -354,10 +348,14 @@ class AgendaWizardDialogImpl(AgendaWizardDialog): ...@@ -354,10 +348,14 @@ class AgendaWizardDialogImpl(AgendaWizardDialog):
# user said: no, do not overwrite # user said: no, do not overwrite
endWizard = False endWizard = False
return False return False
xTextDocument = self.agendaTemplate.document xDocProps = self.agendaTemplate.xTextDocument.DocumentProperties
xDocProps.Title = self.txtTemplateName.Text
self.agendaTemplate.setWizardTemplateDocInfo( \
self.resources.resAgendaWizardDialog_title,
self.resources.resTemplateDescription)
bSaveSuccess = OfficeDocument.store( bSaveSuccess = OfficeDocument.store(
self.xMSF, AgendaTemplate.xTextDocument, self.sPath, self.xMSF, self.agendaTemplate.xTextDocument, self.sPath,
"writer8_template") "writer8_template")
if bSaveSuccess: if bSaveSuccess:
......
...@@ -174,3 +174,5 @@ class AgendaWizardDialogResources(Resource): ...@@ -174,3 +174,5 @@ class AgendaWizardDialogResources(Resource):
#Common Resources #Common Resources
self.resOverwriteWarning = self.getResText( self.resOverwriteWarning = self.getResText(
AgendaWizardDialogResources.RID_COMMON_START + 19) AgendaWizardDialogResources.RID_COMMON_START + 19)
self.resTemplateDescription = self.getResText(
AgendaWizardDialogResources.RID_COMMON_START + 20)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment