diff --git a/.eric4project/openlp.org 2.0.e4q b/.eric4project/openlp.org 2.0.e4q
index f59541818..75dbab402 100644
--- a/.eric4project/openlp.org 2.0.e4q
+++ b/.eric4project/openlp.org 2.0.e4q
@@ -1,7 +1,7 @@
-
+
\ No newline at end of file
diff --git a/.eric4project/openlp.org 2.0.e4t b/.eric4project/openlp.org 2.0.e4t
index 8111b28fe..8ba6fb92d 100644
--- a/.eric4project/openlp.org 2.0.e4t
+++ b/.eric4project/openlp.org 2.0.e4t
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/openlp/core/mediamanageritem.py b/openlp/core/mediamanageritem.py
index 2d9b0875f..957401c24 100644
--- a/openlp/core/mediamanageritem.py
+++ b/openlp/core/mediamanageritem.py
@@ -41,6 +41,7 @@ class MediaManagerItem(QtGui.QWidget):
if title is not None:
self.Title = title
self.Toolbar = None
+ #self.ToolbarButtons = []
def addToolbar(self):
"""
@@ -60,6 +61,46 @@ class MediaManagerItem(QtGui.QWidget):
self.ToolbarLayout.setObjectName('ToolbarLayout')
def addToolbarItem(self, item):
+ """
+ A method to help developers easily add any control to the toolbar.
+ """
if self.Toolbar is None:
self.addToolbar()
self.ToolbarLayout.addWidget(item)
+
+ def addToolbarButton(self, title, tooltip, icon, slot=None, objectname=None):
+ """
+ A method to help developers easily add a button to the toolbar.
+ """
+ ToolbarButton = QtGui.QToolButton(self.Toolbar)
+ ToolbarButton.setText(QtCore.QObject.trUtf8(title))
+ ToolbarButton.setToolTip(QtCore.QObject.trUtf8(tooltip))
+ if type(icon) is QtGui.QIcon:
+ ButtonIcon = icon
+ elif type(icon) is types.StringType:
+ ButtonIcon = QtGui.QIcon()
+ if icon.startswith(':/'):
+ ButtonIcon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal,
+ QtGui.QIcon.Off)
+ else:
+ ButtonIcon.addPixmap(QtGui.QPixmap.fromImage(QtGui.QImage(icon)),
+ QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ ToolbarButton.setIcon(ButtonIcon)
+ ToolbarButton.setIconSize(QtCore.QSize(20, 20))
+ ToolbarButton.setAutoRaise(True)
+ if objectname is not None:
+ ToolbarButton.setObjectName(objectname)
+ if slot is not None:
+ QtCore.QObject.connect(ToolbarButton, QtCore.SIGNAL("clicked()"), slot)
+ self.addToolbarItem(ToolbarButton)
+
+ def addToolbarLine(self):
+ ToolbarLine = QtGui.QFrame(self.Toolbar)
+ ToolbarLine.setMinimumSize(QtCore.QSize(0, 0))
+ ToolbarLine.setFrameShadow(QtGui.QFrame.Sunken)
+ ToolbarLine.setLineWidth(1)
+ ToolbarLine.setMidLineWidth(0)
+ ToolbarLine.setFrameShape(QtGui.QFrame.VLine)
+ ToolbarLine.setFrameShadow(QtGui.QFrame.Sunken)
+ ToolbarLine.setObjectName('ToolbarLine')
+ self.addToolbarItem(ToolbarLine)
diff --git a/openlp/plugins/song/songplugin.py b/openlp/plugins/song/songplugin.py
new file mode 100644
index 000000000..2174540b1
--- /dev/null
+++ b/openlp/plugins/song/songplugin.py
@@ -0,0 +1,86 @@
+# -*- coding: utf-8 -*-
+# vim: autoindent shiftwidth=4 expandtab textwidth=80
+"""
+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.resources import *
+from openlp.core import Plugin, MediaManagerItem
+
+class SongPlugin(Plugin):
+ def __init__(self):
+ # Call the parent constructor
+ Plugin.__init__('Song', '1.9.0')
+ # 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, 'Songs')
+ # 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.addToolbarLine()
+ ## 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')
+ ## Spacer ##
+ self.SongSpacerItem = QtGui.QSpacerItem(40, 20,
+ QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+ self.MediaManagerItem.addToolbarItem(self.SongSpacerItem)
+ # Add the songlist widget
+ self.SongList = QtGui.QTableWidget(self.MediaManagerItem)
+ self.SongList.setObjectName("SongList")
+ self.SongList.setColumnCount(0)
+ self.SongList.setRowCount(0)
+ self.MediaManagerItem.PageLayout.addWidget(self.SongList)
+
+ def onSongNewClick(self):
+ pass
+
+ def onSongEditClick(self):
+ pass
+
+ def onSongDeleteClick(self):
+ pass
+
+ def onSongPreviewClick(self):
+ pass
+
+ def onSongLiveClick(self):
+ pass
+
+ def onSongAddClick(self):
+ pass