This commit is contained in:
Jonathan Corwin 2010-02-27 11:29:10 +00:00
commit 117ad2d848
42 changed files with 329 additions and 194 deletions

View File

@ -10,3 +10,5 @@ openlp.org 2.0.e4*
documentation/build/html documentation/build/html
documentation/build/doctrees documentation/build/doctrees
*.log* *.log*
dist
OpenLP.egg-info

12
MANIFEST.in Normal file
View File

@ -0,0 +1,12 @@
recursive-include openlp *.py
recursive-include openlp *.sqlite
recursive-include openlp *.csv
recursive-include documentation *
recursive-include resources/forms *
recursive-include resources/i18n *
recursive-include resources/images *
recursive-include scripts *.py
include resources/*.desktop
include copyright.txt
include LICENSE
include openlp/.version

View File

@ -35,7 +35,7 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import Receiver, str_to_bool from openlp.core.lib import Receiver, str_to_bool
from openlp.core.resources import qInitResources from openlp.core.resources import qInitResources
from openlp.core.ui import MainWindow, SplashScreen, ScreenList from openlp.core.ui import MainWindow, SplashScreen, ScreenList
from openlp.core.utils import ConfigHelper from openlp.core.utils import get_config_directory, ConfigHelper
log = logging.getLogger() log = logging.getLogger()
@ -158,7 +158,7 @@ def main():
parser.add_option("-s", "--style", dest="style", parser.add_option("-s", "--style", dest="style",
help="Set the Qt4 style (passed directly to Qt4).") help="Set the Qt4 style (passed directly to Qt4).")
# Set up logging # Set up logging
filename = u'openlp.log' filename = os.path.join(get_config_directory(), u'openlp.log')
logfile = FileHandler(filename, u'w') logfile = FileHandler(filename, u'w')
logfile.setFormatter(logging.Formatter( logfile.setFormatter(logging.Formatter(
u'%(asctime)s %(name)-15s %(levelname)-8s %(message)s')) u'%(asctime)s %(name)-15s %(levelname)-8s %(message)s'))

View File

@ -25,10 +25,10 @@
import logging import logging
from PyQt4 import QtGui, QtCore from PyQt4 import QtCore
from renderer import Renderer from renderer import Renderer
from openlp.core.lib import ThemeLevel, resize_image from openlp.core.lib import ThemeLevel
class RenderManager(object): class RenderManager(object):
""" """

View File

@ -72,6 +72,7 @@ class ServiceItem(object):
self._raw_frames = [] self._raw_frames = []
self._display_frames = [] self._display_frames = []
self._uuid = unicode(uuid.uuid1()) self._uuid = unicode(uuid.uuid1())
self.autoPreviewAllowed = False
def addIcon(self, icon): def addIcon(self, icon):
""" """
@ -200,7 +201,8 @@ class ServiceItem(object):
u'icon':self.icon, u'icon':self.icon,
u'footer':self.raw_footer, u'footer':self.raw_footer,
u'type':self.service_item_type, u'type':self.service_item_type,
u'audit':self.audit u'audit':self.audit,
u'preview':self.autoPreviewAllowed
} }
service_data = [] service_data = []
if self.service_item_type == ServiceItemType.Text: if self.service_item_type == ServiceItemType.Text:
@ -234,6 +236,7 @@ class ServiceItem(object):
self.addIcon(header[u'icon']) self.addIcon(header[u'icon'])
self.raw_footer = header[u'footer'] self.raw_footer = header[u'footer']
self.audit = header[u'audit'] self.audit = header[u'audit']
self.autoPreviewAllowed = header[u'preview']
if self.service_item_type == ServiceItemType.Text: if self.service_item_type == ServiceItemType.Text:
for slide in serviceitem[u'serviceitem'][u'data']: for slide in serviceitem[u'serviceitem'][u'data']:
self._raw_frames.append(slide) self._raw_frames.append(slide)

View File

@ -30,7 +30,7 @@ from PyQt4 import QtGui
DelphiColors={"clRed":0xFF0000, DelphiColors={"clRed":0xFF0000,
"clBlue":0x0000FF, "clBlue":0x0000FF,
"clYellow":0x0FFFF00, "clYellow":0xFFFF00,
"clBlack":0x000000, "clBlack":0x000000,
"clWhite":0xFFFFFF} "clWhite":0xFFFFFF}
@ -113,6 +113,7 @@ class Theme(object):
root = ElementTree(element=XML(xml)) root = ElementTree(element=XML(xml))
iter = root.getiterator() iter = root.getiterator()
for element in iter: for element in iter:
delphiColorChange = False
if element.tag != u'Theme': if element.tag != u'Theme':
t = element.text t = element.text
val = 0 val = 0
@ -128,6 +129,7 @@ class Theme(object):
pass pass
elif DelphiColors.has_key(t): elif DelphiColors.has_key(t):
val = DelphiColors[t] val = DelphiColors[t]
delphiColorChange = True
else: else:
try: try:
val = int(t) val = int(t)
@ -136,7 +138,10 @@ class Theme(object):
if (element.tag.find(u'Color') > 0 or if (element.tag.find(u'Color') > 0 or
(element.tag.find(u'BackgroundParameter') == 0 and type(val) == type(0))): (element.tag.find(u'BackgroundParameter') == 0 and type(val) == type(0))):
# convert to a wx.Colour # convert to a wx.Colour
val = QtGui.QColor((val>>16) & 0xFF, (val>>8)&0xFF, val&0xFF) if not delphiColorChange:
val = QtGui.QColor(val&0xFF, (val>>8)&0xFF, (val>>16)&0xFF)
else:
val = QtGui.QColor((val>>16)&0xFF, (val>>8)&0xFF, val&0xFF)
setattr(self, element.tag, val) setattr(self, element.tag, val)
def __str__(self): def __str__(self):

View File

@ -25,7 +25,6 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import build_icon
from aboutdialog import Ui_AboutDialog from aboutdialog import Ui_AboutDialog
class AboutForm(QtGui.QDialog, Ui_AboutDialog): class AboutForm(QtGui.QDialog, Ui_AboutDialog):

View File

@ -87,6 +87,10 @@ class GeneralTab(SettingsTab):
self.SaveCheckServiceCheckBox.setObjectName(u'SaveCheckServiceCheckBox') self.SaveCheckServiceCheckBox.setObjectName(u'SaveCheckServiceCheckBox')
self.SettingsLayout.addWidget(self.SaveCheckServiceCheckBox) self.SettingsLayout.addWidget(self.SaveCheckServiceCheckBox)
self.GeneralLeftLayout.addWidget(self.SettingsGroupBox) self.GeneralLeftLayout.addWidget(self.SettingsGroupBox)
self.AutoPreviewCheckBox = QtGui.QCheckBox(self.SettingsGroupBox)
self.AutoPreviewCheckBox.setObjectName(u'AutoPreviewCheckBox')
self.SettingsLayout.addWidget(self.AutoPreviewCheckBox)
self.GeneralLeftLayout.addWidget(self.SettingsGroupBox)
self.GeneralLeftSpacer = QtGui.QSpacerItem(20, 40, self.GeneralLeftSpacer = QtGui.QSpacerItem(20, 40,
QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.GeneralLeftLayout.addItem(self.GeneralLeftSpacer) self.GeneralLeftLayout.addItem(self.GeneralLeftSpacer)
@ -137,6 +141,8 @@ class GeneralTab(SettingsTab):
QtCore.SIGNAL(u'stateChanged(int)'), self.onShowSplashCheckBoxChanged) QtCore.SIGNAL(u'stateChanged(int)'), self.onShowSplashCheckBoxChanged)
QtCore.QObject.connect(self.SaveCheckServiceCheckBox, QtCore.QObject.connect(self.SaveCheckServiceCheckBox,
QtCore.SIGNAL(u'stateChanged(int)'), self.onSaveCheckServiceCheckBox) QtCore.SIGNAL(u'stateChanged(int)'), self.onSaveCheckServiceCheckBox)
QtCore.QObject.connect(self.AutoPreviewCheckBox,
QtCore.SIGNAL(u'stateChanged(int)'), self.onAutoPreviewCheckBox)
QtCore.QObject.connect(self.NumberEdit, QtCore.QObject.connect(self.NumberEdit,
QtCore.SIGNAL(u'editingFinished()'), self.onNumberEditLostFocus) QtCore.SIGNAL(u'editingFinished()'), self.onNumberEditLostFocus)
QtCore.QObject.connect(self.UsernameEdit, QtCore.QObject.connect(self.UsernameEdit,
@ -153,6 +159,7 @@ class GeneralTab(SettingsTab):
self.ShowSplashCheckBox.setText(self.trUtf8('Show the splash screen')) self.ShowSplashCheckBox.setText(self.trUtf8('Show the splash screen'))
self.SettingsGroupBox.setTitle(self.trUtf8('Application Settings')) self.SettingsGroupBox.setTitle(self.trUtf8('Application Settings'))
self.SaveCheckServiceCheckBox.setText(self.trUtf8('Prompt to save Service before starting New')) self.SaveCheckServiceCheckBox.setText(self.trUtf8('Prompt to save Service before starting New'))
self.AutoPreviewCheckBox.setText(self.trUtf8('Preview Next Song from Service Manager'))
self.CCLIGroupBox.setTitle(self.trUtf8('CCLI Details')) self.CCLIGroupBox.setTitle(self.trUtf8('CCLI Details'))
self.NumberLabel.setText(self.trUtf8('CCLI Number:')) self.NumberLabel.setText(self.trUtf8('CCLI Number:'))
self.UsernameLabel.setText(self.trUtf8('SongSelect Username:')) self.UsernameLabel.setText(self.trUtf8('SongSelect Username:'))
@ -173,6 +180,9 @@ class GeneralTab(SettingsTab):
def onSaveCheckServiceCheckBox(self, value): def onSaveCheckServiceCheckBox(self, value):
self.PromptSaveService = (value == QtCore.Qt.Checked) self.PromptSaveService = (value == QtCore.Qt.Checked)
def onAutoPreviewCheckBox(self, value):
self.AutoPreview = (value == QtCore.Qt.Checked)
def onNumberEditLostFocus(self): def onNumberEditLostFocus(self):
self.CCLINumber = self.NumberEdit.displayText() self.CCLINumber = self.NumberEdit.displayText()
@ -194,6 +204,7 @@ class GeneralTab(SettingsTab):
self.AutoOpen = str_to_bool(self.config.get_config(u'auto open', u'False')) self.AutoOpen = str_to_bool(self.config.get_config(u'auto open', u'False'))
self.ShowSplash = str_to_bool(self.config.get_config(u'show splash', u'True')) self.ShowSplash = str_to_bool(self.config.get_config(u'show splash', u'True'))
self.PromptSaveService = str_to_bool(self.config.get_config(u'save prompt', u'False')) self.PromptSaveService = str_to_bool(self.config.get_config(u'save prompt', u'False'))
self.AutoPreview = str_to_bool(self.config.get_config(u'auto preview', u'False'))
self.CCLINumber = unicode(self.config.get_config(u'ccli number', u'')) self.CCLINumber = unicode(self.config.get_config(u'ccli number', u''))
self.Username = unicode(self.config.get_config(u'songselect username', u'')) self.Username = unicode(self.config.get_config(u'songselect username', u''))
self.Password = unicode(self.config.get_config(u'songselect password', u'')) self.Password = unicode(self.config.get_config(u'songselect password', u''))
@ -203,6 +214,7 @@ class GeneralTab(SettingsTab):
self.WarningCheckBox.setChecked(self.Warning) self.WarningCheckBox.setChecked(self.Warning)
self.AutoOpenCheckBox.setChecked(self.AutoOpen) self.AutoOpenCheckBox.setChecked(self.AutoOpen)
self.ShowSplashCheckBox.setChecked(self.ShowSplash) self.ShowSplashCheckBox.setChecked(self.ShowSplash)
self.AutoPreviewCheckBox.setChecked(self.AutoPreview)
self.NumberEdit.setText(self.CCLINumber) self.NumberEdit.setText(self.CCLINumber)
self.UsernameEdit.setText(self.Username) self.UsernameEdit.setText(self.Username)
self.PasswordEdit.setText(self.Password) self.PasswordEdit.setText(self.Password)
@ -213,6 +225,7 @@ class GeneralTab(SettingsTab):
self.config.set_config(u'auto open', self.AutoOpen) self.config.set_config(u'auto open', self.AutoOpen)
self.config.set_config(u'show splash', self.ShowSplash) self.config.set_config(u'show splash', self.ShowSplash)
self.config.set_config(u'save prompt', self.PromptSaveService) self.config.set_config(u'save prompt', self.PromptSaveService)
self.config.set_config(u'auto preview', self.AutoPreview)
self.config.set_config(u'ccli number', self.CCLINumber) self.config.set_config(u'ccli number', self.CCLINumber)
self.config.set_config(u'songselect username', self.Username) self.config.set_config(u'songselect username', self.Username)
self.config.set_config(u'songselect password', self.Password) self.config.set_config(u'songselect password', self.Password)

View File

@ -25,7 +25,6 @@
import logging import logging
import os import os
import time
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from PyQt4.phonon import Phonon from PyQt4.phonon import Phonon
@ -203,7 +202,7 @@ class MainDisplay(DisplayWidget):
if not self.primary: if not self.primary:
self.setVisible(True) self.setVisible(True)
self.showFullScreen() self.showFullScreen()
self.generateAlert() Receiver.send_message(u'flush_alert')
def addImageWithText(self, frame): def addImageWithText(self, frame):
frame = resize_image(frame, frame = resize_image(frame,

View File

@ -52,12 +52,17 @@ media_manager_style = """
} }
""" """
class versionThread(QtCore.QThread): class versionThread(QtCore.QThread):
def __init__(self, parent): def __init__(self, parent, app_version, generalConfig):
QtCore.QThread.__init__(self, parent) QtCore.QThread.__init__(self, parent)
self.parent = parent self.parent = parent
self.app_version = app_version
self.generalConfig = generalConfig
def run (self): def run (self):
time.sleep(2) time.sleep(2)
Receiver.send_message(u'version_check') version = check_latest_version(self.generalConfig, self.app_version)
#new version has arrived
if version != self.app_version:
Receiver.send_message(u'version_check', u'%s' % version)
class Ui_MainWindow(object): class Ui_MainWindow(object):
@ -536,20 +541,18 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
log.info(u'Load data from Settings') log.info(u'Load data from Settings')
self.settingsForm.postSetUp() self.settingsForm.postSetUp()
def versionCheck(self): def versionCheck(self, version):
""" """
Checks the version of the Application called from openlp.pyw Checks the version of the Application called from openlp.pyw
""" """
app_version = self.applicationVersion[u'full'] app_version = self.applicationVersion[u'full']
version = check_latest_version(self.generalConfig, app_version) version_text = unicode(self.trUtf8('OpenLP version %s has been updated '
if app_version != version: 'to version %s\n\nYou can obtain the latest version from http://openlp.org'))
version_text = unicode(self.trUtf8('OpenLP version %s has been updated ' QtGui.QMessageBox.question(self,
'to version %s\n\nYou can obtain the latest version from http://openlp.org')) self.trUtf8('OpenLP Version Updated'),
QtGui.QMessageBox.question(self, version_text % (app_version, version),
self.trUtf8('OpenLP Version Updated'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
version_text % (app_version, version), QtGui.QMessageBox.Ok)
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
QtGui.QMessageBox.Ok)
def getMonitorNumber(self): def getMonitorNumber(self):
""" """
@ -584,7 +587,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
QtGui.QMessageBox.Ok) QtGui.QMessageBox.Ok)
def versionThread(self): def versionThread(self):
vT = versionThread(self) app_version = self.applicationVersion[u'full']
vT = versionThread(self, app_version, self.generalConfig)
vT.start() vT.start()
def onHelpAboutItemClicked(self): def onHelpAboutItemClicked(self):

View File

@ -30,8 +30,8 @@ import zipfile
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import PluginConfig, OpenLPToolbar, ServiceItem, \ from openlp.core.lib import PluginConfig, OpenLPToolbar, ServiceItem, \
ServiceItemType, contextMenuAction, contextMenuSeparator, contextMenu, \ contextMenuAction, contextMenuSeparator, contextMenu, Receiver, \
Receiver, contextMenu, str_to_bool contextMenu, str_to_bool
class ServiceManagerList(QtGui.QTreeWidget): class ServiceManagerList(QtGui.QTreeWidget):
@ -573,13 +573,15 @@ class ServiceManager(QtGui.QWidget):
self.regenerateServiceItems() self.regenerateServiceItems()
def regenerateServiceItems(self): def regenerateServiceItems(self):
#force reset of renderer as theme data has changed
self.parent.RenderManager.themedata = None
if len(self.serviceItems) > 0: if len(self.serviceItems) > 0:
tempServiceItems = self.serviceItems tempServiceItems = self.serviceItems
self.onNewService() self.onNewService()
for item in tempServiceItems: for item in tempServiceItems:
self.addServiceItem(item[u'service_item']) self.addServiceItem(item[u'service_item'], True)
def addServiceItem(self, item): def addServiceItem(self, item, rebuild=False):
""" """
Add a Service item to the list Add a Service item to the list
@ -606,6 +608,9 @@ class ServiceManager(QtGui.QWidget):
u'order': len(self.serviceItems)+1, u'order': len(self.serviceItems)+1,
u'expanded':True}) u'expanded':True})
self.repaintServiceList(sitem + 1, 0) self.repaintServiceList(sitem + 1, 0)
#if rebuilding list make sure live is fixed.
if rebuild:
self.parent.LiveController.replaceServiceManagerItem(item)
self.parent.serviceChanged(False, self.serviceName) self.parent.serviceChanged(False, self.serviceName)
def makePreview(self): def makePreview(self):
@ -616,6 +621,7 @@ class ServiceManager(QtGui.QWidget):
self.parent.PreviewController.addServiceManagerItem( self.parent.PreviewController.addServiceManagerItem(
self.serviceItems[item][u'service_item'], count) self.serviceItems[item][u'service_item'], count)
def makeLive(self): def makeLive(self):
""" """
Send the current item to the Live slide controller Send the current item to the Live slide controller
@ -623,6 +629,13 @@ class ServiceManager(QtGui.QWidget):
item, count = self.findServiceItem() item, count = self.findServiceItem()
self.parent.LiveController.addServiceManagerItem( self.parent.LiveController.addServiceManagerItem(
self.serviceItems[item][u'service_item'], count) self.serviceItems[item][u'service_item'], count)
if str_to_bool(PluginConfig(u'General').
get_config(u'auto preview', u'False')):
item += 1
if len(self.serviceItems) > 0 and item < len(self.serviceItems) and \
self.serviceItems[item][u'service_item'].autoPreviewAllowed:
self.parent.PreviewController.addServiceManagerItem(
self.serviceItems[item][u'service_item'], 0)
def remoteEdit(self): def remoteEdit(self):
""" """

View File

@ -144,6 +144,7 @@ class SlideController(QtGui.QWidget):
self.PreviewListWidget.setEditTriggers( self.PreviewListWidget.setEditTriggers(
QtGui.QAbstractItemView.NoEditTriggers) QtGui.QAbstractItemView.NoEditTriggers)
self.PreviewListWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.PreviewListWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.PreviewListWidget.setAlternatingRowColors(True)
self.ControllerLayout.addWidget(self.PreviewListWidget) self.ControllerLayout.addWidget(self.PreviewListWidget)
# Build the full toolbar # Build the full toolbar
self.Toolbar = OpenLPToolbar(self) self.Toolbar = OpenLPToolbar(self)

View File

@ -34,8 +34,8 @@ from PyQt4 import QtCore, QtGui
from openlp.core.ui import AmendThemeForm from openlp.core.ui import AmendThemeForm
from openlp.core.theme import Theme from openlp.core.theme import Theme
from openlp.core.lib import PluginConfig, OpenLPToolbar, contextMenuAction, \ from openlp.core.lib import PluginConfig, OpenLPToolbar, contextMenuAction, \
ThemeXML, ThemeLevel, str_to_bool, get_text_file_string, build_icon, \ ThemeXML, str_to_bool, get_text_file_string, build_icon, Receiver, \
Receiver, contextMenuSeparator contextMenuSeparator
from openlp.core.utils import ConfigHelper from openlp.core.utils import ConfigHelper
class ThemeManager(QtGui.QWidget): class ThemeManager(QtGui.QWidget):
@ -313,17 +313,23 @@ class ThemeManager(QtGui.QWidget):
filexml = None filexml = None
themename = None themename = None
for file in zip.namelist(): for file in zip.namelist():
if file.endswith(os.path.sep): osfile = unicode(QtCore.QDir.toNativeSeparators(file))
theme_dir = os.path.join(dir, file) theme_dir = None
if osfile.endswith(os.path.sep):
theme_dir = os.path.join(dir, osfile)
if not os.path.exists(theme_dir): if not os.path.exists(theme_dir):
os.mkdir(os.path.join(dir, file)) os.mkdir(os.path.join(dir, osfile))
else: else:
fullpath = os.path.join(dir, file) fullpath = os.path.join(dir, osfile)
names = file.split(os.path.sep) names = osfile.split(os.path.sep)
if len(names) > 1: if len(names) > 1:
# not preview file # not preview file
if themename is None: if themename is None:
themename = names[0] themename = names[0]
if theme_dir is None:
theme_dir = os.path.join(dir, names[0])
if not os.path.exists(theme_dir):
os.mkdir(os.path.join(dir, names[0]))
xml_data = zip.read(file) xml_data = zip.read(file)
if os.path.splitext(file)[1].lower() in [u'.xml']: if os.path.splitext(file)[1].lower() in [u'.xml']:
if self.checkVersion1(xml_data): if self.checkVersion1(xml_data):
@ -335,7 +341,7 @@ class ThemeManager(QtGui.QWidget):
outfile = open(fullpath, u'w') outfile = open(fullpath, u'w')
outfile.write(filexml) outfile.write(filexml)
else: else:
outfile = open(fullpath, u'w') outfile = open(fullpath, u'wb')
outfile.write(zip.read(file)) outfile.write(zip.read(file))
self.generateAndSaveImage(dir, themename, filexml) self.generateAndSaveImage(dir, themename, filexml)
except: except:
@ -384,7 +390,6 @@ class ThemeManager(QtGui.QWidget):
unicode(theme.BackgroundParameter2.name()), direction) unicode(theme.BackgroundParameter2.name()), direction)
else: else:
newtheme.add_background_image(unicode(theme.BackgroundParameter1)) newtheme.add_background_image(unicode(theme.BackgroundParameter1))
newtheme.add_font(unicode(theme.FontName), newtheme.add_font(unicode(theme.FontName),
unicode(theme.FontColor.name()), unicode(theme.FontColor.name()),
unicode(theme.FontProportion * 3), u'False') unicode(theme.FontProportion * 3), u'False')
@ -397,9 +402,14 @@ class ThemeManager(QtGui.QWidget):
shadow = True shadow = True
if theme.Outline == 1: if theme.Outline == 1:
outline = True outline = True
vAlignCorrection = 0
if theme.VerticalAlign == 2:
vAlignCorrection = 1
elif theme.VerticalAlign == 1:
vAlignCorrection = 2
newtheme.add_display(unicode(shadow), unicode(theme.ShadowColor.name()), newtheme.add_display(unicode(shadow), unicode(theme.ShadowColor.name()),
unicode(outline), unicode(theme.OutlineColor.name()), unicode(outline), unicode(theme.OutlineColor.name()),
unicode(theme.HorizontalAlign), unicode(theme.VerticalAlign), unicode(theme.HorizontalAlign), unicode(vAlignCorrection),
unicode(theme.WrapStyle), unicode(0)) unicode(theme.WrapStyle), unicode(0))
return newtheme.extract_xml() return newtheme.extract_xml()

View File

@ -22,17 +22,12 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59 # # with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
############################################################################### ###############################################################################
import os
import logging import logging
import urllib2 import urllib2
from datetime import datetime from datetime import datetime
from registry import Registry
from confighelper import ConfigHelper
log = logging.getLogger(__name__)
__all__ = ['Registry', 'ConfigHelper']
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
def check_latest_version(config, current_version): def check_latest_version(config, current_version):
@ -54,3 +49,40 @@ def check_latest_version(config, current_version):
if hasattr(e, u'reason'): if hasattr(e, u'reason'):
log.exception(u'Reason for failure: %s', e.reason) log.exception(u'Reason for failure: %s', e.reason)
return version_string return version_string
def get_config_directory():
path = u''
if os.name == u'nt':
path = os.path.join(os.getenv(u'APPDATA'), u'openlp')
elif os.name == u'mac':
path = os.path.join(os.getenv(u'HOME'), u'Library',
u'Application Support', u'openlp')
else:
try:
from xdg import BaseDirectory
path = os.path.join(BaseDirectory.xdg_config_home, u'openlp')
except ImportError:
path = os.path.join(os.getenv(u'HOME'), u'.openlp')
return path
def get_data_directory():
path = u''
if os.name == u'nt':
# ask OS for path to application data, set on Windows XP and Vista
path = os.path.join(os.getenv(u'APPDATA'), u'openlp', u'data')
elif os.name == u'mac':
path = os.path.join(os.getenv(u'HOME'), u'Library',
u'Application Support', u'openlp', u'Data')
else:
try:
from xdg import BaseDirectory
path = os.path.join(BaseDirectory.xdg_data_home, u'openlp')
except ImportError:
path = os.path.join(os.getenv(u'HOME'), u'.openlp', u'data')
return path
from registry import Registry
from confighelper import ConfigHelper
__all__ = [u'Registry', u'ConfigHelper', u'get_config_directory',
u'get_data_directory', u'check_latest_version']

View File

@ -24,6 +24,8 @@
############################################################################### ###############################################################################
import os import os
from openlp.core.utils import get_data_directory, get_config_directory
from openlp.core.utils.registry import Registry from openlp.core.utils.registry import Registry
class ConfigHelper(object): class ConfigHelper(object):
@ -34,20 +36,7 @@ class ConfigHelper(object):
@staticmethod @staticmethod
def get_data_path(): def get_data_path():
if os.name == u'nt': path = get_data_directory()
# ask OS for path to application data, set on Windows XP and Vista
path = os.path.join(os.getenv(u'APPDATA'), u'openlp', u'data')
elif os.name == u'mac':
path = os.path.join(os.getenv(u'HOME'), u'Library',
u'Application Support', u'openlp', u'Data')
else:
try:
from xdg import BaseDirectory
path = os.path.join(BaseDirectory.xdg_data_home, u'openlp')
except ImportError:
path = os.path.join(os.getenv(u'HOME'), u'.openlp', u'data')
#reg = ConfigHelper.get_registry()
#path = ConfigHelper.get_config(u'main', 'data path', path)
if not os.path.exists(path): if not os.path.exists(path):
os.makedirs(path) os.makedirs(path)
return path return path
@ -81,17 +70,7 @@ class ConfigHelper(object):
current operating system, and returns an instantiation of that class. current operating system, and returns an instantiation of that class.
""" """
if ConfigHelper.__registry__ is None: if ConfigHelper.__registry__ is None:
config_path = u'' config_path = get_config_directory()
if os.name == u'nt':
config_path = os.path.join(os.getenv(u'APPDATA'), u'openlp')
elif os.name == u'mac':
config_path = os.path.join(os.getenv(u'HOME'), u'Library',
u'Application Support', u'openlp')
else:
try:
from xdg import BaseDirectory
config_path = os.path.join(BaseDirectory.xdg_config_home, u'openlp')
except ImportError:
config_path = os.path.join(os.getenv(u'HOME'), u'.openlp')
ConfigHelper.__registry__ = Registry(config_path) ConfigHelper.__registry__ = Registry(config_path)
return ConfigHelper.__registry__ return ConfigHelper.__registry__

View File

@ -23,12 +23,11 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
############################################################################### ###############################################################################
from datetime import datetime
import logging import logging
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import Plugin, Receiver, str_to_bool, build_icon, PluginStatus from openlp.core.lib import Plugin, build_icon, PluginStatus
from openlp.plugins.alerts.lib import AlertsManager, DBManager from openlp.plugins.alerts.lib import AlertsManager, DBManager
from openlp.plugins.alerts.forms import AlertsTab, AlertForm, AlertEditForm from openlp.plugins.alerts.forms import AlertsTab, AlertForm, AlertEditForm

View File

@ -23,8 +23,6 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
############################################################################### ###############################################################################
from datetime import date
from PyQt4 import QtGui, QtCore from PyQt4 import QtGui, QtCore
from openlp.plugins.alerts.lib.models import AlertItem from openlp.plugins.alerts.lib.models import AlertItem

View File

@ -23,9 +23,8 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
############################################################################### ###############################################################################
from datetime import date
from PyQt4 import QtGui, QtCore from PyQt4 import QtGui, QtCore
from openlp.plugins.alerts.lib.models import AlertItem from openlp.plugins.alerts.lib.models import AlertItem
from alertdialog import Ui_AlertDialog from alertdialog import Ui_AlertDialog

View File

@ -1,10 +1,33 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# 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 logging import logging
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import str_to_bool, Receiver from openlp.core.lib import Receiver
from openlp.core.lib import SettingsTab
class AlertsManager(QtCore.QObject): class AlertsManager(QtCore.QObject):
""" """
@ -19,6 +42,8 @@ class AlertsManager(QtCore.QObject):
self.parent = parent self.parent = parent
self.timer_id = 0 self.timer_id = 0
self.alertList = [] self.alertList = []
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'flush_alert'), self.generateAlert)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'alert_text'), self.displayAlert) QtCore.SIGNAL(u'alert_text'), self.displayAlert)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),

View File

@ -23,11 +23,10 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
############################################################################### ###############################################################################
import csv
import logging import logging
import os import os
import os.path import os.path
from time import sleep
import csv
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
@ -46,8 +45,8 @@ class DownloadLocation(object):
} }
@classmethod @classmethod
def get_name(class_, id): def get_name(cls, id):
return class_.Names[id] return cls.Names[id]
class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):

View File

@ -27,7 +27,6 @@ import urllib2
import chardet import chardet
import logging import logging
import re import re
import sqlite3
only_verses = re.compile(r'([\w .]+)[ ]+([0-9]+)[ ]*[:|v|V][ ]*([0-9]+)' only_verses = re.compile(r'([\w .]+)[ ]+([0-9]+)[ ]*[:|v|V][ ]*([0-9]+)'
r'(?:[ ]*-[ ]*([0-9]+|end))?(?:[ ]*,[ ]*([0-9]+)(?:[ ]*-[ ]*([0-9]+|end))?)?', r'(?:[ ]*-[ ]*([0-9]+|end))?(?:[ ]*,[ ]*([0-9]+)(?:[ ]*-[ ]*([0-9]+|end))?)?',
@ -167,8 +166,6 @@ class BibleCommon(object):
""" """
A common ancestor for bible download sites. A common ancestor for bible download sites.
""" """
global log
log = logging.getLogger(u'BibleCommon')
log.info(u'BibleCommon') log.info(u'BibleCommon')
def _get_web_text(self, urlstring, proxyurl): def _get_web_text(self, urlstring, proxyurl):

View File

@ -59,7 +59,7 @@ class BibleDB(QtCore.QObject):
``config`` ``config``
The configuration object, passed in from the plugin. The configuration object, passed in from the plugin.
""" """
log.info(u'BibleDBimpl loaded') log.info(u'BibleDB loaded')
QtCore.QObject.__init__(self) QtCore.QObject.__init__(self)
if u'path' not in kwargs: if u'path' not in kwargs:
raise KeyError(u'Missing keyword argument "path".') raise KeyError(u'Missing keyword argument "path".')

View File

@ -35,6 +35,8 @@ from common import BibleCommon, SearchResults
from db import BibleDB from db import BibleDB
from openlp.plugins.bibles.lib.models import Book from openlp.plugins.bibles.lib.models import Book
log = logging.getLogger(__name__)
class HTTPBooks(object): class HTTPBooks(object):
cursor = None cursor = None
@ -119,9 +121,7 @@ class HTTPBooks(object):
class BGExtract(BibleCommon): class BGExtract(BibleCommon):
global log log.info(u'%s BGExtract loaded', __name__)
log = logging.getLogger(u'BibleHTTPMgr(BG_extract)')
log.info(u'BG_extract loaded')
def __init__(self, proxyurl=None): def __init__(self, proxyurl=None):
log.debug(u'init %s', proxyurl) log.debug(u'init %s', proxyurl)
@ -184,7 +184,7 @@ class BGExtract(BibleCommon):
return SearchResults(bookname, chapter, bible) return SearchResults(bookname, chapter, bible)
class CWExtract(BibleCommon): class CWExtract(BibleCommon):
log.info(u'%s loaded', __name__) log.info(u'%s CWExtract loaded', __name__)
def __init__(self, proxyurl=None): def __init__(self, proxyurl=None):
log.debug(u'init %s', proxyurl) log.debug(u'init %s', proxyurl)
@ -229,7 +229,7 @@ class CWExtract(BibleCommon):
class HTTPBible(BibleDB): class HTTPBible(BibleDB):
log.info(u'%s loaded', __name__) log.info(u'%s HTTPBible loaded' , __name__)
def __init__(self, parent, **kwargs): def __init__(self, parent, **kwargs):
""" """

View File

@ -25,7 +25,6 @@
import logging import logging
import os import os
import csv
from common import parse_reference from common import parse_reference
from opensong import OpenSongBible from opensong import OpenSongBible

View File

@ -31,8 +31,6 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, Receiver, str_to_bool, \ from openlp.core.lib import MediaManagerItem, Receiver, str_to_bool, \
BaseListWithDnD BaseListWithDnD
from openlp.plugins.bibles.forms import ImportWizardForm from openlp.plugins.bibles.forms import ImportWizardForm
from openlp.plugins.bibles.lib.manager import BibleMode
from openlp.plugins.bibles.lib.common import parse_reference
class BibleListView(BaseListWithDnD): class BibleListView(BaseListWithDnD):
""" """
@ -45,7 +43,6 @@ class BibleListView(BaseListWithDnD):
def resizeEvent(self, event): def resizeEvent(self, event):
self.parent.onListViewResize(event.size().width(), event.size().width()) self.parent.onListViewResize(event.size().width(), event.size().width())
class BibleMediaItem(MediaManagerItem): class BibleMediaItem(MediaManagerItem):
""" """
This is the custom media manager item for Bibles. This is the custom media manager item for Bibles.
@ -437,6 +434,7 @@ class BibleMediaItem(MediaManagerItem):
raw_slides = [] raw_slides = []
raw_footer = [] raw_footer = []
bible_text = u'' bible_text = u''
service_item.autoPreviewAllowed = True
#If we want to use a 2nd translation / version #If we want to use a 2nd translation / version
bible2 = u'' bible2 = u''
if self.SearchTabWidget.currentIndex() == 0: if self.SearchTabWidget.currentIndex() == 0:
@ -472,12 +470,12 @@ class BibleMediaItem(MediaManagerItem):
verse_text = self.formatVerse(old_chapter, chapter, verse, u'', u'') verse_text = self.formatVerse(old_chapter, chapter, verse, u'', u'')
old_chapter = chapter old_chapter = chapter
footer = u'%s (%s %s)' % (book, version, copyright) footer = u'%s (%s %s)' % (book, version, copyright)
#If not found throws and error so add.s #If not found add to footer
if footer not in raw_footer: if footer not in raw_footer:
raw_footer.append(footer) raw_footer.append(footer)
if bible2: if bible2:
footer = u'%s (%s %s)' % (book, version, copyright) footer = u'%s (%s %s)' % (book, version, copyright)
#If not found throws and error so add.s #If not found add to footer
if footer not in raw_footer: if footer not in raw_footer:
raw_footer.append(footer) raw_footer.append(footer)
bible_text = u'%s %s \n\n %s %s' % \ bible_text = u'%s %s \n\n %s %s' % \

View File

@ -23,13 +23,9 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
############################################################################### ###############################################################################
import os
import os.path
import logging import logging
import chardet
import codecs
from lxml import objectify
from lxml import objectify
from PyQt4 import QtCore from PyQt4 import QtCore
from openlp.core.lib import Receiver from openlp.core.lib import Receiver

View File

@ -30,8 +30,6 @@ import chardet
import codecs import codecs
import re import re
from PyQt4 import QtCore
from openlp.core.lib import Receiver from openlp.core.lib import Receiver
from db import BibleDB from db import BibleDB

View File

@ -144,6 +144,7 @@ class CustomMediaItem(MediaManagerItem):
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
else: else:
item_id = self.remoteCustom item_id = self.remoteCustom
service_item.autoPreviewAllowed = True
customSlide = self.parent.custommanager.get_custom(item_id) customSlide = self.parent.custommanager.get_custom(item_id)
title = customSlide.title title = customSlide.title
credit = customSlide.credits credit = customSlide.credits
@ -165,4 +166,4 @@ class CustomMediaItem(MediaManagerItem):
else: else:
raw_footer.append(u'') raw_footer.append(u'')
service_item.raw_footer = raw_footer service_item.raw_footer = raw_footer
return True return True

View File

@ -144,6 +144,7 @@ class ImageMediaItem(MediaManagerItem):
items = self.ListView.selectedIndexes() items = self.ListView.selectedIndexes()
if items: if items:
service_item.title = self.trUtf8('Image(s)') service_item.title = self.trUtf8('Image(s)')
service_item.autoPreviewAllowed = True
for item in items: for item in items:
bitem = self.ListView.item(item.row()) bitem = self.ListView.item(item.row())
filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString()) filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString())

View File

@ -30,6 +30,8 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon
log = logging.getLogger(__name__)
class MediaListView(BaseListWithDnD): class MediaListView(BaseListWithDnD):
def __init__(self, parent=None): def __init__(self, parent=None):
self.PluginName = u'Media' self.PluginName = u'Media'
@ -39,9 +41,7 @@ class MediaMediaItem(MediaManagerItem):
""" """
This is the custom media manager item for Media Slides. This is the custom media manager item for Media Slides.
""" """
global log log.info(u'%s MediaMediaItem loaded', __name__)
log = logging.getLogger(u'MediaMediaItem')
log.info(u'Media Media Item loaded')
def __init__(self, parent, icon, title): def __init__(self, parent, icon, title):
self.PluginNameShort = u'Media' self.PluginNameShort = u'Media'

View File

@ -27,11 +27,12 @@ import logging
from openlp.core.lib import Plugin, build_icon, PluginStatus from openlp.core.lib import Plugin, build_icon, PluginStatus
from openlp.plugins.media.lib import MediaMediaItem from openlp.plugins.media.lib import MediaMediaItem
from PyQt4.phonon import Phonon
log = logging.getLogger(__name__)
class MediaPlugin(Plugin): class MediaPlugin(Plugin):
global log log.info(u'%s MediaPlugin loaded', __name__)
log = logging.getLogger(u'MediaPlugin')
log.info(u'Media Plugin loaded')
def __init__(self, plugin_helpers): def __init__(self, plugin_helpers):
Plugin.__init__(self, u'Media', u'1.9.1', plugin_helpers) Plugin.__init__(self, u'Media', u'1.9.1', plugin_helpers)
@ -40,6 +41,9 @@ class MediaPlugin(Plugin):
# passed with drag and drop messages # passed with drag and drop messages
self.dnd_id = u'Media' self.dnd_id = u'Media'
self.status = PluginStatus.Active self.status = PluginStatus.Active
# print Phonon.BackendCapabilities.availableMimeTypes()
# for mimetype in Phonon.BackendCapabilities.availableMimeTypes():
# print mimetype
def initialise(self): def initialise(self):
log.info(u'Plugin Initialising') log.info(u'Plugin Initialising')

View File

@ -51,17 +51,10 @@ class PresentationTab(SettingsTab):
self.PresentationLeftLayout.setMargin(0) self.PresentationLeftLayout.setMargin(0)
self.VerseDisplayGroupBox = QtGui.QGroupBox(self) self.VerseDisplayGroupBox = QtGui.QGroupBox(self)
self.VerseDisplayGroupBox.setObjectName(u'VerseDisplayGroupBox') self.VerseDisplayGroupBox.setObjectName(u'VerseDisplayGroupBox')
self.VerseDisplayLayout = QtGui.QGridLayout(self.VerseDisplayGroupBox) self.VerseDisplayLayout = QtGui.QVBoxLayout(self.VerseDisplayGroupBox)
self.VerseDisplayLayout.setMargin(8) self.VerseDisplayLayout.setMargin(8)
self.VerseDisplayLayout.setObjectName(u'VerseDisplayLayout') self.VerseDisplayLayout.setObjectName(u'VerseDisplayLayout')
self.VerseTypeWidget = QtGui.QWidget(self.VerseDisplayGroupBox)
self.VerseTypeWidget.setObjectName(u'VerseTypeWidget')
self.VerseTypeLayout = QtGui.QHBoxLayout(self.VerseTypeWidget)
self.VerseTypeLayout.setSpacing(8)
self.VerseTypeLayout.setMargin(0)
self.VerseTypeLayout.setObjectName(u'VerseTypeLayout')
self.PresenterCheckboxes = {} self.PresenterCheckboxes = {}
index = 0
for key in self.controllers: for key in self.controllers:
controller = self.controllers[key] controller = self.controllers[key]
checkbox = QtGui.QCheckBox(self.VerseDisplayGroupBox) checkbox = QtGui.QCheckBox(self.VerseDisplayGroupBox)
@ -69,8 +62,7 @@ class PresentationTab(SettingsTab):
checkbox.setEnabled(controller.available) checkbox.setEnabled(controller.available)
checkbox.setObjectName(controller.name + u'CheckBox') checkbox.setObjectName(controller.name + u'CheckBox')
self.PresenterCheckboxes[controller.name] = checkbox self.PresenterCheckboxes[controller.name] = checkbox
index = index + 1 self.VerseDisplayLayout.addWidget(checkbox)
self.VerseDisplayLayout.addWidget(checkbox, index, 0, 1, 1)
self.PresentationThemeWidget = QtGui.QWidget(self.VerseDisplayGroupBox) self.PresentationThemeWidget = QtGui.QWidget(self.VerseDisplayGroupBox)
self.PresentationThemeWidget.setObjectName(u'PresentationThemeWidget') self.PresentationThemeWidget.setObjectName(u'PresentationThemeWidget')
self.PresentationThemeLayout = QtGui.QHBoxLayout( self.PresentationThemeLayout = QtGui.QHBoxLayout(
@ -96,6 +88,7 @@ class PresentationTab(SettingsTab):
self.PresentationLayout.addWidget(self.PresentationRightWidget) self.PresentationLayout.addWidget(self.PresentationRightWidget)
def retranslateUi(self): def retranslateUi(self):
self.VerseDisplayGroupBox.setTitle(self.trUtf8('Available Controllers'))
for key in self.controllers: for key in self.controllers:
controller = self.controllers[key] controller = self.controllers[key]
checkbox = self.PresenterCheckboxes[controller.name] checkbox = self.PresenterCheckboxes[controller.name]
@ -115,4 +108,4 @@ class PresentationTab(SettingsTab):
controller = self.controllers[key] controller = self.controllers[key]
checkbox = self.PresenterCheckboxes[controller.name] checkbox = self.PresenterCheckboxes[controller.name]
self.config.set_config( self.config.set_config(
controller.name, unicode(checkbox.checkState())) controller.name, unicode(checkbox.checkState()))

View File

@ -33,13 +33,13 @@ from openlp.plugins.songs.forms import EditVerseForm
from openlp.plugins.songs.lib.models import Song from openlp.plugins.songs.lib.models import Song
from editsongdialog import Ui_EditSongDialog from editsongdialog import Ui_EditSongDialog
log = logging.getLogger(__name__)
class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
""" """
Class to manage the editing of a song Class to manage the editing of a song
""" """
global log log.info(u'%s EditSongForm loaded', __name__)
log = logging.getLogger(u'EditSongForm')
log.info(u'Song Editor loaded')
def __init__(self, songmanager, parent=None): def __init__(self, songmanager, parent=None):
""" """

View File

@ -77,6 +77,8 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
def setVerse(self, text, verseCount=0, single=False, tag=u'Verse:1'): def setVerse(self, text, verseCount=0, single=False, tag=u'Verse:1'):
posVerse = 0 posVerse = 0
posSub = 0 posSub = 0
if len(text) == 0:
text = u'---[Verse:1]---\n'
if single: if single:
id = tag.split(u':') id = tag.split(u':')
posVerse = self.VerseListComboBox.findText(id[0], QtCore.Qt.MatchExactly) posVerse = self.VerseListComboBox.findText(id[0], QtCore.Qt.MatchExactly)
@ -112,6 +114,7 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
self.VerseTextEdit.setPlainText(text) self.VerseTextEdit.setPlainText(text)
self.VerseTextEdit.setFocus(QtCore.Qt.OtherFocusReason) self.VerseTextEdit.setFocus(QtCore.Qt.OtherFocusReason)
self.onVerseComboChanged(0) self.onVerseComboChanged(0)
self.VerseTextEdit.moveCursor(QtGui.QTextCursor.Down)
def getVerse(self): def getVerse(self):
return self.VerseTextEdit.toPlainText(), \ return self.VerseTextEdit.toPlainText(), \
@ -119,11 +122,14 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
unicode(self.SubVerseListComboBox.currentText()) unicode(self.SubVerseListComboBox.currentText())
def getVerseAll(self): def getVerseAll(self):
return self.VerseTextEdit.toPlainText() text = self.VerseTextEdit.toPlainText()
if not text.startsWith(u'---['):
text = u'---[Verse:1]---\n%s' % text
return text
def onVerseComboChanged(self, id): def onVerseComboChanged(self, id):
if unicode(self.VerseListComboBox.currentText()) == u'Verse': if unicode(self.VerseListComboBox.currentText()) == u'Verse':
self.SubVerseListComboBox.setEnabled(True) self.SubVerseListComboBox.setEnabled(True)
else: else:
self.SubVerseListComboBox.setEnabled(False) self.SubVerseListComboBox.setEnabled(False)
self.SubVerseListComboBox.setCurrentIndex(0) self.SubVerseListComboBox.setCurrentIndex(0)

View File

@ -290,6 +290,7 @@ class SongMediaItem(MediaManagerItem):
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
else: else:
item_id = self.remoteSong item_id = self.remoteSong
service_item.autoPreviewAllowed = True
song = self.parent.songmanager.get_song(item_id) song = self.parent.songmanager.get_song(item_id)
service_item.theme = song.theme_name service_item.theme = song.theme_name
service_item.edit_enabled = True service_item.edit_enabled = True

View File

@ -23,8 +23,6 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
############################################################################### ###############################################################################
from datetime import date
from PyQt4 import QtGui from PyQt4 import QtGui
from songusagedeletedialog import Ui_SongUsageDeleteDialog from songusagedeletedialog import Ui_SongUsageDeleteDialog

View File

@ -1,69 +1,91 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
# Form implementation generated from reading ui file 'songusagedetaildialog.ui' ###############################################################################
# # OpenLP - Open Source Lyrics Projection #
# Created: Tue Feb 9 07:34:05 2010 # --------------------------------------------------------------------------- #
# by: PyQt4 UI code generator 4.6.2 # Copyright (c) 2008-2010 Raoul Snyman #
# # Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# WARNING! All changes made in this file will be lost! # Gorven, Scott Guerrieri, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# 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 #
###############################################################################
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
class Ui_SongUsageDetailDialog(object): class Ui_SongUsageDetailDialog(object):
def setupUi(self, AuditDetailDialog): def setupUi(self, AuditDetailDialog):
AuditDetailDialog.setObjectName("AuditDetailDialog") AuditDetailDialog.setObjectName(u'AuditDetailDialog')
AuditDetailDialog.resize(609, 413) AuditDetailDialog.resize(609, 413)
self.verticalLayout = QtGui.QVBoxLayout(AuditDetailDialog) self.verticalLayout = QtGui.QVBoxLayout(AuditDetailDialog)
self.verticalLayout.setObjectName("verticalLayout") self.verticalLayout.setObjectName(u'verticalLayout')
self.DateRangeGroupBox = QtGui.QGroupBox(AuditDetailDialog) self.DateRangeGroupBox = QtGui.QGroupBox(AuditDetailDialog)
self.DateRangeGroupBox.setObjectName("DateRangeGroupBox") self.DateRangeGroupBox.setObjectName(u'DateRangeGroupBox')
self.verticalLayout_2 = QtGui.QVBoxLayout(self.DateRangeGroupBox) self.verticalLayout_2 = QtGui.QVBoxLayout(self.DateRangeGroupBox)
self.verticalLayout_2.setObjectName("verticalLayout_2") self.verticalLayout_2.setObjectName(u'verticalLayout_2')
self.DateHorizontalLayout = QtGui.QHBoxLayout() self.DateHorizontalLayout = QtGui.QHBoxLayout()
self.DateHorizontalLayout.setObjectName("DateHorizontalLayout") self.DateHorizontalLayout.setObjectName(u'DateHorizontalLayout')
self.FromDate = QtGui.QCalendarWidget(self.DateRangeGroupBox) self.FromDate = QtGui.QCalendarWidget(self.DateRangeGroupBox)
self.FromDate.setObjectName("FromDate") self.FromDate.setObjectName(u'FromDate')
self.DateHorizontalLayout.addWidget(self.FromDate) self.DateHorizontalLayout.addWidget(self.FromDate)
self.ToLabel = QtGui.QLabel(self.DateRangeGroupBox) self.ToLabel = QtGui.QLabel(self.DateRangeGroupBox)
self.ToLabel.setScaledContents(False) self.ToLabel.setScaledContents(False)
self.ToLabel.setAlignment(QtCore.Qt.AlignCenter) self.ToLabel.setAlignment(QtCore.Qt.AlignCenter)
self.ToLabel.setObjectName("ToLabel") self.ToLabel.setObjectName(u'ToLabel')
self.DateHorizontalLayout.addWidget(self.ToLabel) self.DateHorizontalLayout.addWidget(self.ToLabel)
self.ToDate = QtGui.QCalendarWidget(self.DateRangeGroupBox) self.ToDate = QtGui.QCalendarWidget(self.DateRangeGroupBox)
self.ToDate.setObjectName("ToDate") self.ToDate.setObjectName(u'ToDate')
self.DateHorizontalLayout.addWidget(self.ToDate) self.DateHorizontalLayout.addWidget(self.ToDate)
self.verticalLayout_2.addLayout(self.DateHorizontalLayout) self.verticalLayout_2.addLayout(self.DateHorizontalLayout)
self.FileGroupBox = QtGui.QGroupBox(self.DateRangeGroupBox) self.FileGroupBox = QtGui.QGroupBox(self.DateRangeGroupBox)
self.FileGroupBox.setObjectName("FileGroupBox") self.FileGroupBox.setObjectName(u'FileGroupBox')
self.verticalLayout_4 = QtGui.QVBoxLayout(self.FileGroupBox) self.verticalLayout_4 = QtGui.QVBoxLayout(self.FileGroupBox)
self.verticalLayout_4.setObjectName("verticalLayout_4") self.verticalLayout_4.setObjectName(u'verticalLayout_4')
self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout") self.horizontalLayout.setObjectName(u'horizontalLayout')
self.FileLineEdit = QtGui.QLineEdit(self.FileGroupBox) self.FileLineEdit = QtGui.QLineEdit(self.FileGroupBox)
self.FileLineEdit.setObjectName("FileLineEdit") self.FileLineEdit.setObjectName(u'FileLineEdit')
self.horizontalLayout.addWidget(self.FileLineEdit) self.horizontalLayout.addWidget(self.FileLineEdit)
self.SaveFilePushButton = QtGui.QPushButton(self.FileGroupBox) self.SaveFilePushButton = QtGui.QPushButton(self.FileGroupBox)
icon = QtGui.QIcon() icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/exports/export_load.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon.addPixmap(QtGui.QPixmap(u':/exports/export_load.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.SaveFilePushButton.setIcon(icon) self.SaveFilePushButton.setIcon(icon)
self.SaveFilePushButton.setObjectName("SaveFilePushButton") self.SaveFilePushButton.setObjectName(u'SaveFilePushButton')
self.horizontalLayout.addWidget(self.SaveFilePushButton) self.horizontalLayout.addWidget(self.SaveFilePushButton)
self.verticalLayout_4.addLayout(self.horizontalLayout) self.verticalLayout_4.addLayout(self.horizontalLayout)
self.verticalLayout_2.addWidget(self.FileGroupBox) self.verticalLayout_2.addWidget(self.FileGroupBox)
self.verticalLayout.addWidget(self.DateRangeGroupBox) self.verticalLayout.addWidget(self.DateRangeGroupBox)
self.buttonBox = QtGui.QDialogButtonBox(AuditDetailDialog) self.buttonBox = QtGui.QDialogButtonBox(AuditDetailDialog)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox") self.buttonBox.setObjectName(u'buttonBox')
self.verticalLayout.addWidget(self.buttonBox) self.verticalLayout.addWidget(self.buttonBox)
self.retranslateUi(AuditDetailDialog) self.retranslateUi(AuditDetailDialog)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), AuditDetailDialog.accept) QtCore.QObject.connect(self.buttonBox,
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), AuditDetailDialog.close) QtCore.SIGNAL(u'accepted()'),
QtCore.QObject.connect(self.SaveFilePushButton, QtCore.SIGNAL("pressed()"), AuditDetailDialog.defineOutputLocation) AuditDetailDialog.accept)
QtCore.QObject.connect(self.buttonBox,
QtCore.SIGNAL(u'rejected()'),
AuditDetailDialog.close)
QtCore.QObject.connect(self.SaveFilePushButton,
QtCore.SIGNAL(u'pressed()'),
AuditDetailDialog.defineOutputLocation)
QtCore.QMetaObject.connectSlotsByName(AuditDetailDialog) QtCore.QMetaObject.connectSlotsByName(AuditDetailDialog)
def retranslateUi(self, AuditDetailDialog): def retranslateUi(self, AuditDetailDialog):
AuditDetailDialog.setWindowTitle(QtGui.QApplication.translate("AuditDetailDialog", "Audit Detail Extraction", None, QtGui.QApplication.UnicodeUTF8)) AuditDetailDialog.setWindowTitle(self.trUtf8('Audit Detail Extraction'))
self.DateRangeGroupBox.setTitle(QtGui.QApplication.translate("AuditDetailDialog", "Select Date Range", None, QtGui.QApplication.UnicodeUTF8)) self.DateRangeGroupBox.setTitle(self.trUtf8('ASelect Date Range'))
self.ToLabel.setText(QtGui.QApplication.translate("AuditDetailDialog", "to", None, QtGui.QApplication.UnicodeUTF8)) self.ToLabel.setText(self.trUtf8('to'))
self.FileGroupBox.setTitle(QtGui.QApplication.translate("AuditDetailDialog", "Report Location", None, QtGui.QApplication.UnicodeUTF8)) self.FileGroupBox.setTitle(self.trUtf8('Report Location'))

View File

@ -147,4 +147,4 @@ if __name__ == u'__main__':
newdb = os.path.join(newpath, u'songs.sqlite') newdb = os.path.join(newpath, u'songs.sqlite')
mig.convert_sqlite2_to_3(olddb, newdb) mig.convert_sqlite2_to_3(olddb, newdb)
mig.process() mig.process()
#mig.move_log_file() #mig.move_log_file()

10
resources/openlp.desktop Normal file
View File

@ -0,0 +1,10 @@
[Desktop Entry]
Encoding=UTF-8
Name=OpenLP
GenericName=Church lyrics projection
Exec=openlp
Icon=openlp
StartupNotify=true
Terminal=False
Type=Application
Categories=AudioVideo

View File

@ -28,7 +28,7 @@ import sys
import os import os
import sqlite import sqlite
import sqlite3 import sqlite3
import re
from optparse import OptionParser from optparse import OptionParser
from traceback import format_tb as get_traceback from traceback import format_tb as get_traceback

85
setup.py Normal file → Executable file
View File

@ -1,38 +1,57 @@
# -*- coding: utf-8 -*- #!/usr/bin/env python
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
############################################################################### from setuptools import setup, find_packages
# OpenLP - Open Source Lyrics Projection # import sys, os
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# 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 #
###############################################################################
from setuptools import setup VERSION_FILE = 'openlp/.version'
try:
from bzrlib.branch import Branch
b = Branch.open_containing('.')[0]
b.lock_read()
try:
# Get the branch's latest revision number.
revno = b.revno()
# Convert said revision number into a bzr revision id.
revision_id = b.dotted_revno_to_revision_id((revno,))
# Get a dict of tags, with the revision id as the key.
tags = b.tags.get_reverse_tag_dict()
# Check if the latest
if revision_id in tags:
version = u'%s' % tags[revision_id][0]
else:
version = '%s-bzr%s' % (sorted(b.tags.get_tag_dict().keys())[-1], revno)
ver_file = open(VERSION_FILE, u'w')
ver_file.write(version)
ver_file.close()
finally:
b.unlock()
except:
ver_file = open(VERSION_FILE, u'r')
version = ver_file.read().strip()
ver_file.close()
APP = ['openlp.pyw']
OPTIONS = {'argv_emulation': True, 'includes': ['sip', 'PyQt4']}
setup( setup(
name='openlp.org', name='OpenLP',
version='1.9.0', version=version,
url='http://www.openlp.org/', description="Open source Church presentation and lyrics projection application.",
app=APP, long_description="""\
options={'py2app': OPTIONS}, OpenLP (previously openlp.org) is free church presentation software, or lyrics projection software, used to display slides of songs, Bible verses, videos, images, and even presentations (if PowerPoint is installed) for church worship using a computer and a data projector.""",
setup_requires=['py2app'], classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
) keywords='open source church presentation lyrics projection song bible display project',
author='Raoul Snyman',
author_email='raoulsnyman@openlp.org',
url='http://openlp.org/',
license='GNU General Public License',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
scripts=['openlp.pyw', 'scripts/openlp-1to2-converter.py', 'scripts/bible-1to2-converter.py'],
include_package_data=True,
zip_safe=False,
install_requires=[
# -*- Extra requirements: -*-
],
entry_points="""
# -*- Entry points: -*-
"""
)

View File

@ -1 +1 @@
1.9.0-705 1.9.0-716