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

Proposed by Jonathan Corwin
Status: Superseded
Proposed branch: lp:~j-corwin/openlp/present
Merge into: lp:openlp
Diff against target: 482 lines
11 files modified
openlp/plugins/presentations/lib/__init__.py (+0/-3)
openlp/plugins/presentations/lib/impresscontroller.py (+20/-11)
openlp/plugins/presentations/lib/mediaitem.py (+2/-1)
openlp/plugins/presentations/lib/powerpointcontroller.py (+15/-10)
openlp/plugins/presentations/lib/pptviewcontroller.py (+18/-5)
openlp/plugins/presentations/lib/pptviewlib/README.TXT (+3/-0)
openlp/plugins/presentations/lib/pptviewlib/pptviewlib.cpp (+8/-0)
openlp/plugins/presentations/lib/pptviewlib/pptviewlib.h (+1/-0)
openlp/plugins/presentations/lib/presentationcontroller.py (+17/-2)
openlp/plugins/presentations/lib/presentationtab.py (+27/-37)
openlp/plugins/presentations/presentationplugin.py (+29/-24)
To merge this branch: bzr merge lp:~j-corwin/openlp/present
Reviewer Review Type Date Requested Status
OpenLP Core Pending
Review via email: mp+12682@code.launchpad.net

This proposal has been superseded by a proposal from 2009-09-30.

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

Make presentation controllers self contained.

pptviewlib.dll excluded this time. I'll attempt this in a separate push attempt since it's required as the powerpoint viewer won't work now without the latest version.

lp:~j-corwin/openlp/present updated
581. By Jonathan Corwin

Presentations made it at last

582. By Jonathan Corwin

Presentation dll

583. By Tim Bentley

Start of about Text

584. By Jon Tibble

Dialogs, Exceptions and Toolbars

585. By Tim Bentley

Update PluginList Window

586. By Jonathan Corwin

Presentation updates

587. By Tim Bentley

Add Ability to hide plugins

588. By Jonathan Corwin

More Presentation improvements

589. By Tim Bentley

More hiding code changes

590. By Tim Bentley

Fix song issue

591. By Jon Tibble

Presentation cleanups

592. By Jon Tibble

Bible rendering fixes

593. By Tim Bentley

Apply fixes for Jon

594. By Raoul Snyman

Merged in lp:~raoul-snyman/openlp/pluginlist

595. By Tim Bentley

Plugin hinding comes to town

596. By Jonathan Corwin

More Presentation fixes

597. By Tim Bentley

Various changes and fixes

598. By Jonathan Corwin

TLC for the asv

599. By Raoul Snyman

Merged in lp:~raoul-snyman/openlp/versionfix

600. By Tim Bentley

Add Web Bibles to Advanced Tab and other nice features

601. By Jonathan Corwin

Presentation changes

602. By Tim Bentley

Update config files for deployment

603. By Tim Bentley

Changes to settings and SlideController handling

604. By Jon Tibble

Python 2.5 fixes

605. By Raoul Snyman

Merged in lp:~raoul-snyman/openlp/uifixes

606. By Raoul Snyman

Merge from lp:~raoul-snyman/openlp/uifixes

607. By Jonathan Corwin

Merged in lp:~j-corwin/openlp/present

608. By Raoul Snyman

Merged lp:~raoul-snyman/openlp/uifixes

609. By Tim Bentley

Theme Image and Presentation fixes

610. By Jon Tibble

General fixes

611. By Tim Bentley

General Tab Changes

612. By Jonathan Corwin

Merged tweaks to openlpcnv.pyw

613. By Raoul Snyman

Merge from lp:~raoul-snyman/openlp/converter

614. By Raoul Snyman

Fix Slide Controller look and feel

615. By Raoul Snyman

Fix Bible Media manager look and feel

616. By Jonathan Corwin

Presentation fixes for Impress

617. By Tim Bentley

Bible Fixes

618. By Tim Bentley

Theme features - wrap indentation and lines per slide

619. By Tim Bentley

Font Sizing and rendering improvements

620. By Jonathan Corwin

Presentations Impress mini display

621. By Raoul Snyman

Merge from lp:~raoul-snyman/openlp/i18n

622. By Jon Tibble

Fix imports and config item

623. By Tim Bentley

Song editing from Preview, bible fixes

624. By Jon Tibble

Fix imports and typo

625. By Tim Bentley

fix up song edit from preview

626. By Jonathan Corwin

More presentation fixes

627. By Tim Bentley

Save and preview + dynamic theme changing

628. By Raoul Snyman

Fix slide controller look and feel

629. By Raoul Snyman

Fix i18n issues

630. By Tim Bentley

Move Audit to SongUsage , Return of BibleGateway part1. Additions to SlideController

631. By Tim Bentley

Add more bible sources and improve handling

632. By Jon Tibble

Fix plugintabs i18n

633. By Jon Tibble

Fix i18n and cleanup for New Theme

634. By Tim Bentley

Edit Songs and Custom for Service Manager and auto replace

635. By Jon Tibble

Fix i18n for mediaitems

636. By Jon Tibble

Fix unnecessary screen setup

637. By Tim Bentley

Minor fixes

638. By Jon Tibble

Fix theme editing, copyright and song icon

639. By Jon Tibble

Plugin fixes, cleanups and i18n

640. By Tim Bentley

Fixes to Renderer etc

641. By Tim Bentley

Remote Song Editing Finished - minor other changes

642. By Jon Tibble

Fix typos

643. By Tim Bentley

Fix up editing code from Preview and ServiceManager

644. By Raoul Snyman

Fix up converter

645. By Tim Bentley

Clean up the version code and remove not required file

646. By Tim Bentley

Media is starting to work - just

647. By Jon Tibble

Fix mediaitem translation

648. By Jon Tibble

Enable consecutive video playing

649. By Tim Bentley

Minor fixes and copyright

650. By Tim Bentley

Merge it right this time

651. By Jon Tibble

Single monitor display hiding

652. By Jon Tibble

Cleanups

653. By Tim Bentley

Expansion and Song editing fixes

654. By Tim Bentley

Fix song editing error messages

655. By Jon Tibble

Various cleanups and fixes

656. By Jon Tibble

More fixes

657. By Raoul Snyman

Merged in display fixes from lp:~raoul-snyman/openlp/fixes

658. By Jon Tibble

Clean theme handling

659. By Tim Bentley

Remote editing for custom and theme fix

660. By Jon Tibble

Fix file handling

661. By Tim Bentley

Plugin clean ups

662. By Jonathan Corwin

Presentation fixes

663. By Tim Bentley

SlideController cleanups

664. By Tim Bentley

Fix bugs in theme and slidecontroller

665. By Tim Bentley

Clean up slidecontroller

666. By Tim Bentley

Add media Preview code

667. By Tim Bentley

Change version number

668. By Jon Tibble

Unicode and import fixes

669. By Tim Bentley

Slide Controller cleanups and Media bug fixes

670. By Jon Tibble

Cleanups and fixes

671. By Raoul Snyman

Merged in lp:~raoul-snyman/openlp/bitsandbobs

672. By Raoul Snyman

Updated version.txt

673. By Tim Bentley

Refactor Service Item and clean up Slide Controller

674. By Michael Gorven

Merge get-strings: Improve regex to extract translation strings.
https://code.launchpad.net/~mgorven/openlp/get-strings/+merge/15120

675. By Tim Bentley

Updates to the Renderer and impose minimum slide width

676. By Raoul Snyman

Merge from lp:~raoul-snyman/openlp/bitsandbobs

677. By Michael Gorven

Merge lp:~mgorven/openlp/get-strings-ast: Use AST module to parse code and extract translation strings.
https://code.launchpad.net/~mgorven/openlp/get-strings-ast/+merge/15328

678. By Raoul Snyman

Merged in lp:~raoul-snyman/openlp/i18n

679. By Tim Bentley

Verse tagging changes etc

680. By Tim Bentley

Add verse expansion from song plugin

681. By Tim Bentley

Cannot type

682. By Raoul Snyman

Merge from lp:~raoul-snyman/openlp/bitsandbobs

683. By Michael Gorven

Merge lp:~mgorven/openlp/copyright-symbol: Fix copyright symbol in translation strings.
https://code.launchpad.net/~mgorven/openlp/copyright-symbol/+merge/15399

684. By Tim Bentley

Verse Tagging

685. By Tim Bentley

Merge from lp:~trb143/openlp/cleanup

686. By Tim Bentley

Fix Theme handling so Song level works again

687. By Tim Bentley

Fix Theme tab handling

688. By Tim Bentley

Fix bibles and themes

689. By Tim Bentley

Presentation, Custom , bug fixes

690. By Tim Bentley

Add Shadow and Outline options to Themes

691. By Tim Bentley

Fix bug stopping Custom editing

692. By Raoul Snyman

Merged in OpenSong/Bible importer branch.

693. By Raoul Snyman

Merge in changes from lp:~raoul-snyman/openlp/biblesplugin

694. By Raoul Snyman

Updated the copyright.

695. By Tim Bentley

Changes to:
 Alerts so they wait before being displayed
 Presentations so they work correctly
 Themes so the blank line is removed
 Rendering so the correct size is used
 Themes are cached so theme manager loads quicker

Various other fixes

696. By Tim Bentley

More Fixes for Presentations
Fix screen blanking so resets for Video
Fix screen blanking so it does not remember at start up if set by presentations and video.
Fix Pop ups so they display on correct monitor

697. By Raoul Snyman

New version 1 -> 2 Bible converter script.

698. By Tim Bentley

Display updates, Song Usage fixes, Theme display fixes

699. By Tim Bentley

Changes to presentations to allow smart file selection
Fix ServiceManager to load / save services.
Add start of filtering to allow Services to handle presentations where the player is missing
Add debugging to try and sort out Impress crashes.

700. By Raoul Snyman

Some major work on the Bibles plugin:
 - Reworked import system to make it pluggable.
 - Created a Bible Import Wizard.
 - Converted Crosswalk to use BeautifulSoup.
 - Merged HTTP and DB Bible list.
 - Made all Bibles descend from BibleDB.
 - Lots of other changes and fixes.

701. By Tim Bentley

Fix up notification on startup
Fix alerts for presentations
Fix remote client so works better
Add extra key strokes for display of songs

702. By Tim Bentley

Fix Presentation file filter
Fix Cancel for song verse editor

703. By Tim Bentley

Fix number of song verses. > 10

704. By Tim Bentley

Fix theme import bug

705. By Tim Bentley

Fix SongUsage Dialog so should be complete
Minor bug fixes discovered and fixed.
Alerts - Major refactor
* Make a plugin
* Move code from maindisplay into plugin
* Add Location , Font size and History option to Font Tab and fix code to use them
* Add button to Alert Tab to allow History to be edited
* Amend Alert screen to be able to use History if option set
* Build screen to allow alerts to be Added / Edited and Deleted.

706. By Jonathan Corwin

A couple of small changes to get powerpoint+viewer working.

707. By Tim Bentley

Fix displayAlert error
Fix UTF8 settings on SongUSage dialog

708. By Jonathan Corwin

A few more small presentation fixes/cosmetics.

709. By Raoul Snyman

Updated version.txt to the latest revision.

710. By Raoul Snyman

Moved the log file to a location that OpenLP can write to as an unpriviledged user.

711. By Jon Tibble

Import and theme importing fixes

712. By Raoul Snyman

Cleaned up setup.py file, so that a source distribution is possible, and also packages can be built.

713. By Michael Gorven

Add menu entry .desktop file and some source tarball and script fixes.
https://code.launchpad.net/~mgorven/openlp/menu-entry/+merge/19978

714. By Tim Bentley

Fix Presentation Tag and flush Renderer cache on re-paint

715. By Raoul Snyman

Trying to set a tag on trunk.

716. By Tim Bentley

Add HTTP Check to Thread to stop UI blocking at startup
Add Preview option for songs etc from service manager

717. By Tim Bentley

Fix lost text on Song editing
Fixed Display on SlideController
Fixed bugs in last merge
Cleaned up comments and some log debug statements.

718. By Tim Bentley

Automate Media type list from phonon

719. By Raoul Snyman

Added some more icons.

720. By Jonathan Corwin

Split live/preview presentation documents, plus fixes for Windows

721. By Raoul Snyman

A fix to the OSIS importer, and added the version file.

722. By Raoul Snyman

Create the config directory if it doesn't exist yet, in order to save the log file.

723. By Tim Bentley

Cleaned up logging code
Added code to stop themes in use being deleted
Added Service Notes to service items
Fixed ServiceManager context menu so it works based on the item selected
Various minor bug fixes
Fix up bug for Theme savings and OOS

724. By Jonathan Corwin

Presentations:
- Close presentation app down correctly
- Add mode to automatically detect file type

725. By Tim Bentley

Add indication if service item has notes
Add display of notes as Tooltip

726. By Tim Bentley

Remove version tag

727. By Tim Bentley

Fix serviceItem expansion on repaint
Add ALL to Images file filter
Add Icon overlay to serviceItem when we have notes.

728. By Raoul Snyman

Fixed up some problems and inadvertant bugs from the move of the "get-strings.py" file to the scripts directory.

729. By Tim Bentley

ServiceManager fixes

730. By Raoul Snyman

Windows modifications:
- Added Windows build files.
- Added Windows installer files.
- Modified the tabs in the media manager to look a little better on both Windows and Linux.
- Windows icon.

731. By Jon Tibble

Truth test and C style cleanups

732. By Raoul Snyman

Fix "red letter" versions of Crosswalk Bibles.

733. By Jonathan Corwin

Fix issues regarding the blank button for presentations and added methods to extract presentation text and notes for use in the future.

734. By Tim Bentley

Refactor renderer to do outline correctly
Add removal of footer for blank screens
Fix song edit bug allowing preview to be triggered.

735. By Jonathan Corwin

head

736. By Jonathan Corwin

head

737. By Jonathan Corwin

Remove transparent error: QImage::scaled: Image is a null image

738. By Jonathan Corwin

head

739. By Jonathan Corwin

Close down presentation apps at end correctly

740. By Jonathan Corwin

head

741. By Jonathan Corwin

Start presentation apps in right place

742. By Jonathan Corwin

head

743. By Jonathan Corwin

resize thumbs

744. By Jonathan Corwin

Head

745. By Jonathan Corwin

Well at least you can open a presentation now. Can't see it yet though cos of some silly black window in the way

746. By Jonathan Corwin

Head

747. By Jonathan Corwin

Remove the main display so we can see the ppt's

748. By Jonathan Corwin

head

749. By Jonathan Corwin

Presentation tidyups

750. By Jonathan Corwin

Head

751. By Jonathan Corwin

Merge excepts together

752. By Jonathan Corwin

head

753. By Jonathan Corwin

Merge excepts together (again)

754. By Jonathan Corwin

pptviewlib.dll

755. By Jonathan Corwin

Bug 598361 - Preview presentation error. Ensure presentations close correctly

756. By Jonathan Corwin

head

757. By Jonathan Corwin

head

758. By Jonathan Corwin

Remove error trace if no impress

759. By Jonathan Corwin

Prevent crash if OpenOffice not installed on Windows

760. By Jonathan Corwin

head

761. By Jonathan Corwin

Clean up after TRB143's attempts to outclean Meths
Fix pptview plugin when running as exe

762. By Jonathan Corwin

head

763. By Jonathan Corwin

Must get TRB143 a new mop for Christmas

764. By Jonathan Corwin

Head r925

765. By Jonathan Corwin

Presentation thumbnail changes

766. By Jonathan Corwin

Missed one

767. By Jonathan Corwin

Head

768. By Jonathan Corwin

Got a conflict fix wrong

769. By Jonathan Corwin

Powerpoint fix

770. By Jonathan Corwin

pptview/impress fixes to thumbnails on Windows

771. By Jonathan Corwin

Coding standards

772. By Jonathan Corwin

Head946

773. By Jonathan Corwin

Head

774. By Jonathan Corwin

[Bug 608149] [NEW] Presentations are not intuitive

775. By Jonathan Corwin

Head

776. By Jonathan Corwin

Presentations no longer startup blanked

777. By Jonathan Corwin

Head

778. By Jonathan Corwin

Warn, not error, if COM Impress not available

779. By Jonathan Corwin

Head

780. By Jonathan Corwin

Untidy the code I tided, so it functions correctly!

781. By Jonathan Corwin

Add the dll too

782. By Jonathan Corwin

Further detection efforts

783. By Jonathan Corwin

non-debug version of dll

784. By Jonathan Corwin

remove pptviewlib.dll and build it via windows-builder.py

785. By Jonathan Corwin

head

786. By Jonathan Corwin

tabs to spaces *grr at VC++*

787. By Jonathan Corwin

StevanP's changes, so vc variables don't need setting now

788. By Jonathan Corwin

u's and spaces

789. By Jonathan Corwin

head

790. By Jonathan Corwin

Fix bug 773036

791. By Jonathan Corwin

Minimized impress troubles

792. By Jonathan Corwin

head

793. By Jonathan Corwin

process events not required

794. By Jonathan Corwin

Make Impress changes windows specific

795. By Jonathan Corwin

head

796. By Jonathan Corwin

os.path.splitext includes the . in the extension!

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/plugins/presentations/lib/__init__.py'
2--- openlp/plugins/presentations/lib/__init__.py 2009-09-26 20:51:05 +0000
3+++ openlp/plugins/presentations/lib/__init__.py 2009-09-30 19:41:10 +0000
4@@ -23,9 +23,6 @@
5 ###############################################################################
6
7 from presentationcontroller import PresentationController
8-from impresscontroller import ImpressController
9-from powerpointcontroller import PowerpointController
10-from pptviewcontroller import PptviewController
11 from messagelistener import MessageListener
12 from mediaitem import PresentationMediaItem
13 from presentationtab import PresentationTab
14
15=== modified file 'openlp/plugins/presentations/lib/impresscontroller.py'
16--- openlp/plugins/presentations/lib/impresscontroller.py 2009-09-27 12:44:11 +0000
17+++ openlp/plugins/presentations/lib/impresscontroller.py 2009-09-30 19:41:10 +0000
18@@ -38,7 +38,6 @@
19
20 from presentationcontroller import PresentationController
21
22-
23 class ImpressController(PresentationController):
24 """
25 Class to control interactions with Impress presentations.
26@@ -47,6 +46,7 @@
27 """
28 global log
29 log = logging.getLogger(u'ImpressController')
30+ log.info(u'loaded')
31
32 def __init__(self, plugin):
33 """
34@@ -59,16 +59,17 @@
35 self.presentation = None
36 self.controller = None
37
38- def is_available(self):
39- """
40- PPT Viewer is able to run on this machine
41- """
42- log.debug(u'is_available')
43- try:
44- self.start_process()
45+ def check_available(self):
46+ """
47+ Impress is able to run on this machine
48+ """
49+ log.debug(u'check_available')
50+ if os.name == u'nt':
51+ return self.get_com_servicemanager() is not None
52+ else:
53+ # If not windows, and we've got this far then probably
54+ # installed else the import uno would likely have failed
55 return True
56- except:
57- return False
58
59 def start_process(self):
60 """
61@@ -148,13 +149,21 @@
62 def get_com_desktop(self):
63 log.debug(u'getCOMDesktop')
64 try:
65- smgr = Dispatch("com.sun.star.ServiceManager")
66+ smgr = self.get_com_servicemanager()
67 desktop = smgr.createInstance( "com.sun.star.frame.Desktop")
68 return desktop
69 except:
70 log.exception(u'Failed to get COM desktop')
71 return None
72
73+ def get_com_servicemanager(self):
74+ log.debug(u'get_com_servicemanager')
75+ try:
76+ return Dispatch("com.sun.star.ServiceManager")
77+ except:
78+ log.exception(u'Failed to get COM service manager')
79+ return None
80+
81 def close_presentation(self):
82 """
83 Close presentation and clean up objects
84
85=== modified file 'openlp/plugins/presentations/lib/mediaitem.py'
86--- openlp/plugins/presentations/lib/mediaitem.py 2009-09-28 20:45:04 +0000
87+++ openlp/plugins/presentations/lib/mediaitem.py 2009-09-30 19:41:10 +0000
88@@ -94,7 +94,8 @@
89 self.loadList(list)
90 for item in self.controllers:
91 #load the drop down selection
92- self.DisplayTypeComboBox.addItem(item)
93+ if self.controllers[item].enabled:
94+ self.DisplayTypeComboBox.addItem(item)
95
96 def loadList(self, list):
97 for file in list:
98
99=== modified file 'openlp/plugins/presentations/lib/powerpointcontroller.py'
100--- openlp/plugins/presentations/lib/powerpointcontroller.py 2009-09-27 21:49:00 +0000
101+++ openlp/plugins/presentations/lib/powerpointcontroller.py 2009-09-30 19:41:10 +0000
102@@ -27,6 +27,7 @@
103
104 if os.name == u'nt':
105 from win32com.client import Dispatch
106+ import _winreg
107
108 from presentationcontroller import PresentationController
109
110@@ -41,7 +42,8 @@
111 """
112 global log
113 log = logging.getLogger(u'PowerpointController')
114-
115+ log.info(u'loaded')
116+
117 def __init__(self, plugin):
118 """
119 Initialise the class
120@@ -51,18 +53,18 @@
121 self.process = None
122 self.presentation = None
123
124- def is_available(self):
125+ def check_available(self):
126 """
127 PowerPoint is able to run on this machine
128 """
129- log.debug(u'is_available')
130- if os.name != u'nt':
131- return False
132- try:
133- self.start_process()
134- return True
135- except:
136- return False
137+ log.debug(u'check_available')
138+ if os.name == u'nt':
139+ try:
140+ _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, u'PowerPoint.Application').Close()
141+ return True
142+ except:
143+ pass
144+ return False
145
146 if os.name == u'nt':
147 def start_process(self):
148@@ -83,6 +85,9 @@
149 return False
150
151 def kill(self):
152+ """
153+ Called at system exit to clean up any running presentations
154+ """
155 self.process.Quit()
156 self.process = None
157
158
159=== modified file 'openlp/plugins/presentations/lib/pptviewcontroller.py'
160--- openlp/plugins/presentations/lib/pptviewcontroller.py 2009-09-26 20:51:05 +0000
161+++ openlp/plugins/presentations/lib/pptviewcontroller.py 2009-09-30 19:41:10 +0000
162@@ -39,37 +39,50 @@
163 """
164 global log
165 log = logging.getLogger(u'PptviewController')
166+ log.info(u'loaded')
167
168 def __init__(self, plugin):
169 """
170 Initialise the class
171 """
172 log.debug(u'Initialising')
173+ self.process = None
174 PresentationController.__init__(self, plugin, u'Powerpoint Viewer')
175- self.process = None
176 self.pptid = None
177 self.thumbnailpath = os.path.join(plugin.config.get_data_path(),
178 u'pptview', u'thumbnails')
179 self.thumbprefix = u'slide'
180
181- def is_available(self):
182+ def check_available(self):
183 """
184 PPT Viewer is able to run on this machine
185 """
186- log.debug(u'is_available')
187+ log.debug(u'check_available')
188 if os.name != u'nt':
189 return False
190 try:
191- self.start_process()
192- return True
193+ return self.check_installed()
194 except:
195 return False
196
197 if os.name == u'nt':
198+ def check_installed(self):
199+ """
200+ Check the viewer is installed
201+ """
202+ log.debug(u'Check installed')
203+ try:
204+ self.start_process()
205+ return self.process.CheckInstalled()
206+ except:
207+ return False
208+
209 def start_process(self):
210 """
211 Loads the PPTVIEWLIB library
212 """
213+ if self.process is not None:
214+ return
215 log.debug(u'start PPTView')
216 self.process = cdll.LoadLibrary(r'openlp\plugins\presentations\lib\pptviewlib\pptviewlib.dll')
217
218
219=== modified file 'openlp/plugins/presentations/lib/pptviewlib/README.TXT'
220--- openlp/plugins/presentations/lib/pptviewlib/README.TXT 2009-09-13 15:14:45 +0000
221+++ openlp/plugins/presentations/lib/pptviewlib/README.TXT 2009-09-30 19:41:10 +0000
222@@ -25,6 +25,9 @@
223
224 USAGE
225 -----
226+BOOL CheckInstalled(void);
227+ Returns TRUE if PowerPointViewer is installed. FALSE if not.
228+
229 int OpenPPT(char *filename, HWND hParentWnd, RECT rect, char *previewpath);
230
231 Opens the PowerPoint file, counts the number of slides, sizes and positions accordingly
232
233=== modified file 'openlp/plugins/presentations/lib/pptviewlib/pptviewlib.cpp'
234--- openlp/plugins/presentations/lib/pptviewlib/pptviewlib.cpp 2009-09-23 20:40:19 +0000
235+++ openlp/plugins/presentations/lib/pptviewlib/pptviewlib.cpp 2009-09-30 19:41:10 +0000
236@@ -82,6 +82,14 @@
237 DEBUG("enabled\n");
238 }
239
240+DllExport BOOL CheckInstalled()
241+{
242+ DEBUG("CheckInstalled\n");
243+ char cmdline[MAX_PATH * 2];
244+
245+ return GetPPTViewerPath(cmdline, sizeof(cmdline));
246+}
247+
248 // Open the PointPoint, count the slides and take a snapshot of each slide
249 // for use in previews
250 // previewpath is a prefix for the location to put preview images of each slide.
251
252=== modified file 'openlp/plugins/presentations/lib/pptviewlib/pptviewlib.h'
253--- openlp/plugins/presentations/lib/pptviewlib/pptviewlib.h 2009-09-23 20:40:19 +0000
254+++ openlp/plugins/presentations/lib/pptviewlib/pptviewlib.h 2009-09-30 19:41:10 +0000
255@@ -4,6 +4,7 @@
256 enum PPTVIEWSTATE { PPT_CLOSED, PPT_STARTED, PPT_OPENED, PPT_LOADED, PPT_CLOSING};
257
258 DllExport int OpenPPT(char *filename, HWND hParentWnd, RECT rect, char *previewpath);
259+DllExport BOOL CheckInstalled();
260 DllExport void ClosePPT(int id);
261 DllExport int GetCurrentSlide(int id);
262 DllExport int GetSlideCount(int id);
263
264=== modified file 'openlp/plugins/presentations/lib/presentationcontroller.py'
265--- openlp/plugins/presentations/lib/presentationcontroller.py 2009-09-28 19:34:55 +0000
266+++ openlp/plugins/presentations/lib/presentationcontroller.py 2009-09-30 19:41:10 +0000
267@@ -20,6 +20,8 @@
268
269 import logging
270
271+from PyQt4 import QtCore
272+
273 class PresentationController(object):
274 """
275 Base class for presentation controllers to inherit from
276@@ -32,6 +34,13 @@
277 ``name``
278 The name that appears in the options and the media manager
279
280+ ``enabled``
281+ The controller is enabled
282+
283+ ``available``
284+ The controller is available on this machine. Set by init via
285+ call to check_available
286+
287 ``plugin``
288 The presentationplugin object
289
290@@ -40,7 +49,7 @@
291 ``kill()``
292 Called at system exit to clean up any running presentations
293
294- ``is_available()``
295+ ``check_available()``
296 Returns True if presentation application is installed/can run on this machine
297
298 ``load_presentation(presentation)``
299@@ -108,8 +117,14 @@
300 """
301 self.plugin = plugin
302 self.name = name
303+ self.available = self.check_available()
304+ if self.available:
305+ self.enabled = int(plugin.config.get_config(
306+ name, QtCore.Qt.Unchecked)) == QtCore.Qt.Checked
307+ else:
308+ self.enabled = False
309
310- def is_available(self):
311+ def check_available(self):
312 """
313 Presentation app is able to run on this machine
314 """
315
316=== modified file 'openlp/plugins/presentations/lib/presentationtab.py'
317--- openlp/plugins/presentations/lib/presentationtab.py 2009-09-26 20:51:05 +0000
318+++ openlp/plugins/presentations/lib/presentationtab.py 2009-09-30 19:41:10 +0000
319@@ -60,24 +60,17 @@
320 self.VerseTypeLayout.setSpacing(8)
321 self.VerseTypeLayout.setMargin(0)
322 self.VerseTypeLayout.setObjectName(u'VerseTypeLayout')
323- self.PowerpointCheckBox = QtGui.QCheckBox(self.VerseDisplayGroupBox)
324- self.PowerpointCheckBox.setTristate(False)
325- if os.name != u'nt':
326- self.PowerpointCheckBox.setEnabled(False)
327- self.PowerpointCheckBox.setObjectName(u'PowerpointCheckBox')
328- self.VerseDisplayLayout.addWidget(self.PowerpointCheckBox, 0, 0, 1, 1)
329- self.PowerpointViewerCheckBox = QtGui.QCheckBox(
330- self.VerseDisplayGroupBox)
331- self.PowerpointViewerCheckBox.setTristate(False)
332- if os.name != u'nt':
333- self.PowerpointViewerCheckBox.setEnabled(False)
334- self.PowerpointViewerCheckBox.setObjectName(u'PowerpointViewerCheckBox')
335- self.VerseDisplayLayout.addWidget(
336- self.PowerpointViewerCheckBox, 1, 0, 1, 1)
337- self.ImpressCheckBox = QtGui.QCheckBox(self.VerseDisplayGroupBox)
338- self.ImpressCheckBox.setTristate(False)
339- self.ImpressCheckBox.setObjectName(u'ImpressCheckBox')
340- self.VerseDisplayLayout.addWidget(self.ImpressCheckBox, 2, 0, 1, 1)
341+ self.PresenterCheckboxes = {}
342+ index = 0
343+ for key in self.controllers:
344+ controller = self.controllers[key]
345+ checkbox = QtGui.QCheckBox(self.VerseDisplayGroupBox)
346+ checkbox.setTristate(False)
347+ checkbox.setEnabled(controller.available)
348+ checkbox.setObjectName(controller.name + u'CheckBox')
349+ self.PresenterCheckboxes[controller.name] = checkbox
350+ index = index + 1
351+ self.VerseDisplayLayout.addWidget(checkbox, index, 0, 1, 1)
352 self.PresentationThemeWidget = QtGui.QWidget(self.VerseDisplayGroupBox)
353 self.PresentationThemeWidget.setObjectName(u'PresentationThemeWidget')
354 self.PresentationThemeLayout = QtGui.QHBoxLayout(
355@@ -103,26 +96,23 @@
356 self.PresentationLayout.addWidget(self.PresentationRightWidget)
357
358 def retranslateUi(self):
359- self.PowerpointCheckBox.setText(
360- translate(u'PresentationTab', 'Powerpoint available:'))
361- self.PowerpointViewerCheckBox.setText(
362- translate(u'PresentationTab', 'PowerpointViewer available:'))
363- self.ImpressCheckBox.setText(
364- translate(u'PresentationTab', 'Impress available:'))
365+ for key in self.controllers:
366+ controller = self.controllers[key]
367+ checkbox = self.PresenterCheckboxes[controller.name]
368+ checkbox.setText(translate(u'PresentationTab',
369+ controller.name + u' available:'))
370
371 def load(self):
372- self.PowerpointCheckBox.setChecked(
373- int(self.config.get_config(u'Powerpoint', 0)))
374- self.PowerpointViewerCheckBox.setChecked(
375- int(self.config.get_config(u'Powerpoint Viewer', 0)))
376- self.ImpressCheckBox.setChecked(
377- int(self.config.get_config(u'Impress', 0)))
378+ for key in self.controllers:
379+ controller = self.controllers[key]
380+ if controller.available:
381+ checkbox = self.PresenterCheckboxes[controller.name]
382+ checkbox.setChecked(
383+ int(self.config.get_config(controller.name, 0)))
384
385 def save(self):
386- self.config.set_config(
387- u'Powerpoint', unicode(self.PowerpointCheckBox.checkState()))
388- self.config.set_config(
389- u'Powerpoint Viewer',
390- unicode(self.PowerpointViewerCheckBox.checkState()))
391- self.config.set_config(
392- u'Impress', unicode(self.ImpressCheckBox.checkState()))
393+ for key in self.controllers:
394+ controller = self.controllers[key]
395+ checkbox = self.PresenterCheckboxes[controller.name]
396+ self.config.set_config(
397+ controller.name, unicode(checkbox.checkState()))
398
399=== modified file 'openlp/plugins/presentations/presentationplugin.py'
400--- openlp/plugins/presentations/presentationplugin.py 2009-09-29 17:05:34 +0000
401+++ openlp/plugins/presentations/presentationplugin.py 2009-09-30 19:41:10 +0000
402@@ -22,11 +22,12 @@
403 # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
404 ###############################################################################
405
406+import os
407 import logging
408
409-from PyQt4 import QtCore
410+from PyQt4 import QtGui
411
412-from openlp.core.lib import Plugin, buildIcon
413+from openlp.core.lib import Plugin
414 from openlp.plugins.presentations.lib import *
415
416 class PresentationPlugin(Plugin):
417@@ -41,7 +42,9 @@
418 Plugin.__init__(self, u'Presentations', u'1.9.0', plugin_helpers)
419 self.weight = -8
420 # Create the plugin icon
421- self.icon = buildIcon(u':/media/media_presentation.png')
422+ self.icon = QtGui.QIcon()
423+ self.icon.addPixmap(QtGui.QPixmap(u':/media/media_presentation.png'),
424+ QtGui.QIcon.Normal, QtGui.QIcon.Off)
425
426 def get_settings_tab(self):
427 """
428@@ -67,25 +70,25 @@
429 If Not do not install the plugin.
430 """
431 log.debug(u'check_pre_conditions')
432- #Lets see if Powerpoint is required (Default is Not wanted)
433- controller = PowerpointController(self)
434- if int(self.config.get_config(
435- controller.name, QtCore.Qt.Unchecked)) == QtCore.Qt.Checked:
436- if controller.is_available():
437- self.registerControllers(controller)
438- #Lets see if Impress is required (Default is Not wanted)
439- controller = ImpressController(self)
440- if int(self.config.get_config(
441- controller.name, QtCore.Qt.Unchecked)) == QtCore.Qt.Checked:
442- if controller.is_available():
443- self.registerControllers(controller)
444- #Lets see if Powerpoint Viewer is required (Default is Not wanted)
445- controller = PptviewController(self)
446- if int(self.config.get_config(
447- controller.name, QtCore.Qt.Unchecked)) == QtCore.Qt.Checked:
448- if controller.is_available():
449- self.registerControllers(controller)
450- #If we have no available controllers disable plugin
451+ dir = os.path.join(os.path.dirname(__file__), u'lib')
452+ for filename in os.listdir(dir):
453+ if filename.endswith(u'controller.py') and \
454+ not filename == 'presentationcontroller.py':
455+ path = os.path.join(dir, filename)
456+ if os.path.isfile(path):
457+ modulename = u'openlp.plugins.presentations.lib.' + \
458+ os.path.splitext(filename)[0]
459+ log.debug(u'Importing controller %s', modulename)
460+ try:
461+ __import__(modulename, globals(), locals(), [])
462+ except ImportError, e:
463+ log.error(u'Failed to import %s on path %s for reason %s', modulename, path, e.args[0])
464+ controller_classes = PresentationController.__subclasses__()
465+ for controller_class in controller_classes:
466+ controller = controller_class(self)
467+ self.registerControllers(controller)
468+ if controller.enabled:
469+ controller.start_process()
470 if len(self.controllers) > 0:
471 return True
472 else:
473@@ -94,5 +97,7 @@
474 def finalise(self):
475 log.debug(u'Finalise')
476 #Ask each controller to tidy up
477- for controller in self.controllers:
478- self.controllers[controller].kill()
479+ for key in self.controllers:
480+ controller = self.controllers[key]
481+ if controller.enabled:
482+ controller.kill()