openlp/openlp/core/ui/serviceitemeditdialog.py

72 lines
3.9 KiB
Python
Raw Normal View History

2010-03-17 21:08:18 +00:00
# -*- coding: utf-8 -*-
2012-12-29 13:35:16 +00:00
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
2010-03-17 21:08:18 +00:00
2010-03-19 07:23:48 +00:00
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
2016-12-31 11:01:36 +00:00
# Copyright (c) 2008-2017 OpenLP Developers #
2010-03-19 07:23:48 +00:00
# --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the Free #
# Software Foundation; version 2 of the License. #
# #
# This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
# more details. #
# #
# You should have received a copy of the GNU General Public License along #
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
2013-02-01 21:34:23 +00:00
"""
The UI widgets for the service item edit dialog
"""
2015-11-07 00:49:40 +00:00
from PyQt5 import QtWidgets
2013-10-13 21:07:28 +00:00
from openlp.core.common import translate
from openlp.core.lib import build_icon
from openlp.core.lib.ui import create_button_box, create_button
2010-03-17 21:08:18 +00:00
2013-02-01 21:34:23 +00:00
2010-03-17 21:08:18 +00:00
class Ui_ServiceItemEditDialog(object):
2013-02-01 21:34:23 +00:00
"""
The UI widgets for the service item edit dialog
"""
2010-07-27 08:22:01 +00:00
def setupUi(self, serviceItemEditDialog):
2013-02-01 21:34:23 +00:00
"""
Set up the UI
"""
2013-08-31 18:17:38 +00:00
serviceItemEditDialog.setObjectName('serviceItemEditDialog')
2016-10-27 17:45:50 +00:00
serviceItemEditDialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg'))
2015-11-07 00:49:40 +00:00
self.dialog_layout = QtWidgets.QGridLayout(serviceItemEditDialog)
2013-01-27 20:36:18 +00:00
self.dialog_layout.setContentsMargins(8, 8, 8, 8)
self.dialog_layout.setSpacing(8)
2013-08-31 18:17:38 +00:00
self.dialog_layout.setObjectName('dialog_layout')
2015-11-07 00:49:40 +00:00
self.list_widget = QtWidgets.QListWidget(serviceItemEditDialog)
2013-01-27 20:36:18 +00:00
self.list_widget.setAlternatingRowColors(True)
2013-08-31 18:17:38 +00:00
self.list_widget.setObjectName('list_widget')
2013-01-27 20:36:18 +00:00
self.dialog_layout.addWidget(self.list_widget, 0, 0)
2015-11-07 00:49:40 +00:00
self.button_layout = QtWidgets.QVBoxLayout()
2013-08-31 18:17:38 +00:00
self.button_layout.setObjectName('button_layout')
self.delete_button = create_button(serviceItemEditDialog, 'deleteButton', role='delete',
2013-12-24 15:55:01 +00:00
click=serviceItemEditDialog.on_delete_button_clicked)
2013-01-27 20:36:18 +00:00
self.button_layout.addWidget(self.delete_button)
self.button_layout.addStretch()
2013-08-31 18:17:38 +00:00
self.up_button = create_button(serviceItemEditDialog, 'up_button', role='up',
2013-12-24 15:55:01 +00:00
click=serviceItemEditDialog.on_up_button_clicked)
2013-08-31 18:17:38 +00:00
self.down_button = create_button(serviceItemEditDialog, 'down_button', role='down',
2013-12-24 15:55:01 +00:00
click=serviceItemEditDialog.on_down_button_clicked)
2013-01-27 20:36:18 +00:00
self.button_layout.addWidget(self.up_button)
self.button_layout.addWidget(self.down_button)
self.dialog_layout.addLayout(self.button_layout, 0, 1)
2013-08-31 18:17:38 +00:00
self.button_box = create_button_box(serviceItemEditDialog, 'button_box', ['cancel', 'save'])
2013-01-27 20:36:18 +00:00
self.dialog_layout.addWidget(self.button_box, 1, 0, 1, 2)
2010-07-27 08:22:01 +00:00
self.retranslateUi(serviceItemEditDialog)
2010-03-17 21:08:18 +00:00
2010-07-27 08:22:01 +00:00
def retranslateUi(self, serviceItemEditDialog):
2013-02-01 21:34:23 +00:00
"""
Translate the UI on the fly
"""
2012-12-29 13:35:16 +00:00
serviceItemEditDialog.setWindowTitle(translate('OpenLP.ServiceItemEditForm', 'Reorder Service Item'))