forked from openlp/openlp
Added a WinRegistry helper class, made a few changes.
bzr-revno: 150
This commit is contained in:
parent
0179ffc6bd
commit
026388ce18
@ -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: 2008-11-30, 21:56:54 -->
|
||||
<!-- Saved: 2008-12-01, 15:10:04 -->
|
||||
<!-- Copyright (C) 2008 Raoul Snyman, raoulsnyman@openlp.org -->
|
||||
<UserProject version="4.0">
|
||||
</UserProject>
|
@ -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: 2008-11-30, 21:56:54 -->
|
||||
<!-- Saved: 2008-12-01, 15:10:04 -->
|
||||
<Tasks version="4.2">
|
||||
<Task priority="1" completed="False" bugfix="False">
|
||||
<Summary>TODO: what is the tags for bridge, pre-chorus?</Summary>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Project SYSTEM "Project-4.4.dtd">
|
||||
<!-- eric4 project file for project openlp.org 2.0 -->
|
||||
<!-- Saved: 2008-11-30, 21:56:54 -->
|
||||
<!-- Saved: 2008-12-01, 15:10:04 -->
|
||||
<!-- Copyright (C) 2008 Raoul Snyman, raoulsnyman@openlp.org -->
|
||||
<Project version="4.4">
|
||||
<ProgLanguage mixed="0">Python</ProgLanguage>
|
||||
@ -21,8 +21,6 @@
|
||||
<Source>openlp/__init__.py</Source>
|
||||
<Source>demo.py</Source>
|
||||
<Source>openlp/core/settingsmanager.py</Source>
|
||||
<Source>openlp/core/plugin.py</Source>
|
||||
<Source>openlp/core/xmlrootclass.py</Source>
|
||||
<Source>openlp/plugins/biblemanager/__init__.py</Source>
|
||||
<Source>openlp/plugins/biblemanager/test/__init__.py</Source>
|
||||
<Source>openlp/plugins/biblemanager/test/test_bibleManager.py</Source>
|
||||
@ -38,8 +36,6 @@
|
||||
<Source>openlp/plugins/test/test_mediamanageritem.py</Source>
|
||||
<Source>openlp/plugins/biblemanager/test/test_bibleManagerOSIS.py</Source>
|
||||
<Source>openlp/core/pluginmanager.py</Source>
|
||||
<Source>openlp/core/mediamanageritem.py</Source>
|
||||
<Source>openlp/core/settingstab.py</Source>
|
||||
<Source>openlp/core/ui/__init__.py</Source>
|
||||
<Source>openlp/core/ui/mainwindow.py</Source>
|
||||
<Source>openlp/core/ui/splashscreen.py</Source>
|
||||
@ -64,7 +60,6 @@
|
||||
<Source>openlp/plugins/songs/test/test_song_verse.py</Source>
|
||||
<Source>openlp/plugins/songs/test/test_song_text.py</Source>
|
||||
<Source>openlp/core/theme/test/test_theme.py</Source>
|
||||
<Source>openlp/core/event.py</Source>
|
||||
<Source>openlp/core/resources.py</Source>
|
||||
<Source>openlp/plugins/biblemanager/bibleplugin.py</Source>
|
||||
<Source>openlp/plugins/biblemanager/bibleOSISImpl.py</Source>
|
||||
@ -78,6 +73,13 @@
|
||||
<Source>openlp/plugins/biblemanager/forms/bibleimportform.py</Source>
|
||||
<Source>openlp/plugins/biblemanager/forms/bibleimportprogressform.py</Source>
|
||||
<Source>openlp/plugins/biblemanager/forms/bibleimportprogressdialog.py</Source>
|
||||
<Source>openlp/core/lib/__init__.py</Source>
|
||||
<Source>openlp/core/lib/xmlrootclass.py</Source>
|
||||
<Source>openlp/core/lib/settingstab.py</Source>
|
||||
<Source>openlp/core/lib/plugin.py</Source>
|
||||
<Source>openlp/core/lib/mediamanageritem.py</Source>
|
||||
<Source>openlp/core/lib/event.py</Source>
|
||||
<Source>openlp/core/lib/winregistry.py</Source>
|
||||
</Sources>
|
||||
<Forms>
|
||||
<Form>resources/forms/bibleimport.ui</Form>
|
||||
|
@ -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']
|
||||
|
@ -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
|
||||
|
@ -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']
|
||||
|
29
openlp/core/lib/winregistry.py
Normal file
29
openlp/core/lib/winregistry.py
Normal file
@ -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
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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=\
|
||||
'''<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
@ -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)
|
||||
|
@ -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")
|
||||
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user