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
531b7136
Kaydet (Commit)
531b7136
authored
Kas 07, 2012
tarafından
Xisco Fauli
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
pyagenda: remove duplicate code
Change-Id: Id0842c128038bc4ec2f0c3b0145c8bb9fac5142b
üst
d6ee3e33
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
50 deletions
+38
-50
AgendaTemplate.py
wizards/com/sun/star/wizards/agenda/AgendaTemplate.py
+23
-38
AgendaWizardDialogImpl.py
...rds/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py
+15
-12
No files found.
wizards/com/sun/star/wizards/agenda/AgendaTemplate.py
Dosyayı görüntüle @
531b7136
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
import
uno
import
uno
import
traceback
import
traceback
from
threading
import
RLock
from
threading
import
RLock
from
.
TemplateConsts
import
TemplateConsts
from
.
.text.TextElement
import
TextElement
from
..text.TextDocument
import
TextDocument
from
..text.TextDocument
import
TextDocument
from
..common.FileAccess
import
FileAccess
from
..common.FileAccess
import
FileAccess
from
..text.TextSectionHandler
import
TextSectionHandler
from
..text.TextSectionHandler
import
TextSectionHandler
...
@@ -105,12 +105,12 @@ class AgendaTemplate(TextDocument):
...
@@ -105,12 +105,12 @@ class AgendaTemplate(TextDocument):
@param resources_ resources.
@param resources_ resources.
'''
'''
def
__init__
(
self
,
xmsf
_
,
agenda_
,
resources_
,
listener
):
def
__init__
(
self
,
xmsf
,
agenda
,
resources
,
templateConsts
,
listener
):
super
(
AgendaTemplate
,
self
)
.
__init__
(
xmsf
_
,
listener
,
None
,
super
(
AgendaTemplate
,
self
)
.
__init__
(
xmsf
,
listener
,
None
,
"WIZARD_LIVE_PREVIEW"
)
"WIZARD_LIVE_PREVIEW"
)
AgendaTemplate
.
agenda
=
agenda
_
AgendaTemplate
.
agenda
=
agenda
AgendaTemplate
.
templateConsts
=
T
emplateConsts
AgendaTemplate
.
templateConsts
=
t
emplateConsts
self
.
resources
=
resources
_
self
.
resources
=
resources
if
AgendaTemplate
.
itemsCache
is
None
:
if
AgendaTemplate
.
itemsCache
is
None
:
self
.
initItemsCache
()
self
.
initItemsCache
()
...
@@ -173,6 +173,7 @@ class AgendaTemplate(TextDocument):
...
@@ -173,6 +173,7 @@ class AgendaTemplate(TextDocument):
def
redraw
(
self
,
itemName
):
def
redraw
(
self
,
itemName
):
AgendaTemplate
.
xTextDocument
.
lockControllers
()
AgendaTemplate
.
xTextDocument
.
lockControllers
()
try
:
try
:
print
"kinki"
# get the table in which the item is...
# get the table in which the item is...
itemsTable
=
AgendaTemplate
.
itemsMap
[
itemName
]
itemsTable
=
AgendaTemplate
.
itemsMap
[
itemName
]
# rewrite the table.
# rewrite the table.
...
@@ -234,28 +235,28 @@ class AgendaTemplate(TextDocument):
...
@@ -234,28 +235,28 @@ class AgendaTemplate(TextDocument):
AgendaTemplate
.
itemsCache
[
AgendaTemplate
.
itemsCache
[
AgendaTemplate
.
templateConsts
.
FILLIN_MEETING_TYPE
]
=
\
AgendaTemplate
.
templateConsts
.
FILLIN_MEETING_TYPE
]
=
\
AgendaItem
(
AgendaTemplate
.
templateConsts
.
FILLIN_MEETING_TYPE
,
AgendaItem
(
AgendaTemplate
.
templateConsts
.
FILLIN_MEETING_TYPE
,
TextElement
(
self
.
resources
.
itemMeetingType
)
,
self
.
resources
.
itemMeetingType
,
PlaceholderElement
(
PlaceholderElement
(
self
.
resources
.
reschkMeetingTitle_value
,
self
.
resources
.
reschkMeetingTitle_value
,
self
.
resources
.
resPlaceHolderHint
,
self
.
xMSF
))
self
.
resources
.
resPlaceHolderHint
,
self
.
xMSF
))
AgendaTemplate
.
itemsCache
[
AgendaTemplate
.
itemsCache
[
AgendaTemplate
.
templateConsts
.
FILLIN_BRING
]
=
\
AgendaTemplate
.
templateConsts
.
FILLIN_BRING
]
=
\
AgendaItem
(
AgendaTemplate
.
templateConsts
.
FILLIN_BRING
,
AgendaItem
(
AgendaTemplate
.
templateConsts
.
FILLIN_BRING
,
TextElement
(
self
.
resources
.
itemBring
)
,
self
.
resources
.
itemBring
,
PlaceholderElement
(
PlaceholderElement
(
self
.
resources
.
reschkBring_value
,
self
.
resources
.
reschkBring_value
,
self
.
resources
.
resPlaceHolderHint
,
self
.
xMSF
))
self
.
resources
.
resPlaceHolderHint
,
self
.
xMSF
))
AgendaTemplate
.
itemsCache
[
AgendaTemplate
.
itemsCache
[
AgendaTemplate
.
templateConsts
.
FILLIN_READ
]
=
\
AgendaTemplate
.
templateConsts
.
FILLIN_READ
]
=
\
AgendaItem
(
AgendaTemplate
.
templateConsts
.
FILLIN_READ
,
AgendaItem
(
AgendaTemplate
.
templateConsts
.
FILLIN_READ
,
TextElement
(
self
.
resources
.
itemRead
)
,
self
.
resources
.
itemRead
,
PlaceholderElement
(
PlaceholderElement
(
self
.
resources
.
reschkRead_value
,
self
.
resources
.
reschkRead_value
,
self
.
resources
.
resPlaceHolderHint
,
self
.
xMSF
))
self
.
resources
.
resPlaceHolderHint
,
self
.
xMSF
))
AgendaTemplate
.
itemsCache
[
AgendaTemplate
.
itemsCache
[
AgendaTemplate
.
templateConsts
.
FILLIN_NOTES
]
=
\
AgendaTemplate
.
templateConsts
.
FILLIN_NOTES
]
=
\
AgendaItem
(
AgendaTemplate
.
templateConsts
.
FILLIN_NOTES
,
AgendaItem
(
AgendaTemplate
.
templateConsts
.
FILLIN_NOTES
,
TextElement
(
self
.
resources
.
itemNote
)
,
self
.
resources
.
itemNote
,
PlaceholderElement
(
PlaceholderElement
(
self
.
resources
.
reschkNotes_value
,
self
.
resources
.
reschkNotes_value
,
self
.
resources
.
resPlaceHolderHint
,
self
.
xMSF
))
self
.
resources
.
resPlaceHolderHint
,
self
.
xMSF
))
...
@@ -264,52 +265,52 @@ class AgendaTemplate(TextDocument):
...
@@ -264,52 +265,52 @@ class AgendaTemplate(TextDocument):
AgendaTemplate
.
itemsCache
[
AgendaTemplate
.
itemsCache
[
AgendaTemplate
.
templateConsts
.
FILLIN_CALLED_BY
]
=
\
AgendaTemplate
.
templateConsts
.
FILLIN_CALLED_BY
]
=
\
AgendaItem
(
AgendaTemplate
.
templateConsts
.
FILLIN_CALLED_BY
,
AgendaItem
(
AgendaTemplate
.
templateConsts
.
FILLIN_CALLED_BY
,
TextElement
(
self
.
resources
.
itemCalledBy
)
,
self
.
resources
.
itemCalledBy
,
PlaceholderElement
(
PlaceholderElement
(
self
.
resources
.
reschkConvenedBy_value
,
self
.
resources
.
reschkConvenedBy_value
,
self
.
resources
.
resPlaceHolderHint
,
self
.
xMSF
))
self
.
resources
.
resPlaceHolderHint
,
self
.
xMSF
))
AgendaTemplate
.
itemsCache
[
AgendaTemplate
.
itemsCache
[
AgendaTemplate
.
templateConsts
.
FILLIN_FACILITATOR
]
=
\
AgendaTemplate
.
templateConsts
.
FILLIN_FACILITATOR
]
=
\
AgendaItem
(
AgendaTemplate
.
templateConsts
.
FILLIN_FACILITATOR
,
AgendaItem
(
AgendaTemplate
.
templateConsts
.
FILLIN_FACILITATOR
,
TextElement
(
self
.
resources
.
itemFacilitator
)
,
self
.
resources
.
itemFacilitator
,
PlaceholderElement
(
PlaceholderElement
(
self
.
resources
.
reschkPresiding_value
,
self
.
resources
.
reschkPresiding_value
,
self
.
resources
.
resPlaceHolderHint
,
self
.
xMSF
))
self
.
resources
.
resPlaceHolderHint
,
self
.
xMSF
))
AgendaTemplate
.
itemsCache
[
AgendaTemplate
.
itemsCache
[
AgendaTemplate
.
templateConsts
.
FILLIN_PARTICIPANTS
]
=
\
AgendaTemplate
.
templateConsts
.
FILLIN_PARTICIPANTS
]
=
\
AgendaItem
(
AgendaTemplate
.
templateConsts
.
FILLIN_PARTICIPANTS
,
AgendaItem
(
AgendaTemplate
.
templateConsts
.
FILLIN_PARTICIPANTS
,
TextElement
(
self
.
resources
.
itemAttendees
)
,
self
.
resources
.
itemAttendees
,
PlaceholderElement
(
PlaceholderElement
(
self
.
resources
.
reschkAttendees_value
,
self
.
resources
.
reschkAttendees_value
,
self
.
resources
.
resPlaceHolderHint
,
self
.
xMSF
))
self
.
resources
.
resPlaceHolderHint
,
self
.
xMSF
))
AgendaTemplate
.
itemsCache
[
AgendaTemplate
.
itemsCache
[
AgendaTemplate
.
templateConsts
.
FILLIN_NOTETAKER
]
=
\
AgendaTemplate
.
templateConsts
.
FILLIN_NOTETAKER
]
=
\
AgendaItem
(
AgendaTemplate
.
templateConsts
.
FILLIN_NOTETAKER
,
AgendaItem
(
AgendaTemplate
.
templateConsts
.
FILLIN_NOTETAKER
,
TextElement
(
self
.
resources
.
itemNotetaker
)
,
self
.
resources
.
itemNotetaker
,
PlaceholderElement
(
PlaceholderElement
(
self
.
resources
.
reschkNoteTaker_value
,
self
.
resources
.
reschkNoteTaker_value
,
self
.
resources
.
resPlaceHolderHint
,
self
.
xMSF
))
self
.
resources
.
resPlaceHolderHint
,
self
.
xMSF
))
AgendaTemplate
.
itemsCache
[
AgendaTemplate
.
itemsCache
[
AgendaTemplate
.
templateConsts
.
FILLIN_TIMEKEEPER
]
=
\
AgendaTemplate
.
templateConsts
.
FILLIN_TIMEKEEPER
]
=
\
AgendaItem
(
AgendaTemplate
.
templateConsts
.
FILLIN_TIMEKEEPER
,
AgendaItem
(
AgendaTemplate
.
templateConsts
.
FILLIN_TIMEKEEPER
,
TextElement
(
self
.
resources
.
itemTimekeeper
)
,
self
.
resources
.
itemTimekeeper
,
PlaceholderElement
(
PlaceholderElement
(
self
.
resources
.
reschkTimekeeper_value
,
self
.
resources
.
reschkTimekeeper_value
,
self
.
resources
.
resPlaceHolderHint
,
self
.
xMSF
))
self
.
resources
.
resPlaceHolderHint
,
self
.
xMSF
))
AgendaTemplate
.
itemsCache
[
AgendaTemplate
.
itemsCache
[
AgendaTemplate
.
templateConsts
.
FILLIN_OBSERVERS
]
=
\
AgendaTemplate
.
templateConsts
.
FILLIN_OBSERVERS
]
=
\
AgendaItem
(
AgendaTemplate
.
templateConsts
.
FILLIN_OBSERVERS
,
AgendaItem
(
AgendaTemplate
.
templateConsts
.
FILLIN_OBSERVERS
,
TextElement
(
self
.
resources
.
itemObservers
)
,
self
.
resources
.
itemObservers
,
PlaceholderElement
(
PlaceholderElement
(
self
.
resources
.
reschkObservers_value
,
self
.
resources
.
reschkObservers_value
,
self
.
resources
.
resPlaceHolderHint
,
self
.
xMSF
))
self
.
resources
.
resPlaceHolderHint
,
self
.
xMSF
))
AgendaTemplate
.
itemsCache
[
AgendaTemplate
.
itemsCache
[
AgendaTemplate
.
templateConsts
.
FILLIN_RESOURCE_PERSONS
]
=
\
AgendaTemplate
.
templateConsts
.
FILLIN_RESOURCE_PERSONS
]
=
\
AgendaItem
(
AgendaTemplate
.
templateConsts
.
FILLIN_RESOURCE_PERSONS
,
AgendaItem
(
AgendaTemplate
.
templateConsts
.
FILLIN_RESOURCE_PERSONS
,
TextElement
(
self
.
resources
.
itemResource
)
,
self
.
resources
.
itemResource
,
PlaceholderElement
(
PlaceholderElement
(
self
.
resources
.
reschkResourcePersons_value
,
self
.
resources
.
reschkResourcePersons_value
,
AgendaTemplate
.
templateConst
s
.
resPlaceHolderHint
,
self
.
xMSF
))
self
.
resource
s
.
resPlaceHolderHint
,
self
.
xMSF
))
'''Initializes a template.<br/>
'''Initializes a template.<br/>
This method does the following tasks:<br/>
This method does the following tasks:<br/>
...
@@ -902,18 +903,16 @@ class Topics(object):
...
@@ -902,18 +903,16 @@ class Topics(object):
# analyze the structure of the topic rows.
# analyze the structure of the topic rows.
while
not
cursor
.
RangeName
==
afterLastCell
:
while
not
cursor
.
RangeName
==
afterLastCell
:
cell
=
Topics
.
table
.
getCellByName
(
cursor
.
RangeName
)
cell
=
Topics
.
table
.
getCellByName
(
cursor
.
RangeName
)
# first I store the content and para style of the cell
ae
=
TextElement
(
cell
)
# if the cell contains a relevant <...>
# if the cell contains a relevant <...>
# i add the text element to the hash,
# i add the text element to the hash,
# so it's text can be updated later.
# so it's text can be updated later.
try
:
try
:
if
items
[
cell
.
CellName
]
is
not
None
:
if
items
[
cell
.
CellName
]
is
not
None
:
self
.
topicItems
[
cell
.
String
.
lower
()
.
lstrip
()]
=
ae
self
.
topicItems
[
cell
.
String
.
lower
()
.
lstrip
()]
=
cell
except
KeyError
:
except
KeyError
:
pass
pass
Topics
.
topicCells
.
append
(
ae
)
Topics
.
topicCells
.
append
(
cell
)
# goto next cell.
# goto next cell.
cursor
.
goRight
(
1
,
False
)
cursor
.
goRight
(
1
,
False
)
'''
'''
...
@@ -1133,20 +1132,6 @@ class Topics(object):
...
@@ -1133,20 +1132,6 @@ class Topics(object):
else
:
else
:
cursor
.
goRight
(
1
,
False
)
cursor
.
goRight
(
1
,
False
)
'''
A basic implementation of AgendaElement:
writes a String to the given XText/XTextRange, and applies
a ParaStyle to it (using the parent class).
@author rp143992
'''
class
TextElement
(
object
):
def
__init__
(
self
,
text_
):
self
.
text
=
text_
def
write
(
self
,
textRange
):
textRange
.
String
=
self
.
text
'''
'''
A Text element which, if the text to write is empty (null or "")
A Text element which, if the text to write is empty (null or "")
inserts a placeholder instead.
inserts a placeholder instead.
...
@@ -1156,7 +1141,7 @@ inserts a placeholder instead.
...
@@ -1156,7 +1141,7 @@ inserts a placeholder instead.
class
PlaceholderTextElement
(
TextElement
):
class
PlaceholderTextElement
(
TextElement
):
def
__init__
(
self
,
textRange
,
placeHolderText_
,
hint_
,
xmsf_
):
def
__init__
(
self
,
textRange
,
placeHolderText_
,
hint_
,
xmsf_
):
super
(
PlaceholderTextElement
,
self
)
.
__init__
(
textRange
)
super
(
PlaceholderTextElement
,
self
)
.
__init__
(
textRange
,
placeHolderText_
)
self
.
placeHolderText
=
placeHolderText_
self
.
placeHolderText
=
placeHolderText_
self
.
hint
=
hint_
self
.
hint
=
hint_
...
@@ -1213,7 +1198,7 @@ class AgendaItem(object):
...
@@ -1213,7 +1198,7 @@ class AgendaItem(object):
def
write
(
self
,
tableCursor
):
def
write
(
self
,
tableCursor
):
cellname
=
tableCursor
.
RangeName
cellname
=
tableCursor
.
RangeName
cell
=
ItemsTable
.
table
.
getCellByName
(
cellname
)
cell
=
ItemsTable
.
table
.
getCellByName
(
cellname
)
self
.
textElement
.
write
(
cell
)
cell
.
String
=
self
.
textElement
tableCursor
.
goRight
(
1
,
False
)
tableCursor
.
goRight
(
1
,
False
)
#second field is actually always null...
#second field is actually always null...
# this is a preparation for adding placeholders.
# this is a preparation for adding placeholders.
...
...
wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py
Dosyayı görüntüle @
531b7136
...
@@ -19,6 +19,7 @@ import traceback
...
@@ -19,6 +19,7 @@ import traceback
from
.AgendaWizardDialog
import
AgendaWizardDialog
from
.AgendaWizardDialog
import
AgendaWizardDialog
from
.AgendaWizardDialogConst
import
HID
from
.AgendaWizardDialogConst
import
HID
from
.AgendaTemplate
import
AgendaTemplate
,
FileAccess
from
.AgendaTemplate
import
AgendaTemplate
,
FileAccess
from
.TemplateConsts
import
TemplateConsts
from
.TopicsControl
import
TopicsControl
from
.TopicsControl
import
TopicsControl
from
.CGAgenda
import
CGAgenda
from
.CGAgenda
import
CGAgenda
from
..ui.PathSelection
import
PathSelection
from
..ui.PathSelection
import
PathSelection
...
@@ -71,8 +72,10 @@ class AgendaWizardDialogImpl(AgendaWizardDialog):
...
@@ -71,8 +72,10 @@ class AgendaWizardDialogImpl(AgendaWizardDialog):
# initialize the agenda template
# initialize the agenda template
self
.
agenda
=
CGAgenda
()
self
.
agenda
=
CGAgenda
()
self
.
templateConsts
=
TemplateConsts
self
.
agendaTemplate
=
AgendaTemplate
(
self
.
agendaTemplate
=
AgendaTemplate
(
self
.
xMSF
,
self
.
agenda
,
self
.
resources
,
self
)
self
.
xMSF
,
self
.
agenda
,
self
.
resources
,
self
.
templateConsts
,
self
)
# build the dialog.
# build the dialog.
self
.
drawNaviBar
()
self
.
drawNaviBar
()
...
@@ -296,37 +299,37 @@ class AgendaWizardDialogImpl(AgendaWizardDialog):
...
@@ -296,37 +299,37 @@ class AgendaWizardDialogImpl(AgendaWizardDialog):
AgendaTemplate
.
agenda
.
cp_IncludeMinutes
=
bool
(
self
.
chkMinutes
.
State
)
AgendaTemplate
.
agenda
.
cp_IncludeMinutes
=
bool
(
self
.
chkMinutes
.
State
)
def
chkUseMeetingTypeItemChanged
(
self
):
def
chkUseMeetingTypeItemChanged
(
self
):
AgendaTemplate
.
redraw
(
FILLIN_MEETING_TYPE
)
AgendaTemplate
.
redraw
(
self
.
templateConsts
.
FILLIN_MEETING_TYPE
)
def
chkUseReadItemChanged
(
self
):
def
chkUseReadItemChanged
(
self
):
AgendaTemplate
.
redraw
(
FILLIN_READ
)
AgendaTemplate
.
redraw
(
self
.
templateConsts
.
FILLIN_READ
)
def
chkUseBringItemChanged
(
self
):
def
chkUseBringItemChanged
(
self
):
AgendaTemplate
.
redraw
(
FILLIN_BRING
)
AgendaTemplate
.
redraw
(
self
.
templateConsts
.
FILLIN_BRING
)
def
chkUseNotesItemChanged
(
self
):
def
chkUseNotesItemChanged
(
self
):
AgendaTemplate
.
redraw
(
FILLIN_NOTES
)
AgendaTemplate
.
redraw
(
self
.
templateConsts
.
FILLIN_NOTES
)
def
chkUseCalledByItemChanged
(
self
):
def
chkUseCalledByItemChanged
(
self
):
AgendaTemplate
.
redraw
(
FILLIN_CALLED_BY
)
AgendaTemplate
.
redraw
(
self
.
templateConsts
.
FILLIN_CALLED_BY
)
def
chkUseFacilitatorItemChanged
(
self
):
def
chkUseFacilitatorItemChanged
(
self
):
AgendaTemplate
.
redraw
(
FILLIN_FACILITATOR
)
AgendaTemplate
.
redraw
(
self
.
templateConsts
.
FILLIN_FACILITATOR
)
def
chkUseNoteTakerItemChanged
(
self
):
def
chkUseNoteTakerItemChanged
(
self
):
AgendaTemplate
.
redraw
(
FILLIN_NOTETAKER
)
AgendaTemplate
.
redraw
(
self
.
templateConsts
.
FILLIN_NOTETAKER
)
def
chkUseTimeKeeperItemChanged
(
self
):
def
chkUseTimeKeeperItemChanged
(
self
):
AgendaTemplate
.
redraw
(
FILLIN_TIMEKEEPER
)
AgendaTemplate
.
redraw
(
self
.
templateConsts
.
FILLIN_TIMEKEEPER
)
def
chkUseAttendeesItemChanged
(
self
):
def
chkUseAttendeesItemChanged
(
self
):
AgendaTemplate
.
redraw
(
FILLIN_PARTICIPANTS
)
AgendaTemplate
.
redraw
(
self
.
templateConsts
.
FILLIN_PARTICIPANTS
)
def
chkUseObserversItemChanged
(
self
):
def
chkUseObserversItemChanged
(
self
):
AgendaTemplate
.
redraw
(
FILLIN_OBSERVERS
)
AgendaTemplate
.
redraw
(
self
.
templateConsts
.
FILLIN_OBSERVERS
)
def
chkUseResourcePersonsItemChanged
(
self
):
def
chkUseResourcePersonsItemChanged
(
self
):
AgendaTemplate
.
redraw
(
FILLIN_RESOURCE_PERSONS
)
AgendaTemplate
.
redraw
(
self
.
templateConsts
.
FILLIN_RESOURCE_PERSONS
)
'''
'''
convenience method.
convenience method.
...
...
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