Lose the [None] and fix jquery issue

This commit is contained in:
Jonathan Corwin 2011-05-21 18:43:37 +01:00
parent 218ee2db2b
commit 031525b0e6
3 changed files with 15 additions and 12 deletions

View File

@ -506,18 +506,18 @@ class MediaManagerItem(QtGui.QWidget):
# multiple service items?
if self.singleServiceItem or self.remoteTriggered:
log.debug(u'%s Add requested', self.plugin.name)
self.addToService([None], self.remoteTriggered)
self.addToService(replace=self.remoteTriggered)
else:
items = self.listView.selectedIndexes()
self.addToService(items)
for item in items:
self.addToService(item)
def addToService(self, items, replace=None):
for item in items:
serviceItem = self.buildServiceItem(item, True)
if serviceItem:
serviceItem.from_plugin = False
self.parent.serviceManager.addServiceItem(serviceItem,
replace=replace)
def addToService(self, item=None, replace=None):
serviceItem = self.buildServiceItem(item, True)
if serviceItem:
serviceItem.from_plugin = False
self.parent.serviceManager.addServiceItem(serviceItem,
replace=replace)
def onAddEditClick(self):
"""

View File

@ -247,8 +247,11 @@ window.OpenLP = {
var text = JSON.stringify({"request": {"id": id}});
$.getJSON(
"/api/" + $("#search-plugin").val() + "/add",
{"data": text})
history.back();
{"data": text},
function () {
history.back();
}
);
return false;
}
}

View File

@ -499,7 +499,7 @@ class HttpConnection(object):
plugin = self.parent.parent.pluginManager.get_plugin_by_name(type)
if plugin.status == PluginStatus.Active and plugin.mediaItem:
item_id = plugin.mediaItem.createItemFromId(id)
plugin.mediaItem.addToService([item_id])
plugin.mediaItem.addToService(item_id)
def send_response(self, response):
http = u'HTTP/1.1 %s\r\n' % response.code