Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
74e4137c
Kaydet (Commit)
74e4137c
authored
Eyl 27, 2012
tarafından
Xisco Fauli
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
pyfax: Translate the template at run-time
Change-Id: Ied94eaeb33dcfab582ac1d4702b736cf81c5d7ca
üst
0e66cce3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
106 additions
and
10 deletions
+106
-10
TextElement.py
wizards/com/sun/star/wizards/common/TextElement.py
+41
-0
CallWizard.py
wizards/com/sun/star/wizards/fax/CallWizard.py
+0
-1
FaxDocument.py
wizards/com/sun/star/wizards/fax/FaxDocument.py
+5
-4
FaxWizardDialogImpl.py
wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py
+31
-3
FaxWizardDialogResources.py
wizards/com/sun/star/wizards/fax/FaxWizardDialogResources.py
+29
-2
No files found.
wizards/com/sun/star/wizards/common/TextElement.py
0 → 100644
Dosyayı görüntüle @
74e4137c
#
# 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 .
#
import
traceback
from
.Helper
import
Helper
from
com.sun.star.text.PlaceholderType
import
TEXT
class
TextElement
(
object
):
def
__init__
(
self
,
item
,
placeHolderText
,
hint
,
xmsf
):
self
.
item
=
item
self
.
placeHolderText
=
placeHolderText
self
.
xmsf
=
xmsf
self
.
paraStyle
=
Helper
.
getUnoPropertyValue
(
item
.
Start
,
"ParaStyleName"
)
def
write
(
self
):
try
:
if
self
.
item
is
not
None
:
self
.
item
.
String
=
""
cursor
=
self
.
item
.
Text
.
createTextCursorByRange
(
self
.
item
.
Start
)
cursor
.
String
=
self
.
placeHolderText
Helper
.
setUnoPropertyValue
(
cursor
,
"ParaStyleName"
,
self
.
paraStyle
)
except
Exception
,
e
:
traceback
.
print_exc
()
wizards/com/sun/star/wizards/fax/CallWizard.py
Dosyayı görüntüle @
74e4137c
...
...
@@ -30,7 +30,6 @@ class CallWizard(unohelper.Base, XJobExecutor):
self
.
ctx
=
ctx
def
trigger
(
self
,
args
):
print
"hello"
try
:
fw
=
FaxWizardDialogImpl
(
self
.
ctx
.
ServiceManager
)
fw
.
startWizard
(
self
.
ctx
.
ServiceManager
)
...
...
wizards/com/sun/star/wizards/fax/FaxDocument.py
Dosyayı görüntüle @
74e4137c
...
...
@@ -15,9 +15,9 @@
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
from
..text.TextDocument
import
TextDocument
,
traceback
,
Helper
,
\
TextFieldHandler
,
Configuration
from
..text.TextDocument
import
*
#
TextDocument, traceback, Helper,\
#
TextFieldHandler, Configuration
from
..text.TextSectionHandler
import
TextSectionHandler
from
..common.PropertyNames
import
PropertyNames
...
...
@@ -51,8 +51,8 @@ class FaxDocument(TextDocument):
def
switchFooter
(
self
,
sPageStyle
,
bState
,
bPageNumber
,
sText
):
if
TextDocument
.
xTextDocument
is
not
None
:
TextDocument
.
xTextDocument
.
lockControllers
()
try
:
TextDocument
.
xTextDocument
.
lockControllers
()
xPageStyleCollection
=
\
TextDocument
.
xTextDocument
.
StyleFamilies
.
getByName
(
"PageStyles"
)
xPageStyle
=
xPageStyleCollection
.
getByName
(
sPageStyle
)
...
...
@@ -84,6 +84,7 @@ class FaxDocument(TextDocument):
TextDocument
.
xTextDocument
.
unlockControllers
()
except
Exception
:
TextDocument
.
xTextDocument
.
lockControllers
()
traceback
.
print_exc
()
def
hasElement
(
self
,
sElement
):
...
...
wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py
Dosyayı görüntüle @
74e4137c
...
...
@@ -32,6 +32,7 @@ from ..common.NoValidPathException import NoValidPathException
from
..common.HelpIds
import
HelpIds
from
..common.FileAccess
import
FileAccess
from
..common.Desktop
import
Desktop
from
..common.TextElement
import
TextElement
from
..document.OfficeDocument
import
OfficeDocument
from
com.sun.star.awt.VclWindowPeerAttribute
import
YES_NO
,
DEF_NO
...
...
@@ -67,15 +68,17 @@ class FaxWizardDialogImpl(FaxWizardDialog):
@classmethod
def
main
(
self
,
args
):
#
only being called when starting
wizard remotely
#
Call the
wizard remotely
try
:
ConnectStr
=
\
"uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext"
xLocMSF
=
Desktop
.
connect
(
ConnectStr
)
lw
=
FaxWizardDialogImpl
(
xLocMSF
)
lw
.
startWizard
(
xLocMSF
)
except
Exception
,
e
:
traceback
.
print_exc
()
except
Exception
as
e
:
print
(
"Wizard failure exception "
+
str
(
type
(
e
))
+
" message "
+
str
(
e
)
+
" args "
+
str
(
e
.
args
)
+
traceback
.
format_exc
())
def
startWizard
(
self
,
xMSF
):
self
.
running
=
True
...
...
@@ -232,6 +235,30 @@ class FaxWizardDialogImpl(FaxWizardDialog):
except
CloseVetoException
,
e
:
traceback
.
print_exc
()
def
drawConstants
(
self
):
'''Localise the template'''
constRangeList
=
self
.
searchFillInItems
(
1
)
for
i
in
xrange
(
constRangeList
.
Count
):
item
=
constRangeList
.
getByIndex
(
i
)
text
=
item
.
String
.
lower
()
aux
=
TextElement
(
item
,
self
.
resources
.
dictConstants
[
text
],
"hint"
,
self
.
xMSF
)
aux
.
write
()
def
searchFillInItems
(
self
,
typeSearch
):
sd
=
TextDocument
.
xTextDocument
.
createSearchDescriptor
()
if
typeSearch
==
0
:
sd
.
setSearchString
(
"<[^>]+>"
)
elif
typeSearch
==
1
:
sd
.
setSearchString
(
"#[^#]+#"
)
sd
.
setPropertyValue
(
"SearchRegularExpression"
,
True
)
sd
.
setPropertyValue
(
"SearchWords"
,
True
)
return
TextDocument
.
xTextDocument
.
findAll
(
sd
)
def
insertRoadmap
(
self
):
self
.
addRoadmap
()
self
.
insertRoadMapItems
(
...
...
@@ -430,6 +457,7 @@ class FaxWizardDialogImpl(FaxWizardDialog):
self
.
BusinessFiles
[
1
][
selectedItemPos
],
False
)
self
.
initializeElements
()
self
.
setElements
()
self
.
drawConstants
()
def
optPrivateFaxItemChanged
(
self
):
FaxWizardDialogImpl
.
lstBusinessStylePos
=
None
...
...
wizards/com/sun/star/wizards/fax/FaxWizardDialogResources.py
Dosyayı görüntüle @
74e4137c
...
...
@@ -25,6 +25,15 @@ class FaxWizardDialogResources(Resource):
RID_FAXWIZARDSALUTATION_START
=
3290
RID_FAXWIZARDROADMAP_START
=
3300
RID_RID_COMMON_START
=
500
resToPlaceHolder
=
"#to#"
resFromPlaceHolder
=
"#from#"
resFaxconstPlaceHolder
=
"#faxconst#"
resTelconstPlaceHolder
=
"#telconst#"
resEmailconstPlaceHolder
=
"#emailconst#"
resConsist1PlaceHolder
=
"#consist1#"
resConsist2PlaceHolder
=
"#consist2#"
resConsist3PlaceHolder
=
"#consist3#"
def
__init__
(
self
,
xmsf
):
...
...
@@ -40,8 +49,6 @@ class FaxWizardDialogResources(Resource):
self
.
resFaxWizardDialog_title
=
self
.
getResText
(
FaxWizardDialogResources
.
RID_FAXWIZARDDIALOG_START
+
1
)
self
.
resLabel9_value
=
self
.
getResText
(
FaxWizardDialogResources
.
RID_FAXWIZARDDIALOG_START
+
2
)
self
.
resoptBusinessFax_value
=
self
.
getResText
(
FaxWizardDialogResources
.
RID_FAXWIZARDDIALOG_START
+
3
)
self
.
resoptPrivateFax_value
=
self
.
getResText
(
...
...
@@ -118,6 +125,26 @@ class FaxWizardDialogResources(Resource):
FaxWizardDialogResources
.
RID_FAXWIZARDDIALOG_START
+
39
)
self
.
resLabel2_value
=
self
.
getResText
(
FaxWizardDialogResources
.
RID_FAXWIZARDDIALOG_START
+
40
)
#Create a Dictionary for the constants values.
self
.
dictConstants
=
{
FaxWizardDialogResources
.
resToPlaceHolder
:
self
.
getResText
(
FaxWizardDialogResources
.
RID_FAXWIZARDDIALOG_START
+
41
),
FaxWizardDialogResources
.
resFromPlaceHolder
:
self
.
getResText
(
FaxWizardDialogResources
.
RID_FAXWIZARDDIALOG_START
+
42
),
FaxWizardDialogResources
.
resFaxconstPlaceHolder
:
self
.
getResText
(
FaxWizardDialogResources
.
RID_FAXWIZARDDIALOG_START
+
43
),
FaxWizardDialogResources
.
resTelconstPlaceHolder
:
self
.
getResText
(
FaxWizardDialogResources
.
RID_FAXWIZARDDIALOG_START
+
44
),
FaxWizardDialogResources
.
resEmailconstPlaceHolder
:
self
.
getResText
(
FaxWizardDialogResources
.
RID_FAXWIZARDDIALOG_START
+
45
),
FaxWizardDialogResources
.
resConsist1PlaceHolder
:
self
.
getResText
(
FaxWizardDialogResources
.
RID_FAXWIZARDDIALOG_START
+
46
),
FaxWizardDialogResources
.
resConsist2PlaceHolder
:
self
.
getResText
(
FaxWizardDialogResources
.
RID_FAXWIZARDDIALOG_START
+
47
),
FaxWizardDialogResources
.
resConsist3PlaceHolder
:
self
.
getResText
(
FaxWizardDialogResources
.
RID_FAXWIZARDDIALOG_START
+
48
)}
self
.
loadRoadmapResources
()
self
.
loadSalutationResources
()
self
.
loadGreetingResources
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment