forked from openlp/openlp
missed bits
This commit is contained in:
parent
90ac714c0d
commit
38ed9bdc35
@ -101,7 +101,7 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
self.required_icons()
|
||||
self.setupUi()
|
||||
self.retranslateUi()
|
||||
self.autoSelectId = -1
|
||||
self.auto_select_id = -1
|
||||
Registry().register_function(u'%s_service_load' % self.plugin.name, self.service_load)
|
||||
|
||||
def required_icons(self):
|
||||
@ -452,10 +452,10 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
Allows the change of current item in the list to be actioned
|
||||
"""
|
||||
if Settings().value(u'advanced/single click preview') and self.quick_preview_allowed \
|
||||
and self.list_view.selectedIndexes() and self.autoSelectId == -1:
|
||||
and self.list_view.selectedIndexes() and self.auto_select_id == -1:
|
||||
self.on_preview_click(True)
|
||||
|
||||
def on_preview_click(self, keepFocus=False):
|
||||
def on_preview_click(self, keep_focus=False):
|
||||
"""
|
||||
Preview an item by building a service item then adding that service item to the preview slide controller.
|
||||
"""
|
||||
@ -468,7 +468,7 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
if service_item:
|
||||
service_item.from_plugin = True
|
||||
self.preview_controller.add_service_item(service_item)
|
||||
if keepFocus:
|
||||
if keep_focus:
|
||||
self.list_view.setFocus()
|
||||
|
||||
def on_live_click(self):
|
||||
@ -553,13 +553,13 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
QtGui.QMessageBox.information(self, translate('OpenLP.MediaManagerItem', 'Invalid Service Item'),
|
||||
translate('OpenLP.MediaManagerItem', 'You must select a %s service item.') % self.title)
|
||||
|
||||
def build_service_item(self, item=None, xmlVersion=False, remote=False, context=ServiceItemContext.Live):
|
||||
def build_service_item(self, item=None, xml_version=False, remote=False, context=ServiceItemContext.Live):
|
||||
"""
|
||||
Common method for generating a service item
|
||||
"""
|
||||
service_item = ServiceItem(self.plugin)
|
||||
service_item.add_icon(self.plugin.icon_path)
|
||||
if self.generate_slide_data(service_item, item, xmlVersion, remote, context):
|
||||
if self.generate_slide_data(service_item, item, xml_version, remote, context):
|
||||
return service_item
|
||||
else:
|
||||
return None
|
||||
@ -585,14 +585,14 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
item.setFont(font)
|
||||
self.list_view.addItem(item)
|
||||
|
||||
def _get_id_of_item_to_generate(self, item, remoteItem):
|
||||
def _get_id_of_item_to_generate(self, item, remote_item):
|
||||
"""
|
||||
Utility method to check items being submitted for slide generation.
|
||||
|
||||
``item``
|
||||
The item to check.
|
||||
|
||||
``remoteItem``
|
||||
``remote_item``
|
||||
The id to assign if the slide generation was remotely triggered.
|
||||
"""
|
||||
if item is None:
|
||||
@ -602,7 +602,7 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
return False
|
||||
item_id = item.data(QtCore.Qt.UserRole)
|
||||
else:
|
||||
item_id = remoteItem
|
||||
item_id = remote_item
|
||||
else:
|
||||
item_id = item.data(QtCore.Qt.UserRole)
|
||||
return item_id
|
||||
@ -612,12 +612,12 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
Sorts out, what item to select after loading a list.
|
||||
"""
|
||||
# The item to select has not been set.
|
||||
if self.autoSelectId == -1:
|
||||
if self.auto_select_id == -1:
|
||||
item = self.list_view.currentItem()
|
||||
if item:
|
||||
self.autoSelectId = item.data(QtCore.Qt.UserRole)
|
||||
self.auto_select_id = item.data(QtCore.Qt.UserRole)
|
||||
|
||||
def search(self, string, showError=True):
|
||||
def search(self, string, show_error=True):
|
||||
"""
|
||||
Performs a plugin specific search for items containing ``string``
|
||||
"""
|
||||
|
@ -130,7 +130,7 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
|
||||
self.custom_slide.credits = self.credit_edit.text()
|
||||
self.custom_slide.theme_name = self.theme_combo_box.currentText()
|
||||
success = self.manager.save_object(self.custom_slide)
|
||||
self.media_item.autoSelectId = self.custom_slide.id
|
||||
self.media_item.auto_select_id = self.custom_slide.id
|
||||
return success
|
||||
|
||||
def on_up_button_clicked(self):
|
||||
|
@ -109,9 +109,9 @@ class CustomMediaItem(MediaManagerItem):
|
||||
custom_name.setData(QtCore.Qt.UserRole, custom_slide.id)
|
||||
self.list_view.addItem(custom_name)
|
||||
# Auto-select the custom.
|
||||
if custom_slide.id == self.autoSelectId:
|
||||
if custom_slide.id == self.auto_select_id:
|
||||
self.list_view.setCurrentItem(custom_name)
|
||||
self.autoSelectId = -1
|
||||
self.auto_select_id = -1
|
||||
# Called to redisplay the custom list screen edith from a search
|
||||
# or from the exit of the Custom edit dialog. If remote editing is
|
||||
# active trigger it and clean up so it will not update again.
|
||||
@ -135,7 +135,7 @@ class CustomMediaItem(MediaManagerItem):
|
||||
if self.edit_custom_form.exec_() == QtGui.QDialog.Accepted:
|
||||
self.remote_triggered = True
|
||||
self.remoteCustom = custom_id
|
||||
self.autoSelectId = -1
|
||||
self.auto_select_id = -1
|
||||
self.on_search_text_button_clicked()
|
||||
item = self.build_service_item(remote=True)
|
||||
self.remote_triggered = None
|
||||
@ -153,7 +153,7 @@ class CustomMediaItem(MediaManagerItem):
|
||||
item_id = item.data(QtCore.Qt.UserRole)
|
||||
self.edit_custom_form.load_custom(item_id, False)
|
||||
self.edit_custom_form.exec_()
|
||||
self.autoSelectId = -1
|
||||
self.auto_select_id = -1
|
||||
self.on_search_text_button_clicked()
|
||||
|
||||
def on_delete_click(self):
|
||||
|
@ -914,7 +914,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
log.exception(u'Could not remove directory: %s', save_path)
|
||||
clean_song(self.manager, self.song)
|
||||
self.manager.save_object(self.song)
|
||||
self.media_item.autoSelectId = self.song.id
|
||||
self.media_item.auto_select_id = self.song.id
|
||||
|
||||
def _get_plugin_manager(self):
|
||||
"""
|
||||
|
@ -237,9 +237,9 @@ class SongMediaItem(MediaManagerItem):
|
||||
song_name.setData(QtCore.Qt.UserRole, song.id)
|
||||
self.list_view.addItem(song_name)
|
||||
# Auto-select the item if name has been set
|
||||
if song.id == self.autoSelectId:
|
||||
if song.id == self.auto_select_id:
|
||||
self.list_view.setCurrentItem(song_name)
|
||||
self.autoSelectId = -1
|
||||
self.auto_select_id = -1
|
||||
|
||||
def displayResultsAuthor(self, searchresults):
|
||||
log.debug(u'display results Author')
|
||||
@ -313,7 +313,7 @@ class SongMediaItem(MediaManagerItem):
|
||||
self.editSongForm.exec_()
|
||||
self.onClearTextButtonClick()
|
||||
self.on_selection_change()
|
||||
self.autoSelectId = -1
|
||||
self.auto_select_id = -1
|
||||
|
||||
def onSongMaintenanceClick(self):
|
||||
self.songMaintenanceForm.exec_()
|
||||
@ -330,7 +330,7 @@ class SongMediaItem(MediaManagerItem):
|
||||
if valid:
|
||||
self.editSongForm.load_song(song_id, preview)
|
||||
if self.editSongForm.exec_() == QtGui.QDialog.Accepted:
|
||||
self.autoSelectId = -1
|
||||
self.auto_select_id = -1
|
||||
self.on_song_list_load()
|
||||
self.remoteSong = song_id
|
||||
self.remote_triggered = True
|
||||
@ -351,7 +351,7 @@ class SongMediaItem(MediaManagerItem):
|
||||
item_id = self.editItem.data(QtCore.Qt.UserRole)
|
||||
self.editSongForm.load_song(item_id, False)
|
||||
self.editSongForm.exec_()
|
||||
self.autoSelectId = -1
|
||||
self.auto_select_id = -1
|
||||
self.on_song_list_load()
|
||||
self.editItem = None
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user