Fix a couple of parents so the form opens in the right place

This commit is contained in:
Jonathan Corwin 2011-05-28 20:38:19 +01:00
parent 82a72fdc87
commit 147c41e16f
4 changed files with 12 additions and 8 deletions

View File

@ -43,12 +43,13 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
Class documentation goes here.
"""
log.info(u'Custom Editor loaded')
def __init__(self, parent, manager):
def __init__(self, mediaitem, parent, manager):
"""
Constructor
"""
QtGui.QDialog.__init__(self, parent)
self.manager = manager
self.mediaitem = mediaitem
self.setupUi(self)
# Create other objects and forms.
self.editSlideForm = EditCustomSlideForm(self)
@ -136,7 +137,7 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
self.customSlide.credits = unicode(self.creditEdit.text())
self.customSlide.theme_name = unicode(self.themeComboBox.currentText())
success = self.manager.save_object(self.customSlide)
self.parent().auto_select_id = self.customSlide.id
self.mediaitem().auto_select_id = self.customSlide.id
return success
def onUpButtonClicked(self):

View File

@ -58,7 +58,8 @@ class CustomMediaItem(MediaManagerItem):
def __init__(self, parent, plugin, icon):
self.IconPath = u'custom/custom'
MediaManagerItem.__init__(self, parent, plugin, icon)
self.edit_custom_form = EditCustomForm(self, self.plugin.manager)
self.edit_custom_form = EditCustomForm(self, self.plugin.formparent,
self.plugin.manager)
self.singleServiceItem = False
self.quickPreviewAllowed = True
self.hasSearch = True

View File

@ -47,11 +47,12 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
"""
log.info(u'%s EditSongForm loaded', __name__)
def __init__(self, parent, manager):
def __init__(self, mediaitem, parent, manager):
"""
Constructor
"""
QtGui.QDialog.__init__(self, parent)
self.mediaitem = mediaitem
self.song = None
# can this be automated?
self.width = 400
@ -89,7 +90,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.onVerseListViewPressed)
QtCore.QObject.connect(self.themeAddButton,
QtCore.SIGNAL(u'clicked()'),
self.parent().plugin.renderer.theme_manager.onAddTheme)
self.mediaitem.plugin.renderer.theme_manager.onAddTheme)
QtCore.QObject.connect(self.maintenanceButton,
QtCore.SIGNAL(u'clicked()'), self.onMaintenanceButtonClicked)
QtCore.QObject.connect(Receiver.get_receiver(),
@ -648,7 +649,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
text = unicode(self.songBookComboBox.currentText())
if item == 0 and text:
temp_song_book = text
self.parent().song_maintenance_form.exec_()
self.mediaitem.song_maintenance_form.exec_()
self.loadAuthors()
self.loadBooks()
self.loadTopics()
@ -754,7 +755,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.song.topics.append(self.manager.get_object(Topic, topicId))
clean_song(self.manager, self.song)
self.manager.save_object(self.song)
self.parent().auto_select_id = self.song.id
self.mediaitem.auto_select_id = self.song.id
def _processLyrics(self):
"""

View File

@ -63,7 +63,8 @@ class SongMediaItem(MediaManagerItem):
def __init__(self, parent, plugin, icon):
self.IconPath = u'songs/song'
MediaManagerItem.__init__(self, parent, plugin, icon)
self.edit_song_form = EditSongForm(self, self.plugin.manager)
self.edit_song_form = EditSongForm(self, self.plugin.formparent,
self.plugin.manager)
self.openLyrics = OpenLyrics(self.plugin.manager)
self.singleServiceItem = False
self.song_maintenance_form = SongMaintenanceForm(