diff --git a/.eric4project/openlp.org 2.0.e4q b/.eric4project/openlp.org 2.0.e4q index 1ed051586..b562652af 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 5ea0330db..7620ff7d6 100644 --- a/.eric4project/openlp.org 2.0.e4t +++ b/.eric4project/openlp.org 2.0.e4t @@ -1,7 +1,7 @@ - + TODO: what is the tags for bridge, pre-chorus? diff --git a/openlp.org 2.0.e4p b/openlp.org 2.0.e4p index 9e1812d1b..dc213d1db 100644 --- a/openlp.org 2.0.e4p +++ b/openlp.org 2.0.e4p @@ -1,7 +1,7 @@ - + Python @@ -21,8 +21,6 @@ openlp/__init__.py demo.py openlp/core/settingsmanager.py - openlp/core/plugin.py - openlp/core/xmlrootclass.py openlp/plugins/biblemanager/__init__.py openlp/plugins/biblemanager/test/__init__.py openlp/plugins/biblemanager/test/test_bibleManager.py @@ -38,8 +36,6 @@ openlp/plugins/test/test_mediamanageritem.py openlp/plugins/biblemanager/test/test_bibleManagerOSIS.py openlp/core/pluginmanager.py - openlp/core/mediamanageritem.py - openlp/core/settingstab.py openlp/core/ui/__init__.py openlp/core/ui/mainwindow.py openlp/core/ui/splashscreen.py @@ -64,7 +60,6 @@ openlp/plugins/songs/test/test_song_verse.py openlp/plugins/songs/test/test_song_text.py openlp/core/theme/test/test_theme.py - openlp/core/event.py openlp/core/resources.py openlp/plugins/biblemanager/bibleplugin.py openlp/plugins/biblemanager/bibleOSISImpl.py @@ -78,6 +73,13 @@ openlp/plugins/biblemanager/forms/bibleimportform.py openlp/plugins/biblemanager/forms/bibleimportprogressform.py openlp/plugins/biblemanager/forms/bibleimportprogressdialog.py + openlp/core/lib/__init__.py + openlp/core/lib/xmlrootclass.py + openlp/core/lib/settingstab.py + openlp/core/lib/plugin.py + openlp/core/lib/mediamanageritem.py + openlp/core/lib/event.py + openlp/core/lib/winregistry.py
resources/forms/bibleimport.ui
diff --git a/openlp/core/__init__.py b/openlp/core/__init__.py index 7becad326..82bd7bea9 100644 --- a/openlp/core/__init__.py +++ b/openlp/core/__init__.py @@ -18,12 +18,8 @@ this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ -from openlp.core.render import Renderer -from openlp.core.settingsmanager import SettingsManager -from openlp.core.plugin import Plugin -from openlp.core.pluginmanager import PluginManager -from openlp.core.settingstab import SettingsTab -from openlp.core.mediamanageritem import MediaManagerItem +from render import Renderer +from settingsmanager import SettingsManager +from pluginmanager import PluginManager -__all__ = ['Renderer', 'SettingsManager', 'Plugin', 'PluginManager', - 'SettingsTab', 'MediaManagerItem'] +__all__ = ['Renderer', 'SettingsManager', 'PluginManager'] diff --git a/openlp/core/interpolate.py b/openlp/core/interpolate.py index 437d97970..f2a48dd06 100644 --- a/openlp/core/interpolate.py +++ b/openlp/core/interpolate.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 """ OpenLP - Open Source Lyrics Projection Copyright (c) 2008 Raoul Snyman diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 8b1378917..3ce58ddde 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -1 +1,29 @@ +# -*- 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 plugin import Plugin +from settingstab import SettingsTab +from mediamanageritem import MediaManagerItem +from event import Event +from xmlrootclass import XmlRootClass +from winregistry import WinRegistry + +__all__ = ['Plugin', 'SettingsTab', 'MediaManagerItem', 'Event', 'XmlRootClass', + 'WinRegistry'] diff --git a/openlp/core/lib/winregistry.py b/openlp/core/lib/winregistry.py new file mode 100644 index 000000000..dc622dd65 --- /dev/null +++ b/openlp/core/lib/winregistry.py @@ -0,0 +1,29 @@ +# -*- 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 +""" + +import _winreg + +class WinRegistry(object): + """ + The WinRegistry class is a high-level wrapper class for the Windows registry + functions in Python. + """ + def __init__(self): + pass diff --git a/openlp/core/lib/xmlrootclass.py b/openlp/core/lib/xmlrootclass.py index 982b0eb23..e96ba6546 100644 --- a/openlp/core/lib/xmlrootclass.py +++ b/openlp/core/lib/xmlrootclass.py @@ -1,106 +1,108 @@ -""" -OpenLP - Open Source Lyrics Projection -Copyright (c) 2008 Raoul Snyman -Portions copyright (c) 2008 Martin Thompson, Tim Bentley, Carsten Tinggaard - -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 -""" - -import platform -import sys -import os -from types import StringType, NoneType, UnicodeType -sys.path.append(os.path.abspath("./../..")) - -ver = platform.python_version() -if ver >= '2.5': - from xml.etree.ElementTree import ElementTree, XML -else: - from elementtree import ElementTree, XML - - -# borrowed from theme - can be common -DelphiColors={"clRed":0xFF0000, - "clBlack":0x000000, - "clWhite":0xFFFFFF} - -class XmlRootClass(object): - """Root class for themes, songs etc - - provides interface for parsing xml files into object attributes - """ - def _setFromXml(self, xml, rootTag): - """Set song properties from given xml content - - xml (string) -- formatted as xml tags and values - rootTag -- main tag of the xml - """ - root=ElementTree(element=XML(xml)) - iter=root.getiterator() - for element in iter: - if element.tag != rootTag: - t=element.text - #print element.tag, t, type(t) - if type(t) == NoneType: # easy! - val=t - elif type(t) == UnicodeType : - val=t - elif type(t) == StringType: # strings need special handling to sort the colours out - #print "str", - if t[0] == "$": # might be a hex number - #print "hex", - try: - val=int(t[1:], 16) - except ValueError: # nope - #print "nope", - pass - elif DelphiColors.has_key(t): - #print "colour", - val=DelphiColors[t] - else: - #print "last chance", - try: - val=int(t) - #print "int", - except ValueError: - #print "give up", - val=t - if (element.tag.find("Color") > 0 or - (element.tag.find("BackgroundParameter") == 0 and type(val) == type(0))): - # convert to a QtGui.Color - val= QtGui.QColor((val>>16) & 0xFF, (val>>8)&0xFF, val&0xFF) - #print [val] - setattr(self,element.tag, val) - pass - - def __str__(self): - """Return string with all public attributes - - The string is formatted with one attribute per line - If the string is split on newline then the length of the - list is equal to the number of attributes - """ - l = [] - for k in dir(self): - if not k.startswith("_"): - l.append("%30s : %s" %(k,getattr(self,k))) - return "\n".join(l) - - def _get_as_string(self): - """Return one string with all public attributes""" - s="" - for k in dir(self): - if not k.startswith("_"): - s+= "_%s_" %(getattr(self,k)) - return s - +# -*- 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, Carsten Tinggaard + +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 +""" + +import platform +import sys +import os +from types import StringType, NoneType, UnicodeType +sys.path.append(os.path.abspath("./../..")) + +ver = platform.python_version() +if ver >= '2.5': + from xml.etree.ElementTree import ElementTree, XML +else: + from elementtree import ElementTree, XML + + +# borrowed from theme - can be common +DelphiColors={"clRed":0xFF0000, + "clBlack":0x000000, + "clWhite":0xFFFFFF} + +class XmlRootClass(object): + """Root class for themes, songs etc + + provides interface for parsing xml files into object attributes + """ + def _setFromXml(self, xml, rootTag): + """Set song properties from given xml content + + xml (string) -- formatted as xml tags and values + rootTag -- main tag of the xml + """ + root=ElementTree(element=XML(xml)) + iter=root.getiterator() + for element in iter: + if element.tag != rootTag: + t=element.text + #print element.tag, t, type(t) + if type(t) == NoneType: # easy! + val=t + elif type(t) == UnicodeType : + val=t + elif type(t) == StringType: # strings need special handling to sort the colours out + #print "str", + if t[0] == "$": # might be a hex number + #print "hex", + try: + val=int(t[1:], 16) + except ValueError: # nope + #print "nope", + pass + elif DelphiColors.has_key(t): + #print "colour", + val=DelphiColors[t] + else: + #print "last chance", + try: + val=int(t) + #print "int", + except ValueError: + #print "give up", + val=t + if (element.tag.find("Color") > 0 or + (element.tag.find("BackgroundParameter") == 0 and type(val) == type(0))): + # convert to a QtGui.Color + val= QtGui.QColor((val>>16) & 0xFF, (val>>8)&0xFF, val&0xFF) + #print [val] + setattr(self,element.tag, val) + pass + + def __str__(self): + """Return string with all public attributes + + The string is formatted with one attribute per line + If the string is split on newline then the length of the + list is equal to the number of attributes + """ + l = [] + for k in dir(self): + if not k.startswith("_"): + l.append("%30s : %s" %(k,getattr(self,k))) + return "\n".join(l) + + def _get_as_string(self): + """Return one string with all public attributes""" + s="" + for k in dir(self): + if not k.startswith("_"): + s+= "_%s_" %(getattr(self,k)) + return s + diff --git a/openlp/core/pluginmanager.py b/openlp/core/pluginmanager.py index 6537ad5df..3d92e5c85 100644 --- a/openlp/core/pluginmanager.py +++ b/openlp/core/pluginmanager.py @@ -21,7 +21,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA import os, sys import logging -from openlp.core import Plugin +from openlp.core.lib import Plugin, Event # Not sure what this is for. I prefer keeping as much code in the class as possible. mypath=os.path.split(os.path.abspath(__file__))[0] @@ -76,7 +76,7 @@ class PluginManager(object): plugin = p() self.plugin_by_name[plugin.Name] = plugin; - def hook_media_manager(self, MediaToolBox): + def hookMediaManager(self, mediatoolbox): """ Loop through all the plugins. If a plugin has a valid media manager item, add it to the media manager. @@ -86,5 +86,7 @@ class PluginManager(object): media_manager_item = plugin.getMediaManagerItem() if media_manager_item is not None: log.debug('Inserting media manager item from %s' % plugin.Name) - MediaToolBox.addItem(media_manager_item, plugin.Icon, plugin.Name) + mediatoolbox.addItem(media_manager_item, plugin.Icon, plugin.Name) + def hookHandleEvent(self, event): + pass diff --git a/openlp/core/render.py b/openlp/core/render.py index 1b59d0371..05172db2c 100644 --- a/openlp/core/render.py +++ b/openlp/core/render.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 """ OpenLP - Open Source Lyrics Projection Copyright (c) 2008 Raoul Snyman diff --git a/openlp/core/theme/theme.py b/openlp/core/theme/theme.py index 8218504c9..30f05736d 100644 --- a/openlp/core/theme/theme.py +++ b/openlp/core/theme/theme.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 """ OpenLP - Open Source Lyrics Projection Copyright (c) 2008 Raoul Snyman @@ -22,7 +24,7 @@ import os from PyQt4 import QtGui sys.path.append(os.path.abspath("./../..")) -from openlp.core.xmlrootclass import XmlRootClass +from openlp.core.lib import XmlRootClass blankstylexml=\ ''' diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 92df782ff..ed383727e 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -160,7 +160,7 @@ class MainWindow(object): self.MediaToolBox.setObjectName("MediaToolBox") # This is where we will eventually get the Plugin Manager to pull in # the media manager items. - self.plugin_manager.hook_media_manager(self.MediaToolBox) + self.plugin_manager.hookMediaManager(self.MediaToolBox) # End adding media manager items. self.MediaManagerLayout.addWidget(self.MediaToolBox) self.MediaManagerDock.setWidget(self.MediaManagerContents) diff --git a/openlp/core/utils/ConfigHelper.py b/openlp/core/utils/ConfigHelper.py index 788f57436..5eae42851 100644 --- a/openlp/core/utils/ConfigHelper.py +++ b/openlp/core/utils/ConfigHelper.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 """ OpenLP - Open Source Lyrics Projection Copyright (c) 2008 Raoul Snyman @@ -18,33 +20,35 @@ Place, Suite 330, Boston, MA 02111-1307 USA import os -# Utility Helper to allow classes to find directories in a standard manner +class ConfigHelper(object): + """ + Utility Helper to allow classes to find directories in a standard manner. + """ + def get_registry_value(reg, key, value_name): + k = _winreg.OpenKey(reg, key) + value = _winreg.QueryValueEx(k, value_name)[0] + _winreg.CloseKey(k) + return value -def get_registry_value(reg, key, value_name): - k = _winreg.OpenKey(reg, key) - value = _winreg.QueryValueEx(k, value_name)[0] - _winreg.CloseKey(k) - return value + def getConfigPath(): + if os.name == 'nt': + import _winreg + reg = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE) + key = r"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" + path = get_registry_value(reg, key, "Common AppData") + elif os.name == 'posix': + path = os.path.join(os.getenv('HOME'), ".openlp.org") + if os.path.exists(path) == False : + raise Exception ('Configuration Directory does not Exist ') + return path -def getConfigPath(): - if os.name == 'nt': - import _winreg - reg = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE) - key = r"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" - path = get_registry_value(reg, key, "Common AppData") - elif os.name == 'posix': - path = os.path.join(os.getenv('HOME'), ".openlp.org") - if os.path.exists(path) == False : - raise Exception ('Configuration Directory does not Exist ') - return path + def getSongsFile(): + path = getConfigPath() + songfile = os.path.join(path, ".openlp.org", "Data", "songs.olp") + if os.path.exists(songfile): + filename.set_filename(songfile) + print songfile -def getSongsFile(): - path = getConfigPath() - songfile = os.path.join(path, ".openlp.org", "Data", "songs.olp") - if os.path.exists(songfile): - filename.set_filename(songfile) - print songfile - -def getBiblePath(): - return os.path.join(getConfigPath(), "Data","Bibles") + def getBiblePath(): + return os.path.join(getConfigPath(), "Data","Bibles") diff --git a/openlp/plugins/songs/forms/__init__.py b/openlp/plugins/songs/forms/__init__.py index e69de29bb..84167c096 100644 --- a/openlp/plugins/songs/forms/__init__.py +++ b/openlp/plugins/songs/forms/__init__.py @@ -0,0 +1,22 @@ +# -*- 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 editsongform import EditSongForm + diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 486f98fdd..a732d5e6e 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -1,190 +1,201 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'C:\Project Folders\Personal Projects\openlp-2\trunk\openlp\resources\forms\editsongform.ui' -# -# Created: Wed Nov 05 20:55:02 2008 -# by: PyQt4 UI code generator 4.4.4-snapshot-20080918 -# -# WARNING! All changes made in this file will be lost! - -from PyQt4 import QtCore, QtGui - -from openlp.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() +# -*- 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() diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index afde28134..6ec5fdc74 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- -# vim: autoindent shiftwidth=4 expandtab textwidth=80 +# 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 +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 @@ -21,11 +21,13 @@ Place, Suite 330, Boston, MA 02111-1307 USA from PyQt4 import QtCore, QtGui from openlp.core.resources import * from openlp.core import Plugin, MediaManagerItem +from forms import EditSongForm class SongsPlugin(Plugin): def __init__(self): # Call the parent constructor Plugin.__init__(self, 'Songs', '1.9.0') + self.edit_song_form = EditSongForm() def getMediaManagerItem(self): # Create the plugin icon @@ -70,7 +72,7 @@ class SongsPlugin(Plugin): pass def onSongEditClick(self): - pass + self.edit_song_form.show() def onSongDeleteClick(self): pass