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):
self.redrawTitle("txtDate")
self.redrawTitle("txtTime")
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
This method is called when the user checks/unchecks an item.
......@@ -181,14 +178,6 @@ class AgendaTemplate(TextDocument):
traceback.print_exc()
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
item corresponding to the given string should be shown
@param itemName a string representing an Item (name or heading).
......@@ -336,11 +325,6 @@ class AgendaTemplate(TextDocument):
AgendaTemplate.timeFormat = \
AgendaTemplate.dateUtils.getFormat(TIME_HHMM)
'''
get the document properties object.
'''
self.m_xDocProps = AgendaTemplate.xTextDocument.DocumentProperties
self.initItemsCache()
AgendaTemplate._allItems = self.searchFillInItems(0)
self.initializeTitles()
......
......@@ -322,8 +322,7 @@ class AgendaWizardDialog(WizardDialog):
(8, self.resources.reslblTemplateName_value,
97, 62, 6, 602, 101))
self.txtTemplateName = self.insertTextField("txtTemplateName",
AgendaWizardDialogConst.TXTTEMPLATENAME_TEXT_CHANGED,
self.PROPS_X,
None, self.PROPS_X,
(12, AgendaWizardDialogConst.TXTTEMPLATENAME_HID,
202, 60, 6, 603, 100), self)
self.insertLabel("lblProceed", self.PROPS_TEXT,
......
......@@ -38,7 +38,6 @@ class AgendaWizardDialogConst:
CHKUSEOBSERVERS_ITEM_CHANGED = "chkUseObserversItemChanged"
CHKUSERESOURCEPERSONS_ITEM_CHANGED = "chkUseResourcePersonsItemChanged"
LISTPAGEDESIGN_ACTION_PERFORMED = "pageDesignChanged"
TXTTEMPLATENAME_TEXT_CHANGED = "templateTitleChanged"
BTNTEMPLATEPATH_ACTION_PERFORMED = "saveAs"
BTNINSERT_ACTION_PERFORMED = "insertRow"
BTNREMOVE_ACTION_PERFORMED = "removeRow"
......
......@@ -16,7 +16,7 @@
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
import traceback
from .AgendaWizardDialog import AgendaWizardDialog
from .AgendaWizardDialog import AgendaWizardDialog, uno
from .AgendaWizardDialogConst import HID
from .AgendaTemplate import AgendaTemplate, FileAccess
from .TemplateConsts import TemplateConsts
......@@ -30,6 +30,8 @@ from ..common.SystemDialog import SystemDialog
from ..common.Desktop import Desktop
from ..common.HelpIds import HelpIds
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.awt.VclWindowPeerAttribute import YES_NO, DEF_NO
......@@ -255,14 +257,6 @@ class AgendaWizardDialogImpl(AgendaWizardDialog):
except Exception:
traceback.print_exc()
'''
last page, template title changed...
'''
def templateTitleChanged(self):
title = Helper.getUnoPropertyValue(getModel(txtTemplateName), "Text")
self.agendaTemplate.setTemplateTitle(title)
#textFields listeners
def txtTitleTextChanged(self):
AgendaTemplate.redrawTitle("txtTitle")
......@@ -354,10 +348,14 @@ class AgendaWizardDialogImpl(AgendaWizardDialog):
# user said: no, do not overwrite
endWizard = 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(
self.xMSF, AgendaTemplate.xTextDocument, self.sPath,
self.xMSF, self.agendaTemplate.xTextDocument, self.sPath,
"writer8_template")
if bSaveSuccess:
......
......@@ -174,3 +174,5 @@ class AgendaWizardDialogResources(Resource):
#Common Resources
self.resOverwriteWarning = self.getResText(
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