clean ups + forgotten file

This commit is contained in:
Andreas Preikschat 2010-10-10 15:09:45 +02:00
parent f1d7b8a1be
commit 3c32cb5be5
5 changed files with 124 additions and 24 deletions

View File

@ -36,35 +36,35 @@ class Ui_CustomEditDialog(object):
build_icon(u':/icon/openlp.org-icon-32.bmp')) build_icon(u':/icon/openlp.org-icon-32.bmp'))
self.gridLayout = QtGui.QGridLayout(customEditDialog) self.gridLayout = QtGui.QGridLayout(customEditDialog)
self.gridLayout.setObjectName(u'gridLayout') self.gridLayout.setObjectName(u'gridLayout')
self.horizontalLayout_3 = QtGui.QHBoxLayout() self.horizontalLayout3 = QtGui.QHBoxLayout()
self.horizontalLayout_3.setObjectName(u'horizontalLayout_3') self.horizontalLayout3.setObjectName(u'horizontalLayout3')
self.themeLabel = QtGui.QLabel(customEditDialog) self.themeLabel = QtGui.QLabel(customEditDialog)
self.themeLabel.setObjectName(u'themeLabel') self.themeLabel.setObjectName(u'themeLabel')
self.horizontalLayout_3.addWidget(self.themeLabel) self.horizontalLayout3.addWidget(self.themeLabel)
self.themeComboBox = QtGui.QComboBox(customEditDialog) self.themeComboBox = QtGui.QComboBox(customEditDialog)
self.themeComboBox.setObjectName(u'themeComboBox') self.themeComboBox.setObjectName(u'themeComboBox')
self.horizontalLayout_3.addWidget(self.themeComboBox) self.horizontalLayout3.addWidget(self.themeComboBox)
self.gridLayout.addLayout(self.horizontalLayout_3, 2, 0, 1, 1) self.gridLayout.addLayout(self.horizontalLayout3, 2, 0, 1, 1)
self.horizontalLayout_2 = QtGui.QHBoxLayout() self.horizontalLayout2 = QtGui.QHBoxLayout()
self.horizontalLayout_2.setObjectName(u'horizontalLayout_2') self.horizontalLayout2.setObjectName(u'horizontalLayout2')
self.creditLabel = QtGui.QLabel(customEditDialog) self.creditLabel = QtGui.QLabel(customEditDialog)
self.creditLabel.setObjectName(u'creditLabel') self.creditLabel.setObjectName(u'creditLabel')
self.horizontalLayout_2.addWidget(self.creditLabel) self.horizontalLayout2.addWidget(self.creditLabel)
self.creditEdit = QtGui.QLineEdit(customEditDialog) self.creditEdit = QtGui.QLineEdit(customEditDialog)
self.creditEdit.setObjectName(u'creditEdit') self.creditEdit.setObjectName(u'creditEdit')
self.horizontalLayout_2.addWidget(self.creditEdit) self.horizontalLayout2.addWidget(self.creditEdit)
self.gridLayout.addLayout(self.horizontalLayout_2, 3, 0, 1, 1) self.gridLayout.addLayout(self.horizontalLayout2, 3, 0, 1, 1)
self.buttonBox = QtGui.QDialogButtonBox(customEditDialog) self.buttonBox = QtGui.QDialogButtonBox(customEditDialog)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel |
QtGui.QDialogButtonBox.Save) QtGui.QDialogButtonBox.Save)
self.buttonBox.setObjectName(u'buttonBox') self.buttonBox.setObjectName(u'buttonBox')
self.gridLayout.addWidget(self.buttonBox, 4, 0, 1, 1) self.gridLayout.addWidget(self.buttonBox, 4, 0, 1, 1)
self.horizontalLayout_4 = QtGui.QHBoxLayout() self.horizontalLayout4 = QtGui.QHBoxLayout()
self.horizontalLayout_4.setObjectName(u'horizontalLayout_4') self.horizontalLayout4.setObjectName(u'horizontalLayout4')
self.verseListView = QtGui.QListWidget(customEditDialog) self.verseListView = QtGui.QListWidget(customEditDialog)
self.verseListView.setAlternatingRowColors(True) self.verseListView.setAlternatingRowColors(True)
self.verseListView.setObjectName(u'verseListView') self.verseListView.setObjectName(u'verseListView')
self.horizontalLayout_4.addWidget(self.verseListView) self.horizontalLayout4.addWidget(self.verseListView)
self.verticalLayout = QtGui.QVBoxLayout() self.verticalLayout = QtGui.QVBoxLayout()
self.verticalLayout.setObjectName(u'verticalLayout') self.verticalLayout.setObjectName(u'verticalLayout')
self.addButton = QtGui.QPushButton(customEditDialog) self.addButton = QtGui.QPushButton(customEditDialog)
@ -96,8 +96,8 @@ class Ui_CustomEditDialog(object):
self.downButton.setIcon(icon2) self.downButton.setIcon(icon2)
self.downButton.setObjectName(u'downButton') self.downButton.setObjectName(u'downButton')
self.verticalLayout.addWidget(self.downButton) self.verticalLayout.addWidget(self.downButton)
self.horizontalLayout_4.addLayout(self.verticalLayout) self.horizontalLayout4.addLayout(self.verticalLayout)
self.gridLayout.addLayout(self.horizontalLayout_4, 1, 0, 1, 1) self.gridLayout.addLayout(self.horizontalLayout4, 1, 0, 1, 1)
self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName(u'horizontalLayout') self.horizontalLayout.setObjectName(u'horizontalLayout')
self.titleLabel = QtGui.QLabel(customEditDialog) self.titleLabel = QtGui.QLabel(customEditDialog)
@ -111,7 +111,7 @@ class Ui_CustomEditDialog(object):
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'accepted()'), QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'accepted()'),
customEditDialog.accept) customEditDialog.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'), QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'),
customEditDialog.close) customEditDialog.closePressed)
QtCore.QMetaObject.connectSlotsByName(customEditDialog) QtCore.QMetaObject.connectSlotsByName(customEditDialog)
def retranslateUi(self, customEditDialog): def retranslateUi(self, customEditDialog):

View File

@ -78,6 +78,12 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
self.slide_form = EditCustomSlideForm(self) self.slide_form = EditCustomSlideForm(self)
self.initialise() 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): def initialise(self):
self.addButton.setEnabled(True) self.addButton.setEnabled(True)
self.deleteButton.setEnabled(False) self.deleteButton.setEnabled(False)
@ -179,12 +185,6 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
self.verseListView.insertItem(selectedRow + 1, qw) self.verseListView.insertItem(selectedRow + 1, qw)
self.verseListView.setCurrentRow(selectedRow + 1) 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): def onVerseListViewPressed(self, item):
self.deleteButton.setEnabled(True) self.deleteButton.setEnabled(True)
self.editButton.setEnabled(True) self.editButton.setEnabled(True)
@ -245,7 +245,7 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
else: else:
old_slides = [] old_slides = []
old_row = self.verseListView.currentRow() 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 \ old_slides = [self.verseListView.item(row).text() for row in \
range(0, self.verseListView.count())] range(0, self.verseListView.count())]
self.verseListView.clear() self.verseListView.clear()

View File

@ -35,7 +35,8 @@ class Ui_CustomSlideEditDialog(object):
self.buttonBox = QtGui.QDialogButtonBox(customSlideEditDialog) self.buttonBox = QtGui.QDialogButtonBox(customSlideEditDialog)
self.buttonBox.setGeometry(QtCore.QRect(8, 407, 458, 32)) self.buttonBox.setGeometry(QtCore.QRect(8, 407, 458, 32))
self.buttonBox.setOrientation(QtCore.Qt.Horizontal) 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.buttonBox.setObjectName(u'buttonBox')
self.verseTextEdit = QtGui.QTextEdit(customSlideEditDialog) self.verseTextEdit = QtGui.QTextEdit(customSlideEditDialog)
self.verseTextEdit.setGeometry(QtCore.QRect(8, 8, 451, 341)) self.verseTextEdit.setGeometry(QtCore.QRect(8, 8, 451, 341))

View File

@ -68,6 +68,9 @@ class EditCustomSlideForm(QtGui.QDialog, Ui_CustomSlideEditDialog):
return self.verseTextEdit.toPlainText().split(u'\n[---]\n') return self.verseTextEdit.toPlainText().split(u'\n[---]\n')
def onSplitButtonPressed(self): def onSplitButtonPressed(self):
"""
Splits a slide in two slides.
"""
if self.verseTextEdit.textCursor().columnNumber() != 0: if self.verseTextEdit.textCursor().columnNumber() != 0:
self.verseTextEdit.insertPlainText(u'\n') self.verseTextEdit.insertPlainText(u'\n')
self.verseTextEdit.insertPlainText(u'[---]\n' ) self.verseTextEdit.insertPlainText(u'[---]\n' )

View File

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>customSlideEditDialog</class>
<widget class="QDialog" name="customSlideEditDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>474</width>
<height>442</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="geometry">
<rect>
<x>8</x>
<y>407</y>
<width>458</width>
<height>32</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Save</set>
</property>
</widget>
<widget class="QTextEdit" name="VerseTextEdit">
<property name="geometry">
<rect>
<x>8</x>
<y>8</y>
<width>451</width>
<height>341</height>
</rect>
</property>
</widget>
<widget class="QPushButton" name="SplitButton">
<property name="geometry">
<rect>
<x>370</x>
<y>360</y>
<width>85</width>
<height>27</height>
</rect>
</property>
<property name="toolTip">
<string extracomment="Add new slide split"/>
</property>
<property name="text">
<string>Split Slide</string>
</property>
</widget>
</widget>
<resources>
<include location="../images/openlp-2.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>customSlideEditDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>customSlideEditDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>