openlp/openlp/plugins/alerts/forms/alertdialog.py

110 lines
6.2 KiB
Python
Raw Normal View History

2010-02-14 13:27:32 +00:00
# -*- coding: utf-8 -*-
2010-04-21 17:21:56 +00:00
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
2010-02-14 13:27:32 +00:00
2010-04-21 17:21:56 +00:00
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
2010-12-26 11:04:47 +00:00
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
2010-07-24 22:10:47 +00:00
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
2010-04-21 17:21:56 +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 #
###############################################################################
2010-02-14 13:27:32 +00:00
from PyQt4 import QtCore, QtGui
2010-06-01 17:13:54 +00:00
2010-07-08 11:46:03 +00:00
from openlp.core.lib import build_icon, translate
2010-02-14 13:27:32 +00:00
class Ui_AlertDialog(object):
2010-05-01 19:45:06 +00:00
def setupUi(self, AlertDialog):
AlertDialog.setObjectName(u'AlertDialog')
2011-01-04 21:06:50 +00:00
AlertDialog.resize(400, 300)
2010-07-08 11:46:03 +00:00
AlertDialog.setWindowIcon(build_icon(u':/icon/openlp.org-icon-32.bmp'))
2011-01-04 21:06:50 +00:00
self.AlertDialogLayout = QtGui.QGridLayout(AlertDialog)
2010-05-01 19:45:06 +00:00
self.AlertDialogLayout.setObjectName(u'AlertDialogLayout')
self.AlertTextLayout = QtGui.QFormLayout()
2010-04-21 17:21:56 +00:00
self.AlertTextLayout.setObjectName(u'AlertTextLayout')
2010-05-01 19:45:06 +00:00
self.AlertEntryLabel = QtGui.QLabel(AlertDialog)
2010-04-21 17:21:56 +00:00
self.AlertEntryLabel.setObjectName(u'AlertEntryLabel')
2011-01-04 21:06:50 +00:00
self.AlertTextEdit = QtGui.QLineEdit(AlertDialog)
self.AlertTextEdit.setObjectName(u'AlertTextEdit')
self.AlertEntryLabel.setBuddy(self.AlertTextEdit)
self.AlertTextLayout.addRow(self.AlertEntryLabel, self.AlertTextEdit)
2010-05-01 19:45:06 +00:00
self.AlertParameter = QtGui.QLabel(AlertDialog)
2010-04-21 17:21:56 +00:00
self.AlertParameter.setObjectName(u'AlertParameter')
2010-05-01 19:45:06 +00:00
self.ParameterEdit = QtGui.QLineEdit(AlertDialog)
2010-04-21 17:21:56 +00:00
self.ParameterEdit.setObjectName(u'ParameterEdit')
2011-01-04 21:06:50 +00:00
self.AlertParameter.setBuddy(self.ParameterEdit)
self.AlertTextLayout.addRow(self.AlertParameter, self.ParameterEdit)
self.AlertDialogLayout.addLayout(self.AlertTextLayout, 0, 0, 1, 2)
2010-05-01 19:45:06 +00:00
self.AlertListWidget = QtGui.QListWidget(AlertDialog)
self.AlertListWidget.setAlternatingRowColors(True)
2010-04-21 17:21:56 +00:00
self.AlertListWidget.setObjectName(u'AlertListWidget')
2011-01-04 21:06:50 +00:00
self.AlertDialogLayout.addWidget(self.AlertListWidget, 1, 0)
self.ManageButtonLayout = QtGui.QVBoxLayout()
2010-04-21 17:21:56 +00:00
self.ManageButtonLayout.setObjectName(u'ManageButtonLayout')
2010-05-01 19:45:06 +00:00
self.NewButton = QtGui.QPushButton(AlertDialog)
2010-07-08 11:46:03 +00:00
self.NewButton.setIcon(build_icon(u':/general/general_new.png'))
2010-04-21 17:21:56 +00:00
self.NewButton.setObjectName(u'NewButton')
self.ManageButtonLayout.addWidget(self.NewButton)
2010-05-01 19:45:06 +00:00
self.SaveButton = QtGui.QPushButton(AlertDialog)
self.SaveButton.setEnabled(False)
2010-07-08 11:46:03 +00:00
self.SaveButton.setIcon(build_icon(u':/general/general_save.png'))
2010-04-21 17:21:56 +00:00
self.SaveButton.setObjectName(u'SaveButton')
self.ManageButtonLayout.addWidget(self.SaveButton)
2010-05-01 19:45:06 +00:00
self.DeleteButton = QtGui.QPushButton(AlertDialog)
2010-07-08 11:46:03 +00:00
self.DeleteButton.setIcon(build_icon(u':/general/general_delete.png'))
2010-04-21 17:21:56 +00:00
self.DeleteButton.setObjectName(u'DeleteButton')
self.ManageButtonLayout.addWidget(self.DeleteButton)
2011-01-04 21:06:50 +00:00
self.ManageButtonLayout.addStretch()
self.AlertDialogLayout.addLayout(self.ManageButtonLayout, 1, 1)
self.ButtonBox = QtGui.QDialogButtonBox(AlertDialog)
self.ButtonBox.addButton(QtGui.QDialogButtonBox.Close)
2010-07-08 12:25:17 +00:00
displayIcon = build_icon(u':/general/general_live.png')
2010-05-01 19:45:06 +00:00
self.DisplayButton = QtGui.QPushButton(AlertDialog)
2010-07-08 12:25:17 +00:00
self.DisplayButton.setIcon(displayIcon)
2010-04-21 17:21:56 +00:00
self.DisplayButton.setObjectName(u'DisplayButton')
2011-01-04 21:06:50 +00:00
self.ButtonBox.addButton(self.DisplayButton,
QtGui.QDialogButtonBox.ActionRole)
2010-05-01 19:45:06 +00:00
self.DisplayCloseButton = QtGui.QPushButton(AlertDialog)
2010-07-08 12:25:17 +00:00
self.DisplayCloseButton.setIcon(displayIcon)
2010-04-21 17:21:56 +00:00
self.DisplayCloseButton.setObjectName(u'DisplayCloseButton')
2011-01-04 21:06:50 +00:00
self.ButtonBox.addButton(self.DisplayCloseButton,
QtGui.QDialogButtonBox.ActionRole)
self.AlertDialogLayout.addWidget(self.ButtonBox, 2, 0, 1, 2)
2010-05-01 19:45:06 +00:00
self.retranslateUi(AlertDialog)
2011-01-04 21:06:50 +00:00
QtCore.QObject.connect(self.ButtonBox, QtCore.SIGNAL(u'rejected()'),
2010-06-01 17:13:54 +00:00
AlertDialog.close)
2010-05-01 19:45:06 +00:00
QtCore.QMetaObject.connectSlotsByName(AlertDialog)
2010-02-14 13:27:32 +00:00
2010-05-01 19:45:06 +00:00
def retranslateUi(self, AlertDialog):
AlertDialog.setWindowTitle(
translate('AlertsPlugin.AlertForm', 'Alert Message'))
self.AlertEntryLabel.setText(
translate('AlertsPlugin.AlertForm', 'Alert &text:'))
self.AlertParameter.setText(
2010-12-09 17:44:18 +00:00
translate('AlertsPlugin.AlertForm', '&Parameter:'))
self.NewButton.setText(
translate('AlertsPlugin.AlertForm', '&New'))
self.SaveButton.setText(
translate('AlertsPlugin.AlertForm', '&Save'))
self.DeleteButton.setText(
translate('AlertsPlugin.AlertForm', '&Delete'))
self.DisplayButton.setText(
translate('AlertsPlugin.AlertForm', 'Displ&ay'))
self.DisplayCloseButton.setText(
translate('AlertsPlugin.AlertForm', 'Display && Cl&ose'))