forked from openlp/openlp
Head
This commit is contained in:
commit
ebddea9a7b
@ -17,3 +17,4 @@ resources/innosetup/Output
|
||||
_eric4project
|
||||
.pylint.d
|
||||
*.qm
|
||||
openlp/core/resources.py.old
|
||||
|
@ -1,6 +1,8 @@
|
||||
recursive-include openlp *.py
|
||||
recursive-include openlp *.sqlite
|
||||
recursive-include openlp *.csv
|
||||
recursive-include openlp *.html
|
||||
recursive-include openlp *.js
|
||||
recursive-include documentation *
|
||||
recursive-include resources/forms *
|
||||
recursive-include resources/i18n *
|
||||
|
@ -163,7 +163,7 @@ def main():
|
||||
parser.add_option("-s", "--style", dest="style",
|
||||
help="Set the Qt4 style (passed directly to Qt4).")
|
||||
# Set up logging
|
||||
log_path = AppLocation.get_directory(AppLocation.ConfigDir)
|
||||
log_path = AppLocation.get_directory(AppLocation.CacheDir)
|
||||
if not os.path.exists(log_path):
|
||||
os.makedirs(log_path)
|
||||
filename = os.path.join(log_path, u'openlp.log')
|
||||
|
@ -491,7 +491,7 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
#Turn off the remote edit update message indicator
|
||||
QtGui.QMessageBox.information(self,
|
||||
translate('MediaManagerItem', 'Invalid Service Item'),
|
||||
translate(unicode('MediaManagerItem',
|
||||
unicode(translate('MediaManagerItem',
|
||||
'You must select a %s service item.')) % self.title)
|
||||
|
||||
def buildServiceItem(self, item=None):
|
||||
|
@ -37,9 +37,9 @@ log = logging.getLogger(u'AmendThemeForm')
|
||||
|
||||
class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
||||
|
||||
def __init__(self, thememanager, parent=None):
|
||||
def __init__(self, parent):
|
||||
QtGui.QDialog.__init__(self, parent)
|
||||
self.thememanager = thememanager
|
||||
self.thememanager = parent
|
||||
self.path = None
|
||||
self.theme = ThemeXML()
|
||||
self.setupUi(self)
|
||||
|
@ -76,6 +76,7 @@ class MediaDockManager(object):
|
||||
log.debug(u'remove %s dock' % name)
|
||||
for dock_index in range(0, self.media_dock.count()):
|
||||
if self.media_dock.widget(dock_index):
|
||||
if self.media_dock.widget(dock_index).settingsSection == name.lower():
|
||||
if self.media_dock.widget(dock_index).settingsSection == \
|
||||
name.lower():
|
||||
self.media_dock.widget(dock_index).hide()
|
||||
self.media_dock.removeItem(dock_index)
|
||||
|
@ -50,6 +50,7 @@ class AppLocation(object):
|
||||
DataDir = 3
|
||||
PluginsDir = 4
|
||||
VersionDir = 5
|
||||
CacheDir = 6
|
||||
|
||||
@staticmethod
|
||||
def get_directory(dir_type=1):
|
||||
@ -103,6 +104,20 @@ class AppLocation(object):
|
||||
else:
|
||||
plugin_path = os.path.split(openlp.__file__)[0]
|
||||
return plugin_path
|
||||
elif dir_type == AppLocation.CacheDir:
|
||||
if sys.platform == u'win32':
|
||||
path = os.path.join(os.getenv(u'APPDATA'), u'openlp')
|
||||
elif sys.platform == u'darwin':
|
||||
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_cache_home, u'openlp')
|
||||
except ImportError:
|
||||
path = os.path.join(os.getenv(u'HOME'), u'.openlp')
|
||||
return path
|
||||
|
||||
@staticmethod
|
||||
def get_data_path():
|
||||
|
@ -82,7 +82,7 @@ class BiblePlugin(Plugin):
|
||||
self.ExportBibleItem.setObjectName(u'ExportBibleItem')
|
||||
export_menu.addAction(self.ExportBibleItem)
|
||||
self.ExportBibleItem.setText(translate(
|
||||
u'BiblePlugin', u'&Bible'))
|
||||
'BiblePlugin', '&Bible'))
|
||||
self.ExportBibleItem.setVisible(False)
|
||||
|
||||
def onBibleImportClick(self):
|
||||
|
@ -85,9 +85,8 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
|
||||
|
||||
def onPreview(self, button):
|
||||
log.debug(u'onPreview')
|
||||
if button.text() == \
|
||||
unicode(translate('CustomPlugin.EditCustomForm', 'Save && Preview')) \
|
||||
and self.saveCustom():
|
||||
if button.text() == unicode(translate('CustomPlugin.EditCustomForm',
|
||||
'Save && Preview')) and self.saveCustom():
|
||||
Receiver.send_message(u'custom_preview')
|
||||
|
||||
def initialise(self):
|
||||
|
@ -63,9 +63,9 @@ class SongImport(object):
|
||||
self.verses = []
|
||||
self.versecount = 0
|
||||
self.choruscount = 0
|
||||
self.copyright_string = unicode(QtGui.QApplication.translate( \
|
||||
self.copyright_string = unicode(QtGui.QApplication.translate(
|
||||
u'SongsPlugin.SongImport', u'copyright'))
|
||||
self.copyright_symbol = unicode(QtGui.QApplication.translate( \
|
||||
self.copyright_symbol = unicode(QtGui.QApplication.translate(
|
||||
u'SongsPlugin.SongImport', u'\xa9'))
|
||||
|
||||
@staticmethod
|
||||
|
@ -91,10 +91,9 @@ class SongsPlugin(Plugin):
|
||||
self.SongImportItem = QtGui.QAction(import_menu)
|
||||
self.SongImportItem.setObjectName(u'SongImportItem')
|
||||
self.SongImportItem.setText(translate(
|
||||
u'SongsPlugin', u'&Song'))
|
||||
self.SongImportItem.setToolTip(
|
||||
translate('SongsPlugin',
|
||||
'Import songs using the import wizard.'))
|
||||
'SongsPlugin', '&Song'))
|
||||
self.SongImportItem.setToolTip(translate('SongsPlugin',
|
||||
'Import songs using the import wizard.'))
|
||||
import_menu.addAction(self.SongImportItem)
|
||||
# Songs of Fellowship import menu item - will be removed and the
|
||||
# functionality will be contained within the import wizard
|
||||
|
@ -60,24 +60,20 @@ class SongUsagePlugin(Plugin):
|
||||
self.SongUsageMenu = QtGui.QMenu(tools_menu)
|
||||
self.SongUsageMenu.setObjectName(u'SongUsageMenu')
|
||||
self.SongUsageMenu.setTitle(translate(
|
||||
u'SongUsagePlugin', u'&Song Usage'))
|
||||
'SongUsagePlugin', '&Song Usage'))
|
||||
#SongUsage Delete
|
||||
self.SongUsageDelete = QtGui.QAction(tools_menu)
|
||||
self.SongUsageDelete.setText(
|
||||
translate('SongUsagePlugin',
|
||||
'&Delete recorded data'))
|
||||
self.SongUsageDelete.setStatusTip(
|
||||
translate('SongUsagePlugin',
|
||||
'Delete song usage to specified date'))
|
||||
self.SongUsageDelete.setText(translate('SongUsagePlugin',
|
||||
'&Delete recorded data'))
|
||||
self.SongUsageDelete.setStatusTip(translate('SongUsagePlugin',
|
||||
'Delete song usage to specified date'))
|
||||
self.SongUsageDelete.setObjectName(u'SongUsageDelete')
|
||||
#SongUsage Report
|
||||
self.SongUsageReport = QtGui.QAction(tools_menu)
|
||||
self.SongUsageReport.setText(
|
||||
translate('SongUsagePlugin',
|
||||
'&Extract recorded data'))
|
||||
translate('SongUsagePlugin', '&Extract recorded data'))
|
||||
self.SongUsageReport.setStatusTip(
|
||||
translate('SongUsagePlugin',
|
||||
'Generate report on Song Usage'))
|
||||
translate('SongUsagePlugin', 'Generate report on Song Usage'))
|
||||
self.SongUsageReport.setObjectName(u'SongUsageReport')
|
||||
#SongUsage activation
|
||||
SongUsageIcon = build_icon(u':/tools/tools_alert.png')
|
||||
@ -87,8 +83,7 @@ class SongUsagePlugin(Plugin):
|
||||
self.SongUsageStatus.setChecked(False)
|
||||
self.SongUsageStatus.setText(translate(
|
||||
'SongUsagePlugin', 'Song Usage Status'))
|
||||
self.SongUsageStatus.setStatusTip(
|
||||
translate('SongUsagePlugin',
|
||||
self.SongUsageStatus.setStatusTip(translate('SongUsagePlugin',
|
||||
'Start/Stop live song usage recording'))
|
||||
self.SongUsageStatus.setShortcut(u'F4')
|
||||
self.SongUsageStatus.setObjectName(u'SongUsageStatus')
|
||||
|
54
scripts/generate_resources.sh
Normal file
54
scripts/generate_resources.sh
Normal file
@ -0,0 +1,54 @@
|
||||
#!/bin/sh
|
||||
# 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, Christian Richter, 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 #
|
||||
###############################################################################
|
||||
#
|
||||
# This script automates the generation of resources.py for OpenLP saving a
|
||||
# backup of the old resources, inserting the coding and copyright header and
|
||||
# conforming it to the project coding standards.
|
||||
#
|
||||
# To make use of the script:
|
||||
# 1 - Add the new image files in resources/images/
|
||||
# 2 - Modify resources/images/openlp-2.qrc as appropriate
|
||||
# 3 - run sh scripts/generate_resources.sh
|
||||
#
|
||||
# Once you have confirmed the resources are correctly modified to an updated,
|
||||
# working state you may optionally remove openlp/core/resources.py.old
|
||||
#
|
||||
###############################################################################
|
||||
# Backup the existing resources
|
||||
mv openlp/core/resources.py openlp/core/resources.py.old
|
||||
|
||||
# Create the new data from the updated qrc
|
||||
pyrcc4 -o openlp/core/resources.py.new resources/images/openlp-2.qrc
|
||||
|
||||
# Remove patch breaking lines
|
||||
cat openlp/core/resources.py.new | sed '/# Created: /d;/# by: /d' \
|
||||
> openlp/core/resources.py
|
||||
|
||||
# Patch resources.py to OpenLP coding style
|
||||
patch --posix -s openlp/core/resources.py scripts/resources.patch
|
||||
|
||||
# Remove temporary file
|
||||
rm openlp/core/resources.py.new
|
||||
|
59
scripts/resources.patch
Normal file
59
scripts/resources.patch
Normal file
@ -0,0 +1,59 @@
|
||||
--- openlp/core/resources.py.old Mon Jun 21 23:16:19 2010
|
||||
+++ openlp/core/resources.py Mon Jun 21 23:27:48 2010
|
||||
@@ -1,10 +1,31 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
+# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
|
||||
-# Resource object code
|
||||
-#
|
||||
-#
|
||||
-# WARNING! All changes made in this file will be lost!
|
||||
-
|
||||
+###############################################################################
|
||||
+# OpenLP - Open Source Lyrics Projection #
|
||||
+# --------------------------------------------------------------------------- #
|
||||
+# Copyright (c) 2008-2010 Raoul Snyman #
|
||||
+# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
|
||||
+# Gorven, Scott Guerrieri, Christian Richter, 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 #
|
||||
+###############################################################################
|
||||
+"""
|
||||
+The :mod:`resources` module provides application images and icons in a central
|
||||
+store for use by OpenLP.
|
||||
+"""
|
||||
from PyQt4 import QtCore
|
||||
|
||||
qt_resource_data = "\
|
||||
@@ -48643,9 +48664,16 @@
|
||||
"
|
||||
|
||||
def qInitResources():
|
||||
- QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
|
||||
+ """
|
||||
+ Initialise OpenLP resources at application startup.
|
||||
+ """
|
||||
+ QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name,
|
||||
+ qt_resource_data)
|
||||
|
||||
def qCleanupResources():
|
||||
- QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
|
||||
+ """
|
||||
+ Cleanup OpenLP resources when the application shuts down.
|
||||
+ """
|
||||
+ QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name,
|
||||
+ qt_resource_data)
|
||||
|
||||
-qInitResources()
|
Loading…
Reference in New Issue
Block a user