fixed traceback after editing image item, icons for down/up buttons

This commit is contained in:
Andreas Preikschat 2010-10-24 13:00:20 +02:00
parent 5b9371a74c
commit c8e5f9c07e
3 changed files with 34 additions and 16 deletions

View File

@ -25,6 +25,7 @@
############################################################################### ###############################################################################
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate from openlp.core.lib import translate
class Ui_ServiceItemEditDialog(object): class Ui_ServiceItemEditDialog(object):
@ -44,16 +45,26 @@ class Ui_ServiceItemEditDialog(object):
self.topLayout.addWidget(self.listWidget) self.topLayout.addWidget(self.listWidget)
self.buttonLayout = QtGui.QVBoxLayout() self.buttonLayout = QtGui.QVBoxLayout()
self.buttonLayout.setObjectName(u'buttonLayout') self.buttonLayout.setObjectName(u'buttonLayout')
self.upButton = QtGui.QPushButton(self.layoutWidget)
self.upButton.setObjectName(u'upButton')
self.buttonLayout.addWidget(self.upButton)
spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
QtGui.QSizePolicy.Expanding)
self.buttonLayout.addItem(spacerItem)
self.deleteButton = QtGui.QPushButton(self.layoutWidget) self.deleteButton = QtGui.QPushButton(self.layoutWidget)
self.deleteButton.setObjectName(u'deleteButton') self.deleteButton.setObjectName(u'deleteButton')
self.buttonLayout.addWidget(self.deleteButton) self.buttonLayout.addWidget(self.deleteButton)
spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
QtGui.QSizePolicy.Expanding)
self.buttonLayout.addItem(spacerItem)
self.upButton = QtGui.QPushButton(self.layoutWidget)
self.upButton.setText(u'')
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(u':/services/service_up.png'),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.upButton.setIcon(icon)
self.upButton.setObjectName(u'upButton')
self.buttonLayout.addWidget(self.upButton)
self.downButton = QtGui.QPushButton(self.layoutWidget) self.downButton = QtGui.QPushButton(self.layoutWidget)
self.downButton.setText(u'')
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(u':/services/service_down.png'),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.downButton.setIcon(icon)
self.downButton.setObjectName(u'downButton') self.downButton.setObjectName(u'downButton')
self.buttonLayout.addWidget(self.downButton) self.buttonLayout.addWidget(self.downButton)
self.topLayout.addLayout(self.buttonLayout) self.topLayout.addLayout(self.buttonLayout)
@ -63,14 +74,11 @@ class Ui_ServiceItemEditDialog(object):
QtGui.QDialogButtonBox.Save) QtGui.QDialogButtonBox.Save)
self.buttonBox.setObjectName(u'buttonBox') self.buttonBox.setObjectName(u'buttonBox')
self.outerLayout.addWidget(self.buttonBox) self.outerLayout.addWidget(self.buttonBox)
self.retranslateUi(serviceItemEditDialog) self.retranslateUi(serviceItemEditDialog)
QtCore.QMetaObject.connectSlotsByName(serviceItemEditDialog) QtCore.QMetaObject.connectSlotsByName(serviceItemEditDialog)
def retranslateUi(self, serviceItemEditDialog): def retranslateUi(self, serviceItemEditDialog):
serviceItemEditDialog.setWindowTitle( serviceItemEditDialog.setWindowTitle(
translate('OpenLP.ServiceItemEditForm', 'Reorder Service Item')) translate('OpenLP.ServiceItemEditForm', 'Reorder Service Item'))
self.upButton.setText(translate('OpenLP.ServiceItemEditForm', 'Up'))
self.deleteButton.setText(translate('OpenLP.ServiceItemEditForm', self.deleteButton.setText(translate('OpenLP.ServiceItemEditForm',
'Delete')) 'Delete'))
self.downButton.setText(translate('OpenLP.ServiceItemEditForm', 'Down'))

View File

@ -346,7 +346,7 @@ class ServiceManager(QtGui.QWidget):
self.serviceItems[item][u'service_item']) self.serviceItems[item][u'service_item'])
if self.serviceItemEditForm.exec_(): if self.serviceItemEditForm.exec_():
self.addServiceItem(self.serviceItemEditForm.getServiceItem(), self.addServiceItem(self.serviceItemEditForm.getServiceItem(),
replace=True, expand=self.serviceItems[item][u'expand']) replace=True, expand=self.serviceItems[item][u'expanded'])
def nextItem(self): def nextItem(self):
""" """

View File

@ -35,9 +35,9 @@
<item> <item>
<layout class="QVBoxLayout" name="buttonLayout"> <layout class="QVBoxLayout" name="buttonLayout">
<item> <item>
<widget class="QPushButton" name="upButton"> <widget class="QPushButton" name="deleteButton">
<property name="text"> <property name="text">
<string>Up</string> <string>Delete</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -55,16 +55,24 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="deleteButton"> <widget class="QPushButton" name="upButton">
<property name="text"> <property name="text">
<string>Delete</string> <string/>
</property>
<property name="icon">
<iconset resource="../images/openlp-2.qrc">
<normaloff>:/services/service_up.png</normaloff>:/services/service_up.png</iconset>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="downButton"> <widget class="QPushButton" name="downButton">
<property name="text"> <property name="text">
<string>Down</string> <string/>
</property>
<property name="icon">
<iconset resource="../images/openlp-2.qrc">
<normaloff>:/services/service_down.png</normaloff>:/services/service_down.png</iconset>
</property> </property>
</widget> </widget>
</item> </item>
@ -82,6 +90,8 @@
</layout> </layout>
</widget> </widget>
</widget> </widget>
<resources/> <resources>
<include location="../images/openlp-2.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>