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
c71a811b
Kaydet (Commit)
c71a811b
authored
Ock 18, 2013
tarafından
Xisco Fauli
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
pyagenda: Change to new model and remove unused code
Change-Id: Ibdc1fb2fb09e5b209c761b7f9898ad019620b01d
üst
0d9683c7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
52 deletions
+31
-52
AgendaDocument.py
wizards/com/sun/star/wizards/agenda/AgendaDocument.py
+28
-40
AgendaWizardDialogImpl.py
...rds/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py
+3
-2
FileAccess.py
wizards/com/sun/star/wizards/common/FileAccess.py
+0
-10
No files found.
wizards/com/sun/star/wizards/agenda/AgendaDocument.py
Dosyayı görüntüle @
c71a811b
...
...
@@ -19,7 +19,6 @@ import uno
import
traceback
from
..text.TextElement
import
TextElement
from
..text.TextDocument
import
TextDocument
from
..common.FileAccess
import
FileAccess
from
..text.TextSectionHandler
import
TextSectionHandler
from
datetime
import
date
as
dateTimeObject
...
...
@@ -71,7 +70,7 @@ Many methods here are synchronized, in order to avoid colission made by
events fired too often.
@author rpiterman
'''
class
Agenda
Template
(
TextDocument
):
class
Agenda
Document
(
TextDocument
):
'''
constructor. The document is *not* loaded here.
...
...
@@ -79,7 +78,7 @@ class AgendaTemplate(TextDocument):
'''
def
__init__
(
self
,
xmsf
,
agenda
,
resources
,
templateConsts
,
listener
):
super
(
Agenda
Template
,
self
)
.
__init__
(
xmsf
,
listener
,
None
,
super
(
Agenda
Document
,
self
)
.
__init__
(
xmsf
,
listener
,
None
,
"WIZARD_LIVE_PREVIEW"
)
self
.
agenda
=
agenda
self
.
templateConsts
=
templateConsts
...
...
@@ -88,7 +87,6 @@ class AgendaTemplate(TextDocument):
self
.
allItems
=
[]
def
load
(
self
,
templateURL
,
topics
):
self
.
template
=
self
.
calcTemplateName
(
templateURL
)
self
.
loadAsPreview
(
templateURL
,
False
)
self
.
xFrame
.
ComponentWindow
.
Enable
=
False
self
.
xTextDocument
.
lockControllers
()
...
...
@@ -96,16 +94,6 @@ class AgendaTemplate(TextDocument):
self
.
initializeData
(
topics
)
self
.
xTextDocument
.
unlockControllers
()
'''
The agenda templates are in format of aw-XXX.ott
the templates name is then XXX.ott.
This method calculates it.
'''
def
calcTemplateName
(
self
,
url
):
return
FileAccess
.
connectURLs
(
FileAccess
.
getParentDir
(
url
),
FileAccess
.
getFilename
(
url
)[
3
:])
'''synchronize the document to the model.<br/>
this method rewrites all titles, item tables , and the topics table-
thus synchronizing the document to the data model (CGAgenda).
...
...
@@ -279,13 +267,13 @@ class AgendaTemplate(TextDocument):
Get the default locale of the document,
and create the date and time formatters.
'''
Agenda
Template
.
dateUtils
=
self
.
DateUtils
(
Agenda
Document
.
dateUtils
=
self
.
DateUtils
(
self
.
xMSF
,
self
.
xTextDocument
)
Agenda
Template
.
formatter
=
AgendaTemplate
.
dateUtils
.
formatter
Agenda
Template
.
dateFormat
=
\
Agenda
Template
.
dateUtils
.
getFormat
(
DATE_SYSTEM_LONG
)
Agenda
Template
.
timeFormat
=
\
Agenda
Template
.
dateUtils
.
getFormat
(
TIME_HHMM
)
Agenda
Document
.
formatter
=
AgendaDocument
.
dateUtils
.
formatter
Agenda
Document
.
dateFormat
=
\
Agenda
Document
.
dateUtils
.
getFormat
(
DATE_SYSTEM_LONG
)
Agenda
Document
.
timeFormat
=
\
Agenda
Document
.
dateUtils
.
getFormat
(
TIME_HHMM
)
self
.
initItemsCache
()
self
.
allItems
=
self
.
searchFillInItems
(
0
)
...
...
@@ -305,29 +293,29 @@ class AgendaTemplate(TextDocument):
for
i
in
self
.
allItems
:
text
=
i
.
String
.
lstrip
()
.
lower
()
if
text
==
self
.
templateConsts
.
FILLIN_TITLE
:
Agenda
Template
.
teTitle
=
PlaceholderTextElement
(
Agenda
Document
.
teTitle
=
PlaceholderTextElement
(
i
,
self
.
resources
.
resPlaceHolderTitle
,
self
.
resources
.
resPlaceHolderHint
,
self
.
xTextDocument
)
Agenda
Template
.
trTitle
=
i
Agenda
Document
.
trTitle
=
i
elif
text
==
self
.
templateConsts
.
FILLIN_DATE
:
Agenda
Template
.
teDate
=
PlaceholderTextElement
(
Agenda
Document
.
teDate
=
PlaceholderTextElement
(
i
,
self
.
resources
.
resPlaceHolderDate
,
self
.
resources
.
resPlaceHolderHint
,
self
.
xTextDocument
)
Agenda
Template
.
trDate
=
i
Agenda
Document
.
trDate
=
i
elif
text
==
self
.
templateConsts
.
FILLIN_TIME
:
Agenda
Template
.
teTime
=
PlaceholderTextElement
(
Agenda
Document
.
teTime
=
PlaceholderTextElement
(
i
,
self
.
resources
.
resPlaceHolderTime
,
self
.
resources
.
resPlaceHolderHint
,
self
.
xTextDocument
)
Agenda
Template
.
trTime
=
i
Agenda
Document
.
trTime
=
i
elif
text
==
self
.
templateConsts
.
FILLIN_LOCATION
:
Agenda
Template
.
teLocation
=
PlaceholderTextElement
(
Agenda
Document
.
teLocation
=
PlaceholderTextElement
(
i
,
self
.
resources
.
resPlaceHolderLocation
,
self
.
resources
.
resPlaceHolderHint
,
self
.
xTextDocument
)
Agenda
Template
.
trLocation
=
i
Agenda
Document
.
trLocation
=
i
else
:
auxList
.
append
(
i
)
self
.
allItems
=
auxList
...
...
@@ -367,19 +355,19 @@ class AgendaTemplate(TextDocument):
try
:
if
controlName
==
"txtTitle"
:
self
.
writeTitle
(
Agenda
Template
.
teTitle
,
AgendaTemplate
.
trTitle
,
Agenda
Document
.
teTitle
,
AgendaDocument
.
trTitle
,
self
.
agenda
.
cp_Title
)
elif
controlName
==
"txtDate"
:
self
.
writeTitle
(
Agenda
Template
.
teDate
,
AgendaTemplate
.
trDate
,
Agenda
Document
.
teDate
,
AgendaDocument
.
trDate
,
self
.
getDateString
(
self
.
agenda
.
cp_Date
))
elif
controlName
==
"txtTime"
:
self
.
writeTitle
(
Agenda
Template
.
teTime
,
AgendaTemplate
.
trTime
,
Agenda
Document
.
teTime
,
AgendaDocument
.
trTime
,
self
.
getTimeString
(
self
.
agenda
.
cp_Time
))
elif
controlName
==
"cbLocation"
:
self
.
writeTitle
(
Agenda
Template
.
teLocation
,
AgendaTemplate
.
trLocation
,
Agenda
Document
.
teLocation
,
AgendaDocument
.
trLocation
,
self
.
agenda
.
cp_Location
)
else
:
raise
IllegalArgumentException
(
"No such title control..."
)
...
...
@@ -403,8 +391,8 @@ class AgendaTemplate(TextDocument):
month
=
int
((
date
%
10000
)
/
100
)
day
=
int
(
date
%
100
)
dateObject
=
dateTimeObject
(
year
,
month
,
day
)
return
Agenda
Template
.
dateUtils
.
format
(
Agenda
Template
.
dateFormat
,
dateObject
)
return
Agenda
Document
.
dateUtils
.
format
(
Agenda
Document
.
dateFormat
,
dateObject
)
@classmethod
def
getTimeString
(
self
,
s
):
...
...
@@ -414,7 +402,7 @@ class AgendaTemplate(TextDocument):
t
=
((
time
/
float
(
1000000
))
/
float
(
24
))
\
+
((
time
%
1000000
)
/
float
(
1000000
))
/
float
(
35
)
return
self
.
formatter
.
convertNumberToString
(
Agenda
Template
.
timeFormat
,
t
)
Agenda
Document
.
timeFormat
,
t
)
def
finish
(
self
,
topics
):
self
.
createMinutes
(
topics
)
...
...
@@ -739,8 +727,8 @@ class ItemsTable(object):
if
cellName
==
cursor
.
RangeName
:
return
rowIndex
=
Agenda
Template
.
getRowIndex
(
cursor
)
rowsCount
=
Agenda
Template
.
getRowCount
(
ItemsTable
.
table
)
rowIndex
=
Agenda
Document
.
getRowIndex
(
cursor
)
rowsCount
=
Agenda
Document
.
getRowCount
(
ItemsTable
.
table
)
'''
now before deleteing i move the cursor up so it
does not disappear, because it will crash office.
...
...
@@ -756,7 +744,7 @@ the update is done programttically.<br/>
The decision to make this class a class by its own
was done out of logic reasons and not design/functionality reasons,
since there is anyway only one instance of this class at runtime
it could have also be implemented in the Agenda
Template
class
it could have also be implemented in the Agenda
Document
class
but for clarity and separation I decided to make a sub class for it.
@author rp143992
...
...
@@ -1093,7 +1081,7 @@ class PlaceholderTextElement(TextElement):
textRange
.
String
=
self
.
placeHolderText
if
self
.
placeHolderText
is
None
or
self
.
placeHolderText
==
""
:
try
:
xTextContent
=
Agenda
Template
.
createPlaceHolder
(
xTextContent
=
Agenda
Document
.
createPlaceHolder
(
self
.
xmsf
,
self
.
text
,
self
.
hint
)
textRange
.
Text
.
insertTextContent
(
textRange
.
Start
,
xTextContent
,
True
)
...
...
@@ -1115,7 +1103,7 @@ class PlaceholderElement(object):
def
write
(
self
,
textRange
):
try
:
xTextContent
=
Agenda
Template
.
createPlaceHolder
(
xTextContent
=
Agenda
Document
.
createPlaceHolder
(
self
.
textDocument
,
self
.
placeHolderText
,
self
.
hint
)
textRange
.
Text
.
insertTextContent
(
textRange
.
Start
,
xTextContent
,
True
)
...
...
wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py
Dosyayı görüntüle @
c71a811b
...
...
@@ -18,7 +18,7 @@
import
traceback
from
.AgendaWizardDialog
import
AgendaWizardDialog
,
uno
from
.AgendaWizardDialogConst
import
HID
from
.AgendaDocument
import
Agenda
Template
,
FileAccess
from
.AgendaDocument
import
Agenda
Document
from
.TemplateConsts
import
TemplateConsts
from
.TopicsControl
import
TopicsControl
from
.CGAgenda
import
CGAgenda
...
...
@@ -30,6 +30,7 @@ from ..common.SystemDialog import SystemDialog
from
..common.Desktop
import
Desktop
from
..common.HelpIds
import
HelpIds
from
..common.Configuration
import
Configuration
from
..common.FileAccess
import
FileAccess
from
..document.OfficeDocument
import
OfficeDocument
from
com.sun.star.view.DocumentZoomType
import
OPTIMAL
...
...
@@ -74,7 +75,7 @@ class AgendaWizardDialogImpl(AgendaWizardDialog):
self
.
agenda
=
CGAgenda
()
self
.
templateConsts
=
TemplateConsts
self
.
agendaTemplate
=
Agenda
Template
(
self
.
agendaTemplate
=
Agenda
Document
(
self
.
xMSF
,
self
.
agenda
,
self
.
resources
,
self
.
templateConsts
,
self
)
...
...
wizards/com/sun/star/wizards/common/FileAccess.py
Dosyayı görüntüle @
c71a811b
...
...
@@ -251,13 +251,3 @@ class FileAccess(object):
while
url
[
-
1
]
==
"/"
:
url
=
hello
[:
-
1
]
return
url
[:
url
.
rfind
(
"/"
)]
@classmethod
def
connectURLs
(
self
,
urlFolder
,
urlFilename
):
stringFolder
=
""
stringFileName
=
urlFilename
if
not
urlFolder
.
endswith
(
"/"
):
stringFolder
=
"/"
if
urlFilename
.
startswith
(
"/"
):
stringFileName
=
urlFilename
[
1
:]
return
urlFolder
+
stringFolder
+
stringFileName
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