Fix song editing error messages

bzr-revno: 654
This commit is contained in:
Tim Bentley 2009-11-04 18:16:35 +00:00
commit 4e9aa7f142
4 changed files with 10 additions and 11 deletions

View File

@ -24,7 +24,6 @@
import types
import os
import uuid
from PyQt4 import QtCore, QtGui
@ -113,6 +112,7 @@ class MediaManagerItem(QtGui.QWidget):
if title is not None:
self.title = title
self.Toolbar = None
self.remoteTriggered = None
self.ServiceItemIconName = None
self.PageLayout = QtGui.QVBoxLayout(self)
self.PageLayout.setSpacing(0)
@ -358,13 +358,13 @@ class MediaManagerItem(QtGui.QWidget):
u'to be defined by the plugin')
def onPreviewClick(self):
if not self.ListView.selectedIndexes():
if not self.ListView.selectedIndexes() and not self.remoteTriggered:
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:
if service_item:
service_item.fromPlugin = True
self.parent.preview_controller.addServiceItem(service_item)
@ -375,21 +375,20 @@ class MediaManagerItem(QtGui.QWidget):
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:
if service_item:
service_item.fromPlugin = True
service_item.uuid = unicode(uuid.uuid1())
self.parent.live_controller.addServiceItem(service_item)
def onAddClick(self):
if not self.ListView.selectedIndexes():
if not self.ListView.selectedIndexes() and not self.remoteTriggered:
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:
if service_item:
service_item.fromPlugin = False
service_item.uuid = unicode(uuid.uuid1())
self.parent.service_manager.addServiceItem(service_item)
def buildServiceItem(self):
@ -397,7 +396,7 @@ class MediaManagerItem(QtGui.QWidget):
Common method for generating a service item
"""
service_item = ServiceItem(self.parent)
if self.ServiceItemIconName is not None:
if self.ServiceItemIconName:
service_item.addIcon(self.ServiceItemIconName)
else:
service_item.addIcon(

View File

@ -25,6 +25,7 @@
import logging
import os
import time
import uuid
from PyQt4 import QtGui
@ -73,6 +74,7 @@ class ServiceItem(object):
self.service_item_type = None
self.editEnabled = False
self.service_frames = []
self.uuid = unicode(uuid.uuid1())
def addIcon(self, icon):
"""

View File

@ -55,7 +55,6 @@ class SongMediaItem(MediaManagerItem):
self.parent.songmanager, self)
#Holds information about whether the edit is remotly triggered and which
#Song is required.
self.remoteTriggered = None
self.remoteSong = -1
def initPluginNameVisible(self):
@ -180,7 +179,6 @@ class SongMediaItem(MediaManagerItem):
def displayResultsSong(self, searchresults):
log.debug(u'display results Song')
self.ListView.clear()
#log.debug(u'Records returned from search %s", len(searchresults))
for song in searchresults:
author_list = u''
for author in song.authors:

View File

@ -1 +1 @@
1.9.0-653
1.9.0-654