fixed manager for customs

This commit is contained in:
Andreas Preikschat 2010-10-28 16:56:52 +02:00
parent d458ac2a98
commit e3b7cc2c91
2 changed files with 6 additions and 6 deletions

View File

@ -59,7 +59,7 @@ class CustomPlugin(Plugin):
return CustomTab(self.name, visible_name[u'title']) return CustomTab(self.name, visible_name[u'title'])
def getMediaManagerItem(self): def getMediaManagerItem(self):
# Create the CustomManagerItem object # Create the ManagerItem object
return CustomMediaItem(self, self, self.icon) return CustomMediaItem(self, self, self.icon)
def about(self): def about(self):
@ -76,7 +76,7 @@ class CustomPlugin(Plugin):
Returns True if the theme is being used, otherwise returns False. Returns True if the theme is being used, otherwise returns False.
""" """
if self.custommanager.get_all_objects(CustomSlide, if self.manager.get_all_objects(CustomSlide,
CustomSlide.theme_name == theme): CustomSlide.theme_name == theme):
return True return True
return False return False
@ -92,11 +92,11 @@ class CustomPlugin(Plugin):
``newTheme`` ``newTheme``
The new name the plugin should now use. The new name the plugin should now use.
""" """
customsUsingTheme = self.custommanager.get_all_objects(CustomSlide, customsUsingTheme = self.manager.get_all_objects(CustomSlide,
CustomSlide.theme_name == oldTheme) CustomSlide.theme_name == oldTheme)
for custom in customsUsingTheme: for custom in customsUsingTheme:
custom.theme_name = newTheme custom.theme_name = newTheme
self.custommanager.save_object(custom) self.manager.save_object(custom)
def setPluginTextStrings(self): def setPluginTextStrings(self):
""" """

View File

@ -140,7 +140,7 @@ class CustomMediaItem(MediaManagerItem):
id_list = [(item.data(QtCore.Qt.UserRole)).toInt()[0] id_list = [(item.data(QtCore.Qt.UserRole)).toInt()[0]
for item in self.listView.selectedIndexes()] for item in self.listView.selectedIndexes()]
for id in id_list: for id in id_list:
self.parent.custommanager.delete_object(CustomSlide, id) self.parent.manager.delete_object(CustomSlide, id)
for row in row_list: for row in row_list:
self.listView.takeItem(row) self.listView.takeItem(row)
@ -162,7 +162,7 @@ class CustomMediaItem(MediaManagerItem):
service_item.add_capability(ItemCapabilities.AllowsEdit) service_item.add_capability(ItemCapabilities.AllowsEdit)
service_item.add_capability(ItemCapabilities.AllowsPreview) service_item.add_capability(ItemCapabilities.AllowsPreview)
service_item.add_capability(ItemCapabilities.AllowsLoop) service_item.add_capability(ItemCapabilities.AllowsLoop)
customSlide = self.parent.custommanager.get_object(CustomSlide, item_id) customSlide = self.parent.manager.get_object(CustomSlide, item_id)
title = customSlide.title title = customSlide.title
credit = customSlide.credits credit = customSlide.credits
service_item.editId = item_id service_item.editId = item_id