From 4f495da73583350d0288b5ff33a2e2df5133b7b3 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 6 Nov 2009 17:36:18 +0000 Subject: [PATCH] Remote Edit for Custom --- openlp/plugins/custom/forms/editcustomform.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index a4fc7a44a..0973e2b5a 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -21,6 +21,7 @@ # with this program; if not, write to the Free Software Foundation, Inc., 59 # # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### +import logging from PyQt4 import QtCore, QtGui @@ -32,6 +33,9 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): """ Class documentation goes here. """ + global log + log = logging.getLogger(u'EditCustomForm') + log.info(u'Custom Editor loaded') def __init__(self, custommanager, parent = None): """ Constructor @@ -40,6 +44,12 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): #self.parent = parent self.setupUi(self) # Connecting signals and slots + self.previewButton = QtGui.QPushButton() + self.previewButton.setText(self.trUtf8(u'Save && Preview')) + self.buttonBox.addButton( + self.previewButton, QtGui.QDialogButtonBox.ActionRole) + QtCore.QObject.connect(self.buttonBox, + QtCore.SIGNAL(u'clicked(QAbstractButton*)'), self.onPreview) QtCore.QObject.connect(self.AddButton, QtCore.SIGNAL(u'pressed()'), self.onAddButtonPressed) QtCore.QObject.connect(self.EditButton, @@ -68,6 +78,12 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): self.custommanager = custommanager self.initialise() + def onPreview(self, button): + log.debug(u'onPreview') + if button.text() == unicode(self.trUtf8(u'Save && Preview')) \ + and self.saveSong(): + Receiver().send_message(u'preview_custom') + def initialise(self): self.editAll = False self.DeleteButton.setEnabled(False)