openlp/openlp/plugins/songs/forms/editsongform.py

202 lines
12 KiB
Python
Raw Normal View History

# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008 Martin Thompson, Tim Bentley,
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
"""
from PyQt4 import QtCore, QtGui
from openlp.core.resources import *
class EditSongForm(object):
def __init__(self):
self.EditSongForm = QtGui.QWidget()
self.setupUi()
def setupUi(self):
self.EditSongForm.setObjectName("EditSongForm")
self.EditSongForm.resize(665, 481)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.EditSongForm.setWindowIcon(icon)
self.EditSongFormLayout = QtGui.QVBoxLayout(self.EditSongForm)
self.EditSongFormLayout.setSpacing(8)
self.EditSongFormLayout.setMargin(8)
self.EditSongFormLayout.setObjectName("EditSongFormLayout")
self.TopWidget = QtGui.QWidget(self.EditSongForm)
self.TopWidget.setObjectName("TopWidget")
self.TopWidgetLayout = QtGui.QHBoxLayout(self.TopWidget)
self.TopWidgetLayout.setSpacing(8)
self.TopWidgetLayout.setMargin(0)
self.TopWidgetLayout.setObjectName("TopWidgetLayout")
self.TextWidget = QtGui.QWidget(self.TopWidget)
self.TextWidget.setObjectName("TextWidget")
self.TextWidgetLayout = QtGui.QVBoxLayout(self.TextWidget)
self.TextWidgetLayout.setSpacing(8)
self.TextWidgetLayout.setMargin(0)
self.TextWidgetLayout.setObjectName("TextWidgetLayout")
self.TitleLabel = QtGui.QLabel(self.TextWidget)
self.TitleLabel.setObjectName("TitleLabel")
self.TextWidgetLayout.addWidget(self.TitleLabel)
self.TitleEditItem = QtGui.QLineEdit(self.TextWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.TitleEditItem.sizePolicy().hasHeightForWidth())
self.TitleEditItem.setSizePolicy(sizePolicy)
self.TitleEditItem.setObjectName("TitleEditItem")
self.TextWidgetLayout.addWidget(self.TitleEditItem)
self.LyricsLabel = QtGui.QLabel(self.TextWidget)
self.LyricsLabel.setObjectName("LyricsLabel")
self.TextWidgetLayout.addWidget(self.LyricsLabel)
self.LyricsTextEdit = QtGui.QTextEdit(self.TextWidget)
self.LyricsTextEdit.setLineWrapMode(QtGui.QTextEdit.NoWrap)
self.LyricsTextEdit.setAcceptRichText(False)
self.LyricsTextEdit.setObjectName("LyricsTextEdit")
self.TextWidgetLayout.addWidget(self.LyricsTextEdit)
self.TopWidgetLayout.addWidget(self.TextWidget)
self.AuthorWidget = QtGui.QWidget(self.TopWidget)
self.AuthorWidget.setObjectName("AuthorWidget")
self.AuthorWidgetLayout = QtGui.QVBoxLayout(self.AuthorWidget)
self.AuthorWidgetLayout.setSpacing(8)
self.AuthorWidgetLayout.setMargin(0)
self.AuthorWidgetLayout.setObjectName("AuthorWidgetLayout")
self.AuthorsLabel = QtGui.QLabel(self.AuthorWidget)
self.AuthorsLabel.setObjectName("AuthorsLabel")
self.AuthorWidgetLayout.addWidget(self.AuthorsLabel)
self.AuthorSelectWidget = QtGui.QWidget(self.AuthorWidget)
self.AuthorSelectWidget.setObjectName("AuthorSelectWidget")
self.AuthorSelectWidgetLayout = QtGui.QHBoxLayout(self.AuthorSelectWidget)
self.AuthorSelectWidgetLayout.setSpacing(8)
self.AuthorSelectWidgetLayout.setMargin(0)
self.AuthorSelectWidgetLayout.setObjectName("AuthorSelectWidgetLayout")
self.AuthorsSelectionComboItem = QtGui.QComboBox(self.AuthorSelectWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.AuthorsSelectionComboItem.sizePolicy().hasHeightForWidth())
self.AuthorsSelectionComboItem.setSizePolicy(sizePolicy)
self.AuthorsSelectionComboItem.setEditable(False)
self.AuthorsSelectionComboItem.setInsertPolicy(QtGui.QComboBox.InsertAlphabetically)
self.AuthorsSelectionComboItem.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLength)
self.AuthorsSelectionComboItem.setMinimumContentsLength(8)
self.AuthorsSelectionComboItem.setObjectName("AuthorsSelectionComboItem")
self.AuthorSelectWidgetLayout.addWidget(self.AuthorsSelectionComboItem)
self.AuthorAddtoSongItem = QtGui.QPushButton(self.AuthorSelectWidget)
self.AuthorAddtoSongItem.setMaximumSize(QtCore.QSize(110, 16777215))
self.AuthorAddtoSongItem.setObjectName("AuthorAddtoSongItem")
self.AuthorSelectWidgetLayout.addWidget(self.AuthorAddtoSongItem)
self.AuthorWidgetLayout.addWidget(self.AuthorSelectWidget)
self.AuthorManagementWidget = QtGui.QWidget(self.AuthorWidget)
self.AuthorManagementWidget.setObjectName("AuthorManagementWidget")
self.AuthorManagementWidgetLayout = QtGui.QHBoxLayout(self.AuthorManagementWidget)
self.AuthorManagementWidgetLayout.setSpacing(8)
self.AuthorManagementWidgetLayout.setMargin(0)
self.AuthorManagementWidgetLayout.setObjectName("AuthorManagementWidgetLayout")
self.NewAuthorButton = QtGui.QPushButton(self.AuthorManagementWidget)
self.NewAuthorButton.setObjectName("NewAuthorButton")
self.AuthorManagementWidgetLayout.addWidget(self.NewAuthorButton)
self.AuthorDeleteItem = QtGui.QPushButton(self.AuthorManagementWidget)
self.AuthorDeleteItem.setObjectName("AuthorDeleteItem")
self.AuthorManagementWidgetLayout.addWidget(self.AuthorDeleteItem)
self.AuthorWidgetLayout.addWidget(self.AuthorManagementWidget)
self.SelectedAuthorsLabel = QtGui.QLabel(self.AuthorWidget)
self.SelectedAuthorsLabel.setObjectName("SelectedAuthorsLabel")
self.AuthorWidgetLayout.addWidget(self.SelectedAuthorsLabel)
self.AuthorsListItem = QtGui.QListView(self.AuthorWidget)
self.AuthorsListItem.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
self.AuthorsListItem.setSelectionRectVisible(True)
self.AuthorsListItem.setObjectName("AuthorsListItem")
self.AuthorWidgetLayout.addWidget(self.AuthorsListItem)
self.RemoveAuthorWidget = QtGui.QWidget(self.AuthorWidget)
self.RemoveAuthorWidget.setObjectName("RemoveAuthorWidget")
self.RemoveAuthorWidgetLayout = QtGui.QHBoxLayout(self.RemoveAuthorWidget)
self.RemoveAuthorWidgetLayout.setSpacing(8)
self.RemoveAuthorWidgetLayout.setMargin(0)
self.RemoveAuthorWidgetLayout.setObjectName("RemoveAuthorWidgetLayout")
spacerItem = QtGui.QSpacerItem(122, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.RemoveAuthorWidgetLayout.addItem(spacerItem)
self.AuthorRemoveItem = QtGui.QPushButton(self.RemoveAuthorWidget)
self.AuthorRemoveItem.setObjectName("AuthorRemoveItem")
self.RemoveAuthorWidgetLayout.addWidget(self.AuthorRemoveItem)
self.AuthorWidgetLayout.addWidget(self.RemoveAuthorWidget)
self.CopyrightInfoLabel = QtGui.QLabel(self.AuthorWidget)
self.CopyrightInfoLabel.setObjectName("CopyrightInfoLabel")
self.AuthorWidgetLayout.addWidget(self.CopyrightInfoLabel)
self.CopyrightWidget = QtGui.QWidget(self.AuthorWidget)
self.CopyrightWidget.setObjectName("CopyrightWidget")
self.CopyrightWidgetLayout = QtGui.QHBoxLayout(self.CopyrightWidget)
self.CopyrightWidgetLayout.setSpacing(8)
self.CopyrightWidgetLayout.setMargin(0)
self.CopyrightWidgetLayout.setObjectName("CopyrightWidgetLayout")
self.CopyrightEditItem = QtGui.QLineEdit(self.CopyrightWidget)
self.CopyrightEditItem.setObjectName("CopyrightEditItem")
self.CopyrightWidgetLayout.addWidget(self.CopyrightEditItem)
self.CopyrightInsertItem = QtGui.QPushButton(self.CopyrightWidget)
self.CopyrightInsertItem.setMaximumSize(QtCore.QSize(29, 16777215))
self.CopyrightInsertItem.setObjectName("CopyrightInsertItem")
self.CopyrightWidgetLayout.addWidget(self.CopyrightInsertItem)
self.AuthorWidgetLayout.addWidget(self.CopyrightWidget)
self.TopWidgetLayout.addWidget(self.AuthorWidget)
self.EditSongFormLayout.addWidget(self.TopWidget)
self.ThemeWidget = QtGui.QWidget(self.EditSongForm)
self.ThemeWidget.setObjectName("ThemeWidget")
self.ThemeWidgetLayout = QtGui.QHBoxLayout(self.ThemeWidget)
self.ThemeWidgetLayout.setSpacing(8)
self.ThemeWidgetLayout.setMargin(0)
self.ThemeWidgetLayout.setObjectName("ThemeWidgetLayout")
self.ThemeLabel = QtGui.QLabel(self.ThemeWidget)
self.ThemeLabel.setMaximumSize(QtCore.QSize(70, 16777215))
self.ThemeLabel.setObjectName("ThemeLabel")
self.ThemeWidgetLayout.addWidget(self.ThemeLabel)
self.ThemeSelectionComboItem = QtGui.QComboBox(self.ThemeWidget)
self.ThemeSelectionComboItem.setObjectName("ThemeSelectionComboItem")
self.ThemeWidgetLayout.addWidget(self.ThemeSelectionComboItem)
self.ThemeAddItem = QtGui.QPushButton(self.ThemeWidget)
self.ThemeAddItem.setMaximumSize(QtCore.QSize(110, 16777215))
self.ThemeAddItem.setObjectName("ThemeAddItem")
self.ThemeWidgetLayout.addWidget(self.ThemeAddItem)
self.EditSongFormLayout.addWidget(self.ThemeWidget)
self.ButtonBox = QtGui.QDialogButtonBox(self.EditSongForm)
self.ButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save)
self.ButtonBox.setObjectName("ButtonBox")
self.EditSongFormLayout.addWidget(self.ButtonBox)
self.retranslateUi()
QtCore.QObject.connect(self.ButtonBox, QtCore.SIGNAL("rejected()"), self.EditSongForm.close)
QtCore.QObject.connect(self.ButtonBox, QtCore.SIGNAL("accepted()"), self.EditSongForm.close)
QtCore.QMetaObject.connectSlotsByName(self.EditSongForm)
def retranslateUi(self):
self.EditSongForm.setWindowTitle(QtGui.QApplication.translate("EditSongForm", "Song Editor", None, QtGui.QApplication.UnicodeUTF8))
self.TitleLabel.setText(QtGui.QApplication.translate("EditSongForm", "Title:", None, QtGui.QApplication.UnicodeUTF8))
self.LyricsLabel.setText(QtGui.QApplication.translate("EditSongForm", "Lyrics:", None, QtGui.QApplication.UnicodeUTF8))
self.AuthorsLabel.setText(QtGui.QApplication.translate("EditSongForm", "Authors:", None, QtGui.QApplication.UnicodeUTF8))
self.AuthorAddtoSongItem.setText(QtGui.QApplication.translate("EditSongForm", "Add to Song", None, QtGui.QApplication.UnicodeUTF8))
self.NewAuthorButton.setText(QtGui.QApplication.translate("EditSongForm", "Add a New Author", None, QtGui.QApplication.UnicodeUTF8))
self.AuthorDeleteItem.setText(QtGui.QApplication.translate("EditSongForm", "Delete Author", None, QtGui.QApplication.UnicodeUTF8))
self.SelectedAuthorsLabel.setText(QtGui.QApplication.translate("EditSongForm", "Selected Authors:", None, QtGui.QApplication.UnicodeUTF8))
self.AuthorRemoveItem.setText(QtGui.QApplication.translate("EditSongForm", "Remove Selected Author(s)", None, QtGui.QApplication.UnicodeUTF8))
self.CopyrightInfoLabel.setText(QtGui.QApplication.translate("EditSongForm", "Copyright Info:", None, QtGui.QApplication.UnicodeUTF8))
self.CopyrightInsertItem.setText(QtGui.QApplication.translate("EditSongForm", "©", None, QtGui.QApplication.UnicodeUTF8))
self.ThemeLabel.setText(QtGui.QApplication.translate("EditSongForm", "Theme", None, QtGui.QApplication.UnicodeUTF8))
self.ThemeAddItem.setText(QtGui.QApplication.translate("EditSongForm", "Add a Theme", None, QtGui.QApplication.UnicodeUTF8))
def show(self):
self.EditSongForm.show()