From 1dc22fc91210a19e33e131dd987c3d643879bc9f Mon Sep 17 00:00:00 2001 From: Dmitriy Marmyshev Date: Tue, 2 Apr 2013 14:19:33 +0400 Subject: [PATCH] fix --- openlp/core/ui/servicemanager.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index cfa0d4707..9abccef9b 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -228,6 +228,8 @@ class ServiceManagerDialog(object): self.menu = QtGui.QMenu() self.edit_action = create_widget_action(self.menu, text=translate('OpenLP.ServiceManager', '&Edit Item'), icon=u':/general/general_edit.png', triggers=self.remote_edit) + self.rename_action = create_widget_action(self.menu, text=translate('OpenLP.ServiceManager', '&Rename...'), + triggers=self.on_service_item_rename) self.maintain_action = create_widget_action(self.menu, text=translate('OpenLP.ServiceManager', '&Reorder Item'), icon=u':/general/general_edit.png', triggers=self.on_service_item_edit_form) self.notes_action = create_widget_action(self.menu, text=translate('OpenLP.ServiceManager', '&Notes'), @@ -1434,6 +1436,28 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog): if new_item: self.add_service_item(new_item, replace=True) + def on_service_item_rename(self): + """ + Opens a dialog to rename the service item. + """ + item = self.find_service_item()[0] +# if False and not self.service_items[item][u'service_item'].is_text()\ +# and (ItemCapabilities.HasDetailedTitleDisplay in self.service_items[item][u'service_item'].capabilities\ +# or len(self.service_items[item][u'service_item']._raw_frames) == 1): +# get_main_title = False +# Title = self.service_items[item][u'service_item']._raw_frames[0][u'title'] +# else: +# get_main_title = True + Title = self.service_items[item][u'service_item'].title + Title, ok = QtGui.QInputDialog.getText(self, + self.tr(translate('OpenLP.ServiceManager', 'Input title')), + self.tr(translate('OpenLP.ServiceManager', 'Title')), + QtGui.QLineEdit.Normal, self.trUtf8(Title)) + if ok: + self.service_items[item][u'service_item'].title = unicode(Title) + self.repaint_service_list(item, -1) + self.set_modified() + def create_custom(self): """ Saves the current text item as a custom slide