diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index 7df2e7a8c..19e589cb2 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -132,6 +132,7 @@ class Plugin(RegistryBase, RegistryProperties): self.status = PluginStatus.Inactive Registry().register_function('{name}_add_service_item'.format(name=self.name), self.process_add_service_event) Registry().register_function('{name}_config_updated'.format(name=self.name), self.config_update) + Registry().register_function('{name}_visible_name'.format(name=self.name), self.get_visible_name) self._setup(version) def _setup(self, version): @@ -372,3 +373,9 @@ class Plugin(RegistryBase, RegistryProperties): The plugin's needs to handle a new song creation """ pass + + def get_visible_name(self): + """ + Returns the plugins visible name + """ + return str(self.get_string(StringContent.VisibleName)['title']) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index d579bc7f3..4d2eb7f81 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -1620,10 +1620,14 @@ class ServiceManager(QtWidgets.QWidget, RegistryBase, Ui_ServiceManager, LogMixi def create_custom(self): """ - Saves the current text item as a custom slide + Saves the current text item as a custom slide and opens the custom tab (if is not open) """ item = self.find_service_item()[0] Registry().execute('custom_create_from_service', self.service_items[item]['service_item']) + for pos in range(1, self.main_window.media_tool_box.count()): + if self.main_window.media_tool_box.itemText(pos) == Registry().execute('custom_visible_name')[0]: + self.main_window.media_tool_box.setItemEnabled(pos, True) + self.main_window.media_tool_box.setCurrentIndex(pos) def find_service_item(self): """ diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 719968752..9024d1d41 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -400,7 +400,7 @@ class EditSongForm(QtWidgets.QDialog, Ui_EditSongDialog, RegistryProperties): self.songbooks = [] self._load_objects(Book, self.songbooks_combo_box, self.songbooks) - def load_themes(self, theme_list): + def load_themes(self, theme_list: list): """ Load the themes into a combobox. """ @@ -409,6 +409,7 @@ class EditSongForm(QtWidgets.QDialog, Ui_EditSongDialog, RegistryProperties): return get_natural_key(theme) self.theme_combo_box.clear() + theme_list.insert(0, f"<{UiStrings().Default}>") self.themes = theme_list self.themes.sort(key=get_theme_key) self.theme_combo_box.addItems(theme_list) @@ -1045,7 +1046,7 @@ class EditSongForm(QtWidgets.QDialog, Ui_EditSongDialog, RegistryProperties): self.song.verse_order = ' '.join(order) self.song.ccli_number = self.ccli_number_edit.text() theme_name = self.theme_combo_box.currentText() - if theme_name: + if theme_name and theme_name != f"<{UiStrings().Default}>": self.song.theme_name = theme_name else: self.song.theme_name = None