diff --git a/openlp/plugins/custom/forms/editcustomdialog.py b/openlp/plugins/custom/forms/editcustomdialog.py index fd5e244f2..82238f005 100644 --- a/openlp/plugins/custom/forms/editcustomdialog.py +++ b/openlp/plugins/custom/forms/editcustomdialog.py @@ -36,35 +36,35 @@ class Ui_CustomEditDialog(object): build_icon(u':/icon/openlp.org-icon-32.bmp')) self.gridLayout = QtGui.QGridLayout(customEditDialog) self.gridLayout.setObjectName(u'gridLayout') - self.horizontalLayout_3 = QtGui.QHBoxLayout() - self.horizontalLayout_3.setObjectName(u'horizontalLayout_3') + self.horizontalLayout3 = QtGui.QHBoxLayout() + self.horizontalLayout3.setObjectName(u'horizontalLayout3') self.themeLabel = QtGui.QLabel(customEditDialog) self.themeLabel.setObjectName(u'themeLabel') - self.horizontalLayout_3.addWidget(self.themeLabel) + self.horizontalLayout3.addWidget(self.themeLabel) self.themeComboBox = QtGui.QComboBox(customEditDialog) self.themeComboBox.setObjectName(u'themeComboBox') - self.horizontalLayout_3.addWidget(self.themeComboBox) - self.gridLayout.addLayout(self.horizontalLayout_3, 2, 0, 1, 1) - self.horizontalLayout_2 = QtGui.QHBoxLayout() - self.horizontalLayout_2.setObjectName(u'horizontalLayout_2') + self.horizontalLayout3.addWidget(self.themeComboBox) + self.gridLayout.addLayout(self.horizontalLayout3, 2, 0, 1, 1) + self.horizontalLayout2 = QtGui.QHBoxLayout() + self.horizontalLayout2.setObjectName(u'horizontalLayout2') self.creditLabel = QtGui.QLabel(customEditDialog) self.creditLabel.setObjectName(u'creditLabel') - self.horizontalLayout_2.addWidget(self.creditLabel) + self.horizontalLayout2.addWidget(self.creditLabel) self.creditEdit = QtGui.QLineEdit(customEditDialog) self.creditEdit.setObjectName(u'creditEdit') - self.horizontalLayout_2.addWidget(self.creditEdit) - self.gridLayout.addLayout(self.horizontalLayout_2, 3, 0, 1, 1) + self.horizontalLayout2.addWidget(self.creditEdit) + self.gridLayout.addLayout(self.horizontalLayout2, 3, 0, 1, 1) self.buttonBox = QtGui.QDialogButtonBox(customEditDialog) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Save) self.buttonBox.setObjectName(u'buttonBox') self.gridLayout.addWidget(self.buttonBox, 4, 0, 1, 1) - self.horizontalLayout_4 = QtGui.QHBoxLayout() - self.horizontalLayout_4.setObjectName(u'horizontalLayout_4') + self.horizontalLayout4 = QtGui.QHBoxLayout() + self.horizontalLayout4.setObjectName(u'horizontalLayout4') self.verseListView = QtGui.QListWidget(customEditDialog) self.verseListView.setAlternatingRowColors(True) self.verseListView.setObjectName(u'verseListView') - self.horizontalLayout_4.addWidget(self.verseListView) + self.horizontalLayout4.addWidget(self.verseListView) self.verticalLayout = QtGui.QVBoxLayout() self.verticalLayout.setObjectName(u'verticalLayout') self.addButton = QtGui.QPushButton(customEditDialog) @@ -96,8 +96,8 @@ class Ui_CustomEditDialog(object): self.downButton.setIcon(icon2) self.downButton.setObjectName(u'downButton') self.verticalLayout.addWidget(self.downButton) - self.horizontalLayout_4.addLayout(self.verticalLayout) - self.gridLayout.addLayout(self.horizontalLayout_4, 1, 0, 1, 1) + self.horizontalLayout4.addLayout(self.verticalLayout) + self.gridLayout.addLayout(self.horizontalLayout4, 1, 0, 1, 1) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName(u'horizontalLayout') self.titleLabel = QtGui.QLabel(customEditDialog) @@ -111,7 +111,7 @@ class Ui_CustomEditDialog(object): QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'accepted()'), customEditDialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'), - customEditDialog.close) + customEditDialog.closePressed) QtCore.QMetaObject.connectSlotsByName(customEditDialog) def retranslateUi(self, customEditDialog): diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index 18ab98d45..b1ffbd214 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -78,6 +78,12 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog): self.slide_form = EditCustomSlideForm(self) self.initialise() + def onPreview(self, button): + log.debug(u'onPreview') + if button.text() == unicode(translate('CustomPlugin.EditCustomForm', + 'Save && Preview')) and self.saveCustom(): + Receiver.send_message(u'custom_preview') + def initialise(self): self.addButton.setEnabled(True) self.deleteButton.setEnabled(False) @@ -179,12 +185,6 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog): self.verseListView.insertItem(selectedRow + 1, qw) self.verseListView.setCurrentRow(selectedRow + 1) - def onPreview(self, button): - log.debug(u'onPreview') - if button.text() == unicode(translate('CustomPlugin.EditCustomForm', - 'Save && Preview')) and self.saveCustom(): - Receiver.send_message(u'custom_preview') - def onVerseListViewPressed(self, item): self.deleteButton.setEnabled(True) self.editButton.setEnabled(True) @@ -245,7 +245,7 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog): else: old_slides = [] old_row = self.verseListView.currentRow() - # Create a list with all slide (unedited). + # Create a list with all (old/unedited) slides. old_slides = [self.verseListView.item(row).text() for row in \ range(0, self.verseListView.count())] self.verseListView.clear() diff --git a/openlp/plugins/custom/forms/editcustomslidedialog.py b/openlp/plugins/custom/forms/editcustomslidedialog.py index bc6657d90..b0d1970ec 100644 --- a/openlp/plugins/custom/forms/editcustomslidedialog.py +++ b/openlp/plugins/custom/forms/editcustomslidedialog.py @@ -35,7 +35,8 @@ class Ui_CustomSlideEditDialog(object): self.buttonBox = QtGui.QDialogButtonBox(customSlideEditDialog) self.buttonBox.setGeometry(QtCore.QRect(8, 407, 458, 32)) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) - self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) + self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | + QtGui.QDialogButtonBox.Save) self.buttonBox.setObjectName(u'buttonBox') self.verseTextEdit = QtGui.QTextEdit(customSlideEditDialog) self.verseTextEdit.setGeometry(QtCore.QRect(8, 8, 451, 341)) diff --git a/openlp/plugins/custom/forms/editcustomslideform.py b/openlp/plugins/custom/forms/editcustomslideform.py index b20c51010..a3296377b 100644 --- a/openlp/plugins/custom/forms/editcustomslideform.py +++ b/openlp/plugins/custom/forms/editcustomslideform.py @@ -68,6 +68,9 @@ class EditCustomSlideForm(QtGui.QDialog, Ui_CustomSlideEditDialog): return self.verseTextEdit.toPlainText().split(u'\n[---]\n') def onSplitButtonPressed(self): + """ + Splits a slide in two slides. + """ if self.verseTextEdit.textCursor().columnNumber() != 0: self.verseTextEdit.insertPlainText(u'\n') self.verseTextEdit.insertPlainText(u'[---]\n' ) diff --git a/resources/forms/editcustomslidedialog.ui b/resources/forms/editcustomslidedialog.ui new file mode 100644 index 000000000..9bc502274 --- /dev/null +++ b/resources/forms/editcustomslidedialog.ui @@ -0,0 +1,96 @@ + + + customSlideEditDialog + + + + 0 + 0 + 474 + 442 + + + + Dialog + + + + + 8 + 407 + 458 + 32 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Save + + + + + + 8 + 8 + 451 + 341 + + + + + + + 370 + 360 + 85 + 27 + + + + + + + Split Slide + + + + + + + + + buttonBox + accepted() + customSlideEditDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + customSlideEditDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + +