2010-03-03 17:48:37 +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-03 17:48:37 +00:00
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# OpenLP - Open Source Lyrics Projection #
|
|
|
|
# --------------------------------------------------------------------------- #
|
2016-12-31 11:01:36 +00:00
|
|
|
# Copyright (c) 2008-2017 OpenLP Developers #
|
2010-03-03 17:48:37 +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 :mod:`~openlp.core.ui.servicenoteform` module contains the `ServiceNoteForm` class.
|
|
|
|
"""
|
2015-12-30 15:03:35 +00:00
|
|
|
from PyQt5 import QtCore, QtWidgets
|
2010-06-08 15:56:47 +00:00
|
|
|
|
2017-10-07 07:05:07 +00:00
|
|
|
from openlp.core.common.i18n import translate
|
|
|
|
from openlp.core.common.registry import Registry, RegistryProperties
|
2016-05-21 05:02:31 +00:00
|
|
|
from openlp.core.ui.lib import SpellTextEdit
|
2012-04-01 21:19:56 +00:00
|
|
|
from openlp.core.lib.ui import create_button_box
|
2010-03-03 17:48:37 +00:00
|
|
|
|
2013-02-01 21:34:23 +00:00
|
|
|
|
2015-11-07 00:49:40 +00:00
|
|
|
class ServiceNoteForm(QtWidgets.QDialog, RegistryProperties):
|
2010-03-03 17:48:37 +00:00
|
|
|
"""
|
|
|
|
This is the form that is used to edit the verses of the song.
|
|
|
|
"""
|
2013-01-27 07:36:04 +00:00
|
|
|
def __init__(self):
|
2010-03-03 17:48:37 +00:00
|
|
|
"""
|
|
|
|
Constructor
|
|
|
|
"""
|
2017-06-04 12:14:23 +00:00
|
|
|
super(ServiceNoteForm, self).__init__(Registry().get('main_window'), QtCore.Qt.WindowSystemMenuHint |
|
|
|
|
QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint)
|
2011-02-01 00:33:50 +00:00
|
|
|
self.setupUi()
|
|
|
|
self.retranslateUi()
|
|
|
|
|
2015-11-07 00:49:40 +00:00
|
|
|
def exec(self):
|
2013-02-01 21:34:23 +00:00
|
|
|
"""
|
|
|
|
Execute the form and return the result.
|
|
|
|
"""
|
2013-01-27 20:36:18 +00:00
|
|
|
self.text_edit.setFocus()
|
2015-11-07 00:49:40 +00:00
|
|
|
return QtWidgets.QDialog.exec(self)
|
2011-06-13 20:49:14 +00:00
|
|
|
|
2011-02-01 00:33:50 +00:00
|
|
|
def setupUi(self):
|
2013-02-01 21:34:23 +00:00
|
|
|
"""
|
|
|
|
Set up the UI of the dialog
|
|
|
|
"""
|
2013-08-31 18:17:38 +00:00
|
|
|
self.setObjectName('serviceNoteEdit')
|
2015-11-07 00:49:40 +00:00
|
|
|
self.dialog_layout = QtWidgets.QVBoxLayout(self)
|
2013-01-27 20:36:18 +00:00
|
|
|
self.dialog_layout.setContentsMargins(8, 8, 8, 8)
|
|
|
|
self.dialog_layout.setSpacing(8)
|
2014-03-04 18:49:30 +00:00
|
|
|
self.dialog_layout.setObjectName('vertical_layout')
|
2013-01-27 20:36:18 +00:00
|
|
|
self.text_edit = SpellTextEdit(self, False)
|
2013-08-31 18:17:38 +00:00
|
|
|
self.text_edit.setObjectName('textEdit')
|
2013-01-27 20:36:18 +00:00
|
|
|
self.dialog_layout.addWidget(self.text_edit)
|
2013-08-31 18:17:38 +00:00
|
|
|
self.button_box = create_button_box(self, 'button_box', ['cancel', 'save'])
|
2013-01-27 20:36:18 +00:00
|
|
|
self.dialog_layout.addWidget(self.button_box)
|
2011-02-01 00:33:50 +00:00
|
|
|
|
|
|
|
def retranslateUi(self):
|
2013-02-01 21:34:23 +00:00
|
|
|
"""
|
|
|
|
Translate the UI on the fly
|
|
|
|
"""
|
2014-03-20 19:10:31 +00:00
|
|
|
self.setWindowTitle(translate('OpenLP.ServiceNoteForm', 'Service Item Notes'))
|