Merge lp:~j-corwin/openlp/presentations into lp:openlp

Proposed by Jonathan Corwin
Status: Merged
Merged at revision: not available
Proposed branch: lp:~j-corwin/openlp/presentations
Merge into: lp:openlp
Diff against target: 172 lines
2 files modified
openlp/plugins/presentations/lib/__init__.py (+1/-0)
openlp/plugins/presentations/lib/pptviewcontroller.py (+68/-37)
To merge this branch: bzr merge lp:~j-corwin/openlp/presentations
Reviewer Review Type Date Requested Status
Raoul Snyman Approve
Jon Tibble (community) Approve
Review via email: mp+12388@code.launchpad.net

This proposal supersedes a proposal from 2009-09-24.

To post a comment you must log in.
Revision history for this message
Jonathan Corwin (j-corwin) wrote : Posted in a previous version of this proposal

Got powerpoint viewer working!

Revision history for this message
Jon Tibble (meths) wrote :

Looks good.

review: Approve
Revision history for this message
Raoul Snyman (raoul-snyman) :
review: Approve
lp:~j-corwin/openlp/presentations updated
570. By Jon Tibble

PPTViewer fixes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openlp/plugins/presentations/lib/__init__.py'
--- openlp/plugins/presentations/lib/__init__.py 2009-09-24 18:46:16 +0000
+++ openlp/plugins/presentations/lib/__init__.py 2009-09-24 21:55:18 +0000
@@ -21,6 +21,7 @@
21# with this program; if not, write to the Free Software Foundation, Inc., 59 #21# with this program; if not, write to the Free Software Foundation, Inc., 59 #
22# Temple Place, Suite 330, Boston, MA 02111-1307 USA #22# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
23###############################################################################23###############################################################################
24
24import os25import os
2526
26from impresscontroller import ImpressController27from impresscontroller import ImpressController
2728
=== modified file 'openlp/plugins/presentations/lib/pptviewcontroller.py'
--- openlp/plugins/presentations/lib/pptviewcontroller.py 2009-09-24 07:35:30 +0000
+++ openlp/plugins/presentations/lib/pptviewcontroller.py 2009-09-24 21:55:18 +0000
@@ -27,6 +27,7 @@
27import time27import time
28import sys28import sys
29import win32api29import win32api
30
30from ctypes import *31from ctypes import *
31from ctypes.wintypes import RECT32from ctypes.wintypes import RECT
3233
@@ -72,19 +73,16 @@
72 and started.73 and started.
7374
74 ``presentation``75 ``presentation``
75 The file name of the presentatios to the run.76 The file name of the presentations to run.
76 """77 """
77 log.debug(u'LoadPresentation')78 log.debug(u'LoadPresentation')
78 if(self.pptid>=0):79 if self.pptid >= 0:
79 self.CloseClick()80 self.closePresentation()
80 rect = RECT()81 rect = RECT(0, 0, 800, 600) # until such time I can get screen info
81 rect.left = 082 filename = str(presentation.replace(u'/', u'\\'));
82 rect.top = 0
83 rect.width = 0
84 rect.hight = 0
85 try:83 try:
86 tempfolder = None #r'c:\temp\pptviewlib\' + presentation84 tempfolder = None #r'c:\temp\pptviewlib\' + filename.split('u\\')[-1]
87 self.pptid = self.presentation.OpenPPT(presentation, None, rect, tempfolder)85 self.pptid = self.presentation.OpenPPT(filename, None, rect, tempfolder)
88 except:86 except:
89 log.exception(u'Failed to load presentation')87 log.exception(u'Failed to load presentation')
90 #self.slidecount = pptdll.GetSlideCount(self.pptid)88 #self.slidecount = pptdll.GetSlideCount(self.pptid)
@@ -95,62 +93,95 @@
95 Triggerent by new object being added to SlideController orOpenLP93 Triggerent by new object being added to SlideController orOpenLP
96 being shut down94 being shut down
97 """95 """
98 if(self.pptid<0): return96 if self.pptid < 0:
99 self.presentation.Close(self.pptid)97 return
98 self.presentation.ClosePPT(self.pptid)
100 self.pptid = -199 self.pptid = -1
101100
101 def nextStep(self):
102 """
103 Triggers the next effect of slide on the running presentation
104 """
105 if self.pptid < 0:
106 return
107 self.presentation.NextStep(self.pptid)
108
109 def previousStep(self):
110 """
111 Triggers the previous slide on the running presentation
112 """
113 if self.pptid < 0:
114 return
115 self.presentation.PrevStep(self.pptid)
116
102 def isActive(self):117 def isActive(self):
118 """
119 Returns true if a presentation is currently active
120 """
103 return self.pptid >= 0121 return self.pptid >= 0
104122
105 def resume(self):123 def resume(self):
106 if(self.pptid<0): return124 """
125 Resumes a previously paused presentation
126 """
127 if self.pptid < 0:
128 return
107 self.presentation.Resume(self.pptid)129 self.presentation.Resume(self.pptid)
108130
109 def pause(self):131 def pause(self):
132 """
133 Not implemented (pauses a presentation)
134 """
110 return135 return
111136
112 def blankScreen(self):137 def blankScreen(self):
113 if(self.pptid<0): return138 """
139 Blanks the screen
140 """
141 if self.pptid < 0:
142 return
114 self.presentation.Blank(self.pptid)143 self.presentation.Blank(self.pptid)
115144
116 def unblankScreen(self):145 def unblankScreen(self):
117 if(self.pptid<0): return146 """
147 Unblanks (restores) the presentationn
148 """
149 if self.pptid < 0:
150 return
118 self.presentation.Unblank(self.pptid)151 self.presentation.Unblank(self.pptid)
119152
120 def stop(self):153 def stop(self):
121 if(self.pptid<0): return154 """
155 Stops the current presentation and hides the output
156 """
157 if self.pptid < 0:
158 return
122 self.presentation.Stop(self.pptid)159 self.presentation.Stop(self.pptid)
123160
124 def go(self):161 def go(self):
125 if(self.pptid<0): return162 """
163 Starts a presentation from the beginning
164 """
165 if self.pptid < 0:
166 return
126 self.presentation.RestartShow(self.pptid)167 self.presentation.RestartShow(self.pptid)
127168
128 def getSlideNumber(self):169 def getSlideNumber(self):
129 if(self.pptid<0): return -1170 """
171 Returns the current slide number
172 """
173 if self.pptid < 0:
174 return -1
130 return self.presentation.GetCurrentSlide(self.pptid)175 return self.presentation.GetCurrentSlide(self.pptid)
131176
132 def setSlideNumber(self, slideno):177 def setSlideNumber(self, slideno):
133 if(self.pptid<0): return178 """
179 Moves to a specific slide in the presentation
180 """
181 if self.pptid < 0:
182 return
134 self.presentation.GotoSlide(self.pptid, slideno)183 self.presentation.GotoSlide(self.pptid, slideno)
135184
136 slideNumber = property(getSlideNumber, setSlideNumber)185 slideNumber = property(getSlideNumber, setSlideNumber)
137186
138 def nextStep(self):
139 """
140 Triggers the next effect of slide on the running presentation
141 """
142 if(self.pptid<0): return
143 self.presentation.NextStep(self.pptid)
144
145 def previousStep(self):
146 """
147 Triggers the previous slide on the running presentation
148 """
149 if self.pptid<0: return
150 self.presentation.PrevStep(self.pptid)
151
152 def NextClick(self):
153 if(self.pptid<0): return
154 pptdll.NextStep(self.pptid)
155 self.slideEdit.setText(pptdll.GetCurrentSlide(self.pptid))
156187