Merge lp:~trb143/openlp/fixes into lp:openlp

Proposed by Tim Bentley
Status: Merged
Merged at revision: not available
Proposed branch: lp:~trb143/openlp/fixes
Merge into: lp:openlp
Diff against target: 133 lines
4 files modified
openlp-1to2-converter.py (+7/-1)
openlp/core/lib/eventreceiver.py (+7/-0)
openlp/core/ui/slidecontroller.py (+15/-4)
openlp/plugins/songs/lib/mediaitem.py (+1/-2)
To merge this branch: bzr merge lp:~trb143/openlp/fixes
Reviewer Review Type Date Requested Status
Raoul Snyman Approve
Review via email: mp+13911@code.launchpad.net

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

To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) wrote : Posted in a previous version of this proposal

Maintain position on slidecontroller when editing and redisplaying songs

Revision history for this message
Raoul Snyman (raoul-snyman) wrote :

On a subsequent merge, please change the following line

    import pysqlite2

to

    import pysqlite2 as sqlite

Also, AFAIK, pysqlite2 is for SQLite version 3, not 2, so some folks who don't have sqlite might find that they still can't open v2 databases.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp-1to2-converter.py' (properties changed: -x to +x)
2--- openlp-1to2-converter.py 2009-10-24 07:14:11 +0000
3+++ openlp-1to2-converter.py 2009-10-25 08:15:23 +0000
4@@ -25,7 +25,13 @@
5
6 import sys
7 import os
8-import sqlite
9+try:
10+ import sqlite
11+except:
12+ try:
13+ import pysqlite2
14+ except:
15+ print 'No Sqlite2 package available'
16 import sqlite3
17 import re
18 from optparse import OptionParser
19
20=== modified file 'openlp/core/lib/eventreceiver.py'
21--- openlp/core/lib/eventreceiver.py 2009-10-17 05:47:17 +0000
22+++ openlp/core/lib/eventreceiver.py 2009-10-25 08:15:23 +0000
23@@ -86,6 +86,13 @@
24
25 ``config_updated``
26 Informs components the config has changed
27+
28+ ``edit_song``
29+ Requests the current song on the preview display be loaded for edit
30+
31+ ``preview_song``
32+ Tells the song plugin the edit has finished and the song can be previewed
33+ Only available if the edit was triggered by the Preview button.
34 """
35 global log
36 log = logging.getLogger(u'EventReceiver')
37
38=== modified file 'openlp/core/ui/slidecontroller.py'
39--- openlp/core/ui/slidecontroller.py 2009-10-24 16:40:36 +0000
40+++ openlp/core/ui/slidecontroller.py 2009-10-25 08:15:23 +0000
41@@ -97,6 +97,8 @@
42 ]
43 self.timer_id = 0
44 self.commandItem = None
45+ self.songEdit = False
46+ self.row = 0
47 self.Panel = QtGui.QWidget(parent.ControlSplitter)
48 # Layout for holding panel
49 self.PanelLayout = QtGui.QVBoxLayout(self.Panel)
50@@ -180,6 +182,7 @@
51 self.Toolbar.addToolbarWidget(
52 u'Image SpinBox', self.DelaySpinBox)
53 self.DelaySpinBox.setSuffix(self.trUtf8(u's'))
54+ self.DelaySpinBox.setToolTip(self.trUtf8(u'Delay between slides in seconds'))
55
56 self.ControllerLayout.addWidget(self.Toolbar)
57 # Screen preview area
58@@ -289,7 +292,12 @@
59 Receiver().send_message(u'%s_start' % item.name.lower(), \
60 [item.shortname, item.service_item_path,
61 item.service_frames[0][u'title']])
62- self.displayServiceManagerItems(item, 0)
63+ slideno = 0
64+ if self.songEdit:
65+ slideno = self.row
66+ self.songEdit = False
67+ self.displayServiceManagerItems(item, slideno)
68+
69
70 def addServiceManagerItem(self, item, slideno):
71 """
72@@ -297,7 +305,7 @@
73 request the correct the toolbar of the plugin
74 Called by ServiceManager
75 """
76- log.debug(u'addServiceItem')
77+ log.debug(u'addServiceManagerItem')
78 #If old item was a command tell it to stop
79 if self.commandItem is not None and \
80 self.commandItem.service_item_type == ServiceType.Command:
81@@ -387,12 +395,13 @@
82 if this is the Live Controller also display on the screen
83 """
84 row = self.PreviewListWidget.currentRow()
85+ self.row = 0
86 if row > -1 and row < self.PreviewListWidget.rowCount():
87 if self.commandItem.service_item_type == ServiceType.Command:
88 Receiver().send_message(u'%s_slide'% self.commandItem.name.lower(), [row])
89- QtCore.QTimer.singleShot(0.5, self.grabMainDisplay)
90+ if isLive:
91+ QtCore.QTimer.singleShot(0.5, self.grabMainDisplay)
92 else:
93- #label = self.PreviewListWidget.cellWidget(row, 0)
94 frame = self.serviceitem.frames[row][u'image']
95 before = time.time()
96 if frame is None:
97@@ -401,6 +410,7 @@
98 log.info(u'Slide Rendering took %4s' % (time.time() - before))
99 if self.isLive:
100 self.parent.mainDisplay.frameView(frame)
101+ self.row = row
102
103 def grabMainDisplay(self):
104 winid = QtGui.QApplication.desktop().winId()
105@@ -474,6 +484,7 @@
106 self.onSlideSelectedNext()
107
108 def onEditSong(self):
109+ self.songEdit = True
110 Receiver().send_message(u'edit_song')
111
112 def onGoLive(self):
113
114=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
115--- openlp/plugins/songs/lib/mediaitem.py 2009-10-24 16:40:36 +0000
116+++ openlp/plugins/songs/lib/mediaitem.py 2009-10-25 08:15:23 +0000
117@@ -125,7 +125,7 @@
118 QtCore.QObject.connect(Receiver.get_receiver(),
119 QtCore.SIGNAL(u'edit_song'), self.onEventEditSong)
120 QtCore.QObject.connect(Receiver.get_receiver(),
121- QtCore.SIGNAL(u'proview_song'), self.onPreviewClick)
122+ QtCore.SIGNAL(u'preview_song'), self.onPreviewClick)
123
124 def configUpdated(self):
125 self.searchAsYouType = str_to_bool(
126@@ -181,7 +181,6 @@
127 if song.id == self.fromPreview:
128 self.fromPreview = 0
129 self.ListView.setCurrentItem(song_name)
130- self.onPreviewClick()
131
132 def displayResultsAuthor(self, searchresults):
133 log.debug(u'display results Author')