openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #09396
[Merge] lp:~j-corwin/openlp/general into lp:openlp
Jonathan Corwin has proposed merging lp:~j-corwin/openlp/general into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Related bugs:
Bug #634771 in OpenLP: "OpenLP 1.9.2+bzr1016-0ubuntu1~lucid1 does not start"
https://bugs.launchpad.net/openlp/+bug/634771
Bug #646718 in OpenLP: "Songbook, Number will not loaded, Title will not be saved"
https://bugs.launchpad.net/openlp/+bug/646718
Bug #696013 in OpenLP: "song import from powerpoint crashes every second time"
https://bugs.launchpad.net/openlp/+bug/696013
Bug #696021 in OpenLP: "presentation loader does not work fine in Windows using Powerpoint Viewer 2007"
https://bugs.launchpad.net/openlp/+bug/696021
Bug #696637 in OpenLP: "Alert not positioned correctly in single screen"
https://bugs.launchpad.net/openlp/+bug/696637
Bug #727732 in OpenLP: "Openlp 1.9.?? crashes on start"
https://bugs.launchpad.net/openlp/+bug/727732
Bug #735039 in OpenLP: "Cannot import PowerPoint Presentations with PowerPoint 2010"
https://bugs.launchpad.net/openlp/+bug/735039
For more details, see:
https://code.launchpad.net/~j-corwin/openlp/general/+merge/62758
Change parents of mediamanageritems, plus one or two others discovered along the way, as per
http://wiki.openlp.org/Scratchpad:Code_Corrections
--
https://code.launchpad.net/~j-corwin/openlp/general/+merge/62758
Your team OpenLP Core is requested to review the proposed merge of lp:~j-corwin/openlp/general into lp:openlp.
=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py 2011-05-27 09:34:14 +0000
+++ openlp/core/lib/mediamanageritem.py 2011-05-28 09:55:54 +0000
@@ -93,8 +93,7 @@
QtGui.QWidget.__init__(self)
self.parent = parent
self.whitespace = re.compile(r'\W+', re.UNICODE)
- #TODO: plugin should not be the parent in future
- self.plugin = parent # plugin
+ self.plugin = plugin
visible_title = self.plugin.getString(StringContent.VisibleName)
self.title = unicode(visible_title[u'title'])
self.settingsSection = self.plugin.name.lower()
@@ -114,8 +113,14 @@
self.retranslateUi()
self.auto_select_id = -1
QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'%s_service_load' % self.parent.name.lower()),
+ QtCore.SIGNAL(u'%s_service_load' % self.plugin.name.lower()),
self.serviceLoad)
+<<<<<<< TREE
+=======
+ QtCore.QObject.connect(Receiver.get_receiver(),
+ QtCore.SIGNAL(u'%s_set_autoselect_item' % self.plugin.name.lower()),
+ self.setAutoSelectItem)
+>>>>>>> MERGE-SOURCE
def requiredIcons(self):
"""
@@ -472,7 +477,7 @@
serviceItem = self.buildServiceItem()
if serviceItem:
serviceItem.from_plugin = True
- self.parent.previewController.addServiceItem(serviceItem)
+ self.plugin.previewController.addServiceItem(serviceItem)
if keepFocus:
self.listView.setFocus()
@@ -497,7 +502,7 @@
if serviceItem:
if not item_id:
serviceItem.from_plugin = True
- self.parent.liveController.addServiceItem(serviceItem)
+ self.plugin.liveController.addServiceItem(serviceItem)
def createItemFromId(self, item_id):
item = QtGui.QListWidgetItem()
@@ -527,7 +532,7 @@
serviceItem = self.buildServiceItem(item, True)
if serviceItem:
serviceItem.from_plugin = False
- self.parent.serviceManager.addServiceItem(serviceItem,
+ self.plugin.serviceManager.addServiceItem(serviceItem,
replace=replace)
def onAddEditClick(self):
@@ -540,14 +545,14 @@
'You must select one or more items.'))
else:
log.debug(u'%s Add requested', self.plugin.name)
- serviceItem = self.parent.serviceManager.getServiceItem()
+ serviceItem = self.plugin.serviceManager.getServiceItem()
if not serviceItem:
QtGui.QMessageBox.information(self, UiStrings().NISs,
translate('OpenLP.MediaManagerItem',
'You must select an existing service item to add to.'))
elif self.plugin.name.lower() == serviceItem.name.lower():
self.generateSlideData(serviceItem)
- self.parent.serviceManager.addServiceItem(serviceItem,
+ self.plugin.serviceManager.addServiceItem(serviceItem,
replace=True)
else:
# Turn off the remote edit update message indicator
@@ -561,8 +566,8 @@
"""
Common method for generating a service item
"""
- serviceItem = ServiceItem(self.parent)
- serviceItem.add_icon(self.parent.icon_path)
+ serviceItem = ServiceItem(self.plugin)
+ serviceItem.add_icon(self.plugin.icon_path)
if self.generateSlideData(serviceItem, item, xmlVersion):
return serviceItem
else:
=== modified file 'openlp/core/lib/plugin.py'
--- openlp/core/lib/plugin.py 2011-05-26 17:11:22 +0000
+++ openlp/core/lib/plugin.py 2011-05-28 09:55:54 +0000
@@ -215,7 +215,7 @@
you need, and return it for integration into openlp.org.
"""
if self.media_item_class:
- return self.media_item_class(self, self, self.icon)
+ return self.media_item_class(self.mediadock, self, self.icon)
return None
def addImportMenuItem(self, importMenu):
=== modified file 'openlp/plugins/alerts/forms/alertform.py'
--- openlp/plugins/alerts/forms/alertform.py 2011-05-26 17:11:22 +0000
+++ openlp/plugins/alerts/forms/alertform.py 2011-05-28 09:55:54 +0000
@@ -41,7 +41,8 @@
Initialise the alert form
"""
self.manager = plugin.manager
- self.parent = plugin
+ self.plugin = plugin
+ self.parent = plugin.formparent
self.item_id = None
QtGui.QDialog.__init__(self, plugin.formparent)
self.setupUi(self)
@@ -195,7 +196,7 @@
self.parameterEdit.setFocus()
return False
text = text.replace(u'<>', unicode(self.parameterEdit.text()))
- self.parent.alertsmanager.displayAlert(text)
+ self.plugin.alertsmanager.displayAlert(text)
return True
def onCurrentRowChanged(self, row):
=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py 2011-05-26 20:17:52 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py 2011-05-28 09:55:54 +0000
@@ -61,7 +61,7 @@
self.unlockIcon = QtGui.QIcon(u':/bibles/bibles_search_unlock.png')
MediaManagerItem.__init__(self, parent, plugin, icon)
# Place to store the search results for both bibles.
- self.settings = self.parent.settings_tab
+ self.settings = self.plugin.settings_tab
self.quickPreviewAllowed = True
self.hasSearch = True
self.search_results = {}
@@ -338,7 +338,7 @@
def initialise(self):
log.debug(u'bible manager initialise')
- self.parent.manager.media = self
+ self.plugin.manager.media = self
self.loadBibles()
bible = QtCore.QSettings().value(
self.settingsSection + u'/quick bible', QtCore.QVariant(
@@ -365,7 +365,7 @@
self.quickSecondComboBox.addItem(u'')
self.advancedSecondComboBox.addItem(u'')
# Get all bibles and sort the list.
- bibles = self.parent.manager.get_bibles().keys()
+ bibles = self.plugin.manager.get_bibles().keys()
bibles.sort(cmp=locale.strcoll)
# Load the bibles into the combo boxes.
for bible in bibles:
@@ -386,7 +386,7 @@
def reloadBibles(self):
log.debug(u'Reloading Bibles')
- self.parent.manager.reload_bibles()
+ self.plugin.manager.reload_bibles()
self.loadBibles()
def initialiseAdvancedBible(self, bible):
@@ -400,7 +400,7 @@
The bible to initialise (unicode).
"""
log.debug(u'initialiseAdvancedBible %s', bible)
- book_data = self.parent.manager.get_books(bible)
+ book_data = self.plugin.manager.get_books(bible)
self.advancedBookComboBox.clear()
first = True
for book in book_data:
@@ -416,7 +416,7 @@
def initialiseChapterVerse(self, bible, book, chapter_count):
log.debug(u'initialiseChapterVerse %s, %s', bible, book)
self.chapter_count = chapter_count
- verse_count = self.parent.manager.get_verse_count(bible, book, 1)
+ verse_count = self.plugin.manager.get_verse_count(bible, book, 1)
if verse_count == 0:
self.advancedSearchButton.setEnabled(False)
critical_error_message_box(
@@ -445,7 +445,7 @@
books = []
# We have to do a 'Reference Search'.
if self.quickSearchEdit.currentSearchType() == BibleSearch.Reference:
- bibles = self.parent.manager.get_bibles()
+ bibles = self.plugin.manager.get_bibles()
bible = unicode(self.quickVersionComboBox.currentText())
if bible:
book_data = bibles[bible].get_books()
@@ -455,8 +455,8 @@
def onImportClick(self):
if not hasattr(self, u'import_wizard'):
- self.import_wizard = BibleImportForm(self, self.parent.manager,
- self.parent)
+ self.import_wizard = BibleImportForm(self, self.plugin.manager,
+ self.plugin)
# If the import was not cancelled then reload.
if self.import_wizard.exec_():
self.reloadBibles()
@@ -515,7 +515,7 @@
bible = unicode(self.advancedVersionComboBox.currentText())
book = unicode(self.advancedBookComboBox.currentText())
verse_from = int(self.advancedFromVerse.currentText())
- verse_count = self.parent.manager.get_verse_count(bible, book,
+ verse_count = self.plugin.manager.get_verse_count(bible, book,
chapter_to)
self.adjustComboBox(verse_from, verse_count,
self.advancedToVerse, True)
@@ -527,7 +527,7 @@
chapter_to = int(self.advancedToChapter.currentText())
verse_from = int(self.advancedFromVerse.currentText())
verse_to = int(self.advancedToVerse.currentText())
- verse_count = self.parent.manager.get_verse_count(bible, book,
+ verse_count = self.plugin.manager.get_verse_count(bible, book,
chapter_to)
if chapter_from == chapter_to and verse_from > verse_to:
self.adjustComboBox(verse_from, verse_count, self.advancedToVerse)
@@ -539,7 +539,7 @@
book = unicode(self.advancedBookComboBox.currentText())
chapter_from = int(self.advancedFromChapter.currentText())
chapter_to = int(self.advancedToChapter.currentText())
- verse_count = self.parent.manager.get_verse_count(bible, book,
+ verse_count = self.plugin.manager.get_verse_count(bible, book,
chapter_from)
self.adjustComboBox(1, verse_count, self.advancedFromVerse)
if chapter_from > chapter_to:
@@ -599,9 +599,9 @@
range_separator + chapter_to + verse_separator + verse_to
versetext = u'%s %s' % (book, verse_range)
Receiver.send_message(u'cursor_busy')
- self.search_results = self.parent.manager.get_verses(bible, versetext)
+ self.search_results = self.plugin.manager.get_verses(bible, versetext)
if second_bible:
- self.second_search_results = self.parent.manager.get_verses(
+ self.second_search_results = self.plugin.manager.get_verses(
second_bible, versetext)
if not self.advancedLockButton.isChecked():
self.listView.clear()
@@ -627,15 +627,15 @@
text = unicode(self.quickSearchEdit.text())
if self.quickSearchEdit.currentSearchType() == BibleSearch.Reference:
# We are doing a 'Reference Search'.
- self.search_results = self.parent.manager.get_verses(bible, text)
+ self.search_results = self.plugin.manager.get_verses(bible, text)
if second_bible and self.search_results:
- self.second_search_results = self.parent.manager.get_verses(
+ self.second_search_results = self.plugin.manager.get_verses(
second_bible, text)
else:
# We are doing a 'Text Search'.
Receiver.send_message(u'cursor_busy')
- bibles = self.parent.manager.get_bibles()
- self.search_results = self.parent.manager.verse_search(bible,
+ bibles = self.plugin.manager.get_bibles()
+ self.search_results = self.plugin.manager.verse_search(bible,
second_bible, text)
if second_bible and self.search_results:
text = []
@@ -674,19 +674,19 @@
further action is saved for/in each row.
"""
verse_separator = get_reference_match(u'sep_v_display')
- version = self.parent.manager.get_meta_data(bible, u'Version').value
- copyright = self.parent.manager.get_meta_data(bible, u'Copyright').value
+ version = self.plugin.manager.get_meta_data(bible, u'Version').value
+ copyright = self.plugin.manager.get_meta_data(bible, u'Copyright').value
permissions = \
- self.parent.manager.get_meta_data(bible, u'Permissions').value
+ self.plugin.manager.get_meta_data(bible, u'Permissions').value
second_version = u''
second_copyright = u''
second_permissions = u''
if second_bible:
- second_version = self.parent.manager.get_meta_data(
+ second_version = self.plugin.manager.get_meta_data(
second_bible, u'Version').value
- second_copyright = self.parent.manager.get_meta_data(
+ second_copyright = self.plugin.manager.get_meta_data(
second_bible, u'Copyright').value
- second_permissions = self.parent.manager.get_meta_data(
+ second_permissions = self.plugin.manager.get_meta_data(
second_bible, u'Permissions').value
items = []
for count, verse in enumerate(search_results):
@@ -879,7 +879,7 @@
# We are still in the same chapter, but a verse has been skipped.
return True
elif old_chapter + 1 == chapter and (verse != 1 or
- old_verse != self.parent.manager.get_verse_count(
+ old_verse != self.plugin.manager.get_verse_count(
old_bible, old_book, old_chapter)):
# We are in the following chapter, but the last verse was not the
# last verse of the chapter or the current verse is not the
@@ -923,7 +923,7 @@
Search for some Bible verses (by reference).
"""
bible = unicode(self.quickVersionComboBox.currentText())
- search_results = self.parent.manager.get_verses(bible, string, False)
+ search_results = self.plugin.manager.get_verses(bible, string, False)
results = []
if search_results:
versetext = u' '.join([verse.text for verse in search_results])
@@ -933,6 +933,6 @@
def createItemFromId(self, item_id):
item = QtGui.QListWidgetItem()
bible = unicode(self.quickVersionComboBox.currentText())
- search_results = self.parent.manager.get_verses(bible, item_id, False)
+ search_results = self.plugin.manager.get_verses(bible, item_id, False)
items = self.buildDisplayResults(bible, u'', search_results)
return items
=== modified file 'openlp/plugins/custom/forms/editcustomform.py'
--- openlp/plugins/custom/forms/editcustomform.py 2011-05-27 09:34:14 +0000
+++ openlp/plugins/custom/forms/editcustomform.py 2011-05-28 09:55:54 +0000
@@ -43,13 +43,23 @@
Class documentation goes here.
"""
log.info(u'Custom Editor loaded')
+<<<<<<< TREE
def __init__(self, parent, manager):
+=======
+ def __init__(self, plugin):
+>>>>>>> MERGE-SOURCE
"""
Constructor
"""
+<<<<<<< TREE
QtGui.QDialog.__init__(self)
self.parent = parent
self.manager = manager
+=======
+ self.plugin = plugin
+ QtGui.QDialog.__init__(self, self.plugin.formparent)
+ self.manager = self.plugin.manager
+>>>>>>> MERGE-SOURCE
self.setupUi(self)
# Create other objects and forms.
self.editSlideForm = EditCustomSlideForm(self)
=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
--- openlp/plugins/custom/lib/mediaitem.py 2011-05-27 09:34:14 +0000
+++ openlp/plugins/custom/lib/mediaitem.py 2011-05-28 09:55:54 +0000
@@ -57,15 +57,19 @@
def __init__(self, parent, plugin, icon):
self.IconPath = u'custom/custom'
+<<<<<<< TREE
MediaManagerItem.__init__(self, parent, self, icon)
self.edit_custom_form = EditCustomForm(self, self.parent.manager)
+=======
+ MediaManagerItem.__init__(self, parent, plugin, icon)
+>>>>>>> MERGE-SOURCE
self.singleServiceItem = False
self.quickPreviewAllowed = True
self.hasSearch = True
# Holds information about whether the edit is remotly triggered and
# which Custom is required.
self.remoteCustom = -1
- self.manager = parent.manager
+ self.manager = plugin.manager
def addEndHeaderBar(self):
self.addToolbarSeparator()
@@ -156,8 +160,13 @@
self.auto_select_id = -1
def onNewClick(self):
+<<<<<<< TREE
self.edit_custom_form.loadCustom(0)
self.edit_custom_form.exec_()
+=======
+ self.plugin.edit_custom_form.loadCustom(0)
+ self.plugin.edit_custom_form.exec_()
+>>>>>>> MERGE-SOURCE
self.initialise()
def onRemoteEditClear(self):
@@ -174,10 +183,18 @@
custom_id = int(custom_id)
valid = self.manager.get_object(CustomSlide, custom_id)
if valid:
+<<<<<<< TREE
self.remoteCustom = custom_id
self.remoteTriggered = remote_type
self.edit_custom_form.loadCustom(custom_id, (remote_type == u'P'))
self.edit_custom_form.exec_()
+=======
+ self.remoteCustom = fields[1]
+ self.remoteTriggered = fields[0]
+ self.plugin.edit_custom_form.loadCustom(fields[1],
+ (fields[0] == u'P'))
+ self.plugin.edit_custom_form.exec_()
+>>>>>>> MERGE-SOURCE
def onEditClick(self):
"""
@@ -186,8 +203,13 @@
if check_item_selected(self.listView, UiStrings().SelectEdit):
item = self.listView.currentItem()
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
+<<<<<<< TREE
self.edit_custom_form.loadCustom(item_id, False)
self.edit_custom_form.exec_()
+=======
+ self.plugin.edit_custom_form.loadCustom(item_id, False)
+ self.plugin.edit_custom_form.exec_()
+>>>>>>> MERGE-SOURCE
self.initialise()
def onDeleteClick(self):
@@ -200,7 +222,7 @@
id_list = [(item.data(QtCore.Qt.UserRole)).toInt()[0]
for item in self.listView.selectedIndexes()]
for id in id_list:
- self.parent.manager.delete_object(CustomSlide, id)
+ self.plugin.manager.delete_object(CustomSlide, id)
for row in row_list:
self.listView.takeItem(row)
@@ -216,7 +238,7 @@
service_item.add_capability(ItemCapabilities.AllowsPreview)
service_item.add_capability(ItemCapabilities.AllowsLoop)
service_item.add_capability(ItemCapabilities.AllowsVirtualSplit)
- customSlide = self.parent.manager.get_object(CustomSlide, item_id)
+ customSlide = self.plugin.manager.get_object(CustomSlide, item_id)
title = customSlide.title
credit = customSlide.credits
service_item.edit_id = item_id
@@ -248,13 +270,13 @@
search_type = self.searchTextEdit.currentSearchType()
if search_type == CustomSearch.Titles:
log.debug(u'Titles Search')
- search_results = self.parent.manager.get_all_objects(CustomSlide,
+ search_results = self.plugin.manager.get_all_objects(CustomSlide,
CustomSlide.title.like(u'%' + self.whitespace.sub(u' ',
search_keywords) + u'%'), order_by_ref=CustomSlide.title)
self.loadList(search_results)
elif search_type == CustomSearch.Themes:
log.debug(u'Theme Search')
- search_results = self.parent.manager.get_all_objects(CustomSlide,
+ search_results = self.plugin.manager.get_all_objects(CustomSlide,
CustomSlide.theme_name.like(u'%' + self.whitespace.sub(u' ',
search_keywords) + u'%'), order_by_ref=CustomSlide.title)
self.loadList(search_results)
=== modified file 'openlp/plugins/images/lib/mediaitem.py'
--- openlp/plugins/images/lib/mediaitem.py 2011-05-26 17:11:22 +0000
+++ openlp/plugins/images/lib/mediaitem.py 2011-05-28 09:55:54 +0000
@@ -47,7 +47,7 @@
def __init__(self, parent, plugin, icon):
self.IconPath = u'images/image'
- MediaManagerItem.__init__(self, parent, self, icon)
+ MediaManagerItem.__init__(self, parent, plugin, icon)
self.quickPreviewAllowed = True
self.hasSearch = True
QtCore.QObject.connect(Receiver.get_receiver(),
@@ -112,14 +112,14 @@
def loadList(self, list, initialLoad=False):
if not initialLoad:
- self.parent.formparent.displayProgressBar(len(list))
+ self.plugin.formparent.displayProgressBar(len(list))
# Sort the themes by its filename considering language specific
# characters. lower() is needed for windows!
list.sort(cmp=locale.strcoll,
key=lambda filename: os.path.split(unicode(filename))[1].lower())
for imageFile in list:
if not initialLoad:
- self.parent.formparent.incrementProgressBar()
+ self.plugin.formparent.incrementProgressBar()
filename = os.path.split(unicode(imageFile))[1]
thumb = os.path.join(self.servicePath, filename)
if os.path.exists(thumb):
@@ -134,7 +134,7 @@
item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(imageFile))
self.listView.addItem(item_name)
if not initialLoad:
- self.parent.formparent.finishedProgressBar()
+ self.plugin.formparent.finishedProgressBar()
def generateSlideData(self, service_item, item=None, xmlVersion=False):
if item:
@@ -188,7 +188,7 @@
Called to reset the Live backgound with the image selected,
"""
self.resetAction.setVisible(False)
- self.parent.liveController.display.resetImage()
+ self.plugin.liveController.display.resetImage()
def liveThemeChanged(self):
"""
@@ -208,7 +208,7 @@
filename = unicode(bitem.data(QtCore.Qt.UserRole).toString())
if os.path.exists(filename):
(path, name) = os.path.split(filename)
- self.parent.liveController.display.directImage(name, filename)
+ self.plugin.liveController.display.directImage(name, filename)
self.resetAction.setVisible(True)
else:
critical_error_message_box(UiStrings().LiveBGError,
=== modified file 'openlp/plugins/media/lib/mediaitem.py'
--- openlp/plugins/media/lib/mediaitem.py 2011-05-26 17:11:22 +0000
+++ openlp/plugins/media/lib/mediaitem.py 2011-05-28 09:55:54 +0000
@@ -50,7 +50,7 @@
self.background = False
self.PreviewFunction = QtGui.QPixmap(
u':/media/media_video.png').toImage()
- MediaManagerItem.__init__(self, parent, self, icon)
+ MediaManagerItem.__init__(self, parent, plugin, icon)
self.singleServiceItem = False
self.hasSearch = True
self.mediaObject = None
@@ -65,8 +65,8 @@
self.onNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media')
self.onNewFileMasks = unicode(translate('MediaPlugin.MediaItem',
'Videos (%s);;Audio (%s);;%s (*)')) % (
- u' '.join(self.parent.video_extensions_list),
- u' '.join(self.parent.audio_extensions_list), UiStrings().AllFiles)
+ u' '.join(self.plugin.video_extensions_list),
+ u' '.join(self.plugin.audio_extensions_list), UiStrings().AllFiles)
self.replaceAction.setText(UiStrings().ReplaceBG)
self.replaceAction.setToolTip(UiStrings().ReplaceLiveBG)
self.resetAction.setText(UiStrings().ResetBG)
@@ -95,7 +95,7 @@
Called to reset the Live backgound with the media selected,
"""
self.resetAction.setVisible(False)
- self.parent.liveController.display.resetVideo()
+ self.plugin.liveController.display.resetVideo()
def videobackgroundReplaced(self):
"""
@@ -114,7 +114,7 @@
filename = unicode(item.data(QtCore.Qt.UserRole).toString())
if os.path.exists(filename):
(path, name) = os.path.split(filename)
- self.parent.liveController.display.video(filename, 0, True)
+ self.plugin.liveController.display.video(filename, 0, True)
self.resetAction.setVisible(True)
else:
critical_error_message_box(UiStrings().LiveBGError,
=== modified file 'openlp/plugins/presentations/lib/mediaitem.py'
--- openlp/plugins/presentations/lib/mediaitem.py 2011-05-26 17:11:22 +0000
+++ openlp/plugins/presentations/lib/mediaitem.py 2011-05-28 09:55:54 +0000
@@ -46,14 +46,14 @@
"""
log.info(u'Presentations Media Item loaded')
- def __init__(self, parent, icon, title, controllers):
+ def __init__(self, parent, plugin, icon, controllers):
"""
Constructor. Setup defaults
"""
self.controllers = controllers
self.IconPath = u'presentations/presentation'
self.Automatic = u''
- MediaManagerItem.__init__(self, parent, self, icon)
+ MediaManagerItem.__init__(self, parent, plugin, icon)
self.message_listener = MessageListener(self)
self.hasSearch = True
QtCore.QObject.connect(Receiver.get_receiver(),
@@ -82,7 +82,7 @@
for type in types:
if fileType.find(type) == -1:
fileType += u'*.%s ' % type
- self.parent.serviceManager.supportedSuffixes(type)
+ self.plugin.serviceManager.supportedSuffixes(type)
self.onNewFileMasks = unicode(translate('PresentationPlugin.MediaItem',
'Presentations (%s)')) % fileType
@@ -161,14 +161,14 @@
titles = [os.path.split(file)[1] for file in currlist]
Receiver.send_message(u'cursor_busy')
if not initialLoad:
- self.parent.formparent.displayProgressBar(len(files))
+ self.plugin.formparent.displayProgressBar(len(files))
# Sort the themes by its filename considering language specific
# characters. lower() is needed for windows!
files.sort(cmp=locale.strcoll,
key=lambda filename: os.path.split(unicode(filename))[1].lower())
for file in files:
if not initialLoad:
- self.parent.formparent.incrementProgressBar()
+ self.plugin.formparent.incrementProgressBar()
if currlist.count(file) > 0:
continue
filename = os.path.split(unicode(file))[1]
@@ -208,7 +208,7 @@
self.listView.addItem(item_name)
Receiver.send_message(u'cursor_normal')
if not initialLoad:
- self.parent.formparent.finishedProgressBar()
+ self.plugin.formparent.finishedProgressBar()
def onDeleteClick(self):
"""
=== modified file 'openlp/plugins/presentations/presentationplugin.py'
--- openlp/plugins/presentations/presentationplugin.py 2011-05-26 17:11:22 +0000
+++ openlp/plugins/presentations/presentationplugin.py 2011-05-28 09:55:54 +0000
@@ -99,7 +99,7 @@
Create the Media Manager List
"""
return PresentationMediaItem(
- self, self.icon, self.name, self.controllers)
+ self.mediadock, self, self.icon, self.controllers)
def registerControllers(self, controller):
"""
=== modified file 'openlp/plugins/remotes/lib/httpserver.py'
--- openlp/plugins/remotes/lib/httpserver.py 2011-05-26 17:11:22 +0000
+++ openlp/plugins/remotes/lib/httpserver.py 2011-05-28 09:55:54 +0000
@@ -154,12 +154,12 @@
e.g. http://localhost:4316/send/slidecontroller_live_next
http://localhost:4316/send/alerts_text?q=your%20alert%20text
"""
- def __init__(self, parent):
+ def __init__(self, plugin):
"""
Initialise the httpserver, and start the server
"""
log.debug(u'Initialise httpserver')
- self.parent = parent
+ self.plugin = plugin
self.html_dir = os.path.join(
AppLocation.get_directory(AppLocation.PluginsDir),
u'remotes', u'html')
@@ -176,10 +176,10 @@
"""
log.debug(u'Start TCP server')
port = QtCore.QSettings().value(
- self.parent.settingsSection + u'/port',
+ self.plugin.settingsSection + u'/port',
QtCore.QVariant(4316)).toInt()[0]
address = QtCore.QSettings().value(
- self.parent.settingsSection + u'/ip address',
+ self.plugin.settingsSection + u'/ip address',
QtCore.QVariant(u'0.0.0.0')).toString()
self.server = QtNetwork.QTcpServer()
self.server.listen(QtNetwork.QHostAddress(address), port)
@@ -264,7 +264,7 @@
def _get_service_items(self):
service_items = []
- service_manager = self.parent.parent.serviceManager
+ service_manager = self.parent.plugin.serviceManager
if self.parent.current_item:
cur_uuid = self.parent.current_item._uuid
else:
@@ -457,7 +457,7 @@
"""
if action == u'search':
searches = []
- for plugin in self.parent.parent.pluginManager.plugins:
+ for plugin in self.parent.plugin.pluginManager.plugins:
if plugin.status == PluginStatus.Active and \
plugin.mediaItem and plugin.mediaItem.hasSearch:
searches.append(plugin.name)
@@ -473,7 +473,7 @@
The plugin name to search in.
"""
text = json.loads(self.url_params[u'data'][0])[u'request'][u'text']
- plugin = self.parent.parent.pluginManager.get_plugin_by_name(type)
+ plugin = self.parent.plugin.pluginManager.get_plugin_by_name(type)
if plugin.status == PluginStatus.Active and \
plugin.mediaItem and plugin.mediaItem.hasSearch:
results =plugin.mediaItem.search(text)
@@ -488,7 +488,7 @@
Go live on an item of type ``type``.
"""
id = json.loads(self.url_params[u'data'][0])[u'request'][u'id']
- plugin = self.parent.parent.pluginManager.get_plugin_by_name(type)
+ plugin = self.parent.plugin.pluginManager.get_plugin_by_name(type)
if plugin.status == PluginStatus.Active and plugin.mediaItem:
plugin.mediaItem.goLive(id)
@@ -497,7 +497,7 @@
Add item of type ``type`` to the end of the service
"""
id = json.loads(self.url_params[u'data'][0])[u'request'][u'id']
- plugin = self.parent.parent.pluginManager.get_plugin_by_name(type)
+ plugin = self.parent.plugin.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)
=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py 2011-05-27 09:34:14 +0000
+++ openlp/plugins/songs/forms/editsongform.py 2011-05-28 09:55:54 +0000
@@ -52,7 +52,6 @@
Constructor
"""
QtGui.QDialog.__init__(self, parent)
- self.parent = parent
self.song = None
# can this be automated?
self.width = 400
@@ -90,7 +89,7 @@
self.onVerseListViewPressed)
QtCore.QObject.connect(self.themeAddButton,
QtCore.SIGNAL(u'clicked()'),
- self.parent.parent.renderer.theme_manager.onAddTheme)
+ self.parent().plugin.renderer.theme_manager.onAddTheme)
QtCore.QObject.connect(self.maintenanceButton,
QtCore.SIGNAL(u'clicked()'), self.onMaintenanceButtonClicked)
QtCore.QObject.connect(Receiver.get_receiver(),
=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py 2011-05-27 09:34:14 +0000
+++ openlp/plugins/songs/lib/mediaitem.py 2011-05-28 09:55:54 +0000
@@ -62,12 +62,12 @@
def __init__(self, parent, plugin, icon):
self.IconPath = u'songs/song'
- MediaManagerItem.__init__(self, parent, self, icon)
- self.edit_song_form = EditSongForm(self, self.parent.manager)
- self.openLyrics = OpenLyrics(self.parent.manager)
+ MediaManagerItem.__init__(self, parent, plugin, icon)
+ self.edit_song_form = EditSongForm(self, self.plugin.manager)
+ self.openLyrics = OpenLyrics(self.plugin.manager)
self.singleServiceItem = False
self.song_maintenance_form = SongMaintenanceForm(
- self.parent.manager, self)
+ self.plugin.manager, self)
# Holds information about whether the edit is remotly triggered and
# which Song is required.
self.remoteSong = -1
@@ -178,31 +178,31 @@
self.displayResultsSong(search_results)
elif search_type == SongSearch.Titles:
log.debug(u'Titles Search')
- search_results = self.parent.manager.get_all_objects(Song,
+ search_results = self.plugin.manager.get_all_objects(Song,
Song.search_title.like(u'%' + self.whitespace.sub(u' ',
search_keywords.lower()) + u'%'))
self.displayResultsSong(search_results)
elif search_type == SongSearch.Lyrics:
log.debug(u'Lyrics Search')
- search_results = self.parent.manager.get_all_objects(Song,
+ search_results = self.plugin.manager.get_all_objects(Song,
Song.search_lyrics.like(u'%' + search_keywords.lower() + u'%'))
self.displayResultsSong(search_results)
elif search_type == SongSearch.Authors:
log.debug(u'Authors Search')
- search_results = self.parent.manager.get_all_objects(Author,
+ search_results = self.plugin.manager.get_all_objects(Author,
Author.display_name.like(u'%' + search_keywords + u'%'),
Author.display_name.asc())
self.displayResultsAuthor(search_results)
elif search_type == SongSearch.Themes:
log.debug(u'Theme Search')
- search_results = self.parent.manager.get_all_objects(Song,
+ search_results = self.plugin.manager.get_all_objects(Song,
Song.theme_name.like(u'%' + self.whitespace.sub(u' ',
search_keywords) + u'%'))
self.displayResultsSong(search_results)
self.check_search_result()
def searchEntire(self, search_keywords):
- return self.parent.manager.get_all_objects(Song,
+ return self.plugin.manager.get_all_objects(Song,
or_(Song.search_title.like(u'%' + self.whitespace.sub(u' ',
search_keywords.lower()) + u'%'),
Song.search_lyrics.like(u'%' + search_keywords.lower() + u'%'),
@@ -225,7 +225,7 @@
if self.editItem and self.updateServiceOnEdit and \
not self.remoteTriggered:
item = self.buildServiceItem(self.editItem)
- self.parent.serviceManager.replaceServiceItem(item)
+ self.plugin.serviceManager.replaceServiceItem(item)
self.onRemoteEditClear()
self.onSearchTextButtonClick()
log.debug(u'onSongListLoad - finished')
@@ -286,12 +286,12 @@
def onImportClick(self):
if not hasattr(self, u'import_wizard'):
- self.import_wizard = SongImportForm(self, self.parent)
+ self.import_wizard = SongImportForm(self, self.plugin)
if self.import_wizard.exec_() == QtGui.QDialog.Accepted:
Receiver.send_message(u'songs_load_list')
def onExportClick(self):
- export_wizard = SongExportForm(self, self.parent)
+ export_wizard = SongExportForm(self, self.plugin)
export_wizard.exec_()
def onNewClick(self):
@@ -316,7 +316,7 @@
log.debug(u'onRemoteEdit %s' % message)
remote_type, song_id = message.split(u':')
song_id = int(song_id)
- valid = self.parent.manager.get_object(Song, song_id)
+ valid = self.plugin.manager.get_object(Song, song_id)
if valid:
self.remoteSong = song_id
self.remoteTriggered = remote_type
@@ -352,7 +352,7 @@
return
for item in items:
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
- self.parent.manager.delete_object(Song, item_id)
+ self.plugin.manager.delete_object(Song, item_id)
self.onSearchTextButtonClick()
def generateSlideData(self, service_item, item=None, xmlVersion=False):
@@ -364,7 +364,7 @@
service_item.add_capability(ItemCapabilities.OnLoadUpdate)
service_item.add_capability(ItemCapabilities.AddIfNewItem)
service_item.add_capability(ItemCapabilities.AllowsVirtualSplit)
- song = self.parent.manager.get_object(Song, item_id)
+ song = self.plugin.manager.get_object(Song, item_id)
service_item.theme = song.theme_name
service_item.edit_id = item_id
if song.lyrics.startswith(u'<?xml version='):
@@ -448,12 +448,12 @@
# that the search title (data_string[u'title']) is probably wrong.
# We add "@" to search title and hope that we do not add any
# duplicate. This should work for songs without alternate title.
- search_results = self.parent.manager.get_all_objects(Song,
+ search_results = self.plugin.manager.get_all_objects(Song,
Song.search_title == (re.compile(r'\W+', re.UNICODE).sub(u' ',
item.data_string[u'title'].strip()) + u'@').strip().lower(),
Song.search_title.asc())
else:
- search_results = self.parent.manager.get_all_objects(Song,
+ search_results = self.plugin.manager.get_all_objects(Song,
Song.search_title == item.data_string[u'title'],
Song.search_title.asc())
author_list = item.data_string[u'authors'].split(u', ')
Follow ups