2009-07-23 20:20:49 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
|
|
|
|
2009-09-29 02:54:32 +00:00
|
|
|
###############################################################################
|
|
|
|
# OpenLP - Open Source Lyrics Projection #
|
|
|
|
# --------------------------------------------------------------------------- #
|
2011-12-27 10:33:55 +00:00
|
|
|
# Copyright (c) 2008-2012 Raoul Snyman #
|
|
|
|
# Portions copyright (c) 2008-2012 Tim Bentley, Gerald Britton, Jonathan #
|
2011-05-26 16:25:54 +00:00
|
|
|
# Corwin, Michael Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, #
|
2011-05-26 17:11:22 +00:00
|
|
|
# Armin Köhler, Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias #
|
2011-06-12 16:02:52 +00:00
|
|
|
# Põldaru, Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith, #
|
2011-06-12 15:41:01 +00:00
|
|
|
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund #
|
2009-09-29 02:54:32 +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 #
|
|
|
|
###############################################################################
|
2009-07-23 20:20:49 +00:00
|
|
|
|
|
|
|
from PyQt4 import QtCore, QtGui
|
2009-09-29 02:54:32 +00:00
|
|
|
|
2011-02-16 17:54:31 +00:00
|
|
|
from openlp.core.lib import build_icon
|
2012-04-01 22:44:09 +00:00
|
|
|
from openlp.core.lib.ui import UiStrings, create_button_box
|
2011-02-11 21:17:56 +00:00
|
|
|
from openlp.plugins.songs.lib.ui import SongStrings
|
2009-07-23 20:20:49 +00:00
|
|
|
|
|
|
|
class Ui_SongMaintenanceDialog(object):
|
2011-01-04 21:06:50 +00:00
|
|
|
def setupUi(self, songMaintenanceDialog):
|
|
|
|
songMaintenanceDialog.setObjectName(u'songMaintenanceDialog')
|
|
|
|
songMaintenanceDialog.setWindowModality(QtCore.Qt.ApplicationModal)
|
|
|
|
songMaintenanceDialog.resize(10, 350)
|
|
|
|
self.dialogLayout = QtGui.QGridLayout(songMaintenanceDialog)
|
|
|
|
self.dialogLayout.setObjectName(u'dialogLayout')
|
|
|
|
self.typeListWidget = QtGui.QListWidget(songMaintenanceDialog)
|
|
|
|
self.typeListWidget.setIconSize(QtCore.QSize(32, 32))
|
|
|
|
self.typeListWidget.setUniformItemSizes(True)
|
|
|
|
self.typeListWidget.setObjectName(u'typeListWidget')
|
|
|
|
self.listItemAuthors = QtGui.QListWidgetItem(self.typeListWidget)
|
|
|
|
self.listItemAuthors.setIcon(
|
|
|
|
build_icon(u':/songs/author_maintenance.png'))
|
|
|
|
self.listItemTopics = QtGui.QListWidgetItem(self.typeListWidget)
|
|
|
|
self.listItemTopics.setIcon(
|
|
|
|
build_icon(u':/songs/topic_maintenance.png'))
|
|
|
|
self.listItemBooks = QtGui.QListWidgetItem(self.typeListWidget)
|
|
|
|
self.listItemBooks.setIcon(
|
|
|
|
build_icon(u':/songs/book_maintenance.png'))
|
|
|
|
self.dialogLayout.addWidget(self.typeListWidget, 0, 0)
|
|
|
|
self.stackedLayout = QtGui.QStackedLayout()
|
|
|
|
self.stackedLayout.setObjectName(u'stackedLayout')
|
|
|
|
# authors page
|
|
|
|
self.authorsPage = QtGui.QWidget(songMaintenanceDialog)
|
|
|
|
self.authorsPage.setObjectName(u'authorsPage')
|
|
|
|
self.authorsLayout = QtGui.QVBoxLayout(self.authorsPage)
|
|
|
|
self.authorsLayout.setObjectName(u'authorsLayout')
|
|
|
|
self.authorsListWidget = QtGui.QListWidget(self.authorsPage)
|
|
|
|
self.authorsListWidget.setObjectName(u'authorsListWidget')
|
|
|
|
self.authorsLayout.addWidget(self.authorsListWidget)
|
|
|
|
self.authorsButtonsLayout = QtGui.QHBoxLayout()
|
|
|
|
self.authorsButtonsLayout.setObjectName(u'authorsButtonsLayout')
|
|
|
|
self.authorsButtonsLayout.addStretch()
|
|
|
|
self.authorsAddButton = QtGui.QPushButton(self.authorsPage)
|
|
|
|
self.authorsAddButton.setIcon(build_icon(u':/songs/author_add.png'))
|
|
|
|
self.authorsAddButton.setObjectName(u'authorsAddButton')
|
|
|
|
self.authorsButtonsLayout.addWidget(self.authorsAddButton)
|
|
|
|
self.authorsEditButton = QtGui.QPushButton(self.authorsPage)
|
|
|
|
self.authorsEditButton.setIcon(build_icon(u':/songs/author_edit.png'))
|
|
|
|
self.authorsEditButton.setObjectName(u'authorsEditButton')
|
|
|
|
self.authorsButtonsLayout.addWidget(self.authorsEditButton)
|
|
|
|
self.authorsDeleteButton = QtGui.QPushButton(self.authorsPage)
|
|
|
|
self.authorsDeleteButton.setIcon(
|
|
|
|
build_icon(u':/songs/author_delete.png'))
|
|
|
|
self.authorsDeleteButton.setObjectName(u'authorsDeleteButton')
|
|
|
|
self.authorsButtonsLayout.addWidget(self.authorsDeleteButton)
|
|
|
|
self.authorsLayout.addLayout(self.authorsButtonsLayout)
|
|
|
|
self.stackedLayout.addWidget(self.authorsPage)
|
|
|
|
# topics page
|
|
|
|
self.topicsPage = QtGui.QWidget(songMaintenanceDialog)
|
|
|
|
self.topicsPage.setObjectName(u'topicsPage')
|
|
|
|
self.topicsLayout = QtGui.QVBoxLayout(self.topicsPage)
|
|
|
|
self.topicsLayout.setObjectName(u'topicsLayout')
|
|
|
|
self.topicsListWidget = QtGui.QListWidget(self.topicsPage)
|
|
|
|
self.topicsListWidget.setObjectName(u'topicsListWidget')
|
|
|
|
self.topicsLayout.addWidget(self.topicsListWidget)
|
|
|
|
self.topicsButtonsLayout = QtGui.QHBoxLayout()
|
|
|
|
self.topicsButtonsLayout.setObjectName(u'topicsButtonLayout')
|
|
|
|
self.topicsButtonsLayout.addStretch()
|
|
|
|
self.topicsAddButton = QtGui.QPushButton(self.topicsPage)
|
|
|
|
self.topicsAddButton.setIcon(build_icon(u':/songs/topic_add.png'))
|
|
|
|
self.topicsAddButton.setObjectName(u'topicsAddButton')
|
|
|
|
self.topicsButtonsLayout.addWidget(self.topicsAddButton)
|
|
|
|
self.topicsEditButton = QtGui.QPushButton(self.topicsPage)
|
|
|
|
self.topicsEditButton.setIcon(build_icon(u':/songs/topic_edit.png'))
|
|
|
|
self.topicsEditButton.setObjectName(u'topicsEditButton')
|
|
|
|
self.topicsButtonsLayout.addWidget(self.topicsEditButton)
|
|
|
|
self.topicsDeleteButton = QtGui.QPushButton(self.topicsPage)
|
|
|
|
self.topicsDeleteButton.setIcon(build_icon(u':/songs/topic_delete.png'))
|
|
|
|
self.topicsDeleteButton.setObjectName(u'topicsDeleteButton')
|
|
|
|
self.topicsButtonsLayout.addWidget(self.topicsDeleteButton)
|
|
|
|
self.topicsLayout.addLayout(self.topicsButtonsLayout)
|
|
|
|
self.stackedLayout.addWidget(self.topicsPage)
|
|
|
|
# song books page
|
|
|
|
self.booksPage = QtGui.QWidget(songMaintenanceDialog)
|
|
|
|
self.booksPage.setObjectName(u'booksPage')
|
|
|
|
self.booksLayout = QtGui.QVBoxLayout(self.booksPage)
|
|
|
|
self.booksLayout.setObjectName(u'booksLayout')
|
|
|
|
self.booksListWidget = QtGui.QListWidget(self.booksPage)
|
|
|
|
self.booksListWidget.setObjectName(u'booksListWidget')
|
|
|
|
self.booksLayout.addWidget(self.booksListWidget)
|
|
|
|
self.booksButtonsLayout = QtGui.QHBoxLayout()
|
|
|
|
self.booksButtonsLayout.setObjectName(u'booksButtonLayout')
|
|
|
|
self.booksButtonsLayout.addStretch()
|
|
|
|
self.booksAddButton = QtGui.QPushButton(self.booksPage)
|
|
|
|
self.booksAddButton.setIcon(build_icon(u':/songs/book_add.png'))
|
|
|
|
self.booksAddButton.setObjectName(u'booksAddButton')
|
|
|
|
self.booksButtonsLayout.addWidget(self.booksAddButton)
|
|
|
|
self.booksEditButton = QtGui.QPushButton(self.booksPage)
|
|
|
|
self.booksEditButton.setIcon(build_icon(u':/songs/book_edit.png'))
|
|
|
|
self.booksEditButton.setObjectName(u'booksEditButton')
|
|
|
|
self.booksButtonsLayout.addWidget(self.booksEditButton)
|
|
|
|
self.booksDeleteButton = QtGui.QPushButton(self.booksPage)
|
|
|
|
self.booksDeleteButton.setIcon(build_icon(u':/songs/book_delete.png'))
|
|
|
|
self.booksDeleteButton.setObjectName(u'booksDeleteButton')
|
|
|
|
self.booksButtonsLayout.addWidget(self.booksDeleteButton)
|
|
|
|
self.booksLayout.addLayout(self.booksButtonsLayout)
|
|
|
|
self.stackedLayout.addWidget(self.booksPage)
|
|
|
|
#
|
|
|
|
self.dialogLayout.addLayout(self.stackedLayout, 0, 1)
|
2012-04-01 22:44:09 +00:00
|
|
|
self.buttonBox = create_button_box(songMaintenanceDialog, u'buttonBox',
|
|
|
|
[u'close'])
|
2011-01-04 21:06:50 +00:00
|
|
|
self.dialogLayout.addWidget(self.buttonBox, 1, 0, 1, 2)
|
|
|
|
self.retranslateUi(songMaintenanceDialog)
|
|
|
|
self.stackedLayout.setCurrentIndex(0)
|
|
|
|
QtCore.QObject.connect(self.typeListWidget,
|
2009-07-24 22:13:40 +00:00
|
|
|
QtCore.SIGNAL(u'currentRowChanged(int)'),
|
2011-01-04 21:06:50 +00:00
|
|
|
self.stackedLayout.setCurrentIndex)
|
2009-07-23 20:20:49 +00:00
|
|
|
|
2011-01-04 21:06:50 +00:00
|
|
|
def retranslateUi(self, songMaintenanceDialog):
|
2011-02-16 17:54:31 +00:00
|
|
|
songMaintenanceDialog.setWindowTitle(SongStrings.SongMaintenance)
|
2011-02-11 21:17:56 +00:00
|
|
|
self.listItemAuthors.setText(SongStrings.Authors)
|
|
|
|
self.listItemTopics.setText(SongStrings.Topics)
|
|
|
|
self.listItemBooks.setText(SongStrings.SongBooks)
|
2011-04-15 21:43:59 +00:00
|
|
|
self.authorsAddButton.setText(UiStrings().Add)
|
|
|
|
self.authorsEditButton.setText(UiStrings().Edit)
|
|
|
|
self.authorsDeleteButton.setText(UiStrings().Delete)
|
|
|
|
self.topicsAddButton.setText(UiStrings().Add)
|
|
|
|
self.topicsEditButton.setText(UiStrings().Edit)
|
|
|
|
self.topicsDeleteButton.setText(UiStrings().Delete)
|
|
|
|
self.booksAddButton.setText(UiStrings().Add)
|
|
|
|
self.booksEditButton.setText(UiStrings().Edit)
|
|
|
|
self.booksDeleteButton.setText(UiStrings().Delete)
|
2011-02-11 21:17:56 +00:00
|
|
|
typeListWidth = max(self.fontMetrics().width(SongStrings.Authors),
|
|
|
|
self.fontMetrics().width(SongStrings.Topics),
|
|
|
|
self.fontMetrics().width(SongStrings.SongBooks))
|
2011-01-09 00:27:46 +00:00
|
|
|
self.typeListWidget.setFixedWidth(typeListWidth +
|
2011-05-24 20:47:05 +00:00
|
|
|
self.typeListWidget.iconSize().width() + 32)
|