Some tweaks to the songs plugin.

bzr-revno: 402
This commit is contained in:
Raoul Snyman 2009-03-09 18:47:37 +00:00
parent 735527d558
commit 86bde695ea
8 changed files with 505 additions and 359 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE UserProject SYSTEM "UserProject-4.0.dtd">
<!-- eric4 user project file for project openlp.org 2.0 -->
<!-- Saved: 2009-03-07, 19:39:48 -->
<!-- Saved: 2009-03-07, 23:44:51 -->
<!-- Copyright (C) 2009 Raoul Snyman, raoulsnyman@openlp.org -->
<UserProject version="4.0">
</UserProject>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Tasks SYSTEM "Tasks-4.2.dtd">
<!-- eric4 tasks file for project openlp.org 2.0 -->
<!-- Saved: 2009-03-07, 19:39:59 -->
<!-- Saved: 2009-03-07, 23:45:01 -->
<Tasks version="4.2">
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: what is the tags for bridge, pre-chorus?</Summary>

View File

@ -12,66 +12,88 @@ from PyQt4 import QtCore, QtGui
class Ui_AuthorsDialog(object):
def setupUi(self, AuthorsDialog):
AuthorsDialog.setObjectName("AuthorsDialog")
AuthorsDialog.resize(387, 532)
self.buttonBox = QtGui.QDialogButtonBox(AuthorsDialog)
self.buttonBox.setGeometry(QtCore.QRect(40, 490, 341, 32))
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.AuthorDetails = QtGui.QGroupBox(AuthorsDialog)
self.AuthorDetails.setGeometry(QtCore.QRect(20, 330, 341, 158))
self.AuthorDetails.setObjectName("AuthorDetails")
self.gridLayout = QtGui.QGridLayout(self.AuthorDetails)
self.gridLayout.setObjectName("gridLayout")
self.DisplayLabel = QtGui.QLabel(self.AuthorDetails)
self.DisplayLabel.setObjectName("DisplayLabel")
self.gridLayout.addWidget(self.DisplayLabel, 0, 0, 1, 1)
self.DisplayEdit = QtGui.QLineEdit(self.AuthorDetails)
self.DisplayEdit.setObjectName("DisplayEdit")
self.gridLayout.addWidget(self.DisplayEdit, 0, 1, 1, 4)
self.FirstNameLabel = QtGui.QLabel(self.AuthorDetails)
self.FirstNameLabel.setObjectName("FirstNameLabel")
self.gridLayout.addWidget(self.FirstNameLabel, 1, 0, 1, 1)
self.FirstNameEdit = QtGui.QLineEdit(self.AuthorDetails)
self.FirstNameEdit.setObjectName("FirstNameEdit")
self.gridLayout.addWidget(self.FirstNameEdit, 1, 1, 1, 4)
self.LastNameLabel = QtGui.QLabel(self.AuthorDetails)
self.LastNameLabel.setObjectName("LastNameLabel")
self.gridLayout.addWidget(self.LastNameLabel, 2, 0, 1, 1)
self.LastNameEdit = QtGui.QLineEdit(self.AuthorDetails)
self.LastNameEdit.setObjectName("LastNameEdit")
self.gridLayout.addWidget(self.LastNameEdit, 2, 1, 1, 4)
spacerItem = QtGui.QSpacerItem(198, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem, 3, 0, 1, 2)
self.DeleteButton = QtGui.QPushButton(self.AuthorDetails)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/services/service_delete.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.DeleteButton.setIcon(icon)
self.DeleteButton.setObjectName("DeleteButton")
self.gridLayout.addWidget(self.DeleteButton, 3, 3, 1, 1)
self.AddUpdateButton = QtGui.QPushButton(self.AuthorDetails)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(":/system/system_settings.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.AddUpdateButton.setIcon(icon1)
self.AddUpdateButton.setObjectName("AddUpdateButton")
self.gridLayout.addWidget(self.AddUpdateButton, 3, 4, 1, 1)
self.ClearButton = QtGui.QPushButton(self.AuthorDetails)
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap(":/songs/song_edit.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ClearButton.setIcon(icon2)
self.ClearButton.setObjectName("ClearButton")
self.gridLayout.addWidget(self.ClearButton, 3, 2, 1, 1)
self.MessageLabel = QtGui.QLabel(AuthorsDialog)
self.MessageLabel.setGeometry(QtCore.QRect(20, 500, 261, 17))
self.MessageLabel.setObjectName("MessageLabel")
AuthorsDialog.resize(410, 505)
self.DialogLayout = QtGui.QVBoxLayout(AuthorsDialog)
self.DialogLayout.setSpacing(8)
self.DialogLayout.setMargin(8)
self.DialogLayout.setObjectName("DialogLayout")
self.AuthorListView = QtGui.QTableWidget(AuthorsDialog)
self.AuthorListView.setGeometry(QtCore.QRect(20, 20, 341, 301))
self.AuthorListView.setDragEnabled(True)
self.AuthorListView.setAlternatingRowColors(True)
self.AuthorListView.setColumnCount(0)
self.AuthorListView.setObjectName("AuthorListView")
self.AuthorListView.setColumnCount(0)
self.AuthorListView.setRowCount(0)
self.DialogLayout.addWidget(self.AuthorListView)
self.AuthorDetails = QtGui.QGroupBox(AuthorsDialog)
self.AuthorDetails.setMinimumSize(QtCore.QSize(0, 0))
self.AuthorDetails.setObjectName("AuthorDetails")
self.AuthorLayout = QtGui.QVBoxLayout(self.AuthorDetails)
self.AuthorLayout.setSpacing(8)
self.AuthorLayout.setMargin(8)
self.AuthorLayout.setObjectName("AuthorLayout")
self.DetailsWidget = QtGui.QWidget(self.AuthorDetails)
self.DetailsWidget.setObjectName("DetailsWidget")
self.DetailsLayout = QtGui.QFormLayout(self.DetailsWidget)
self.DetailsLayout.setMargin(0)
self.DetailsLayout.setSpacing(8)
self.DetailsLayout.setObjectName("DetailsLayout")
self.DisplayLabel = QtGui.QLabel(self.DetailsWidget)
self.DisplayLabel.setObjectName("DisplayLabel")
self.DetailsLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.DisplayLabel)
self.DisplayEdit = QtGui.QLineEdit(self.DetailsWidget)
self.DisplayEdit.setObjectName("DisplayEdit")
self.DetailsLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.DisplayEdit)
self.FirstNameLabel = QtGui.QLabel(self.DetailsWidget)
self.FirstNameLabel.setObjectName("FirstNameLabel")
self.DetailsLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FirstNameLabel)
self.FirstNameEdit = QtGui.QLineEdit(self.DetailsWidget)
self.FirstNameEdit.setObjectName("FirstNameEdit")
self.DetailsLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FirstNameEdit)
self.LastNameLabel = QtGui.QLabel(self.DetailsWidget)
self.LastNameLabel.setObjectName("LastNameLabel")
self.DetailsLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.LastNameLabel)
self.LastNameEdit = QtGui.QLineEdit(self.DetailsWidget)
self.LastNameEdit.setObjectName("LastNameEdit")
self.DetailsLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.LastNameEdit)
self.AuthorLayout.addWidget(self.DetailsWidget)
self.MessageLabel = QtGui.QLabel(self.AuthorDetails)
self.MessageLabel.setObjectName("MessageLabel")
self.AuthorLayout.addWidget(self.MessageLabel)
self.ButtonWidget = QtGui.QWidget(self.AuthorDetails)
self.ButtonWidget.setMinimumSize(QtCore.QSize(0, 0))
self.ButtonWidget.setObjectName("ButtonWidget")
self.ButtonLayout = QtGui.QHBoxLayout(self.ButtonWidget)
self.ButtonLayout.setSpacing(8)
self.ButtonLayout.setMargin(0)
self.ButtonLayout.setObjectName("ButtonLayout")
spacerItem = QtGui.QSpacerItem(198, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.ButtonLayout.addItem(spacerItem)
self.ClearButton = QtGui.QPushButton(self.ButtonWidget)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/services/service_new.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ClearButton.setIcon(icon)
self.ClearButton.setObjectName("ClearButton")
self.ButtonLayout.addWidget(self.ClearButton)
self.AddUpdateButton = QtGui.QPushButton(self.ButtonWidget)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(":/services/service_save.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.AddUpdateButton.setIcon(icon1)
self.AddUpdateButton.setObjectName("AddUpdateButton")
self.ButtonLayout.addWidget(self.AddUpdateButton)
self.DeleteButton = QtGui.QPushButton(self.ButtonWidget)
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap(":/services/service_delete.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.DeleteButton.setIcon(icon2)
self.DeleteButton.setObjectName("DeleteButton")
self.ButtonLayout.addWidget(self.DeleteButton)
self.AuthorLayout.addWidget(self.ButtonWidget)
self.DialogLayout.addWidget(self.AuthorDetails)
self.buttonBox = QtGui.QDialogButtonBox(AuthorsDialog)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.DialogLayout.addWidget(self.buttonBox)
self.retranslateUi(AuthorsDialog)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), AuthorsDialog.accept)
@ -80,11 +102,14 @@ class Ui_AuthorsDialog(object):
def retranslateUi(self, AuthorsDialog):
AuthorsDialog.setWindowTitle(QtGui.QApplication.translate("AuthorsDialog", "Author Maintenance", None, QtGui.QApplication.UnicodeUTF8))
self.buttonBox.setToolTip(QtGui.QApplication.translate("AuthorsDialog", "Exit Screen", None, QtGui.QApplication.UnicodeUTF8))
self.AuthorDetails.setTitle(QtGui.QApplication.translate("AuthorsDialog", "Author Details", None, QtGui.QApplication.UnicodeUTF8))
self.DisplayLabel.setText(QtGui.QApplication.translate("AuthorsDialog", "Display Name:", None, QtGui.QApplication.UnicodeUTF8))
self.FirstNameLabel.setText(QtGui.QApplication.translate("AuthorsDialog", "First Name:", None, QtGui.QApplication.UnicodeUTF8))
self.LastNameLabel.setText(QtGui.QApplication.translate("AuthorsDialog", "Last Name:", None, QtGui.QApplication.UnicodeUTF8))
self.DeleteButton.setToolTip(QtGui.QApplication.translate("AuthorsDialog", "Delete Author", None, QtGui.QApplication.UnicodeUTF8))
self.AddUpdateButton.setToolTip(QtGui.QApplication.translate("AuthorsDialog", "Add Update Author", None, QtGui.QApplication.UnicodeUTF8))
self.ClearButton.setToolTip(QtGui.QApplication.translate("AuthorsDialog", "Clear Selection", None, QtGui.QApplication.UnicodeUTF8))
self.ClearButton.setText(QtGui.QApplication.translate("AuthorsDialog", "New", None, QtGui.QApplication.UnicodeUTF8))
self.AddUpdateButton.setToolTip(QtGui.QApplication.translate("AuthorsDialog", "Add Update Author", None, QtGui.QApplication.UnicodeUTF8))
self.AddUpdateButton.setText(QtGui.QApplication.translate("AuthorsDialog", "Save", None, QtGui.QApplication.UnicodeUTF8))
self.DeleteButton.setToolTip(QtGui.QApplication.translate("AuthorsDialog", "Delete Author", None, QtGui.QApplication.UnicodeUTF8))
self.DeleteButton.setText(QtGui.QApplication.translate("AuthorsDialog", "Delete", None, QtGui.QApplication.UnicodeUTF8))
self.buttonBox.setToolTip(QtGui.QApplication.translate("AuthorsDialog", "Exit Screen", None, QtGui.QApplication.UnicodeUTF8))

View File

@ -63,13 +63,18 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.AuthorsListView.setShowGrid(False)
self.AuthorsListView.setSortingEnabled(False)
self.AuthorsListView.setAlternatingRowColors(True)
self.AuthorsListView.horizontalHeader().setVisible(False)
self.AuthorsListView.verticalHeader().setVisible(False)
self.savebutton = self.ButtonBox.button(QtGui.QDialogButtonBox.Save)
def initialise(self):
list = self.songmanager.get_authors()
self.loadAuthors()
def loadAuthors(self):
authors = self.songmanager.get_authors()
self.AuthorsSelectionComboItem.clear()
for i in list:
self.AuthorsSelectionComboItem.addItem( i.display_name)
for author in authors:
self.AuthorsSelectionComboItem.addItem(author.display_name)
def loadSong(self, id):
self.song = self.songmanager.get_song(id)
@ -81,10 +86,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.VerseListWidget.addItem(verse)
self.AuthorsListView.clear() # clear the results
self.AuthorsListView.setHorizontalHeaderLabels(QtCore.QStringList(['', u'Author']))
self.AuthorsListView.setVerticalHeaderLabels(QtCore.QStringList(['']))
self.AuthorsListView.horizontalHeader().setVisible(False)
self.AuthorsListView.verticalHeader().setVisible(False)
self.AuthorsListView.setRowCount(0)
for author in self.song.authors:
row_count = self.AuthorsListView.rowCount()
@ -102,6 +103,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
"""
self.authors_form.load_form()
self.authors_form.exec_()
self.loadAuthors()
def onAddTopicButtonClicked(self):
"""

View File

@ -12,59 +12,85 @@ from PyQt4 import QtCore, QtGui
class Ui_SongBookDialog(object):
def setupUi(self, SongBookDialog):
SongBookDialog.setObjectName("SongBookDialog")
SongBookDialog.resize(387, 500)
self.gridLayout_2 = QtGui.QGridLayout(SongBookDialog)
self.gridLayout_2.setObjectName("gridLayout_2")
SongBookDialog.resize(387, 531)
self.DialogLayout = QtGui.QVBoxLayout(SongBookDialog)
self.DialogLayout.setSpacing(8)
self.DialogLayout.setMargin(8)
self.DialogLayout.setObjectName("DialogLayout")
self.BookSongListView = QtGui.QTableWidget(SongBookDialog)
self.BookSongListView.setObjectName("BookSongListView")
self.BookSongListView.setColumnCount(0)
self.BookSongListView.setRowCount(0)
self.gridLayout_2.addWidget(self.BookSongListView, 0, 0, 1, 2)
self.DialogLayout.addWidget(self.BookSongListView)
self.SongBookGroup = QtGui.QGroupBox(SongBookDialog)
self.SongBookGroup.setMinimumSize(QtCore.QSize(0, 200))
self.SongBookGroup.setObjectName("SongBookGroup")
self.gridLayout = QtGui.QGridLayout(self.SongBookGroup)
self.gridLayout.setObjectName("gridLayout")
self.NameLabel = QtGui.QLabel(self.SongBookGroup)
self.SongBookLayout = QtGui.QVBoxLayout(self.SongBookGroup)
self.SongBookLayout.setSpacing(8)
self.SongBookLayout.setMargin(8)
self.SongBookLayout.setObjectName("SongBookLayout")
self.DetailsWidget = QtGui.QWidget(self.SongBookGroup)
self.DetailsWidget.setMinimumSize(QtCore.QSize(0, 0))
self.DetailsWidget.setObjectName("DetailsWidget")
self.DetailsLayout = QtGui.QFormLayout(self.DetailsWidget)
self.DetailsLayout.setMargin(0)
self.DetailsLayout.setSpacing(8)
self.DetailsLayout.setObjectName("DetailsLayout")
self.NameLabel = QtGui.QLabel(self.DetailsWidget)
self.NameLabel.setObjectName("NameLabel")
self.gridLayout.addWidget(self.NameLabel, 0, 0, 1, 1)
self.NameEdit = QtGui.QLineEdit(self.SongBookGroup)
self.DetailsLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.NameLabel)
self.NameEdit = QtGui.QLineEdit(self.DetailsWidget)
self.NameEdit.setObjectName("NameEdit")
self.gridLayout.addWidget(self.NameEdit, 0, 1, 1, 4)
self.PublisherLabel = QtGui.QLabel(self.SongBookGroup)
self.DetailsLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.NameEdit)
self.PublisherLabel = QtGui.QLabel(self.DetailsWidget)
self.PublisherLabel.setObjectName("PublisherLabel")
self.gridLayout.addWidget(self.PublisherLabel, 1, 0, 1, 1)
self.PublisherEdit = QtGui.QLineEdit(self.SongBookGroup)
self.DetailsLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.PublisherLabel)
self.PublisherEdit = QtGui.QLineEdit(self.DetailsWidget)
self.PublisherEdit.setObjectName("PublisherEdit")
self.gridLayout.addWidget(self.PublisherEdit, 1, 1, 1, 4)
spacerItem = QtGui.QSpacerItem(198, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem, 2, 0, 1, 2)
self.DeleteButton = QtGui.QPushButton(self.SongBookGroup)
self.DetailsLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.PublisherEdit)
self.SongBookLayout.addWidget(self.DetailsWidget)
self.MessageLabel = QtGui.QLabel(self.SongBookGroup)
self.MessageLabel.setObjectName("MessageLabel")
self.SongBookLayout.addWidget(self.MessageLabel)
self.ButtonWidget = QtGui.QWidget(self.SongBookGroup)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.ButtonWidget.sizePolicy().hasHeightForWidth())
self.ButtonWidget.setSizePolicy(sizePolicy)
self.ButtonWidget.setMinimumSize(QtCore.QSize(0, 0))
self.ButtonWidget.setObjectName("ButtonWidget")
self.ButtonLayout = QtGui.QHBoxLayout(self.ButtonWidget)
self.ButtonLayout.setSpacing(8)
self.ButtonLayout.setMargin(0)
self.ButtonLayout.setObjectName("ButtonLayout")
spacerItem = QtGui.QSpacerItem(61, 24, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.ButtonLayout.addItem(spacerItem)
self.ClearButton = QtGui.QPushButton(self.ButtonWidget)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/services/service_delete.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.DeleteButton.setIcon(icon)
self.DeleteButton.setObjectName("DeleteButton")
self.gridLayout.addWidget(self.DeleteButton, 2, 3, 1, 1)
self.AddUpdateButton = QtGui.QPushButton(self.SongBookGroup)
icon.addPixmap(QtGui.QPixmap(":/services/service_new.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ClearButton.setIcon(icon)
self.ClearButton.setObjectName("ClearButton")
self.ButtonLayout.addWidget(self.ClearButton)
self.AddUpdateButton = QtGui.QPushButton(self.ButtonWidget)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(":/system/system_settings.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
icon1.addPixmap(QtGui.QPixmap(":/services/service_save.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.AddUpdateButton.setIcon(icon1)
self.AddUpdateButton.setObjectName("AddUpdateButton")
self.gridLayout.addWidget(self.AddUpdateButton, 2, 4, 1, 1)
self.ClearButton = QtGui.QPushButton(self.SongBookGroup)
self.ButtonLayout.addWidget(self.AddUpdateButton)
self.DeleteButton = QtGui.QPushButton(self.ButtonWidget)
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap(":/songs/song_edit.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ClearButton.setIcon(icon2)
self.ClearButton.setObjectName("ClearButton")
self.gridLayout.addWidget(self.ClearButton, 2, 2, 1, 1)
self.gridLayout_2.addWidget(self.SongBookGroup, 1, 0, 1, 2)
self.MessageLabel = QtGui.QLabel(SongBookDialog)
self.MessageLabel.setObjectName("MessageLabel")
self.gridLayout_2.addWidget(self.MessageLabel, 2, 0, 1, 1)
icon2.addPixmap(QtGui.QPixmap(":/services/service_delete.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.DeleteButton.setIcon(icon2)
self.DeleteButton.setObjectName("DeleteButton")
self.ButtonLayout.addWidget(self.DeleteButton)
self.SongBookLayout.addWidget(self.ButtonWidget)
self.DialogLayout.addWidget(self.SongBookGroup)
self.ButtonBox = QtGui.QDialogButtonBox(SongBookDialog)
self.ButtonBox.setOrientation(QtCore.Qt.Horizontal)
self.ButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
self.ButtonBox.setObjectName("ButtonBox")
self.gridLayout_2.addWidget(self.ButtonBox, 2, 1, 1, 1)
self.DialogLayout.addWidget(self.ButtonBox)
self.retranslateUi(SongBookDialog)
QtCore.QObject.connect(self.ButtonBox, QtCore.SIGNAL("accepted()"), SongBookDialog.accept)
@ -76,6 +102,9 @@ class Ui_SongBookDialog(object):
self.SongBookGroup.setTitle(QtGui.QApplication.translate("SongBookDialog", "Song Book", None, QtGui.QApplication.UnicodeUTF8))
self.NameLabel.setText(QtGui.QApplication.translate("SongBookDialog", "Name:", None, QtGui.QApplication.UnicodeUTF8))
self.PublisherLabel.setText(QtGui.QApplication.translate("SongBookDialog", "Publisher:", None, QtGui.QApplication.UnicodeUTF8))
self.DeleteButton.setToolTip(QtGui.QApplication.translate("SongBookDialog", "Delete Author", None, QtGui.QApplication.UnicodeUTF8))
self.AddUpdateButton.setToolTip(QtGui.QApplication.translate("SongBookDialog", "Add Update Author", None, QtGui.QApplication.UnicodeUTF8))
self.ClearButton.setToolTip(QtGui.QApplication.translate("SongBookDialog", "Clear Selection", None, QtGui.QApplication.UnicodeUTF8))
self.ClearButton.setText(QtGui.QApplication.translate("SongBookDialog", "New", None, QtGui.QApplication.UnicodeUTF8))
self.AddUpdateButton.setToolTip(QtGui.QApplication.translate("SongBookDialog", "Add Update Author", None, QtGui.QApplication.UnicodeUTF8))
self.AddUpdateButton.setText(QtGui.QApplication.translate("SongBookDialog", "Save", None, QtGui.QApplication.UnicodeUTF8))
self.DeleteButton.setToolTip(QtGui.QApplication.translate("SongBookDialog", "Delete Author", None, QtGui.QApplication.UnicodeUTF8))
self.DeleteButton.setText(QtGui.QApplication.translate("SongBookDialog", "Delete", None, QtGui.QApplication.UnicodeUTF8))

View File

@ -204,8 +204,8 @@ class SongMediaItem(MediaManagerItem):
def onSongEditClick(self):
current_row = self.SongListView.currentRow()
id = int(self.SongListView.item(current_row, 0).text())
self.parent.edit_song_form.loadSong(id)
self.parent.edit_song_form.exec_()
self.edit_song_form.loadSong(id)
self.edit_song_form.exec_()
def onSongDeleteClick(self):
pass

View File

@ -1,178 +1,200 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<ui version="4.0" >
<class>AuthorsDialog</class>
<widget class="QDialog" name="AuthorsDialog">
<property name="geometry">
<widget class="QDialog" name="AuthorsDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>387</width>
<height>532</height>
<width>410</width>
<height>505</height>
</rect>
</property>
<property name="windowTitle">
<property name="windowTitle" >
<string>Author Maintenance</string>
</property>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="geometry">
<rect>
<x>40</x>
<y>490</y>
<width>341</width>
<height>32</height>
</rect>
<layout class="QVBoxLayout" name="DialogLayout" >
<property name="spacing" >
<number>8</number>
</property>
<property name="toolTip">
<string>Exit Screen</string>
<property name="margin" >
<number>8</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property>
</widget>
<widget class="QGroupBox" name="AuthorDetails">
<property name="geometry">
<rect>
<x>20</x>
<y>330</y>
<width>341</width>
<height>158</height>
</rect>
</property>
<property name="title">
<string>Author Details</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="DisplayLabel">
<property name="text">
<string>Display Name:</string>
<item>
<widget class="QTableWidget" name="AuthorListView" >
<property name="dragEnabled" >
<bool>true</bool>
</property>
<property name="alternatingRowColors" >
<bool>true</bool>
</property>
<property name="columnCount" >
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="AuthorDetails" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="title" >
<string>Author Details</string>
</property>
<layout class="QVBoxLayout" name="AuthorLayout" >
<property name="spacing" >
<number>8</number>
</property>
</widget>
</item>
<item row="0" column="1" colspan="4">
<widget class="QLineEdit" name="DisplayEdit"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="FirstNameLabel">
<property name="text">
<string>First Name:</string>
<property name="margin" >
<number>8</number>
</property>
</widget>
</item>
<item row="1" column="1" colspan="4">
<widget class="QLineEdit" name="FirstNameEdit"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="LastNameLabel">
<property name="text">
<string>Last Name:</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="4">
<widget class="QLineEdit" name="LastNameEdit"/>
</item>
<item row="3" column="0" colspan="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>198</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="3">
<widget class="QPushButton" name="DeleteButton">
<property name="toolTip">
<string>Delete Author</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images/openlp-2.qrc">
<normaloff>:/services/service_delete.png</normaloff>:/services/service_delete.png</iconset>
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QPushButton" name="AddUpdateButton">
<property name="toolTip">
<string>Add Update Author</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images/openlp-2.qrc">
<normaloff>:/system/system_settings.png</normaloff>:/system/system_settings.png</iconset>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QPushButton" name="ClearButton">
<property name="toolTip">
<string>Clear Selection</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images/openlp-2.qrc">
<normaloff>:/songs/song_edit.png</normaloff>:/songs/song_edit.png</iconset>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QLabel" name="MessageLabel">
<property name="geometry">
<rect>
<x>20</x>
<y>500</y>
<width>261</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QTableWidget" name="AuthorListView">
<property name="geometry">
<rect>
<x>20</x>
<y>20</y>
<width>341</width>
<height>301</height>
</rect>
</property>
<property name="dragEnabled">
<bool>true</bool>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="columnCount">
<number>0</number>
</property>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
</widget>
<item>
<widget class="QWidget" native="1" name="DetailsWidget" >
<layout class="QFormLayout" name="DetailsLayout" >
<property name="horizontalSpacing" >
<number>8</number>
</property>
<property name="verticalSpacing" >
<number>8</number>
</property>
<property name="margin" >
<number>0</number>
</property>
<item row="0" column="0" >
<widget class="QLabel" name="DisplayLabel" >
<property name="text" >
<string>Display Name:</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="DisplayEdit" />
</item>
<item row="1" column="0" >
<widget class="QLabel" name="FirstNameLabel" >
<property name="text" >
<string>First Name:</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="FirstNameEdit" />
</item>
<item row="2" column="0" >
<widget class="QLabel" name="LastNameLabel" >
<property name="text" >
<string>Last Name:</string>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="QLineEdit" name="LastNameEdit" />
</item>
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="MessageLabel" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item>
<widget class="QWidget" native="1" name="ButtonWidget" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<layout class="QHBoxLayout" name="ButtonLayout" >
<property name="spacing" >
<number>8</number>
</property>
<property name="margin" >
<number>0</number>
</property>
<item>
<spacer name="ButtonSpacer" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>198</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="ClearButton" >
<property name="toolTip" >
<string>Clear Selection</string>
</property>
<property name="text" >
<string>New</string>
</property>
<property name="icon" >
<iconset resource="../images/openlp-2.qrc" >
<normaloff>:/services/service_new.png</normaloff>:/services/service_new.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="AddUpdateButton" >
<property name="toolTip" >
<string>Add Update Author</string>
</property>
<property name="text" >
<string>Save</string>
</property>
<property name="icon" >
<iconset resource="../images/openlp-2.qrc" >
<normaloff>:/services/service_save.png</normaloff>:/services/service_save.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="DeleteButton" >
<property name="toolTip" >
<string>Delete Author</string>
</property>
<property name="text" >
<string>Delete</string>
</property>
<property name="icon" >
<iconset resource="../images/openlp-2.qrc" >
<normaloff>:/services/service_delete.png</normaloff>:/services/service_delete.png</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox" >
<property name="toolTip" >
<string>Exit Screen</string>
</property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons" >
<set>QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../images/openlp-2.qrc"/>
<include location="../images/openlp-2.qrc" />
</resources>
<connections>
<connection>
@ -181,11 +203,11 @@
<receiver>AuthorsDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<hint type="sourcelabel" >
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<hint type="destinationlabel" >
<x>157</x>
<y>274</y>
</hint>
@ -197,11 +219,11 @@
<receiver>AuthorsDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<hint type="sourcelabel" >
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<hint type="destinationlabel" >
<x>286</x>
<y>274</y>
</hint>

View File

@ -1,119 +1,187 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<ui version="4.0" >
<class>SongBookDialog</class>
<widget class="QDialog" name="SongBookDialog">
<property name="geometry">
<widget class="QDialog" name="SongBookDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>387</width>
<height>500</height>
<height>531</height>
</rect>
</property>
<property name="windowTitle">
<property name="windowTitle" >
<string>Book Song Maintenance</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0" colspan="2">
<widget class="QTableWidget" name="BookSongListView"/>
<layout class="QVBoxLayout" name="DialogLayout" >
<property name="spacing" >
<number>8</number>
</property>
<property name="margin" >
<number>8</number>
</property>
<item>
<widget class="QTableWidget" name="BookSongListView" />
</item>
<item row="1" column="0" colspan="2">
<widget class="QGroupBox" name="SongBookGroup">
<property name="title">
<item>
<widget class="QGroupBox" name="SongBookGroup" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>200</height>
</size>
</property>
<property name="title" >
<string>Song Book</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="NameLabel">
<property name="text">
<string>Name:</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="4">
<widget class="QLineEdit" name="NameEdit"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="PublisherLabel">
<property name="text">
<string>Publisher:</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="4">
<widget class="QLineEdit" name="PublisherEdit"/>
</item>
<item row="2" column="0" colspan="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<layout class="QVBoxLayout" name="SongBookLayout" >
<property name="spacing" >
<number>8</number>
</property>
<property name="margin" >
<number>8</number>
</property>
<item>
<widget class="QWidget" native="1" name="DetailsWidget" >
<property name="minimumSize" >
<size>
<width>198</width>
<height>20</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
<layout class="QFormLayout" name="DetailsLayout" >
<property name="horizontalSpacing" >
<number>8</number>
</property>
<property name="verticalSpacing" >
<number>8</number>
</property>
<property name="margin" >
<number>0</number>
</property>
<item row="0" column="0" >
<widget class="QLabel" name="NameLabel" >
<property name="text" >
<string>Name:</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="NameEdit" />
</item>
<item row="1" column="0" >
<widget class="QLabel" name="PublisherLabel" >
<property name="text" >
<string>Publisher:</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="PublisherEdit" />
</item>
</layout>
</widget>
</item>
<item row="2" column="3">
<widget class="QPushButton" name="DeleteButton">
<property name="toolTip">
<string>Delete Author</string>
<item>
<widget class="QLabel" name="MessageLabel" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<property name="text" >
<string/>
</property>
<property name="icon">
<iconset resource="../images/openlp-2.qrc">
<normaloff>:/services/service_delete.png</normaloff>:/services/service_delete.png</iconset>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QPushButton" name="AddUpdateButton">
<property name="toolTip">
<string>Add Update Author</string>
<item>
<widget class="QWidget" native="1" name="ButtonWidget" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images/openlp-2.qrc">
<normaloff>:/system/system_settings.png</normaloff>:/system/system_settings.png</iconset>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QPushButton" name="ClearButton">
<property name="toolTip">
<string>Clear Selection</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images/openlp-2.qrc">
<normaloff>:/songs/song_edit.png</normaloff>:/songs/song_edit.png</iconset>
<property name="minimumSize" >
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<layout class="QHBoxLayout" name="ButtonLayout" >
<property name="spacing" >
<number>8</number>
</property>
<property name="margin" >
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>61</width>
<height>24</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="ClearButton" >
<property name="toolTip" >
<string>Clear Selection</string>
</property>
<property name="text" >
<string>New</string>
</property>
<property name="icon" >
<iconset resource="../images/openlp-2.qrc" >
<normaloff>:/services/service_new.png</normaloff>:/services/service_new.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="AddUpdateButton" >
<property name="toolTip" >
<string>Add Update Author</string>
</property>
<property name="text" >
<string>Save</string>
</property>
<property name="icon" >
<iconset resource="../images/openlp-2.qrc" >
<normaloff>:/services/service_save.png</normaloff>:/services/service_save.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="DeleteButton" >
<property name="toolTip" >
<string>Delete Author</string>
</property>
<property name="text" >
<string>Delete</string>
</property>
<property name="icon" >
<iconset resource="../images/openlp-2.qrc" >
<normaloff>:/services/service_delete.png</normaloff>:/services/service_delete.png</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="MessageLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDialogButtonBox" name="ButtonBox">
<property name="orientation">
<item>
<widget class="QDialogButtonBox" name="ButtonBox" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<property name="standardButtons" >
<set>QDialogButtonBox::Ok</set>
</property>
</widget>
@ -121,7 +189,7 @@
</layout>
</widget>
<resources>
<include location="../images/openlp-2.qrc"/>
<include location="../images/openlp-2.qrc" />
</resources>
<connections>
<connection>
@ -130,11 +198,11 @@
<receiver>SongBookDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<hint type="sourcelabel" >
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<hint type="destinationlabel" >
<x>157</x>
<y>274</y>
</hint>
@ -146,11 +214,11 @@
<receiver>SongBookDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<hint type="sourcelabel" >
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<hint type="destinationlabel" >
<x>286</x>
<y>274</y>
</hint>