Updates to UI plugins

bzr-revno: 213
This commit is contained in:
Tim Bentley 2008-12-11 21:07:12 +00:00
parent 691e84fb02
commit eb1b1010c0
5 changed files with 174 additions and 12 deletions

View File

@ -88,6 +88,15 @@ class BiblePlugin(Plugin):
self.QuickVersionLabel.setObjectName('QuickVersionLabel') self.QuickVersionLabel.setObjectName('QuickVersionLabel')
self.QuickVersionLabel.setText('Version:') self.QuickVersionLabel.setText('Version:')
self.QuickLayout.addWidget(self.QuickVersionLabel, 0, 0, 1, 1) self.QuickLayout.addWidget(self.QuickVersionLabel, 0, 0, 1, 1)
self.QuickSearchComboBox = QtGui.QComboBox(self.QuickTab)
self.QuickSearchComboBox.setObjectName('SearchComboBox')
self.QuickLayout.addWidget(self.QuickSearchComboBox, 1, 1, 1, 2)
self.QuickSearchLabel = QtGui.QLabel(self.QuickTab)
self.QuickSearchLabel .setObjectName('QuickSearchLabel')
self.QuickSearchLabel .setText('Search Type:')
self.QuickLayout.addWidget(self.QuickSearchLabel, 1, 0, 1, 1)
self.QuickSearchLabel = QtGui.QLabel(self.QuickTab) self.QuickSearchLabel = QtGui.QLabel(self.QuickTab)
self.QuickSearchLabel.setObjectName('QuickSearchLabel') self.QuickSearchLabel.setObjectName('QuickSearchLabel')
self.QuickSearchLabel.setText('Find:') self.QuickSearchLabel.setText('Find:')
@ -208,6 +217,8 @@ class BiblePlugin(Plugin):
def _initialiseForm(self): def _initialiseForm(self):
bibles = self.biblemanager.getBibles() bibles = self.biblemanager.getBibles()
self.QuickSearchComboBox.addItem("Text Search")
self.QuickSearchComboBox.addItem("Verse Search")
first = True first = True
for b in bibles: # load bibles into the combo boxes for b in bibles: # load bibles into the combo boxes
self.QuickVersionComboBox.addItem(b) self.QuickVersionComboBox.addItem(b)

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,89 @@
# -*- 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 *
from openlp.core.lib import Plugin, MediaManagerItem
#from forms import EditSongForm
class SongsPlugin(Plugin):
def __init__(self):
# Call the parent constructor
Plugin.__init__(self, 'Presentations', '1.9.0')
self.Weight = -8
#self.edit_song_form = EditSongForm()
def getMediaManagerItem(self):
# Create the plugin icon
self.Icon = QtGui.QIcon()
self.Icon.addPixmap(QtGui.QPixmap(':/media/media_song.png'),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
# Create the MediaManagerItem object
self.MediaManagerItem = MediaManagerItem(self.Icon, 'Presentations')
# Add a toolbar
self.MediaManagerItem.addToolbar()
# Create buttons for the toolbar
## New Song Button ##
self.MediaManagerItem.addToolbarButton('New Song', 'Add a new song',
':/songs/song_new.png', self.onSongNewClick, 'SongNewItem')
## Edit Song Button ##
self.MediaManagerItem.addToolbarButton('Edit Song', 'Edit the selected song',
':/songs/song_edit.png', self.onSongEditClick, 'SongEditItem')
## Delete Song Button ##
self.MediaManagerItem.addToolbarButton('Delete Song', 'Delete the selected song',
':/songs/song_delete.png', self.onSongDeleteClick, 'SongDeleteItem')
## Separator Line ##
self.MediaManagerItem.addToolbarSeparator()
## Preview Song Button ##
self.MediaManagerItem.addToolbarButton('Preview Song', 'Preview the selected song',
':/system/system_preview.png', self.onSongPreviewClick, 'SongPreviewItem')
## Live Song Button ##
self.MediaManagerItem.addToolbarButton('Go Live', 'Send the selected song live',
':/system/system_live.png', self.onSongLiveClick, 'SongLiveItem')
## Add Song Button ##
self.MediaManagerItem.addToolbarButton('Add Song To Service',
'Add the selected song(s) to the service', ':/system/system_add.png',
self.onSongAddClick, 'SongAddItem')
## Add the songlist widget ##
self.listView = QtGui.QListWidget()
self.listView.setGeometry(QtCore.QRect(10, 100, 256, 591))
self.listView.setObjectName("listView")
self.MediaManagerItem.PageLayout.addWidget(self.listView)
return self.MediaManagerItem
def onSongNewClick(self):
pass
def onSongEditClick(self):
self.edit_song_form.show()
def onSongDeleteClick(self):
pass
def onSongPreviewClick(self):
pass
def onSongLiveClick(self):
pass
def onSongAddClick(self):
pass

View File

@ -62,11 +62,53 @@ class SongsPlugin(Plugin):
'Add the selected song(s) to the service', ':/system/system_add.png', 'Add the selected song(s) to the service', ':/system/system_add.png',
self.onSongAddClick, 'SongAddItem') self.onSongAddClick, 'SongAddItem')
## Add the songlist widget ## ## Add the songlist widget ##
self.SongList = QtGui.QTableWidget(self.MediaManagerItem)
self.SongList.setObjectName("SongList") # Create the tab widget
self.SongList.setColumnCount(0) self.SongGroupBox = QtGui.QGroupBox(self.MediaManagerItem)
self.SongList.setRowCount(0) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.MediaManagerItem.PageLayout.addWidget(self.SongList) sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SongGroupBox.sizePolicy().hasHeightForWidth())
self.SongGroupBox.setSizePolicy(sizePolicy)
self.SongGroupBox.setObjectName('SearchTabWidget')
self.QuickLayout = QtGui.QGridLayout(self.SongGroupBox)
self.QuickLayout.setObjectName('QuickLayout')
self.SearchTypeComboBox = QtGui.QComboBox(self.SongGroupBox)
self.SearchTypeComboBox.setObjectName('VersionComboBox')
self.QuickLayout.addWidget(self.SearchTypeComboBox, 0, 1, 1, 2)
self.SearchTypeLabel = QtGui.QLabel(self.SongGroupBox)
self.SearchTypeLabel.setObjectName('SearchTypeLabel')
self.SearchTypeLabel.setText('Search Type:')
self.QuickLayout.addWidget(self.SearchTypeLabel, 0, 0, 1, 1)
self.SearchTextLabel = QtGui.QLabel(self.SongGroupBox)
self.SearchTextLabel.setObjectName('SearchTextLabel')
self.SearchTextLabel.setText('Search Text:')
self.QuickLayout.addWidget(self.SearchTextLabel, 2, 0, 1, 1)
self.SearchTextEdit = QtGui.QLineEdit(self.SongGroupBox)
self.SearchTextEdit.setObjectName('SearchTextEdit')
self.QuickLayout.addWidget(self.SearchTextEdit, 2, 1, 1, 2)
self.SearchTextButton = QtGui.QPushButton(self.SongGroupBox)
self.SearchTextButton.setObjectName('SearchTextButton')
self.SearchTextButton.setText('Search')
self.QuickLayout.addWidget(self.SearchTextButton, 3, 2, 1, 1)
QuickSpacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.QuickLayout.addItem(QuickSpacerItem, 4, 2, 1, 1)
# Add the search tab widget to the page layout
self.MediaManagerItem.PageLayout.addWidget(self.SongGroupBox)
self.listView = QtGui.QListWidget()
self.listView.setGeometry(QtCore.QRect(10, 100, 256, 591))
self.listView.setObjectName("listView")
self.MediaManagerItem.PageLayout.addWidget(self.listView)
self.SearchTypeComboBox.addItem("Lyrics")
self.SearchTypeComboBox.addItem("Authors")
self.SearchTypeComboBox.addItem("Titles")
return self.MediaManagerItem return self.MediaManagerItem
def onSongNewClick(self): def onSongNewClick(self):

View File

@ -31,21 +31,21 @@
<widget class="QToolBox" name="ImportToolBox" > <widget class="QToolBox" name="ImportToolBox" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>0</x> <x>10</x>
<y>0</y> <y>0</y>
<width>481</width> <width>471</width>
<height>431</height> <height>431</height>
</rect> </rect>
</property> </property>
<property name="currentIndex" > <property name="currentIndex" >
<number>0</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="FileImportPage" > <widget class="QWidget" name="FileImportPage" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>471</width> <width>461</width>
<height>361</height> <height>361</height>
</rect> </rect>
</property> </property>
@ -186,7 +186,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>471</width> <width>461</width>
<height>361</height> <height>361</height>
</rect> </rect>
</property> </property>
@ -434,7 +434,7 @@
</property> </property>
<layout class="QGridLayout" name="gridLayout_3" > <layout class="QGridLayout" name="gridLayout_3" >
<item row="0" column="0" > <item row="0" column="0" >
<widget class="QProgressBar" name="progressBar" > <widget class="QProgressBar" name="ProgressBar" >
<property name="value" > <property name="value" >
<number>0</number> <number>0</number>
</property> </property>
@ -449,6 +449,25 @@
</layout> </layout>
</widget> </widget>
</widget> </widget>
<tabstops>
<tabstop>BibleNameEdit</tabstop>
<tabstop>OSISLocationEdit</tabstop>
<tabstop>OsisFileButton</tabstop>
<tabstop>BooksLocationEdit</tabstop>
<tabstop>BooksFileButton</tabstop>
<tabstop>VerseLocationEdit</tabstop>
<tabstop>VersesFileButton</tabstop>
<tabstop>LocationComboBox</tabstop>
<tabstop>TypeComboBox</tabstop>
<tabstop>BibleComboBox</tabstop>
<tabstop>AddressEdit</tabstop>
<tabstop>UsernameEdit</tabstop>
<tabstop>PasswordEdit</tabstop>
<tabstop>VersionNameEdit</tabstop>
<tabstop>CopyrightEdit</tabstop>
<tabstop>PermisionEdit</tabstop>
<tabstop>BibleImportButtonBox</tabstop>
</tabstops>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>