[Openlp-core] [Merge] lp:~meths/openlp/trivialfixes into lp:openlp

2009-11-03 Thread Jon Tibble
Jon Tibble has proposed merging lp:~meths/openlp/trivialfixes into lp:openlp.

Requested reviews:
OpenLP Core (openlp-core)


Fixes and cleanups
-- 
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/14358
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py	2009-11-01 15:31:22 +
+++ openlp/core/lib/mediamanageritem.py	2009-11-03 14:15:24 +
@@ -358,6 +358,10 @@
 u'to be defined by the plugin')
 
 def onPreviewClick(self):
+if not self.ListView.selectedIndexes():
+QtGui.QMessageBox.information(self,
+self.trUtf8(u'No items selected...'),
+self.trUtf8(u'You must select one or more items'))
 log.debug(self.PluginNameShort + u' Preview Requested')
 service_item = self.buildServiceItem()
 if service_item is not None:
@@ -365,6 +369,10 @@
 self.parent.preview_controller.addServiceItem(service_item)
 
 def onLiveClick(self):
+if not self.ListView.selectedIndexes():
+QtGui.QMessageBox.information(self,
+self.trUtf8(u'No items selected...'),
+self.trUtf8(u'You must select one or more items'))
 log.debug(self.PluginNameShort + u' Live Requested')
 service_item = self.buildServiceItem()
 if service_item is not None:
@@ -373,6 +381,10 @@
 self.parent.live_controller.addServiceItem(service_item)
 
 def onAddClick(self):
+if not self.ListView.selectedIndexes():
+QtGui.QMessageBox.information(self,
+self.trUtf8(u'No items selected...'),
+self.trUtf8(u'You must select one or more items'))
 log.debug(self.PluginNameShort + u' Add Requested')
 service_item = self.buildServiceItem()
 if service_item is not None:

=== modified file 'openlp/core/lib/renderer.py'
--- openlp/core/lib/renderer.py	2009-10-30 20:21:36 +
+++ openlp/core/lib/renderer.py	2009-11-03 14:15:24 +
@@ -76,7 +76,6 @@
 self.theme_name = theme.theme_name
 self._set_theme_font()
 if theme.background_type == u'image':
-print theme.background_filename
 if theme.background_filename is not None:
 self.set_bg_image(theme.background_filename)
 

=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py	2009-11-02 18:05:52 +
+++ openlp/core/ui/maindisplay.py	2009-11-03 14:15:24 +
@@ -94,15 +94,15 @@
 self.layout.setObjectName(u'layout')
 self.mediaObject = Phonon.MediaObject(self)
 self.video = Phonon.VideoWidget()
+self.video.setVisible(False)
 self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self.mediaObject)
-self.video.setFullScreen(True)
 Phonon.createPath(self.mediaObject, self.video)
 Phonon.createPath(self.mediaObject, self.audio)
 self.layout.insertWidget(0, self.video)
 self.display = QtGui.QLabel(self)
 self.display.setScaledContents(True)
 self.layout.insertWidget(0, self.display)
-self.primary = False
+self.primary = True
 self.displayBlank = False
 self.blankFrame = None
 self.frame = None
@@ -272,6 +272,7 @@
 self.firstTime = True
 self.mediaLoaded = True
 self.display.hide()
+self.video.setFullScreen(True)
 self.mediaObject.play()
 if self.primary:
 self.setVisible(True)
@@ -292,4 +293,5 @@
 self.mediaObject.stop()
 self.mediaObject.clearQueue()
 self.mediaLoaded = False
+self.video.setVisible(False)
 self.display.show()

=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py	2009-11-01 15:31:22 +
+++ openlp/core/ui/servicemanager.py	2009-11-03 14:15:24 +
@@ -99,17 +99,6 @@
 mimeData.setText(u'ServiceManager')
 dropAction = drag.start(QtCore.Qt.CopyAction)
 
-class Iter(QtGui.QTreeWidgetItemIterator):
-def __init__(self, *args):
-QtGui.QTreeWidgetItemIterator.__init__(self, *args)
-
-def next(self):
-self.__iadd__(1)
-value = self.value()
-if value:
-return self.value()
-else:
-return None
 
 class ServiceManager(QtGui.QWidget):
 
@@ -248,23 +237,22 @@
 Moves the selection up the window
 Called by the up arrow
 
-it = Iter(self.ServiceManagerList)
-item = it.value()
+serviceIterator = QTreeWidgetItemIterator(self.ServiceManagerList)
 tempItem = None
 setLastItem = False
-while item is not None:
-if item.isSelected() and tempItem is None:
+while serviceIterator:
+if serviceIterator.isSelected() and tempItem is None:
 setLastItem = True
-

[Openlp-core] [Merge] lp:~trb143/openlp/fixes into lp:openlp

2009-11-03 Thread Tim Bentley
Tim Bentley has proposed merging lp:~trb143/openlp/fixes into lp:openlp.

Requested reviews:
OpenLP Core (openlp-core)


Clean up song editing
Fix wonky expansion in service manager
-- 
https://code.launchpad.net/~trb143/openlp/fixes/+merge/14378
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/eventreceiver.py'
--- openlp/core/lib/eventreceiver.py	2009-10-29 15:57:58 +
+++ openlp/core/lib/eventreceiver.py	2009-11-03 18:50:27 +
@@ -93,9 +93,6 @@
 ``config_updated``
 Informs components the config has changed
 
-``edit_song``
-Requests the current song on the preview display be loaded for edit
-
 ``preview_song``
 Tells the song plugin the edit has finished and the song can be previewed
 Only available if the edit was triggered by the Preview button.

=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py	2009-11-03 01:37:08 +
+++ openlp/core/ui/servicemanager.py	2009-11-03 18:50:27 +
@@ -162,6 +162,7 @@
 QtGui.QAbstractItemView.DragDrop)
 self.ServiceManagerList.setAlternatingRowColors(True)
 self.ServiceManagerList.setHeaderHidden(True)
+self.ServiceManagerList.setExpandsOnDoubleClick(False)
 self.ServiceManagerList.setObjectName(u'ServiceManagerList')
 # enable drop
 self.ServiceManagerList.__class__.dragEnterEvent = self.dragEnterEvent
@@ -584,7 +585,7 @@
 item, count = self.findServiceItem()
 if self.serviceItems[item][u'data'].editEnabled:
 self.remoteEditTriggered = True
-Receiver().send_message(u'%s_edit' % self.serviceItems[item][u'data'].name,
+Receiver().send_message(u'%s_edit' % self.serviceItems[item][u'data'].name, u'L:%s' %
 self.serviceItems[item][u'data'].editId )
 
 def onRemoteEditClear(self):

=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py	2009-11-02 01:03:27 +
+++ openlp/core/ui/slidecontroller.py	2009-11-03 18:50:27 +
@@ -323,7 +323,7 @@
 
 Allows the Preview toolbar to be customised
 
-if item.name == u'Songs' and item.fromPlugin:
+if (item.name == u'Songs' or item.name == u'Custom') and item.fromPlugin:
 self.Toolbar.makeWidgetsVisible(self.song_list)
 else:
 self.Toolbar.makeWidgetsInvisible(self.song_list)
@@ -561,7 +561,8 @@
 
 def onEditSong(self):
 self.songEdit = True
-Receiver().send_message(u'edit_song')
+Receiver().send_message(u'%s_edit' % self.commandItem.name, u'P:%s' %
+self.commandItem.editId )
 
 def onGoLive(self):
 

=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py	2009-11-01 09:07:10 +
+++ openlp/plugins/songs/lib/mediaitem.py	2009-11-03 18:50:27 +
@@ -53,12 +53,10 @@
 self.edit_song_form = EditSongForm(self.parent.songmanager, self)
 self.song_maintenance_form = SongMaintenanceForm(
 self.parent.songmanager, self)
-#fromPreview holds the id of the item if the song editor needs to trigger a preview
-#without closing.  It is set to -1 if this function is inactive
-self.fromPreview = -1
-#fromServiceManager holds the id of the item if the song editor needs to trigger posting
-#to the servicemanager without closing.  It is set to -1 if this function is inactive
-self.fromServiceManager = -1
+#Holds information about whether the edit is remotly triggered and which
+#Song is required.
+self.remoteTriggered = None
+self.remoteSong = -1
 
 def initPluginNameVisible(self):
 self.PluginNameVisible = self.trUtf8(u'Song')
@@ -129,8 +127,6 @@
 QtCore.QObject.connect(Receiver.get_receiver(),
 QtCore.SIGNAL(u'config_updated'), self.configUpdated)
 QtCore.QObject.connect(Receiver.get_receiver(),
-QtCore.SIGNAL(u'edit_song'), self.onEventEditSong)
-QtCore.QObject.connect(Receiver.get_receiver(),
 QtCore.SIGNAL(u'preview_song'), self.onPreviewClick)
 QtCore.QObject.connect(Receiver.get_receiver(),
 QtCore.SIGNAL(u'%s_edit' % self.parent.name), self.onRemoteEdit)
@@ -172,6 +168,14 @@
 search_results = self.parent.songmanager.get_song_from_author(
 search_keywords)
 self.displayResultsAuthor(search_results)
+#Called to redisplay the song list screen edith from a search
+#or from the exit of the Song edit dialog.  If remote editing is active
+#Trigger it and clean up so it will not update again.
+if self.remoteTriggered == u'L':
+self.onAddClick()
+if self.remoteTriggered == u'P':
+self.onPreviewClick()
+self.onRemoteEditClear()
 
 def displayResultsSong(self, 

Re: [Openlp-core] [Merge] lp:~meths/openlp/trivialfixes into lp:openlp

2009-11-03 Thread Jon Tibble
Object testing cleanups with a theme loading fix
-- 
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/14386
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


Re: [Openlp-core] [Merge] lp:~meths/openlp/trivialfixes into lp:openlp

2009-11-03 Thread Jon Tibble
Fixes and cleanups:
- Truth testing all over especially removing == style tests for bool and 
unnecessary double negative is not None tests.
- Fix theme loading so we call type functions (int(), str_to_bool(), etc) once 
not all over the tree.
- Fix issue with song editing clearing list selection then calling functions 
that want  0 items selected.
-- 
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/14397
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp


Re: [Openlp-core] [Merge] lp:~meths/openlp/trivialfixes into lp:openlp

2009-11-03 Thread Raoul Snyman
Review: Approve
W00t!
-- 
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/14397
Your team OpenLP Core is subscribed to branch lp:openlp.

___
Mailing list: https://launchpad.net/~openlp-core
Post to : openlp-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp