Merge lp:~trb143/openlp/servicing into lp:openlp

Proposed by Tim Bentley
Status: Merged
Merged at revision: not available
Proposed branch: lp:~trb143/openlp/servicing
Merge into: lp:openlp
Diff against target: None lines
To merge this branch: bzr merge lp:~trb143/openlp/servicing
Reviewer Review Type Date Requested Status
Tim Bentley Approve
Raoul Snyman Approve
Review via email: mp+6909@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) wrote :

Ok then, time for another merge.
Lots of goddies this time. Mostly "style police" cleanups but some bug fixes as well.
Images in themes seem to work now as well as theme selection controlled from the settings.

Revision history for this message
Raoul Snyman (raoul-snyman) wrote :

A BFA.

(Big Fat Approve)

review: Approve
Revision history for this message
Tim Bentley (trb143) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openlp.pyw'
--- openlp.pyw 2009-05-11 05:09:43 +0000
+++ openlp.pyw 2009-05-20 20:17:20 +0000
@@ -4,7 +4,7 @@
4"""4"""
5OpenLP - Open Source Lyrics Projection5OpenLP - Open Source Lyrics Projection
6Copyright (c) 2008 Raoul Snyman6Copyright (c) 2008 Raoul Snyman
7Portions copyright (c) 2008 Martin Thompson, Tim Bentley,7Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley,
88
9This program is free software; you can redistribute it and/or modify it under9This program is free software; you can redistribute it and/or modify it under
10the terms of the GNU General Public License as published by the Free Software10the terms of the GNU General Public License as published by the Free Software
@@ -26,17 +26,15 @@
26from openlp.core.lib import Receiver26from openlp.core.lib import Receiver
2727
28logging.basicConfig(level=logging.DEBUG,28logging.basicConfig(level=logging.DEBUG,
29 format=u'%(asctime)s %(msecs)d %(name)-12s %(levelname)-8s %(message)s',29 format=u'%(asctime)s %(msecs)d %(name)-12s %(levelname)-8s %(message)s',
30 datefmt=u'%m-%d %H:%M:%S',30 datefmt=u'%m-%d %H:%M:%S', filename=u'openlp.log', filemode=u'w')
31 filename=u'openlp.log',
32 filemode=u'w')
3331
34from openlp.core.resources import *32from openlp.core.resources import *
35from openlp.core.ui import MainWindow, SplashScreen33from openlp.core.ui import MainWindow, SplashScreen
3634
37class OpenLP(QtGui.QApplication):35class OpenLP(QtGui.QApplication):
38 global log36 global log
39 log=logging.getLogger(u'OpenLP Application')37 log = logging.getLogger(u'OpenLP Application')
40 log.info(u'Application Loaded')38 log.info(u'Application Loaded')
4139
42 def run(self):40 def run(self):
@@ -56,15 +54,16 @@
56 screens.append({u'number': screen,54 screens.append({u'number': screen,
57 u'size': self.desktop().availableGeometry(screen),55 u'size': self.desktop().availableGeometry(screen),
58 u'primary': (self.desktop().primaryScreen() == screen)})56 u'primary': (self.desktop().primaryScreen() == screen)})
59 log.info(u'Screen %d found with resolution %s', screen, self.desktop().availableGeometry(screen))57 log.info(u'Screen %d found with resolution %s',
58 screen, self.desktop().availableGeometry(screen))
60 # start the main app window59 # start the main app window
61 self.main_window = MainWindow(screens)60 self.mainWindow = MainWindow(screens)
62 self.main_window.show()61 self.mainWindow.show()
63 # now kill the splashscreen62 # now kill the splashscreen
64 self.splash.finish(self.main_window.main_window)63 self.splash.finish(self.mainWindow.mainWindow)
65 sys.exit(app.exec_())64 sys.exit(app.exec_())
6665
67if __name__ == '__main__':66if __name__ == u'__main__':
68 app = OpenLP(sys.argv)67 app = OpenLP(sys.argv)
69 app.run()68 app.run()
7069
7170
=== modified file 'openlp/__init__.py'
--- openlp/__init__.py 2009-05-13 19:47:25 +0000
+++ openlp/__init__.py 2009-05-21 05:15:51 +0000
@@ -1,7 +1,7 @@
1"""1"""
2OpenLP - Open Source Lyrics Projection2OpenLP - Open Source Lyrics Projection
3Copyright (c) 2008 Raoul Snyman3Copyright (c) 2008 Raoul Snyman
4Portions copyright (c) 2008 Martin Thompson, Tim Bentley4Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley
55
6This program is free software; you can redistribute it and/or modify it under6This program is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free Software7the terms of the GNU General Public License as published by the Free Software
@@ -15,24 +15,3 @@
15this program; if not, write to the Free Software Foundation, Inc., 59 Temple15this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16Place, Suite 330, Boston, MA 02111-1307 USA16Place, Suite 330, Boston, MA 02111-1307 USA
17"""17"""
18import types
19from PyQt4 import QtCore, QtGui
20
21__all__ = ['convertStringToBoolean','buildIcon',]
22
23def convertStringToBoolean(stringvalue):
24 return stringvalue.strip().lower() in (u'true', u'yes', u'y')
25
26def buildIcon(icon):
27 ButtonIcon = None
28 if type(icon) is QtGui.QIcon:
29 ButtonIcon = icon
30 elif type(icon) is types.StringType or type(icon) is types.UnicodeType:
31 ButtonIcon = QtGui.QIcon()
32 if icon.startswith(u':/'):
33 ButtonIcon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal,
34 QtGui.QIcon.Off)
35 else:
36 ButtonIcon.addPixmap(QtGui.QPixmap.fromImage(QImage(icon)),
37 QtGui.QIcon.Normal, QtGui.QIcon.Off)
38 return ButtonIcon
3918
=== modified file 'openlp/core/__init__.py'
--- openlp/core/__init__.py 2009-04-20 18:22:42 +0000
+++ openlp/core/__init__.py 2009-05-21 05:15:51 +0000
@@ -17,16 +17,8 @@
17this program; if not, write to the Free Software Foundation, Inc., 59 Temple17this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18Place, Suite 330, Boston, MA 02111-1307 USA18Place, Suite 330, Boston, MA 02111-1307 USA
19"""19"""
20from PyQt4 import QtCore, QtGui
21
22from settingsmanager import SettingsManager20from settingsmanager import SettingsManager
23from openlp.core.lib.pluginmanager import PluginManager21from openlp.core.lib.pluginmanager import PluginManager
2422
25__all__ = ['SettingsManager', 'PluginManager', 'translate',23__all__ = ['SettingsManager', 'PluginManager' ]
26 'fileToXML' ]24
27
28def translate(context, text):
29 return QtGui.QApplication.translate(context, text, None, QtGui.QApplication.UnicodeUTF8)
30
31def fileToXML(xmlfile):
32 return open(xmlfile).read()
3325
=== modified file 'openlp/core/lib/__init__.py'
--- openlp/core/lib/__init__.py 2009-04-22 19:46:10 +0000
+++ openlp/core/lib/__init__.py 2009-05-22 18:30:25 +0000
@@ -17,6 +17,46 @@
17this program; if not, write to the Free Software Foundation, Inc., 59 Temple17this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18Place, Suite 330, Boston, MA 02111-1307 USA18Place, Suite 330, Boston, MA 02111-1307 USA
19"""19"""
20import types
21from PyQt4 import QtCore, QtGui
22
23def translate(context, text):
24 return QtGui.QApplication.translate(context, text, None, QtGui.QApplication.UnicodeUTF8)
25
26def file_to_xml(xmlfile):
27 return open(xmlfile).read()
28
29def str_to_bool(stringvalue):
30 return stringvalue.strip().lower() in (u'true', u'yes', u'y')
31
32def buildIcon(icon):
33 ButtonIcon = None
34 if type(icon) is QtGui.QIcon:
35 ButtonIcon = icon
36 elif type(icon) is types.StringType or type(icon) is types.UnicodeType:
37 ButtonIcon = QtGui.QIcon()
38 if icon.startswith(u':/'):
39 ButtonIcon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal,
40 QtGui.QIcon.Off)
41 else:
42 ButtonIcon.addPixmap(QtGui.QPixmap.fromImage(QImage(icon)),
43 QtGui.QIcon.Normal, QtGui.QIcon.Off)
44 return ButtonIcon
45
46def contextMenuAction(base, icon, text, slot):
47 """
48 Utility method to help build context menus for plugins
49 """
50 action = QtGui.QAction(text, base)
51 action .setIcon(buildIcon(icon))
52 QtCore.QObject.connect(action, QtCore.SIGNAL("triggered()"), slot)
53 return action
54
55def contextMenuSeparator(base):
56 action = QtGui.QAction("", base)
57 action.setSeparator(True)
58 return action
59
20from pluginconfig import PluginConfig60from pluginconfig import PluginConfig
21from plugin import Plugin61from plugin import Plugin
22from settingstab import SettingsTab62from settingstab import SettingsTab
@@ -35,6 +75,11 @@
35from renderer import Renderer75from renderer import Renderer
36from rendermanager import RenderManager76from rendermanager import RenderManager
3777
38__all__ = ['Renderer','PluginConfig', 'Plugin', 'SettingsTab', 'MediaManagerItem', 'Event', 'EventType'78#__all__ = ['Renderer','PluginConfig', 'Plugin', 'SettingsTab', 'MediaManagerItem', 'Event', 'EventType'
39 'XmlRootClass', 'ServiceItem', 'Receiver', 'OpenLPToolbar', 'SongXMLBuilder',79# 'XmlRootClass', 'ServiceItem', 'Receiver', 'OpenLPToolbar', 'SongXMLBuilder',
40 'SongXMLParser', 'EventManager', 'ThemeXML', 'RenderManager']80# 'SongXMLParser', 'EventManager', 'ThemeXML', 'RenderManager']
81
82__all__ = [ 'translate', 'file_to_xml', 'str_to_bool', 'contextMenuAction', 'contextMenuSeparator']
83
84
85
4186
=== modified file 'openlp/core/lib/event.py'
--- openlp/core/lib/event.py 2009-05-16 16:38:03 +0000
+++ openlp/core/lib/event.py 2009-05-20 20:17:20 +0000
@@ -44,6 +44,7 @@
44 #PreviewBeforeShow = 1344 #PreviewBeforeShow = 13
45 #PreviewAfterShow = 1445 #PreviewAfterShow = 14
4646
47#Theme Related Events
47 ThemeListChanged = 1548 ThemeListChanged = 15
4849
4950
5051
=== modified file 'openlp/core/lib/eventmanager.py'
--- openlp/core/lib/eventmanager.py 2009-05-16 16:38:03 +0000
+++ openlp/core/lib/eventmanager.py 2009-05-20 20:17:20 +0000
@@ -29,10 +29,10 @@
2929
30 """30 """
31 global log31 global log
32 log=logging.getLogger(u'EventManager')32 log = logging.getLogger(u'EventManager')
3333
34 def __init__(self):34 def __init__(self):
35 self.endpoints=[]35 self.endpoints = []
36 log.info(u'Initialising')36 log.info(u'Initialising')
3737
38 def register(self, plugin):38 def register(self, plugin):
3939
=== modified file 'openlp/core/lib/eventreceiver.py'
--- openlp/core/lib/eventreceiver.py 2009-03-10 16:46:25 +0000
+++ openlp/core/lib/eventreceiver.py 2009-05-20 20:17:20 +0000
@@ -2,7 +2,7 @@
2"""2"""
3OpenLP - Open Source Lyrics Projection3OpenLP - Open Source Lyrics Projection
4Copyright (c) 2008 Raoul Snyman4Copyright (c) 2008 Raoul Snyman
5Portions copyright (c) 2008 Martin Thompson, Tim Bentley,5Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley,
66
7This program is free software; you can redistribute it and/or modify it under7This program is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free Software8the terms of the GNU General Public License as published by the Free Software
@@ -17,15 +17,15 @@
17Place, Suite 330, Boston, MA 02111-1307 USA17Place, Suite 330, Boston, MA 02111-1307 USA
18"""18"""
1919
20from PyQt4.QtCore import *20from PyQt4 import QtCore
2121
22class EventReceiver(QObject):22class EventReceiver(QtCore.QObject):
23 """23 """
24 Class to allow events to be passed from different parts of the system.24 Class to allow events to be passed from different parts of the system.
25 This is a private class and should not be used directly but via the Receiver class25 This is a private class and should not be used directly but via the Receiver class
26 """26 """
27 def __init__(self):27 def __init__(self):
28 QObject.__init__(self)28 QtCore.QObject.__init__(self)
2929
30 def send_message(self, event, msg=None):30 def send_message(self, event, msg=None):
31 self.emit(SIGNAL(event), msg)31 self.emit(SIGNAL(event), msg)
3232
=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py 2009-05-13 19:47:25 +0000
+++ openlp/core/lib/mediamanageritem.py 2009-05-20 20:17:20 +0000
@@ -64,7 +64,7 @@
64 item.64 item.
65 """65 """
66 if self.Toolbar is None:66 if self.Toolbar is None:
67 self.Toolbar=OpenLPToolbar(self)67 self.Toolbar = OpenLPToolbar(self)
68 self.PageLayout.addWidget(self.Toolbar)68 self.PageLayout.addWidget(self.Toolbar)
6969
70 def addToolbarButton(self, title, tooltip, icon, slot=None, objectname=None):70 def addToolbarButton(self, title, tooltip, icon, slot=None, objectname=None):
@@ -82,7 +82,7 @@
82 self.Toolbar.addSeparator()82 self.Toolbar.addSeparator()
8383
84 def contextMenuSeparator(self, base):84 def contextMenuSeparator(self, base):
85 action = QtGui.QAction("", base)85 action = QtGui.QAction(u'', base)
86 action.setSeparator(True)86 action.setSeparator(True)
87 return action87 return action
8888
@@ -94,7 +94,7 @@
94 ButtonIcon = icon94 ButtonIcon = icon
95 elif type(icon) is types.StringType:95 elif type(icon) is types.StringType:
96 ButtonIcon = QtGui.QIcon()96 ButtonIcon = QtGui.QIcon()
97 if icon.startswith(':/'):97 if icon.startswith(u':/'):
98 ButtonIcon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal,98 ButtonIcon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal,
99 QtGui.QIcon.Off)99 QtGui.QIcon.Off)
100 else:100 else:
@@ -103,6 +103,6 @@
103103
104 action = QtGui.QAction(text, base)104 action = QtGui.QAction(text, base)
105 action .setIcon(ButtonIcon)105 action .setIcon(ButtonIcon)
106 QtCore.QObject.connect(action, QtCore.SIGNAL("triggered()"), slot)106 QtCore.QObject.connect(action, QtCore.SIGNAL(u'triggered()'), slot)
107 return action107 return action
108108
109109
=== modified file 'openlp/core/lib/plugin.py'
--- openlp/core/lib/plugin.py 2009-05-02 18:56:27 +0000
+++ openlp/core/lib/plugin.py 2009-05-20 20:17:20 +0000
@@ -80,7 +80,7 @@
80 if name is not None:80 if name is not None:
81 self.name = name81 self.name = name
82 else:82 else:
83 self.name = 'Plugin'83 self.name = u'Plugin'
84 if version is not None:84 if version is not None:
85 self.version = version85 self.version = version
86 self.icon = None86 self.icon = None
@@ -88,12 +88,12 @@
88 self.weight = 088 self.weight = 0
89 # Set up logging89 # Set up logging
90 self.log = logging.getLogger(self.name)90 self.log = logging.getLogger(self.name)
91 self.preview_controller=plugin_helpers[u'preview']91 self.preview_controller = plugin_helpers[u'preview']
92 self.live_controller=plugin_helpers[u'live']92 self.live_controller = plugin_helpers[u'live']
93 self.theme_manager=plugin_helpers[u'theme']93 self.theme_manager = plugin_helpers[u'theme']
94 self.event_manager=plugin_helpers[u'event']94 self.event_manager = plugin_helpers[u'event']
95 self.render_manager=plugin_helpers[u'render']95 self.render_manager = plugin_helpers[u'render']
96 self.service_manager=plugin_helpers[u'service']96 self.service_manager = plugin_helpers[u'service']
9797
98 def check_pre_conditions(self):98 def check_pre_conditions(self):
99 """99 """
100100
=== modified file 'openlp/core/lib/pluginconfig.py'
--- openlp/core/lib/pluginconfig.py 2009-03-15 19:31:33 +0000
+++ openlp/core/lib/pluginconfig.py 2009-05-20 20:17:20 +0000
@@ -37,12 +37,12 @@
37 Get a configuration value from the configuration registry.37 Get a configuration value from the configuration registry.
38 """38 """
39 return ConfigHelper.get_config(self.section, key, default)39 return ConfigHelper.get_config(self.section, key, default)
40 40
41 def delete_config(self, key):41 def delete_config(self, key):
42 """42 """
43 Delete a configuration value from the configuration registry.43 Delete a configuration value from the configuration registry.
44 """44 """
45 return ConfigHelper.delete_config(self.section, key) 45 return ConfigHelper.delete_config(self.section, key)
4646
47 def set_config(self, key, value):47 def set_config(self, key, value):
48 """48 """
@@ -64,26 +64,28 @@
6464
65 def set_data_path(self, path):65 def set_data_path(self, path):
66 return self.set_config(u'data path', os.path.basename(path))66 return self.set_config(u'data path', os.path.basename(path))
67 67
68 def get_files(self, suffix=None):68 def get_files(self, suffix=None):
69 returnfiles = []
70 #suffix = self.get_config("suffix name", default_suffixes)69 #suffix = self.get_config("suffix name", default_suffixes)
71 try:70 try:
72 files = os.listdir(self.get_data_path()) 71 files = os.listdir(self.get_data_path())
73 except:72 except:
74 return returnfiles73 return []
75 if suffix != None:74 if suffix != None:
75 return_files = []
76 for f in files:76 for f in files:
77 if f.find('.') != -1:77 if f.find('.') != -1:
78 nme = f.split('.')78 nme = f.split('.')
79 bname = nme[0]79 bname = nme[0]
80 sfx = nme[1].lower()80 sfx = nme[1].lower()
81 sfx = sfx.lower()81 sfx = sfx.lower()
82 if suffix.find(sfx) > -1 : # only load files with the correct suffix82 # only load files with the correct suffix
83 returnfiles.append(f)83 if suffix.find(sfx) > -1 :
84 return returnfiles84 return_files.append(f)
85 return return_files
85 else:86 else:
86 return files # no filtering required87 # no filtering required
88 return files
8789
88 def load_list(self, name):90 def load_list(self, name):
89 """91 """
9092
=== modified file 'openlp/core/lib/pluginmanager.py'
--- openlp/core/lib/pluginmanager.py 2009-04-20 18:22:42 +0000
+++ openlp/core/lib/pluginmanager.py 2009-05-20 20:17:20 +0000
@@ -29,7 +29,7 @@
29 and executes all the hooks, as and when necessary.29 and executes all the hooks, as and when necessary.
30 """30 """
31 global log31 global log
32 log=logging.getLogger(u'PluginMgr')32 log = logging.getLogger(u'PluginMgr')
33 log.info(u'Plugin manager loaded')33 log.info(u'Plugin manager loaded')
3434
35 def __init__(self, dir):35 def __init__(self, dir):
@@ -42,25 +42,26 @@
42 log.debug("Inserting %s into sys.path", dir)42 log.debug("Inserting %s into sys.path", dir)
43 sys.path.insert(0, dir)43 sys.path.insert(0, dir)
44 self.basepath = os.path.abspath(dir)44 self.basepath = os.path.abspath(dir)
45 log.debug("Base path %s ", self.basepath)45 log.debug(u'Base path %s ', self.basepath)
46 self.plugins = []46 self.plugins = []
47 # this has to happen after the UI is sorted self.find_plugins(dir)47 # this has to happen after the UI is sorted self.find_plugins(dir)
48 log.info("Plugin manager done init")48 log.info(u'Plugin manager done init')
4949
50 def find_plugins(self, dir, plugin_helpers, eventmanager): # TODO shouldn't dir come from self.basepath50 def find_plugins(self, dir, plugin_helpers, eventmanager):
51 """51 """
52 Scan the directory dir for objects inheriting from openlp.plugin52 Scan the directory dir for objects inheriting from openlp.plugin
53 """53 """
54 self.plugin_helpers = plugin_helpers54 self.plugin_helpers = plugin_helpers
55 startdepth=len(os.path.abspath(dir).split(os.sep))55 startdepth = len(os.path.abspath(dir).split(os.sep))
56 log.debug("find plugins %s at depth %d" %( str(dir), startdepth))56 log.debug(u'find plugins %s at depth %d' %( str(dir), startdepth))
5757
58 for root, dirs, files in os.walk(dir):58 for root, dirs, files in os.walk(dir):
59 for name in files:59 for name in files:
60 if name.endswith(".py") and not name.startswith("__"):60 if name.endswith(u'.py') and not name.startswith(u'__'):
61 path = os.path.abspath(os.path.join(root, name))61 path = os.path.abspath(os.path.join(root, name))
62 thisdepth=len(path.split(os.sep))62 thisdepth = len(path.split(os.sep))
63 if thisdepth-startdepth > 2: # skip anything lower down63 if thisdepth-startdepth > 2:
64 # skip anything lower down
64 continue65 continue
65 modulename, pyext = os.path.splitext(path)66 modulename, pyext = os.path.splitext(path)
66 prefix = os.path.commonprefix([self.basepath, path])67 prefix = os.path.commonprefix([self.basepath, path])
@@ -68,11 +69,11 @@
68 modulename = modulename[len(prefix) + 1:]69 modulename = modulename[len(prefix) + 1:]
69 modulename = modulename.replace(os.path.sep, '.')70 modulename = modulename.replace(os.path.sep, '.')
70 # import the modules71 # import the modules
71 log.debug("Importing %s from %s. Depth %d" % (modulename, path, thisdepth))72 log.debug(u'Importing %s from %s. Depth %d' % (modulename, path, thisdepth))
72 try:73 try:
73 __import__(modulename, globals(), locals(), [])74 __import__(modulename, globals(), locals(), [])
74 except ImportError, e:75 except ImportError, e:
75 log.error("Failed to import module %s on path %s for reason %s", modulename, path, e.message)76 log.error(u'Failed to import module %s on path %s for reason %s', modulename, path, e.message)
76 self.plugin_classes = Plugin.__subclasses__()77 self.plugin_classes = Plugin.__subclasses__()
77 self.plugins = []78 self.plugins = []
78 plugin_objects = []79 plugin_objects = []
@@ -80,9 +81,9 @@
80 try:81 try:
81 plugin = p(self.plugin_helpers)82 plugin = p(self.plugin_helpers)
82 log.debug(u'loaded plugin %s with helpers'%str(p))83 log.debug(u'loaded plugin %s with helpers'%str(p))
83 log.debug("Plugin="+str(p))84 log.debug(u'Plugin: %s', str(p))
84 if plugin.check_pre_conditions():85 if plugin.check_pre_conditions():
85 log.debug("Appending "+str(p))86 log.debug(u'Appending %s ', str(p))
86 plugin_objects.append(plugin)87 plugin_objects.append(plugin)
87 eventmanager.register(plugin)88 eventmanager.register(plugin)
88 except TypeError:89 except TypeError:
@@ -100,7 +101,7 @@
100 for plugin in self.plugins:101 for plugin in self.plugins:
101 media_manager_item = plugin.get_media_manager_item()102 media_manager_item = plugin.get_media_manager_item()
102 if media_manager_item is not None:103 if media_manager_item is not None:
103 log.debug('Inserting media manager item from %s' % plugin.name)104 log.debug(u'Inserting media manager item from %s' % plugin.name)
104 mediatoolbox.addItem(media_manager_item, plugin.icon, media_manager_item.title)105 mediatoolbox.addItem(media_manager_item, plugin.icon, media_manager_item.title)
105106
106 def hook_settings_tabs(self, settingsform=None):107 def hook_settings_tabs(self, settingsform=None):
@@ -111,10 +112,10 @@
111 for plugin in self.plugins:112 for plugin in self.plugins:
112 settings_tab = plugin.get_settings_tab()113 settings_tab = plugin.get_settings_tab()
113 if settings_tab is not None:114 if settings_tab is not None:
114 log.debug('Inserting settings tab item from %s' % plugin.name)115 log.debug(u'Inserting settings tab item from %s' % plugin.name)
115 settingsform.addTab(settings_tab)116 settingsform.addTab(settings_tab)
116 else:117 else:
117 log.debug('No settings in %s' % plugin.name)118 log.debug(u'No settings in %s' % plugin.name)
118119
119 def hook_import_menu(self, import_menu):120 def hook_import_menu(self, import_menu):
120 """121 """
@@ -132,15 +133,6 @@
132 for plugin in self.plugins:133 for plugin in self.plugins:
133 plugin.add_export_menu_item(export_menu)134 plugin.add_export_menu_item(export_menu)
134135
135 def hook_handle_event(self, eventmanager):
136 for plugin in self.plugins:
137 handle_event = plugin.handle_event(None)
138 print plugin, handle_event
139# if settings_tab is not None:
140# log.debug('Inserting settings tab item from %s' % plugin.name)
141# settingsform.addTab(settings_tab)
142# else:
143# log.debug('No settings in %s' % plugin.name)
144 def initialise_plugins(self):136 def initialise_plugins(self):
145 """137 """
146 Loop through all the plugins and give them an opportunity to add an item138 Loop through all the plugins and give them an opportunity to add an item
147139
=== modified file 'openlp/core/lib/renderer.py'
--- openlp/core/lib/renderer.py 2009-05-19 16:27:01 +0000
+++ openlp/core/lib/renderer.py 2009-05-30 18:44:16 +0000
@@ -177,13 +177,11 @@
177 painter.drawPath(rectPath)177 painter.drawPath(rectPath)
178178
179 elif self._theme.background_type== u'image': # image179 elif self._theme.background_type== u'image': # image
180 r = self._frame.rect()180 #r = self._frame.rect()
181 log.debug(u'Image size details %d %d %d %d ', r.x(), r.y(), r.width(),r.height())181 #log.debug(u'Image size details %d %d %d %d ', r.x(), r.y(), r.width(),r.height())
182 #log.debug(u' Background Parameter %d ', self._theme.background_color1)
183 #if self._theme.background_color1 is not None:
184 # p.fillRect(self._frame.rect(), self._theme.background_borderColor)
185 if self.bg_image is not None:182 if self.bg_image is not None:
186 painter.drawPixmap(self.background_offsetx,self.background_offsety, self.bg_image)183 #painter.drawPixmap(self.background_offsetx,self.background_offsety, self.bg_image)
184 painter.drawPixmap(0 ,0 , self.bg_image)
187 else:185 else:
188 painter.fillRect(self._frame.rect(), QtGui.QColor(u'#000000'))186 painter.fillRect(self._frame.rect(), QtGui.QColor(u'#000000'))
189 painter.end()187 painter.end()
@@ -204,24 +202,29 @@
204 bboxes = []202 bboxes = []
205 for line in lines:203 for line in lines:
206 bboxes.append(self._render_single_line(line, footer))204 bboxes.append(self._render_single_line(line, footer))
205 #print line, bboxes
207206
208 numlines = len(lines)207 numlines = len(lines)
209 bottom = self._rect.bottom()208 bottom = self._rect.bottom()
210 for ratio in (numlines, numlines/2, numlines/3, numlines/4):209 #for ratio in (numlines): #, numlines/2, numlines/3, numlines/4):
211 good = 1210 ratio = numlines
212 startline = 0211 good = 1
213 endline = startline + ratio212 startline = 0
214 while (endline <= numlines):213 endline = startline + ratio
215 by = 0214 while (endline <= numlines):
216 for (x, y) in bboxes[startline:endline]:215 by = 0
217 by += y216 for (x, y) in bboxes[startline:endline]:
218 if by > bottom:217 by += y
219 good=0218 #print by
220 break219 #print by , bottom
221 startline += ratio220 if by > bottom:
222 endline = startline+ratio221 good=0
223 if good == 1:
224 break222 break
223 startline += ratio
224 endline = startline+ratio
225# if good == 1:
226# break
227 #print "---------"
225228
226 retval = []229 retval = []
227 numlines_per_page = ratio230 numlines_per_page = ratio
228231
=== modified file 'openlp/core/lib/rendermanager.py'
--- openlp/core/lib/rendermanager.py 2009-05-18 19:47:18 +0000
+++ openlp/core/lib/rendermanager.py 2009-05-22 18:30:25 +0000
@@ -63,6 +63,7 @@
63 self.renderer = Renderer()63 self.renderer = Renderer()
64 self.calculate_default(self.screen_list[self.current_display]['size'])64 self.calculate_default(self.screen_list[self.current_display]['size'])
65 self.theme = u''65 self.theme = u''
66 self.service_theme = u''
6667
67 def set_global_theme(self, global_theme, global_style = u'Global'):68 def set_global_theme(self, global_theme, global_style = u'Global'):
68 self.global_theme = global_theme69 self.global_theme = global_theme
@@ -83,11 +84,13 @@
83 else:84 else:
84 if theme is not None:85 if theme is not None:
85 self.theme = theme86 self.theme = theme
86 elif self.global_style == u'Service':87 elif self.global_style == u'Song' or self.global_style == u'Service':
87 if self.service_theme == u'':88 if self.service_theme == u'':
88 self.theme = self.global_theme89 self.theme = self.global_theme
89 else:90 else:
90 self.theme = self.service_theme91 self.theme = self.service_theme
92 else:
93 self.theme = self.global_theme
9194
92 if self.theme is not self.renderer.theme_name:95 if self.theme is not self.renderer.theme_name:
93 log.debug(u'theme is now %s', self.theme)96 log.debug(u'theme is now %s', self.theme)
@@ -117,7 +120,7 @@
117120
118 def generate_preview(self, themedata):121 def generate_preview(self, themedata):
119 log.debug(u'generate preview')122 log.debug(u'generate preview')
120 self.calculate_default(QtCore.QSize(800, 600))123 self.calculate_default(QtCore.QSize(1024, 768))
121 self.renderer.set_theme(themedata)124 self.renderer.set_theme(themedata)
122 self.build_text_rectangle(themedata)125 self.build_text_rectangle(themedata)
123126
124127
=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py 2009-05-17 15:24:02 +0000
+++ openlp/core/lib/serviceitem.py 2009-05-22 18:30:25 +0000
@@ -19,10 +19,8 @@
19"""19"""
20import logging20import logging
21import time21import time
22from openlp import buildIcon22from openlp.core.lib import buildIcon
23from PyQt4.QtCore import *23from PyQt4 import QtCore, QtGui
24from PyQt4.QtGui import *
25
2624
27class ServiceItem():25class ServiceItem():
28 """26 """
@@ -44,6 +42,8 @@
44 self.items = []42 self.items = []
45 self.iconic_representation = None43 self.iconic_representation = None
46 self.raw_slides = None44 self.raw_slides = None
45 self.frame_titles = []
46 self.command_files = []
47 self.frames = []47 self.frames = []
48 self.raw_footer = None48 self.raw_footer = None
49 self.theme = None49 self.theme = None
@@ -62,11 +62,14 @@
62 else:62 else:
63 self.render_manager.set_override_theme(self.theme)63 self.render_manager.set_override_theme(self.theme)
64 log.debug(u'Formatting slides')64 log.debug(u'Formatting slides')
65 if len(self.frames) == 0 :65 if len(self.frames) == 0 and len(self.raw_slides) > 0 :
66 for slide in self.raw_slides:66 for slide in self.raw_slides:
67 formated = self.render_manager.format_slide(slide, False)67 formated = self.render_manager.format_slide(slide, False)
68 frame = self.render_manager.generate_slide(formated, self.raw_footer)68 frame = self.render_manager.generate_slide(formated, self.raw_footer)
69 self.frames.append({u'formatted': formated, u'image': frame})69 self.frames.append({u'title': formated, u'image': frame})
70 else:
71 if len(self.command_files) > 0:
72 pass
7073
7174
72 def get_parent_node(self):75 def get_parent_node(self):
7376
=== modified file 'openlp/core/lib/themexmlhandler.py'
--- openlp/core/lib/themexmlhandler.py 2009-05-16 19:47:30 +0000
+++ openlp/core/lib/themexmlhandler.py 2009-05-22 05:14:55 +0000
@@ -22,7 +22,7 @@
22For XML Schema see wiki.openlp.org22For XML Schema see wiki.openlp.org
23"""23"""
24import os, os.path24import os, os.path
25from openlp import convertStringToBoolean25from openlp.core.lib import str_to_bool
26from xml.dom.minidom import Document26from xml.dom.minidom import Document
27from xml.etree.ElementTree import ElementTree, XML, dump27from xml.etree.ElementTree import ElementTree, XML, dump
2828
@@ -69,12 +69,14 @@
69 # Create the minidom document69 # Create the minidom document
70 self.theme_xml = Document()70 self.theme_xml = Document()
7171
72 def extend_filename(self, path):72 def extend_image_filename(self, path):
73 """
74 Add the path name to the image name so the background can be rendered.
75 """
73 if self.background_filename is not None:76 if self.background_filename is not None:
74 self.background_filename = os.path.join(path, self.theme_name, self.background_filename)77 self.background_filename = os.path.join(path, self.theme_name, self.background_filename)
7578
76 def new_document(self, name):79 def new_document(self, name):
77 # Create the <song> base element
78 self.theme = self.theme_xml.createElement(u'theme')80 self.theme = self.theme_xml.createElement(u'theme')
79 self.theme_xml.appendChild(self.theme)81 self.theme_xml.appendChild(self.theme)
80 self.theme.setAttribute(u'version', u'1.0')82 self.theme.setAttribute(u'version', u'1.0')
@@ -85,89 +87,92 @@
85 self.theme.appendChild(self.name)87 self.theme.appendChild(self.name)
8688
87 def add_background_transparent(self):89 def add_background_transparent(self):
88 # Create the main <lyrics> element90 """
91 Add a transparent background.
92 """
89 background = self.theme_xml.createElement(u'background')93 background = self.theme_xml.createElement(u'background')
90 background.setAttribute(u'mode', u'transparent')94 background.setAttribute(u'mode', u'transparent')
91 self.theme.appendChild(background)95 self.theme.appendChild(background)
9296
93 def add_background_solid(self, bkcolor):97 def add_background_solid(self, bkcolor):
98 """
99 Add a Solid background.
100 """
94 background = self.theme_xml.createElement(u'background')101 background = self.theme_xml.createElement(u'background')
95 background.setAttribute(u'mode', u'opaque')102 background.setAttribute(u'mode', u'opaque')
96 background.setAttribute(u'type', u'solid')103 background.setAttribute(u'type', u'solid')
97 self.theme.appendChild(background)104 self.theme.appendChild(background)
98105
99 color = self.theme_xml.createElement(u'color')106 self.child_element(background, u'color', bkcolor)
100 bkc = self.theme_xml.createTextNode(bkcolor)
101 color.appendChild(bkc)
102 background.appendChild(color)
103107
104 def add_background_gradient(self, startcolor, endcolor, direction):108 def add_background_gradient(self, startcolor, endcolor, direction):
109 """
110 Add a gradient background.
111 """
105 background = self.theme_xml.createElement(u'background')112 background = self.theme_xml.createElement(u'background')
106 background.setAttribute(u'mode', u'opaque')113 background.setAttribute(u'mode', u'opaque')
107 background.setAttribute(u'type', u'gradient')114 background.setAttribute(u'type', u'gradient')
108 self.theme.appendChild(background)115 self.theme.appendChild(background)
109116
110 color = self.theme_xml.createElement(u'startColor')117 # Create startColor element
111 bkc = self.theme_xml.createTextNode(startcolor)118 self.child_element(background, u'startColor', startcolor)
112 color.appendChild(bkc)119 # Create endColor element
113 background.appendChild(color)120 self.child_element(background, u'endColor', endcolor)
114121 # Create direction element
115 color = self.theme_xml.createElement(u'endColor')122 self.child_element(background, u'direction', direction)
116 bkc = self.theme_xml.createTextNode(endcolor)
117 color.appendChild(bkc)
118 background.appendChild(color)
119
120 color = self.theme_xml.createElement(u'direction')
121 bkc = self.theme_xml.createTextNode(direction)
122 color.appendChild(bkc)
123 background.appendChild(color)
124123
125 def add_background_image(self, filename):124 def add_background_image(self, filename):
125 """
126 Add a image background.
127 """
126 background = self.theme_xml.createElement(u'background')128 background = self.theme_xml.createElement(u'background')
127 background.setAttribute(u'mode', u'opaque')129 background.setAttribute(u'mode', u'opaque')
128 background.setAttribute(u'type', u'image')130 background.setAttribute(u'type', u'image')
129 self.theme.appendChild(background)131 self.theme.appendChild(background)
130132
131 color = self.theme_xml.createElement(u'filename')133 #Create Filename element
132 bkc = self.theme_xml.createCDATASection(filename)134 self.child_element(background, u'filename', filename)
133 color.appendChild(bkc)
134 background.appendChild(color)
135135
136 def add_font(self, name, color, proportion, override, fonttype=u'main', xpos=0, ypos=0 ,width=0, height=0):136 def add_font(self, name, color, proportion, override, fonttype=u'main', xpos=0, ypos=0 ,width=0, height=0):
137 """
138 Add a Font.
139 """
137 background = self.theme_xml.createElement(u'font')140 background = self.theme_xml.createElement(u'font')
138 background.setAttribute(u'type',fonttype)141 background.setAttribute(u'type',fonttype)
139 self.theme.appendChild(background)142 self.theme.appendChild(background)
140143
141 element = self.theme_xml.createElement(u'name')144 #Create Font name element
142 fn = self.theme_xml.createTextNode(name)145 self.child_element(background, u'name', name)
143 element.appendChild(fn)146
144 background.appendChild(element)147 #Create Font color element
145148 self.child_element(background, u'color', color)
146 element = self.theme_xml.createElement(u'color')149
147 fn = self.theme_xml.createTextNode(color)150 #Create Proportion name element
148 element.appendChild(fn)151 self.child_element(background, u'proportion', proportion)
149 background.appendChild(element)152
150153 #Create Proportion name element
151 element = self.theme_xml.createElement(u'proportion')154 self.child_element(background, u'proportion', proportion)
152 fn = self.theme_xml.createTextNode(proportion)155
153 element.appendChild(fn)156 #Create Location element
154 background.appendChild(element)
155
156 element = self.theme_xml.createElement(u'location')157 element = self.theme_xml.createElement(u'location')
157 element.setAttribute(u'override',override)158 element.setAttribute(u'override',override)
158159
159 if override == u'True':160 if override == u'True':
160 element.setAttribute(u'x',xpos)161 element.setAttribute(u'x', xpos)
161 element.setAttribute(u'y',ypos)162 element.setAttribute(u'y', ypos)
162 element.setAttribute(u'width',width)163 element.setAttribute(u'width', width)
163 element.setAttribute(u'height',height)164 element.setAttribute(u'height', height)
164 background.appendChild(element)165 background.appendChild(element)
165166
166 def add_display(self, shadow, shadowColor, outline, outlineColor, horizontal, vertical, wrap):167 def add_display(self, shadow, shadowColor, outline, outlineColor, horizontal, vertical, wrap):
168 """
169 Add a Display options.
170 """
167 background = self.theme_xml.createElement(u'display')171 background = self.theme_xml.createElement(u'display')
168 self.theme.appendChild(background)172 self.theme.appendChild(background)
169173
170 tagElement = self.theme_xml.createElement(u'shadow')174 tagElement = self.theme_xml.createElement(u'shadow')
175
171 tagElement.setAttribute(u'color',shadowColor)176 tagElement.setAttribute(u'color',shadowColor)
172 tagValue = self.theme_xml.createTextNode(shadow)177 tagValue = self.theme_xml.createTextNode(shadow)
173 tagElement.appendChild(tagValue)178 tagElement.appendChild(tagValue)
@@ -194,15 +199,15 @@
194 tagElement.appendChild(tagValue)199 tagElement.appendChild(tagValue)
195 background.appendChild(tagElement)200 background.appendChild(tagElement)
196201
197 def child_element(self, tag, value):202 def child_element(self, element, tag, value):
198 tagElement = self.theme_xml.createElement(tag)203 child = self.theme_xml.createElement(tag)
199 tagValue = self.theme_xml.createTextNode(value)204 child.appendChild(self.theme_xml.createTextNode(value))
200 tagElement.appendChild(ftagValue)205 element.appendChild(child)
201 self.background.appendChild(tagElement)206 return child
202207
203 def dump_xml(self):208 def dump_xml(self):
204 # Debugging aid to see what we have209 # Debugging aid to see what we have
205 print self.theme_xml.toprettyxml(indent=" ")210 print self.theme_xml.toprettyxml(indent=u' ')
206211
207 def extract_xml(self):212 def extract_xml(self):
208 # Print our newly created XML213 # Print our newly created XML
@@ -211,18 +216,19 @@
211 def parse(self, xml):216 def parse(self, xml):
212 self.baseParseXml()217 self.baseParseXml()
213 self.parse_xml(xml)218 self.parse_xml(xml)
219 self.theme_filename_extended = False
214220
215 def baseParseXml(self):221 def baseParseXml(self):
216 self.parse_xml(blankthemexml)222 self.parse_xml(blankthemexml)
217223
218 def parse_xml(self, xml):224 def parse_xml(self, xml):
219 theme_xml = ElementTree(element=XML(xml))225 theme_xml = ElementTree(element=XML(xml))
220 iter=theme_xml.getiterator()226 iter = theme_xml.getiterator()
221 master = u''227 master = u''
222 for element in iter:228 for element in iter:
223 #print element.tag, element.text229 #print element.tag, element.text
224 if len(element.getchildren()) > 0:230 if len(element.getchildren()) > 0:
225 master= element.tag + u'_'231 master = element.tag + u'_'
226 if len(element.attrib) > 0:232 if len(element.attrib) > 0:
227 #print "D", element.tag , element.attrib233 #print "D", element.tag , element.attrib
228 for e in element.attrib.iteritems():234 for e in element.attrib.iteritems():
@@ -231,18 +237,18 @@
231 master += e[1] + u'_'237 master += e[1] + u'_'
232 elif master == u'display_' and (element.tag == u'shadow' or element.tag == u'outline'):238 elif master == u'display_' and (element.tag == u'shadow' or element.tag == u'outline'):
233 #print "b", master, element.tag, element.text, e[0], e[1]239 #print "b", master, element.tag, element.text, e[0], e[1]
234 et = convertStringToBoolean(element.text)240 et = str_to_bool(element.text)
235 setattr(self, master + element.tag , et)241 setattr(self, master + element.tag , et)
236 setattr(self, master + element.tag +u'_'+ e[0], e[1])242 setattr(self, master + element.tag + u'_'+ e[0], e[1])
237 else:243 else:
238 field = master + e[0]244 field = master + e[0]
239 e1 = e[1]245 e1 = e[1]
240 if e[1] == u'True' or e[1] == u'False':246 if e[1] == u'True' or e[1] == u'False':
241 e1 = convertStringToBoolean(e[1])247 e1 = str_to_bool(e[1])
242 setattr(self, field, e1)248 setattr(self, field, e1)
243 else:249 else:
244 #print "c", element.tag, element.text250 #print "c", element.tag, element.text
245 if element.tag is not None :251 if element.tag is not None:
246 field = master + element.tag252 field = master + element.tag
247 setattr(self, field, element.text)253 setattr(self, field, element.text)
248254
@@ -250,5 +256,5 @@
250 s = u''256 s = u''
251 for k in dir(self):257 for k in dir(self):
252 if k[0:1] != u'_':258 if k[0:1] != u'_':
253 s+= u'%30s : %s\n' %(k,getattr(self,k))259 s += u'%30s : %s\n' %(k,getattr(self,k))
254 return s260 return s
255261
=== modified file 'openlp/core/lib/xmlrootclass.py'
--- openlp/core/lib/xmlrootclass.py 2008-12-10 21:40:19 +0000
+++ openlp/core/lib/xmlrootclass.py 2009-05-20 20:17:20 +0000
@@ -22,13 +22,9 @@
22import sys22import sys
23import os23import os
24from types import StringType, NoneType, UnicodeType24from types import StringType, NoneType, UnicodeType
25sys.path.append(os.path.abspath("./../.."))25sys.path.append(os.path.abspath(u'./../..'))
2626
27ver = platform.python_version()27from xml.etree.ElementTree import ElementTree, XML
28if ver >= '2.5':
29 from xml.etree.ElementTree import ElementTree, XML
30else:
31 from elementtree import ElementTree, XML
3228
3329
34class XmlRootClass(object):30class XmlRootClass(object):
@@ -47,23 +43,27 @@
47 xml (string) -- formatted as xml tags and values43 xml (string) -- formatted as xml tags and values
48 rootTag -- main tag of the xml44 rootTag -- main tag of the xml
49 """45 """
50 root=ElementTree(element=XML(xml))46 root = ElementTree(element=XML(xml))
51 iter=root.getiterator()47 iter = root.getiterator()
52 for element in iter:48 for element in iter:
53 if element.tag != rootTag:49 if element.tag != rootTag:
54 t=element.text50 t = element.text
55 #print element.tag, t, type(t)51 #print element.tag, t, type(t)
56 if type(t) == NoneType: # easy!52 if type(t) == NoneType:
53 # easy!
57 val=t54 val=t
58 elif type(t) == UnicodeType :55 elif type(t) == UnicodeType :
59 val=t56 val=t
60 elif type(t) == StringType: # strings need special handling to sort the colours out57 elif type(t) == StringType:
58 # strings need special handling to sort the colours out
61 #print "str",59 #print "str",
62 if t[0] == "$": # might be a hex number60 if t[0] == '$':
61 # might be a hex number
63 #print "hex",62 #print "hex",
64 try:63 try:
65 val=int(t[1:], 16)64 val = int(t[1:], 16)
66 except ValueError: # nope65 except ValueError:
66 # nope
67 #print "nope",67 #print "nope",
68 pass68 pass
69 else:69 else:
@@ -74,9 +74,9 @@
74 except ValueError:74 except ValueError:
75 #print "give up",75 #print "give up",
76 val=t76 val=t
77 if hasattr(self, "post_tag_hook"):77 if hasattr(self, u'post_tag_hook'):
78 (element.tag, val) = self.post_tag_hook(element.tag, val)78 (element.tag, val) = self.post_tag_hook(element.tag, val)
79 setattr(self,element.tag, val)79 setattr(self, element.tag, val)
80 pass80 pass
8181
82 def __str__(self):82 def __str__(self):
@@ -88,15 +88,15 @@
88 """88 """
89 l = []89 l = []
90 for k in dir(self):90 for k in dir(self):
91 if not k.startswith("_"):91 if not k.startswith(u'_'):
92 l.append("%30s : %s" %(k,getattr(self,k)))92 l.append(u'%30s : %s' %(k,getattr(self,k)))
93 return "\n".join(l)93 return u'\n'.join(l)
9494
95 def _get_as_string(self):95 def _get_as_string(self):
96 """Return one string with all public attributes"""96 """Return one string with all public attributes"""
97 s=""97 s=""
98 for k in dir(self):98 for k in dir(self):
99 if not k.startswith("_"):99 if not k.startswith(u'_'):
100 s+= "_%s_" %(getattr(self,k))100 s+= u'_%s_' %(getattr(self,k))
101 return s101 return s
102102
103103
=== modified file 'openlp/core/ui/about.py'
--- openlp/core/ui/about.py 2009-05-01 22:26:43 +0000
+++ openlp/core/ui/about.py 2009-05-22 18:30:25 +0000
@@ -19,135 +19,129 @@
19"""19"""
2020
21from PyQt4 import QtCore, QtGui21from PyQt4 import QtCore, QtGui
22from PyQt4.QtGui import QDialog22
2323from openlp.core.lib import translate
24from openlp.core import translate24
25from openlp.core.resources import *25class AboutForm(QtGui.QDialog):
26
27class AboutForm(QDialog):
2826
29 def __init__(self, parent=None):27 def __init__(self, parent=None):
30 QDialog.__init__(self, parent)28 QtGui.QDialog.__init__(self, parent)
31 self.setupUi(self)29 self.setupUi(self)
3230
33 def setupUi(self, AboutForm):31 def setupUi(self, AboutForm):
34 AboutForm.setObjectName("AboutForm")32 AboutForm.setObjectName(u'AboutForm')
35 AboutForm.resize(470, 481)33 AboutForm.resize(470, 481)
36 icon = QtGui.QIcon()34 icon = QtGui.QIcon()
37 icon.addPixmap(QtGui.QPixmap(":/icon/openlp-logo-16x16.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)35 icon.addPixmap(QtGui.QPixmap(u':/icon/openlp-logo-16x16.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off)
38 AboutForm.setWindowIcon(icon)36 AboutForm.setWindowIcon(icon)
39 AboutFormLayout = QtGui.QVBoxLayout(AboutForm)37 AboutFormLayout = QtGui.QVBoxLayout(AboutForm)
40 AboutFormLayout.setSpacing(8)38 AboutFormLayout.setSpacing(8)
41 AboutFormLayout.setMargin(8)39 AboutFormLayout.setMargin(8)
42 AboutFormLayout.setObjectName("AboutDialogLayout")40 AboutFormLayout.setObjectName(u'AboutDialogLayout')
43 self.Logo = QtGui.QLabel(AboutForm)41 self.Logo = QtGui.QLabel(AboutForm)
44 self.Logo.setAutoFillBackground(False)42 self.Logo.setAutoFillBackground(False)
45 self.Logo.setStyleSheet("background-color: rgb(255, 255, 255);")43 self.Logo.setStyleSheet(u'background-color: rgb(255, 255, 255);')
46 self.Logo.setFrameShape(QtGui.QFrame.StyledPanel)44 self.Logo.setFrameShape(QtGui.QFrame.StyledPanel)
47 self.Logo.setLineWidth(1)45 self.Logo.setLineWidth(1)
48 self.Logo.setPixmap(QtGui.QPixmap(":/graphics/openlp-about-logo.png"))46 self.Logo.setPixmap(QtGui.QPixmap(u':/graphics/openlp-about-logo.png'))
49 self.Logo.setScaledContents(False)47 self.Logo.setScaledContents(False)
50 self.Logo.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)48 self.Logo.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
51 self.Logo.setObjectName("Logo")49 self.Logo.setObjectName(u'Logo')
52 AboutFormLayout.addWidget(self.Logo)50 AboutFormLayout.addWidget(self.Logo)
53 self.AboutNotebook = QtGui.QTabWidget(AboutForm)51 self.AboutNotebook = QtGui.QTabWidget(AboutForm)
54 self.AboutNotebook.setObjectName("AboutNotebook")52 self.AboutNotebook.setObjectName(u'AboutNotebook')
55 self.LicenseTab = QtGui.QWidget()53 self.LicenseTab = QtGui.QWidget()
56 self.LicenseTab.setObjectName("LicenseTab")54 self.LicenseTab.setObjectName(u'LicenseTab')
57 self.LicenseTabLayout = QtGui.QVBoxLayout(self.LicenseTab)55 self.LicenseTabLayout = QtGui.QVBoxLayout(self.LicenseTab)
58 self.LicenseTabLayout.setSpacing(8)56 self.LicenseTabLayout.setSpacing(8)
59 self.LicenseTabLayout.setMargin(8)57 self.LicenseTabLayout.setMargin(8)
60 self.LicenseTabLayout.setObjectName("LicenseTabLayout")58 self.LicenseTabLayout.setObjectName(u'LicenseTabLayout')
61 self.CopyrightLabel = QtGui.QLabel(self.LicenseTab)59 self.CopyrightLabel = QtGui.QLabel(self.LicenseTab)
62 self.CopyrightLabel.setObjectName("CopyrightLabel")60 self.CopyrightLabel.setObjectName(u'CopyrightLabel')
63 self.LicenseTabLayout.addWidget(self.CopyrightLabel)61 self.LicenseTabLayout.addWidget(self.CopyrightLabel)
64 self.AboutAuthors = QtGui.QLabel(self.LicenseTab)62 self.AboutAuthors = QtGui.QLabel(self.LicenseTab)
65 self.AboutAuthors.setAlignment(QtCore.Qt.AlignJustify|QtCore.Qt.AlignVCenter)63 self.AboutAuthors.setAlignment(QtCore.Qt.AlignJustify|QtCore.Qt.AlignVCenter)
66 self.AboutAuthors.setWordWrap(True)64 self.AboutAuthors.setWordWrap(True)
67 self.AboutAuthors.setObjectName("AboutAuthors")65 self.AboutAuthors.setObjectName(u'AboutAuthors')
68 self.LicenseTabLayout.addWidget(self.AboutAuthors)66 self.LicenseTabLayout.addWidget(self.AboutAuthors)
69 self.License1Label = QtGui.QLabel(self.LicenseTab)67 self.License1Label = QtGui.QLabel(self.LicenseTab)
70 self.License1Label.setAlignment(QtCore.Qt.AlignJustify|QtCore.Qt.AlignVCenter)68 self.License1Label.setAlignment(QtCore.Qt.AlignJustify|QtCore.Qt.AlignVCenter)
71 self.License1Label.setWordWrap(True)69 self.License1Label.setWordWrap(True)
72 self.License1Label.setObjectName("License1Label")70 self.License1Label.setObjectName(u'License1Label')
73 self.LicenseTabLayout.addWidget(self.License1Label)71 self.LicenseTabLayout.addWidget(self.License1Label)
74 self.License2Label = QtGui.QLabel(self.LicenseTab)72 self.License2Label = QtGui.QLabel(self.LicenseTab)
75 self.License2Label.setAlignment(QtCore.Qt.AlignJustify|QtCore.Qt.AlignVCenter)73 self.License2Label.setAlignment(QtCore.Qt.AlignJustify|QtCore.Qt.AlignVCenter)
76 self.License2Label.setWordWrap(True)74 self.License2Label.setWordWrap(True)
77 self.License2Label.setObjectName("License2Label")75 self.License2Label.setObjectName(u'License2Label')
78 self.LicenseTabLayout.addWidget(self.License2Label)76 self.LicenseTabLayout.addWidget(self.License2Label)
79 self.License3Label = QtGui.QLabel(self.LicenseTab)77 self.License3Label = QtGui.QLabel(self.LicenseTab)
80 self.License3Label.setAlignment(QtCore.Qt.AlignJustify|QtCore.Qt.AlignVCenter)78 self.License3Label.setAlignment(QtCore.Qt.AlignJustify|QtCore.Qt.AlignVCenter)
81 self.License3Label.setWordWrap(True)79 self.License3Label.setWordWrap(True)
82 self.License3Label.setObjectName("License3Label")80 self.License3Label.setObjectName(u'License3Label')
83 self.LicenseTabLayout.addWidget(self.License3Label)81 self.LicenseTabLayout.addWidget(self.License3Label)
84 self.AboutNotebook.addTab(self.LicenseTab, "License")82 self.AboutNotebook.addTab(self.LicenseTab, u'License')
85 self.CreditsTab = QtGui.QWidget()83 self.CreditsTab = QtGui.QWidget()
86 self.CreditsTab.setObjectName("CreditsTab")84 self.CreditsTab.setObjectName(u'CreditsTab')
87 self.CreditsTabLayout = QtGui.QVBoxLayout(self.CreditsTab)85 self.CreditsTabLayout = QtGui.QVBoxLayout(self.CreditsTab)
88 self.CreditsTabLayout.setSpacing(0) #86 self.CreditsTabLayout.setSpacing(0) #
89 self.CreditsTabLayout.setMargin(8) #87 self.CreditsTabLayout.setMargin(8) #
90 self.CreditsTabLayout.setObjectName("CreditsTabLayout")88 self.CreditsTabLayout.setObjectName(u'CreditsTabLayout')
91 self.CreditsTextEdit = QtGui.QTextEdit(self.CreditsTab)89 self.CreditsTextEdit = QtGui.QTextEdit(self.CreditsTab)
92 self.CreditsTextEdit.setReadOnly(True)90 self.CreditsTextEdit.setReadOnly(True)
93 self.CreditsTextEdit.setObjectName("CreditsTextEdit")91 self.CreditsTextEdit.setObjectName(u'CreditsTextEdit')
94 self.CreditsTabLayout.addWidget(self.CreditsTextEdit)92 self.CreditsTabLayout.addWidget(self.CreditsTextEdit)
95 self.AboutNotebook.addTab(self.CreditsTab, "Credits")93 self.AboutNotebook.addTab(self.CreditsTab, u'Credits')
96 AboutFormLayout.addWidget(self.AboutNotebook)94 AboutFormLayout.addWidget(self.AboutNotebook)
97 self.ButtonWidget = QtGui.QWidget(AboutForm)95 self.ButtonWidget = QtGui.QWidget(AboutForm)
98 self.ButtonWidget.setObjectName("ButtonWidget")96 self.ButtonWidget.setObjectName(u'ButtonWidget')
99 self.ButtonWidgetLayout = QtGui.QHBoxLayout(self.ButtonWidget)97 self.ButtonWidgetLayout = QtGui.QHBoxLayout(self.ButtonWidget)
100 self.ButtonWidgetLayout.setSpacing(8)98 self.ButtonWidgetLayout.setSpacing(8)
101 self.ButtonWidgetLayout.setMargin(0)99 self.ButtonWidgetLayout.setMargin(0)
102 self.ButtonWidgetLayout.setObjectName("ButtonWidgetLayout")100 self.ButtonWidgetLayout.setObjectName(u'ButtonWidgetLayout')
103 spacerItem = QtGui.QSpacerItem(275, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)101 spacerItem = QtGui.QSpacerItem(275, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
104 self.ButtonWidgetLayout.addItem(spacerItem)102 self.ButtonWidgetLayout.addItem(spacerItem)
105 self.ContributeButton = QtGui.QPushButton(self.ButtonWidget)103 self.ContributeButton = QtGui.QPushButton(self.ButtonWidget)
106 self.ContributeButton.setObjectName("ContributeButton")104 self.ContributeButton.setObjectName(u'ContributeButton')
107 self.ButtonWidgetLayout.addWidget(self.ContributeButton)105 self.ButtonWidgetLayout.addWidget(self.ContributeButton)
108 self.CloseButton = QtGui.QPushButton(self.ButtonWidget)106 self.CloseButton = QtGui.QPushButton(self.ButtonWidget)
109 self.CloseButton.setObjectName("CloseButton")107 self.CloseButton.setObjectName(u'CloseButton')
110 self.ButtonWidgetLayout.addWidget(self.CloseButton)108 self.ButtonWidgetLayout.addWidget(self.CloseButton)
111 AboutFormLayout.addWidget(self.ButtonWidget)109 AboutFormLayout.addWidget(self.ButtonWidget)
112 self.extContributeItem = QtGui.QAction(AboutForm)110 self.extContributeItem = QtGui.QAction(AboutForm)
113 self.extContributeItem.setObjectName("extContributeItem")111 self.extContributeItem.setObjectName(u'extContributeItem')
114112
115 self.retranslateUi(AboutForm)113 self.retranslateUi(AboutForm)
116 self.AboutNotebook.setCurrentIndex(0)114 self.AboutNotebook.setCurrentIndex(0)
117 QtCore.QObject.connect(self.CloseButton, QtCore.SIGNAL("clicked()"), AboutForm.close)115 QtCore.QObject.connect(self.CloseButton, QtCore.SIGNAL(u'clicked()'), AboutForm.close)
118 QtCore.QMetaObject.connectSlotsByName(AboutForm)116 QtCore.QMetaObject.connectSlotsByName(AboutForm)
119117
120 QtCore.QObject.connect(self.ContributeButton, QtCore.SIGNAL("clicked()"), self.onContributeButtonClicked)118 QtCore.QObject.connect(self.ContributeButton, QtCore.SIGNAL(u'clicked()'), self.onContributeButtonClicked)
121119
122 def retranslateUi(self, AboutForm):120 def retranslateUi(self, AboutForm):
123 AboutForm.setWindowTitle(translate("AboutDialog", "About openlp.org",))121 AboutForm.setWindowTitle(translate(u'AboutDialog', u'About openlp.org',))
124 self.CopyrightLabel.setText(translate("AboutDialog", "Copyright © 2004-2009 openlp.org Foundation"))122 self.CopyrightLabel.setText(translate(u'AboutDialog', u'Copyright © 2004-2009 openlp.org Foundation'))
125 self.AboutAuthors.setText(translate("AboutDialog", "openlp.org is written and maintained by volunteers. If you would like to see more free Christian software being written, please consider contributing by using the button below."))123 self.AboutAuthors.setText(translate(u'AboutDialog', u'openlp.org is written and maintained by volunteers. If you would like to see more free Christian software being written, please consider contributing by using the button below.'))
126 self.License1Label.setText(translate("AboutDialog", "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; either version 2 of the License, or (at your option) any later version."))124 self.License1Label.setText(translate(u'AboutDialog', u'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; either version 2 of the License, or (at your option) any later version.'))
127 self.License2Label.setText(translate("AboutDialog", "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."))125 self.License2Label.setText(translate(u'AboutDialog', u'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.'))
128 self.License3Label.setText(translate("AboutDialog", "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."))126 self.License3Label.setText(translate(u'AboutDialog', u'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.'))
129 self.AboutNotebook.setTabText(self.AboutNotebook.indexOf(self.LicenseTab), QtGui.QApplication.translate("AboutDialog", "License", None, QtGui.QApplication.UnicodeUTF8))127 self.AboutNotebook.setTabText(self.AboutNotebook.indexOf(self.LicenseTab), translate(u'AboutDialog', u'License'))
130 self.CreditsTextEdit.setPlainText(translate("AboutDialog", "Project Lead\n"128 self.CreditsTextEdit.setPlainText(translate(u'AboutDialog',
131" Raoul \"superfly\" Snyman\n"129 u'Project Lead\n'
132"\n"130 u' Raoul \"superfly\" Snyman\n'
133"Developers\n"131 u'\n'
134" Tim \"TRB143\" Bentley\n"132 u'Developers\n'
135" Jonathan \"gushie\" Corwin\n"133 u' Tim \"TRB143\" Bentley\n'
136" Scott \"sguerrieri\" Guerrieri\n"134 u' Jonathan \"gushie\" Corwin\n'
137" Raoul \"superfly\" Snyman\n"135 u' Scott \"sguerrieri\" Guerrieri\n'
138" Martin \"mijiti\" Thompson\n"136 u' Raoul \"superfly\" Snyman\n'
139" Carsten \"catini\" Tingaard"))137 u' Martin \"mijiti\" Thompson\n'
140 self.AboutNotebook.setTabText(self.AboutNotebook.indexOf(self.CreditsTab), translate("AboutDialog", "Credits"))138 u' Carsten \"catini\" Tingaard'))
141 self.ContributeButton.setText(translate("AboutDialog", "Contribute"))139 self.AboutNotebook.setTabText(self.AboutNotebook.indexOf(self.CreditsTab), translate(u'AboutDialog', u'Credits'))
142 self.CloseButton.setText(translate("AboutDialog", "Close"))140 self.ContributeButton.setText(translate(u'AboutDialog', u'Contribute'))
143 self.extContributeItem.setText(translate("AboutDialog", "&Contribute"))141 self.CloseButton.setText(translate(u'AboutDialog', u'Close'))
142 self.extContributeItem.setText(translate(u'AboutDialog', u'&Contribute'))
144143
145 def onContributeButtonClicked(self):144 def onContributeButtonClicked(self):
146 ''' This routine will open the default
147 web-browser to the contribute page
148 of openlp.org as did the original
149 button on the About form
150 '''
151 import webbrowser145 import webbrowser
152 url = "http://www.openlp.org/en/documentation/introduction/contributing.html"146 url = "http://www.openlp.org/en/documentation/introduction/contributing.html"
153 webbrowser.open_new(url)147 webbrowser.open_new(url)
154148
=== modified file 'openlp/core/ui/alertform.py'
--- openlp/core/ui/alertform.py 2009-05-01 22:26:43 +0000
+++ openlp/core/ui/alertform.py 2009-05-20 20:17:20 +0000
@@ -19,17 +19,14 @@
19"""19"""
20import logging20import logging
21from PyQt4 import QtCore, QtGui21from PyQt4 import QtCore, QtGui
22from PyQt4.QtGui import QDialog22from openlp.core.lib import translate
2323
24from openlp.core import translate24class AlertForm(QtGui.QDialog):
25from openlp.core.resources import *
26
27class AlertForm(QDialog):
28 global log25 global log
29 log=logging.getLogger(u'AlertForm')26 log=logging.getLogger(u'AlertForm')
3027
31 def __init__(self, parent=None):28 def __init__(self, parent=None):
32 QDialog.__init__(self, parent)29 QtGui.QDialog.__init__(self, parent)
33 self.setupUi(self)30 self.setupUi(self)
34 log.info(u'Defined')31 log.info(u'Defined')
3532
3633
=== modified file 'openlp/core/ui/alertstab.py'
--- openlp/core/ui/alertstab.py 2009-03-05 20:31:17 +0000
+++ openlp/core/ui/alertstab.py 2009-05-20 20:17:20 +0000
@@ -19,11 +19,8 @@
19"""19"""
2020
21from PyQt4 import QtCore, QtGui21from PyQt4 import QtCore, QtGui
22from PyQt4.QtGui import QColor, QFont
2322
24from openlp.core import translate23from openlp.core.lib import SettingsTab, translate
25from openlp.core.lib import SettingsTab
26from openlp.core.resources import *
2724
28class AlertsTab(SettingsTab):25class AlertsTab(SettingsTab):
29 """26 """
@@ -175,7 +172,7 @@
175 self.timeout = int(self.config.get_config('timeout', 5))172 self.timeout = int(self.config.get_config('timeout', 5))
176 self.font_color = str(self.config.get_config('font color', u'#ffffff'))173 self.font_color = str(self.config.get_config('font color', u'#ffffff'))
177 self.bg_color = str(self.config.get_config('background color', u'#660000'))174 self.bg_color = str(self.config.get_config('background color', u'#660000'))
178 self.font_face = str(self.config.get_config('font face', QFont().family()))175 self.font_face = str(self.config.get_config('font face', QtGui.QFont().family()))
179 self.TimeoutSpinBox.setValue(self.timeout)176 self.TimeoutSpinBox.setValue(self.timeout)
180 self.FontColorButton.setStyleSheet('background-color: %s' % self.font_color)177 self.FontColorButton.setStyleSheet('background-color: %s' % self.font_color)
181 self.BackgroundColorButton.setStyleSheet('background-color: %s' % self.bg_color)178 self.BackgroundColorButton.setStyleSheet('background-color: %s' % self.bg_color)
@@ -192,7 +189,7 @@
192 self.config.set_config('timeout', str(self.timeout))189 self.config.set_config('timeout', str(self.timeout))
193190
194 def updateDisplay(self):191 def updateDisplay(self):
195 font = QFont()192 font = QtGui.QFont()
196 font.setFamily(self.FontComboBox.currentFont().family())193 font.setFamily(self.FontComboBox.currentFont().family())
197 font.setBold(True)194 font.setBold(True)
198 font.setPointSize(16)195 font.setPointSize(16)
199196
=== modified file 'openlp/core/ui/amendthemedialog.py'
--- openlp/core/ui/amendthemedialog.py 2009-05-01 22:26:43 +0000
+++ openlp/core/ui/amendthemedialog.py 2009-05-22 18:30:25 +0000
@@ -456,7 +456,7 @@
456 self.ThemePreviewLayout.setSpacing(8)456 self.ThemePreviewLayout.setSpacing(8)
457 self.ThemePreviewLayout.setMargin(8)457 self.ThemePreviewLayout.setMargin(8)
458 self.ThemePreviewLayout.setObjectName("ThemePreviewLayout")458 self.ThemePreviewLayout.setObjectName("ThemePreviewLayout")
459 spacerItem7 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)459 spacerItem7 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
460 self.ThemePreviewLayout.addItem(spacerItem7)460 self.ThemePreviewLayout.addItem(spacerItem7)
461 self.ThemePreview = QtGui.QLabel(self.PreviewGroupBox)461 self.ThemePreview = QtGui.QLabel(self.PreviewGroupBox)
462 sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)462 sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
@@ -464,14 +464,14 @@
464 sizePolicy.setVerticalStretch(0)464 sizePolicy.setVerticalStretch(0)
465 sizePolicy.setHeightForWidth(self.ThemePreview.sizePolicy().hasHeightForWidth())465 sizePolicy.setHeightForWidth(self.ThemePreview.sizePolicy().hasHeightForWidth())
466 self.ThemePreview.setSizePolicy(sizePolicy)466 self.ThemePreview.setSizePolicy(sizePolicy)
467 self.ThemePreview.setMinimumSize(QtCore.QSize(300, 225))467 self.ThemePreview.setMaximumSize(QtCore.QSize(300, 225))
468 self.ThemePreview.setFrameShape(QtGui.QFrame.WinPanel)468 self.ThemePreview.setFrameShape(QtGui.QFrame.WinPanel)
469 self.ThemePreview.setFrameShadow(QtGui.QFrame.Sunken)469 self.ThemePreview.setFrameShadow(QtGui.QFrame.Sunken)
470 self.ThemePreview.setLineWidth(1)470 self.ThemePreview.setLineWidth(1)
471 self.ThemePreview.setScaledContents(True)471 self.ThemePreview.setScaledContents(True)
472 self.ThemePreview.setObjectName("ThemePreview")472 self.ThemePreview.setObjectName("ThemePreview")
473 self.ThemePreviewLayout.addWidget(self.ThemePreview)473 self.ThemePreviewLayout.addWidget(self.ThemePreview)
474 spacerItem8 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)474 spacerItem8 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
475 self.ThemePreviewLayout.addItem(spacerItem8)475 self.ThemePreviewLayout.addItem(spacerItem8)
476 self.AmendThemeLayout.addWidget(self.PreviewGroupBox)476 self.AmendThemeLayout.addWidget(self.PreviewGroupBox)
477 self.ThemeButtonBox = QtGui.QDialogButtonBox(AmendThemeDialog)477 self.ThemeButtonBox = QtGui.QDialogButtonBox(AmendThemeDialog)
@@ -517,7 +517,7 @@
517 AmendThemeDialog.setTabOrder(self.HorizontalComboBox, self.VerticalComboBox)517 AmendThemeDialog.setTabOrder(self.HorizontalComboBox, self.VerticalComboBox)
518518
519 def retranslateUi(self, AmendThemeDialog):519 def retranslateUi(self, AmendThemeDialog):
520 AmendThemeDialog.setWindowTitle(QtGui.QApplication.translate("AmendThemeDialog", "Theme Maintance", None, QtGui.QApplication.UnicodeUTF8))520 AmendThemeDialog.setWindowTitle(QtGui.QApplication.translate("AmendThemeDialog", "Theme Maintenance", None, QtGui.QApplication.UnicodeUTF8))
521 self.ThemeNameLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Theme Name:", None, QtGui.QApplication.UnicodeUTF8))521 self.ThemeNameLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Theme Name:", None, QtGui.QApplication.UnicodeUTF8))
522 self.BackgroundLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Background:", None, QtGui.QApplication.UnicodeUTF8))522 self.BackgroundLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Background:", None, QtGui.QApplication.UnicodeUTF8))
523 self.BackgroundComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Opaque", None, QtGui.QApplication.UnicodeUTF8))523 self.BackgroundComboBox.setItemText(0, QtGui.QApplication.translate("AmendThemeDialog", "Opaque", None, QtGui.QApplication.UnicodeUTF8))
524524
=== modified file 'openlp/core/ui/amendthemeform.py'
--- openlp/core/ui/amendthemeform.py 2009-05-16 19:47:30 +0000
+++ openlp/core/ui/amendthemeform.py 2009-05-22 05:14:55 +0000
@@ -21,9 +21,7 @@
21import os, os.path21import os, os.path
2222
23from PyQt4 import QtCore, QtGui23from PyQt4 import QtCore, QtGui
24from PyQt4.QtGui import QColor, QFont24from openlp.core.lib import ThemeXML, Renderer, file_to_xml, translate
25from openlp.core.lib import ThemeXML, Renderer
26from openlp.core import fileToXML, translate
2725
28from amendthemedialog import Ui_AmendThemeDialog26from amendthemedialog import Ui_AmendThemeDialog
2927
@@ -34,7 +32,9 @@
34 def __init__(self, thememanager, parent=None):32 def __init__(self, thememanager, parent=None):
35 QtGui.QDialog.__init__(self, parent)33 QtGui.QDialog.__init__(self, parent)
36 self.thememanager = thememanager34 self.thememanager = thememanager
37 self.theme = ThemeXML() # Needed here as UI setup generates Events35 # Needed here as UI setup generates Events
36 self.path = None
37 self.theme = ThemeXML()
38 self.setupUi(self)38 self.setupUi(self)
3939
40 #define signals40 #define signals
@@ -113,15 +113,15 @@
113 else:113 else:
114 (path, filename) =os.path.split(str(self.theme.background_filename))114 (path, filename) =os.path.split(str(self.theme.background_filename))
115 new_theme.add_background_image(filename)115 new_theme.add_background_image(filename)
116 save_to= os.path.join(self.path, theme_name,filename )116 save_to= os.path.join(self.path, theme_name, filename )
117 save_from = self.theme.background_filename117 save_from = self.theme.background_filename
118118
119 new_theme.add_font(str(self.theme.font_main_name), str(self.theme.font_main_color),119 new_theme.add_font(str(self.theme.font_main_name), str(self.theme.font_main_color),
120 str(self.theme.font_main_proportion), str(self.theme.font_main_override),u'main',120 str(self.theme.font_main_proportion), str(self.theme.font_main_override), u'main',
121 str(self.theme.font_main_x), str(self.theme.font_main_y), str(self.theme.font_main_width),121 str(self.theme.font_main_x), str(self.theme.font_main_y), str(self.theme.font_main_width),
122 str(self.theme.font_main_height))122 str(self.theme.font_main_height))
123 new_theme.add_font(str(self.theme.font_footer_name), str(self.theme.font_footer_color),123 new_theme.add_font(str(self.theme.font_footer_name), str(self.theme.font_footer_color),
124 str(self.theme.font_footer_proportion), str(self.theme.font_footer_override),u'footer',124 str(self.theme.font_footer_proportion), str(self.theme.font_footer_override), u'footer',
125 str(self.theme.font_footer_x), str(self.theme.font_footer_y), str(self.theme.font_footer_width),125 str(self.theme.font_footer_x), str(self.theme.font_footer_y), str(self.theme.font_footer_width),
126 str(self.theme.font_footer_height) )126 str(self.theme.font_footer_height) )
127 new_theme.add_display(str(self.theme.display_shadow), str(self.theme.display_shadow_color),127 new_theme.add_display(str(self.theme.display_shadow), str(self.theme.display_shadow_color),
@@ -134,17 +134,15 @@
134 self.thememanager.saveTheme(theme_name, theme, save_from, save_to)134 self.thememanager.saveTheme(theme_name, theme, save_from, save_to)
135 return QtGui.QDialog.accept(self)135 return QtGui.QDialog.accept(self)
136136
137 def themePath(self, path):
138 self.path = path
139
140 def loadTheme(self, theme):137 def loadTheme(self, theme):
141 log.debug(u'LoadTheme %s ', theme)138 log.debug(u'LoadTheme %s', theme)
142 if theme == None:139 if theme == None:
143 self.theme.parse(self.baseTheme())140 self.theme.parse(self.baseTheme())
144 else:141 else:
145 xml_file = os.path.join(self.path, theme, theme+u'.xml')142 xml_file = os.path.join(self.path, theme, theme + u'.xml')
146 xml = fileToXML(xml_file)143 xml = file_to_xml(xml_file)
147 self.theme.parse(xml)144 self.theme.parse(xml)
145 self.theme.extend_image_filename(self.path)
148 self.allowPreview = False146 self.allowPreview = False
149 self.paintUi(self.theme)147 self.paintUi(self.theme)
150 self.allowPreview = True148 self.allowPreview = True
@@ -165,10 +163,10 @@
165163
166 def onFontMainColorPushButtonClicked(self):164 def onFontMainColorPushButtonClicked(self):
167 self.theme.font_main_color = QtGui.QColorDialog.getColor(165 self.theme.font_main_color = QtGui.QColorDialog.getColor(
168 QColor(self.theme.font_main_color), self).name()166 QtGui.QColor(self.theme.font_main_color), self).name()
169167
170 self.FontMainColorPushButton.setStyleSheet(168 self.FontMainColorPushButton.setStyleSheet(
171 'background-color: %s' % str(self.theme.font_main_color))169 u'background-color: %s' % str(self.theme.font_main_color))
172 self.previewTheme(self.theme)170 self.previewTheme(self.theme)
173171
174 def onFontMainSizeSpinBoxChanged(self, value):172 def onFontMainSizeSpinBoxChanged(self, value):
@@ -218,7 +216,7 @@
218216
219 def onFontFooterColorPushButtonClicked(self):217 def onFontFooterColorPushButtonClicked(self):
220 self.theme.font_footer_color = QtGui.QColorDialog.getColor(218 self.theme.font_footer_color = QtGui.QColorDialog.getColor(
221 QColor(self.theme.font_footer_color), self).name()219 QtGui.QColor(self.theme.font_footer_color), self).name()
222220
223 self.FontFooterColorPushButton.setStyleSheet(221 self.FontFooterColorPushButton.setStyleSheet(
224 'background-color: %s' % str(self.theme.font_footer_color))222 'background-color: %s' % str(self.theme.font_footer_color))
@@ -307,22 +305,22 @@
307 def onColor1PushButtonClicked(self):305 def onColor1PushButtonClicked(self):
308 if self.theme.background_type == u'solid':306 if self.theme.background_type == u'solid':
309 self.theme.background_color = QtGui.QColorDialog.getColor(307 self.theme.background_color = QtGui.QColorDialog.getColor(
310 QColor(self.theme.background_color), self).name()308 QtGui.QColor(self.theme.background_color), self).name()
311 self.Color1PushButton.setStyleSheet(309 self.Color1PushButton.setStyleSheet(
312 'background-color: %s' % str(self.theme.background_color))310 u'background-color: %s' % str(self.theme.background_color))
313 else:311 else:
314 self.theme.background_startColor = QtGui.QColorDialog.getColor(312 self.theme.background_startColor = QtGui.QColorDialog.getColor(
315 QColor(self.theme.background_startColor), self).name()313 QtGui.QColor(self.theme.background_startColor), self).name()
316 self.Color1PushButton.setStyleSheet(314 self.Color1PushButton.setStyleSheet(
317 'background-color: %s' % str(self.theme.background_startColor))315 u'background-color: %s' % str(self.theme.background_startColor))
318316
319 self.previewTheme(self.theme)317 self.previewTheme(self.theme)
320318
321 def onColor2PushButtonClicked(self):319 def onColor2PushButtonClicked(self):
322 self.theme.background_endColor = QtGui.QColorDialog.getColor(320 self.theme.background_endColor = QtGui.QColorDialog.getColor(
323 QColor(self.theme.background_endColor), self).name()321 QtGui.QColor(self.theme.background_endColor), self).name()
324 self.Color2PushButton.setStyleSheet(322 self.Color2PushButton.setStyleSheet(
325 'background-color: %s' % str(self.theme.background_endColor))323 u'background-color: %s' % str(self.theme.background_endColor))
326324
327 self.previewTheme(self.theme)325 self.previewTheme(self.theme)
328 #326 #
@@ -338,9 +336,9 @@
338336
339 def onOutlineColorPushButtonClicked(self):337 def onOutlineColorPushButtonClicked(self):
340 self.theme.display_outline_color = QtGui.QColorDialog.getColor(338 self.theme.display_outline_color = QtGui.QColorDialog.getColor(
341 QColor(self.theme.display_outline_color), self).name()339 QtGui.QColor(self.theme.display_outline_color), self).name()
342 self.OutlineColorPushButton.setStyleSheet(340 self.OutlineColorPushButton.setStyleSheet(
343 'background-color: %s' % str(self.theme.display_outline_color))341 u'background-color: %s' % str(self.theme.display_outline_color))
344 self.previewTheme(self.theme)342 self.previewTheme(self.theme)
345343
346 def onShadowCheckBoxChanged(self, value):344 def onShadowCheckBoxChanged(self, value):
@@ -353,9 +351,9 @@
353351
354 def onShadowColorPushButtonClicked(self):352 def onShadowColorPushButtonClicked(self):
355 self.theme.display_shadow_color = QtGui.QColorDialog.getColor(353 self.theme.display_shadow_color = QtGui.QColorDialog.getColor(
356 QColor(self.theme.display_shadow_color), self).name()354 QtGui.QColor(self.theme.display_shadow_color), self).name()
357 self.ShadowColorPushButton.setStyleSheet(355 self.ShadowColorPushButton.setStyleSheet(
358 'background-color: %s' % str(self.theme.display_shadow_color))356 u'background-color: %s' % str(self.theme.display_shadow_color))
359 self.previewTheme(self.theme)357 self.previewTheme(self.theme)
360358
361 def onHorizontalComboBoxSelected(self, currentIndex):359 def onHorizontalComboBoxSelected(self, currentIndex):
@@ -375,8 +373,8 @@
375 newtheme = ThemeXML()373 newtheme = ThemeXML()
376 newtheme.new_document(u'New Theme')374 newtheme.new_document(u'New Theme')
377 newtheme.add_background_solid(str(u'#000000'))375 newtheme.add_background_solid(str(u'#000000'))
378 newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(30), u'False')376 newtheme.add_font(str(QtGui.QFont().family()), str(u'#FFFFFF'), str(30), u'False')
379 newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(12), u'False', u'footer')377 newtheme.add_font(str(QtGui.QFont().family()), str(u'#FFFFFF'), str(12), u'False', u'footer')
380 newtheme.add_display(u'False', str(u'#FFFFFF'), u'False', str(u'#FFFFFF'),378 newtheme.add_display(u'False', str(u'#FFFFFF'), u'False', str(u'#FFFFFF'),
381 str(0), str(0), str(0))379 str(0), str(0), str(0))
382380
@@ -415,9 +413,9 @@
415 self.FontFooterWidthSpinBox.setValue(int(self.theme.font_footer_width))413 self.FontFooterWidthSpinBox.setValue(int(self.theme.font_footer_width))
416 self.FontFooterHeightSpinBox.setValue(int(self.theme.font_footer_height))414 self.FontFooterHeightSpinBox.setValue(int(self.theme.font_footer_height))
417 self.FontMainColorPushButton.setStyleSheet(415 self.FontMainColorPushButton.setStyleSheet(
418 'background-color: %s' % str(theme.font_main_color))416 u'background-color: %s' % str(theme.font_main_color))
419 self.FontFooterColorPushButton.setStyleSheet(417 self.FontFooterColorPushButton.setStyleSheet(
420 'background-color: %s' % str(theme.font_footer_color))418 u'background-color: %s' % str(theme.font_footer_color))
421419
422 if self.theme.font_main_override == False:420 if self.theme.font_main_override == False:
423 self.FontMainDefaultCheckBox.setChecked(True)421 self.FontMainDefaultCheckBox.setChecked(True)
@@ -430,9 +428,9 @@
430 self.FontFooterDefaultCheckBox.setChecked(False)428 self.FontFooterDefaultCheckBox.setChecked(False)
431429
432 self.OutlineColorPushButton.setStyleSheet(430 self.OutlineColorPushButton.setStyleSheet(
433 'background-color: %s' % str(theme.display_outline_color))431 u'background-color: %s' % str(theme.display_outline_color))
434 self.ShadowColorPushButton.setStyleSheet(432 self.ShadowColorPushButton.setStyleSheet(
435 'background-color: %s' % str(theme.display_shadow_color))433 u'background-color: %s' % str(theme.display_shadow_color))
436434
437 if self.theme.display_outline:435 if self.theme.display_outline:
438 self.OutlineCheckBox.setChecked(True)436 self.OutlineCheckBox.setChecked(True)
@@ -454,7 +452,7 @@
454 def stateChanging(self, theme):452 def stateChanging(self, theme):
455 if theme.background_type == u'solid':453 if theme.background_type == u'solid':
456 self.Color1PushButton.setStyleSheet(454 self.Color1PushButton.setStyleSheet(
457 'background-color: %s' % str(theme.background_color))455 u'background-color: %s' % str(theme.background_color))
458 self.Color1Label.setText(translate(u'ThemeManager', u'Background Color:'))456 self.Color1Label.setText(translate(u'ThemeManager', u'Background Color:'))
459 self.Color1Label.setVisible(True)457 self.Color1Label.setVisible(True)
460 self.Color1PushButton.setVisible(True)458 self.Color1PushButton.setVisible(True)
@@ -467,9 +465,9 @@
467 self.GradientComboBox.setVisible(False)465 self.GradientComboBox.setVisible(False)
468 elif theme.background_type == u'gradient':466 elif theme.background_type == u'gradient':
469 self.Color1PushButton.setStyleSheet(467 self.Color1PushButton.setStyleSheet(
470 'background-color: %s' % str(theme.background_startColor))468 u'background-color: %s' % str(theme.background_startColor))
471 self.Color2PushButton.setStyleSheet(469 self.Color2PushButton.setStyleSheet(
472 'background-color: %s' % str(theme.background_endColor))470 u'background-color: %s' % str(theme.background_endColor))
473 self.Color1Label.setText(translate(u'ThemeManager', u'First Color:'))471 self.Color1Label.setText(translate(u'ThemeManager', u'First Color:'))
474 self.Color2Label.setText(translate(u'ThemeManager', u'Second Color:'))472 self.Color2Label.setText(translate(u'ThemeManager', u'Second Color:'))
475 self.Color1Label.setVisible(True)473 self.Color1Label.setVisible(True)
476474
=== modified file 'openlp/core/ui/generaltab.py'
--- openlp/core/ui/generaltab.py 2009-05-01 11:50:09 +0000
+++ openlp/core/ui/generaltab.py 2009-05-20 20:17:20 +0000
@@ -20,9 +20,7 @@
2020
21from PyQt4 import QtCore, QtGui21from PyQt4 import QtCore, QtGui
2222
23from openlp.core import translate23from openlp.core.lib import SettingsTab, translate
24from openlp.core.lib import SettingsTab
25from openlp.core.resources import *
2624
27class GeneralTab(SettingsTab):25class GeneralTab(SettingsTab):
28 """26 """
2927
=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py 2009-05-18 19:04:25 +0000
+++ openlp/core/ui/maindisplay.py 2009-05-20 20:17:20 +0000
@@ -20,7 +20,7 @@
2020
21from PyQt4 import QtCore, QtGui21from PyQt4 import QtCore, QtGui
2222
23from openlp.core import translate23from openlp.core.lib import translate
2424
25class MainDisplay(QtGui.QWidget):25class MainDisplay(QtGui.QWidget):
2626
2727
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2009-05-18 19:04:25 +0000
+++ openlp/core/ui/mainwindow.py 2009-05-20 20:17:20 +0000
@@ -21,29 +21,28 @@
21import logging21import logging
22from time import sleep22from time import sleep
2323
24from PyQt4 import *
25from PyQt4 import QtCore, QtGui24from PyQt4 import QtCore, QtGui
2625
27from openlp.core.ui import AboutForm, SettingsForm, AlertForm, \26from openlp.core.ui import AboutForm, SettingsForm, AlertForm, \
28 SlideController, ServiceManager, ThemeManager, MainDisplay27 SlideController, ServiceManager, ThemeManager, MainDisplay
29from openlp.core.lib import Plugin, MediaManagerItem, SettingsTab, EventManager, RenderManager28from openlp.core.lib import Plugin, MediaManagerItem, SettingsTab, EventManager, RenderManager, translate
3029
31from openlp.core import PluginManager, translate30from openlp.core import PluginManager
3231
33class MainWindow(object):32class MainWindow(object):
34 global log33 global log
35 log=logging.getLogger(u'MainWindow')34 log = logging.getLogger(u'MainWindow')
36 log.info(u'MainWindow loaded')35 log.info(u'MainWindow loaded')
3736
38 def __init__(self, screens):37 def __init__(self, screens):
39 self.main_window = QtGui.QMainWindow()38 self.mainWindow = QtGui.QMainWindow()
40 self.main_window.__class__.closeEvent = self.onCloseEvent39 self.mainWindow.__class__.closeEvent = self.onCloseEvent
41 self.main_display = MainDisplay(None, screens)40 self.mainDisplay = MainDisplay(None, screens)
42 self.screen_list = screens41 self.screenList = screens
43 self.EventManager = EventManager()42 self.EventManager = EventManager()
44 self.alert_form = AlertForm()43 self.alertForm = AlertForm()
45 self.about_form = AboutForm()44 self.aboutForm = AboutForm()
46 self.settings_form = SettingsForm(self.screen_list, self)45 self.settingsForm = SettingsForm(self.screenList, self)
4746
48 pluginpath = os.path.split(os.path.abspath(__file__))[0]47 pluginpath = os.path.split(os.path.abspath(__file__))[0]
49 pluginpath = os.path.abspath(os.path.join(pluginpath, u'..', u'..', u'plugins'))48 pluginpath = os.path.abspath(os.path.join(pluginpath, u'..', u'..', u'plugins'))
@@ -55,7 +54,7 @@
55 #warning cyclic dependency54 #warning cyclic dependency
56 #RenderManager needs to call ThemeManager and55 #RenderManager needs to call ThemeManager and
57 #ThemeManager needs to call RenderManager56 #ThemeManager needs to call RenderManager
58 self.RenderManager = RenderManager(self.ThemeManagerContents, self.screen_list)57 self.RenderManager = RenderManager(self.ThemeManagerContents, self.screenList)
5958
60 log.info(u'Load Plugins')59 log.info(u'Load Plugins')
61 self.plugin_helpers[u'preview'] = self.PreviewController60 self.plugin_helpers[u'preview'] = self.PreviewController
@@ -75,7 +74,7 @@
7574
76 # Find and insert settings tabs75 # Find and insert settings tabs
77 log.info(u'hook settings')76 log.info(u'hook settings')
78 self.plugin_manager.hook_settings_tabs(self.settings_form)77 self.plugin_manager.hook_settings_tabs(self.settingsForm)
7978
80 # Call the hook method to pull in import menus.79 # Call the hook method to pull in import menus.
81 log.info(u'hook menus')80 log.info(u'hook menus')
@@ -107,29 +106,29 @@
107106
108 # Initialise SlideControllers107 # Initialise SlideControllers
109 log.info(u'Set Up SlideControllers')108 log.info(u'Set Up SlideControllers')
110 self.LiveController.mainDisplay = self.main_display109 self.LiveController.mainDisplay = self.mainDisplay
111110
112 def onCloseEvent(self, event):111 def onCloseEvent(self, event):
113 """112 """
114 Hook to close the main window and display windows on exit113 Hook to close the main window and display windows on exit
115 """114 """
116 self.main_display.close()115 self.mainDisplay.close()
117 event.accept()116 event.accept()
118117
119 def setupUi(self):118 def setupUi(self):
120 self.main_window.setObjectName(u'main_window')119 self.mainWindow.setObjectName(u'mainWindow')
121 self.main_window.resize(1087, 847)120 self.mainWindow.resize(1087, 847)
122 sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,121 sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
123 QtGui.QSizePolicy.Expanding)122 QtGui.QSizePolicy.Expanding)
124 sizePolicy.setHorizontalStretch(0)123 sizePolicy.setHorizontalStretch(0)
125 sizePolicy.setVerticalStretch(0)124 sizePolicy.setVerticalStretch(0)
126 sizePolicy.setHeightForWidth(self.main_window.sizePolicy().hasHeightForWidth())125 sizePolicy.setHeightForWidth(self.mainWindow.sizePolicy().hasHeightForWidth())
127 self.main_window.setSizePolicy(sizePolicy)126 self.mainWindow.setSizePolicy(sizePolicy)
128 main_icon = QtGui.QIcon()127 main_icon = QtGui.QIcon()
129 main_icon.addPixmap(QtGui.QPixmap(u':/icon/openlp-logo-16x16.png'),128 main_icon.addPixmap(QtGui.QPixmap(u':/icon/openlp-logo-16x16.png'),
130 QtGui.QIcon.Normal, QtGui.QIcon.Off)129 QtGui.QIcon.Normal, QtGui.QIcon.Off)
131 self.main_window.setWindowIcon(main_icon)130 self.mainWindow.setWindowIcon(main_icon)
132 self.MainContent = QtGui.QWidget(self.main_window)131 self.MainContent = QtGui.QWidget(self.mainWindow)
133 sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)132 sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
134 sizePolicy.setHorizontalStretch(0)133 sizePolicy.setHorizontalStretch(0)
135 sizePolicy.setVerticalStretch(0)134 sizePolicy.setVerticalStretch(0)
@@ -140,14 +139,14 @@
140 self.MainContentLayout.setSpacing(0)139 self.MainContentLayout.setSpacing(0)
141 self.MainContentLayout.setMargin(0)140 self.MainContentLayout.setMargin(0)
142 self.MainContentLayout.setObjectName(u'MainContentLayout')141 self.MainContentLayout.setObjectName(u'MainContentLayout')
143 self.main_window.setCentralWidget(self.MainContent)142 self.mainWindow.setCentralWidget(self.MainContent)
144 self.ControlSplitter = QtGui.QSplitter(self.MainContent)143 self.ControlSplitter = QtGui.QSplitter(self.MainContent)
145 self.ControlSplitter.setOrientation(QtCore.Qt.Horizontal)144 self.ControlSplitter.setOrientation(QtCore.Qt.Horizontal)
146 self.ControlSplitter.setObjectName(u'ControlSplitter')145 self.ControlSplitter.setObjectName(u'ControlSplitter')
147 self.MainContentLayout.addWidget(self.ControlSplitter)146 self.MainContentLayout.addWidget(self.ControlSplitter)
148 self.PreviewController = SlideController(self.ControlSplitter, False)147 self.PreviewController = SlideController(self.ControlSplitter, False)
149 self.LiveController = SlideController(self.ControlSplitter, True)148 self.LiveController = SlideController(self.ControlSplitter, True)
150 self.MenuBar = QtGui.QMenuBar(self.main_window)149 self.MenuBar = QtGui.QMenuBar(self.mainWindow)
151 self.MenuBar.setGeometry(QtCore.QRect(0, 0, 1087, 27))150 self.MenuBar.setGeometry(QtCore.QRect(0, 0, 1087, 27))
152 self.MenuBar.setObjectName(u'MenuBar')151 self.MenuBar.setObjectName(u'MenuBar')
153 self.FileMenu = QtGui.QMenu(self.MenuBar)152 self.FileMenu = QtGui.QMenu(self.MenuBar)
@@ -169,11 +168,11 @@
169 self.ToolsMenu.setObjectName(u'ToolsMenu')168 self.ToolsMenu.setObjectName(u'ToolsMenu')
170 self.HelpMenu = QtGui.QMenu(self.MenuBar)169 self.HelpMenu = QtGui.QMenu(self.MenuBar)
171 self.HelpMenu.setObjectName(u'HelpMenu')170 self.HelpMenu.setObjectName(u'HelpMenu')
172 self.main_window.setMenuBar(self.MenuBar)171 self.mainWindow.setMenuBar(self.MenuBar)
173 self.StatusBar = QtGui.QStatusBar(self.main_window)172 self.StatusBar = QtGui.QStatusBar(self.mainWindow)
174 self.StatusBar.setObjectName(u'StatusBar')173 self.StatusBar.setObjectName(u'StatusBar')
175 self.main_window.setStatusBar(self.StatusBar)174 self.mainWindow.setStatusBar(self.StatusBar)
176 self.MediaManagerDock = QtGui.QDockWidget(self.main_window)175 self.MediaManagerDock = QtGui.QDockWidget(self.mainWindow)
177 sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)176 sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
178 sizePolicy.setHorizontalStretch(0)177 sizePolicy.setHorizontalStretch(0)
179 sizePolicy.setVerticalStretch(0)178 sizePolicy.setVerticalStretch(0)
@@ -202,9 +201,9 @@
202201
203 self.MediaManagerLayout.addWidget(self.MediaToolBox)202 self.MediaManagerLayout.addWidget(self.MediaToolBox)
204 self.MediaManagerDock.setWidget(self.MediaManagerContents)203 self.MediaManagerDock.setWidget(self.MediaManagerContents)
205 self.main_window.addDockWidget(QtCore.Qt.DockWidgetArea(1), self.MediaManagerDock)204 self.mainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(1), self.MediaManagerDock)
206 #Sevice Manager Defined205 #Sevice Manager Defined
207 self.ServiceManagerDock = QtGui.QDockWidget(self.main_window)206 self.ServiceManagerDock = QtGui.QDockWidget(self.mainWindow)
208 ServiceManagerIcon = QtGui.QIcon()207 ServiceManagerIcon = QtGui.QIcon()
209 ServiceManagerIcon.addPixmap(QtGui.QPixmap(u':/system/system_servicemanager.png'),208 ServiceManagerIcon.addPixmap(QtGui.QPixmap(u':/system/system_servicemanager.png'),
210 QtGui.QIcon.Normal, QtGui.QIcon.Off)209 QtGui.QIcon.Normal, QtGui.QIcon.Off)
@@ -213,9 +212,9 @@
213 self.ServiceManagerDock.setObjectName(u'ServiceManagerDock')212 self.ServiceManagerDock.setObjectName(u'ServiceManagerDock')
214 self.ServiceManagerContents = ServiceManager(self)213 self.ServiceManagerContents = ServiceManager(self)
215 self.ServiceManagerDock.setWidget(self.ServiceManagerContents)214 self.ServiceManagerDock.setWidget(self.ServiceManagerContents)
216 self.main_window.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.ServiceManagerDock)215 self.mainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.ServiceManagerDock)
217 #Theme Manager Defined216 #Theme Manager Defined
218 self.ThemeManagerDock = QtGui.QDockWidget(self.main_window)217 self.ThemeManagerDock = QtGui.QDockWidget(self.mainWindow)
219 ThemeManagerIcon = QtGui.QIcon()218 ThemeManagerIcon = QtGui.QIcon()
220 ThemeManagerIcon.addPixmap(QtGui.QPixmap(u':/system/system_thememanager.png'),219 ThemeManagerIcon.addPixmap(QtGui.QPixmap(u':/system/system_thememanager.png'),
221 QtGui.QIcon.Normal, QtGui.QIcon.Off)220 QtGui.QIcon.Normal, QtGui.QIcon.Off)
@@ -226,96 +225,96 @@
226 self.ThemeManagerContents = ThemeManager(self)225 self.ThemeManagerContents = ThemeManager(self)
227226
228 self.ThemeManagerDock.setWidget(self.ThemeManagerContents)227 self.ThemeManagerDock.setWidget(self.ThemeManagerContents)
229 self.main_window.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.ThemeManagerDock)228 self.mainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.ThemeManagerDock)
230229
231 self.FileNewItem = QtGui.QAction(self.main_window)230 self.FileNewItem = QtGui.QAction(self.mainWindow)
232 self.FileNewItem.setIcon(231 self.FileNewItem.setIcon(
233 self.ServiceManagerContents.Toolbar.getIconFromTitle(u'New Service'))232 self.ServiceManagerContents.Toolbar.getIconFromTitle(u'New Service'))
234 self.FileNewItem.setObjectName(u'FileNewItem')233 self.FileNewItem.setObjectName(u'FileNewItem')
235 self.FileOpenItem = QtGui.QAction(self.main_window)234 self.FileOpenItem = QtGui.QAction(self.mainWindow)
236 self.FileOpenItem.setIcon(235 self.FileOpenItem.setIcon(
237 self.ServiceManagerContents.Toolbar.getIconFromTitle(u'Open Service'))236 self.ServiceManagerContents.Toolbar.getIconFromTitle(u'Open Service'))
238 self.FileOpenItem.setObjectName(u'FileOpenItem')237 self.FileOpenItem.setObjectName(u'FileOpenItem')
239 self.FileSaveItem = QtGui.QAction(self.main_window)238 self.FileSaveItem = QtGui.QAction(self.mainWindow)
240 self.FileSaveItem.setIcon(239 self.FileSaveItem.setIcon(
241 self.ServiceManagerContents.Toolbar.getIconFromTitle(u'Save Service'))240 self.ServiceManagerContents.Toolbar.getIconFromTitle(u'Save Service'))
242 self.FileSaveItem.setObjectName(u'FileSaveItem')241 self.FileSaveItem.setObjectName(u'FileSaveItem')
243 self.FileSaveAsItem = QtGui.QAction(self.main_window)242 self.FileSaveAsItem = QtGui.QAction(self.mainWindow)
244 self.FileSaveAsItem.setObjectName(u'FileSaveAsItem')243 self.FileSaveAsItem.setObjectName(u'FileSaveAsItem')
245 self.FileExitItem = QtGui.QAction(self.main_window)244 self.FileExitItem = QtGui.QAction(self.mainWindow)
246 ExitIcon = QtGui.QIcon()245 ExitIcon = QtGui.QIcon()
247 ExitIcon.addPixmap(QtGui.QPixmap(u':/system/system_exit.png'),246 ExitIcon.addPixmap(QtGui.QPixmap(u':/system/system_exit.png'),
248 QtGui.QIcon.Normal, QtGui.QIcon.Off)247 QtGui.QIcon.Normal, QtGui.QIcon.Off)
249 self.FileExitItem.setIcon(ExitIcon)248 self.FileExitItem.setIcon(ExitIcon)
250 self.FileExitItem.setObjectName(u'FileExitItem')249 self.FileExitItem.setObjectName(u'FileExitItem')
251 self.ImportThemeItem = QtGui.QAction(self.main_window)250 self.ImportThemeItem = QtGui.QAction(self.mainWindow)
252 self.ImportThemeItem.setObjectName(u'ImportThemeItem')251 self.ImportThemeItem.setObjectName(u'ImportThemeItem')
253 self.ImportLanguageItem = QtGui.QAction(self.main_window)252 self.ImportLanguageItem = QtGui.QAction(self.mainWindow)
254 self.ImportLanguageItem.setObjectName(u'ImportLanguageItem')253 self.ImportLanguageItem.setObjectName(u'ImportLanguageItem')
255 self.ExportThemeItem = QtGui.QAction(self.main_window)254 self.ExportThemeItem = QtGui.QAction(self.mainWindow)
256 self.ExportThemeItem.setObjectName(u'ExportThemeItem')255 self.ExportThemeItem.setObjectName(u'ExportThemeItem')
257 self.ExportLanguageItem = QtGui.QAction(self.main_window)256 self.ExportLanguageItem = QtGui.QAction(self.mainWindow)
258 self.ExportLanguageItem.setObjectName(u'ExportLanguageItem')257 self.ExportLanguageItem.setObjectName(u'ExportLanguageItem')
259 self.actionLook_Feel = QtGui.QAction(self.main_window)258 self.actionLook_Feel = QtGui.QAction(self.mainWindow)
260 self.actionLook_Feel.setObjectName(u'actionLook_Feel')259 self.actionLook_Feel.setObjectName(u'actionLook_Feel')
261 self.OptionsSettingsItem = QtGui.QAction(self.main_window)260 self.OptionsSettingsItem = QtGui.QAction(self.mainWindow)
262 SettingsIcon = QtGui.QIcon()261 SettingsIcon = QtGui.QIcon()
263 SettingsIcon.addPixmap(QtGui.QPixmap(u':/system/system_settings.png'),262 SettingsIcon.addPixmap(QtGui.QPixmap(u':/system/system_settings.png'),
264 QtGui.QIcon.Normal, QtGui.QIcon.Off)263 QtGui.QIcon.Normal, QtGui.QIcon.Off)
265 self.OptionsSettingsItem.setIcon(SettingsIcon)264 self.OptionsSettingsItem.setIcon(SettingsIcon)
266 self.OptionsSettingsItem.setObjectName(u'OptionsSettingsItem')265 self.OptionsSettingsItem.setObjectName(u'OptionsSettingsItem')
267 self.ViewMediaManagerItem = QtGui.QAction(self.main_window)266 self.ViewMediaManagerItem = QtGui.QAction(self.mainWindow)
268 self.ViewMediaManagerItem.setCheckable(True)267 self.ViewMediaManagerItem.setCheckable(True)
269 self.ViewMediaManagerItem.setChecked(True)268 self.ViewMediaManagerItem.setChecked(True)
270 self.ViewMediaManagerItem.setIcon(icon)269 self.ViewMediaManagerItem.setIcon(icon)
271 self.ViewMediaManagerItem.setObjectName(u'ViewMediaManagerItem')270 self.ViewMediaManagerItem.setObjectName(u'ViewMediaManagerItem')
272 self.ViewThemeManagerItem = QtGui.QAction(self.main_window)271 self.ViewThemeManagerItem = QtGui.QAction(self.mainWindow)
273 self.ViewThemeManagerItem.setCheckable(True)272 self.ViewThemeManagerItem.setCheckable(True)
274 self.ViewThemeManagerItem.setChecked(True)273 self.ViewThemeManagerItem.setChecked(True)
275 self.ViewThemeManagerItem.setIcon(ThemeManagerIcon)274 self.ViewThemeManagerItem.setIcon(ThemeManagerIcon)
276 self.ViewThemeManagerItem.setObjectName(u'ViewThemeManagerItem')275 self.ViewThemeManagerItem.setObjectName(u'ViewThemeManagerItem')
277 self.ViewServiceManagerItem = QtGui.QAction(self.main_window)276 self.ViewServiceManagerItem = QtGui.QAction(self.mainWindow)
278 self.ViewServiceManagerItem.setCheckable(True)277 self.ViewServiceManagerItem.setCheckable(True)
279 self.ViewServiceManagerItem.setChecked(True)278 self.ViewServiceManagerItem.setChecked(True)
280 self.ViewServiceManagerItem.setIcon(ServiceManagerIcon)279 self.ViewServiceManagerItem.setIcon(ServiceManagerIcon)
281 self.ViewServiceManagerItem.setObjectName(u'ViewServiceManagerItem')280 self.ViewServiceManagerItem.setObjectName(u'ViewServiceManagerItem')
282 self.ToolsAlertItem = QtGui.QAction(self.main_window)281 self.ToolsAlertItem = QtGui.QAction(self.mainWindow)
283 AlertIcon = QtGui.QIcon()282 AlertIcon = QtGui.QIcon()
284 AlertIcon.addPixmap(QtGui.QPixmap(u':/tools/tools_alert.png'),283 AlertIcon.addPixmap(QtGui.QPixmap(u':/tools/tools_alert.png'),
285 QtGui.QIcon.Normal, QtGui.QIcon.Off)284 QtGui.QIcon.Normal, QtGui.QIcon.Off)
286 self.ToolsAlertItem.setIcon(AlertIcon)285 self.ToolsAlertItem.setIcon(AlertIcon)
287 self.ToolsAlertItem.setObjectName(u'ToolsAlertItem')286 self.ToolsAlertItem.setObjectName(u'ToolsAlertItem')
288 self.HelpDocumentationItem = QtGui.QAction(self.main_window)287 self.HelpDocumentationItem = QtGui.QAction(self.mainWindow)
289 ContentsIcon = QtGui.QIcon()288 ContentsIcon = QtGui.QIcon()
290 ContentsIcon.addPixmap(QtGui.QPixmap(u':/system/system_help_contents.png'),289 ContentsIcon.addPixmap(QtGui.QPixmap(u':/system/system_help_contents.png'),
291 QtGui.QIcon.Normal, QtGui.QIcon.Off)290 QtGui.QIcon.Normal, QtGui.QIcon.Off)
292 self.HelpDocumentationItem.setIcon(ContentsIcon)291 self.HelpDocumentationItem.setIcon(ContentsIcon)
293 self.HelpDocumentationItem.setObjectName(u'HelpDocumentationItem')292 self.HelpDocumentationItem.setObjectName(u'HelpDocumentationItem')
294 self.HelpAboutItem = QtGui.QAction(self.main_window)293 self.HelpAboutItem = QtGui.QAction(self.mainWindow)
295 AboutIcon = QtGui.QIcon()294 AboutIcon = QtGui.QIcon()
296 AboutIcon.addPixmap(QtGui.QPixmap(u':/system/system_about.png'),295 AboutIcon.addPixmap(QtGui.QPixmap(u':/system/system_about.png'),
297 QtGui.QIcon.Normal, QtGui.QIcon.Off)296 QtGui.QIcon.Normal, QtGui.QIcon.Off)
298 self.HelpAboutItem.setIcon(AboutIcon)297 self.HelpAboutItem.setIcon(AboutIcon)
299 self.HelpAboutItem.setObjectName(u'HelpAboutItem')298 self.HelpAboutItem.setObjectName(u'HelpAboutItem')
300 self.HelpOnlineHelpItem = QtGui.QAction(self.main_window)299 self.HelpOnlineHelpItem = QtGui.QAction(self.mainWindow)
301 self.HelpOnlineHelpItem.setObjectName(u'HelpOnlineHelpItem')300 self.HelpOnlineHelpItem.setObjectName(u'HelpOnlineHelpItem')
302 self.HelpWebSiteItem = QtGui.QAction(self.main_window)301 self.HelpWebSiteItem = QtGui.QAction(self.mainWindow)
303 self.HelpWebSiteItem.setObjectName(u'HelpWebSiteItem')302 self.HelpWebSiteItem.setObjectName(u'HelpWebSiteItem')
304 self.LanguageTranslateItem = QtGui.QAction(self.main_window)303 self.LanguageTranslateItem = QtGui.QAction(self.mainWindow)
305 self.LanguageTranslateItem.setObjectName(u'LanguageTranslateItem')304 self.LanguageTranslateItem.setObjectName(u'LanguageTranslateItem')
306 self.LanguageEnglishItem = QtGui.QAction(self.main_window)305 self.LanguageEnglishItem = QtGui.QAction(self.mainWindow)
307 self.LanguageEnglishItem.setObjectName(u'LanguageEnglishItem')306 self.LanguageEnglishItem.setObjectName(u'LanguageEnglishItem')
308 self.ToolsAddToolItem = QtGui.QAction(self.main_window)307 self.ToolsAddToolItem = QtGui.QAction(self.mainWindow)
309 AddToolIcon = QtGui.QIcon()308 AddToolIcon = QtGui.QIcon()
310 AddToolIcon.addPixmap(QtGui.QPixmap(u':/tools/tools_add.png'),309 AddToolIcon.addPixmap(QtGui.QPixmap(u':/tools/tools_add.png'),
311 QtGui.QIcon.Normal, QtGui.QIcon.Off)310 QtGui.QIcon.Normal, QtGui.QIcon.Off)
312 self.ToolsAddToolItem.setIcon(AddToolIcon)311 self.ToolsAddToolItem.setIcon(AddToolIcon)
313 self.ToolsAddToolItem.setObjectName(u'ToolsAddToolItem')312 self.ToolsAddToolItem.setObjectName(u'ToolsAddToolItem')
314 self.action_Preview_Panel = QtGui.QAction(self.main_window)313 self.action_Preview_Panel = QtGui.QAction(self.mainWindow)
315 self.action_Preview_Panel.setCheckable(True)314 self.action_Preview_Panel.setCheckable(True)
316 self.action_Preview_Panel.setChecked(True)315 self.action_Preview_Panel.setChecked(True)
317 self.action_Preview_Panel.setObjectName(u'action_Preview_Panel')316 self.action_Preview_Panel.setObjectName(u'action_Preview_Panel')
318 self.ModeLiveItem = QtGui.QAction(self.main_window)317 self.ModeLiveItem = QtGui.QAction(self.mainWindow)
319 self.ModeLiveItem.setObjectName(u'ModeLiveItem')318 self.ModeLiveItem.setObjectName(u'ModeLiveItem')
320 self.FileImportMenu.addAction(self.ImportThemeItem)319 self.FileImportMenu.addAction(self.ImportThemeItem)
321 self.FileImportMenu.addAction(self.ImportLanguageItem)320 self.FileImportMenu.addAction(self.ImportLanguageItem)
@@ -361,7 +360,7 @@
361 self.retranslateUi()360 self.retranslateUi()
362 self.MediaToolBox.setCurrentIndex(0)361 self.MediaToolBox.setCurrentIndex(0)
363 QtCore.QObject.connect(self.FileExitItem,362 QtCore.QObject.connect(self.FileExitItem,
364 QtCore.SIGNAL(u'triggered()'), self.main_window.close)363 QtCore.SIGNAL(u'triggered()'), self.mainWindow.close)
365 QtCore.QObject.connect(self.ViewMediaManagerItem,364 QtCore.QObject.connect(self.ViewMediaManagerItem,
366 QtCore.SIGNAL(u'triggered(bool)'), self.MediaManagerDock.setVisible)365 QtCore.SIGNAL(u'triggered(bool)'), self.MediaManagerDock.setVisible)
367 QtCore.QObject.connect(self.ViewServiceManagerItem,366 QtCore.QObject.connect(self.ViewServiceManagerItem,
@@ -382,103 +381,103 @@
382 QtCore.SIGNAL(u'triggered()'), self.onToolsAlertItemClicked)381 QtCore.SIGNAL(u'triggered()'), self.onToolsAlertItemClicked)
383 QtCore.QObject.connect(self.OptionsSettingsItem,382 QtCore.QObject.connect(self.OptionsSettingsItem,
384 QtCore.SIGNAL(u'triggered()'), self.onOptionsSettingsItemClicked)383 QtCore.SIGNAL(u'triggered()'), self.onOptionsSettingsItemClicked)
385 QtCore.QMetaObject.connectSlotsByName(self.main_window)384 QtCore.QMetaObject.connectSlotsByName(self.mainWindow)
386385
387386
388 def retranslateUi(self):387 def retranslateUi(self):
389 self.main_window.setWindowTitle(translate(u'main_window', u'openlp.org 2.0'))388 self.mainWindow.setWindowTitle(translate(u'mainWindow', u'openlp.org 2.0'))
390 self.FileMenu.setTitle(translate(u'main_window', u'&File'))389 self.FileMenu.setTitle(translate(u'mainWindow', u'&File'))
391 self.FileImportMenu.setTitle(translate(u'main_window', u'&Import'))390 self.FileImportMenu.setTitle(translate(u'mainWindow', u'&Import'))
392 self.FileExportMenu.setTitle(translate(u'main_window', u'&Export'))391 self.FileExportMenu.setTitle(translate(u'mainWindow', u'&Export'))
393 self.OptionsMenu.setTitle(translate(u'main_window', u'&Options'))392 self.OptionsMenu.setTitle(translate(u'mainWindow', u'&Options'))
394 self.OptionsViewMenu.setTitle(translate(u'main_window', u'&View'))393 self.OptionsViewMenu.setTitle(translate(u'mainWindow', u'&View'))
395 self.ViewModeMenu.setTitle(translate(u'main_window', u'M&ode'))394 self.ViewModeMenu.setTitle(translate(u'mainWindow', u'M&ode'))
396 self.OptionsLanguageMenu.setTitle(translate(u'main_window', u'&Language'))395 self.OptionsLanguageMenu.setTitle(translate(u'mainWindow', u'&Language'))
397 self.ToolsMenu.setTitle(translate(u'main_window', u'&Tools'))396 self.ToolsMenu.setTitle(translate(u'mainWindow', u'&Tools'))
398 self.HelpMenu.setTitle(translate(u'main_window', u'&Help'))397 self.HelpMenu.setTitle(translate(u'mainWindow', u'&Help'))
399 self.MediaManagerDock.setWindowTitle(translate(u'main_window', u'Media Manager'))398 self.MediaManagerDock.setWindowTitle(translate(u'mainWindow', u'Media Manager'))
400 self.ServiceManagerDock.setWindowTitle(translate(u'main_window', u'Service Manager'))399 self.ServiceManagerDock.setWindowTitle(translate(u'mainWindow', u'Service Manager'))
401# self.ServiceManagerContents.MoveTopButton.setText(translate(u'main_window', u'Move To Top'))400# self.ServiceManagerContents.MoveTopButton.setText(translate(u'mainWindow', u'Move To Top'))
402# self.ServiceManagerContents.MoveUpButton.setText(translate(u'main_window', u'Move Up'))401# self.ServiceManagerContents.MoveUpButton.setText(translate(u'mainWindow', u'Move Up'))
403# self.ServiceManagerContents.MoveDownButton.setText(translate(u'main_window', u'Move Down'))402# self.ServiceManagerContents.MoveDownButton.setText(translate(u'mainWindow', u'Move Down'))
404# self.ServiceManagerContents.MoveBottomButton.setText(translate(u'main_window', u'Move To Bottom'))403# self.ServiceManagerContents.MoveBottomButton.setText(translate(u'mainWindow', u'Move To Bottom'))
405# self.ServiceManagerContents.NewItem.setText(translate(u'main_window', u'New Service'))404# self.ServiceManagerContents.NewItem.setText(translate(u'mainWindow', u'New Service'))
406# self.ServiceManagerContents.OpenItem.setText(translate(u'main_window', u'Open Service'))405# self.ServiceManagerContents.OpenItem.setText(translate(u'mainWindow', u'Open Service'))
407# self.ServiceManagerContents.SaveItem.setText(translate(u'main_window', u'Save Service'))406# self.ServiceManagerContents.SaveItem.setText(translate(u'mainWindow', u'Save Service'))
408# self.ServiceManagerContents.ThemeComboBox.setItemText(0, translate(u'main_window', u'African Sunset'))407# self.ServiceManagerContents.ThemeComboBox.setItemText(0, translate(u'mainWindow', u'African Sunset'))
409# self.ServiceManagerContents.ThemeComboBox.setItemText(1, translate(u'main_window', u'Snowy Mountains'))408# self.ServiceManagerContents.ThemeComboBox.setItemText(1, translate(u'mainWindow', u'Snowy Mountains'))
410# self.ServiceManagerContents.ThemeComboBox.setItemText(2, translate(u'main_window', u'Wilderness'))409# self.ServiceManagerContents.ThemeComboBox.setItemText(2, translate(u'mainWindow', u'Wilderness'))
411 self.ThemeManagerDock.setWindowTitle(translate(u'main_window', u'Theme Manager'))410 self.ThemeManagerDock.setWindowTitle(translate(u'mainWindow', u'Theme Manager'))
412# self.ThemeNewItem.setText(translate(u'main_window', u'New Theme'))411# self.ThemeNewItem.setText(translate(u'mainWindow', u'New Theme'))
413# self.ThemeEditItem.setText(translate(u'main_window', u'Edit Theme'))412# self.ThemeEditItem.setText(translate(u'mainWindow', u'Edit Theme'))
414# self.ThemeDeleteButton.setText(translate(u'main_window', u'Delete Theme'))413# self.ThemeDeleteButton.setText(translate(u'mainWindow', u'Delete Theme'))
415# self.ThemeImportButton.setText(translate(u'main_window', u'Import Theme'))414# self.ThemeImportButton.setText(translate(u'mainWindow', u'Import Theme'))
416# self.ThemeExportButton.setText(translate(u'main_window', u'Export Theme'))415# self.ThemeExportButton.setText(translate(u'mainWindow', u'Export Theme'))
417 self.FileNewItem.setText(translate(u'main_window', u'&New'))416 self.FileNewItem.setText(translate(u'mainWindow', u'&New'))
418 self.FileNewItem.setToolTip(translate(u'main_window', u'New Service'))417 self.FileNewItem.setToolTip(translate(u'mainWindow', u'New Service'))
419 self.FileNewItem.setStatusTip(translate(u'main_window', u'Create a new Service'))418 self.FileNewItem.setStatusTip(translate(u'mainWindow', u'Create a new Service'))
420 self.FileNewItem.setShortcut(translate(u'main_window', u'Ctrl+N'))419 self.FileNewItem.setShortcut(translate(u'mainWindow', u'Ctrl+N'))
421 self.FileOpenItem.setText(translate(u'main_window', u'&Open'))420 self.FileOpenItem.setText(translate(u'mainWindow', u'&Open'))
422 self.FileOpenItem.setToolTip(translate(u'main_window', u'Open Service'))421 self.FileOpenItem.setToolTip(translate(u'mainWindow', u'Open Service'))
423 self.FileOpenItem.setStatusTip(translate(u'main_window', u'Open an existing service'))422 self.FileOpenItem.setStatusTip(translate(u'mainWindow', u'Open an existing service'))
424 self.FileOpenItem.setShortcut(translate(u'main_window', u'Ctrl+O'))423 self.FileOpenItem.setShortcut(translate(u'mainWindow', u'Ctrl+O'))
425 self.FileSaveItem.setText(translate(u'main_window', u'&Save'))424 self.FileSaveItem.setText(translate(u'mainWindow', u'&Save'))
426 self.FileSaveItem.setToolTip(translate(u'main_window', u'Save Service'))425 self.FileSaveItem.setToolTip(translate(u'mainWindow', u'Save Service'))
427 self.FileSaveItem.setStatusTip(translate(u'main_window', u'Save the current service to disk'))426 self.FileSaveItem.setStatusTip(translate(u'mainWindow', u'Save the current service to disk'))
428 self.FileSaveItem.setShortcut(translate(u'main_window', u'Ctrl+S'))427 self.FileSaveItem.setShortcut(translate(u'mainWindow', u'Ctrl+S'))
429 self.FileSaveAsItem.setText(translate(u'main_window', u'Save &As...'))428 self.FileSaveAsItem.setText(translate(u'mainWindow', u'Save &As...'))
430 self.FileSaveAsItem.setToolTip(translate(u'main_window', u'Save Service As'))429 self.FileSaveAsItem.setToolTip(translate(u'mainWindow', u'Save Service As'))
431 self.FileSaveAsItem.setStatusTip(translate(u'main_window', u'Save the current service under a new name'))430 self.FileSaveAsItem.setStatusTip(translate(u'mainWindow', u'Save the current service under a new name'))
432 self.FileSaveAsItem.setShortcut(translate(u'main_window', u'F12'))431 self.FileSaveAsItem.setShortcut(translate(u'mainWindow', u'F12'))
433 self.FileExitItem.setText(translate(u'main_window', u'E&xit'))432 self.FileExitItem.setText(translate(u'mainWindow', u'E&xit'))
434 self.FileExitItem.setStatusTip(translate(u'main_window', u'Quit OpenLP 2.0'))433 self.FileExitItem.setStatusTip(translate(u'mainWindow', u'Quit OpenLP 2.0'))
435 self.FileExitItem.setShortcut(translate(u'main_window', u'Alt+F4'))434 self.FileExitItem.setShortcut(translate(u'mainWindow', u'Alt+F4'))
436 self.ImportThemeItem.setText(translate(u'main_window', u'&Theme'))435 self.ImportThemeItem.setText(translate(u'mainWindow', u'&Theme'))
437 self.ImportLanguageItem.setText(translate(u'main_window', u'&Language'))436 self.ImportLanguageItem.setText(translate(u'mainWindow', u'&Language'))
438 self.ExportThemeItem.setText(translate(u'main_window', u'&Theme'))437 self.ExportThemeItem.setText(translate(u'mainWindow', u'&Theme'))
439 self.ExportLanguageItem.setText(translate(u'main_window', u'&Language'))438 self.ExportLanguageItem.setText(translate(u'mainWindow', u'&Language'))
440 self.actionLook_Feel.setText(translate(u'main_window', u'Look && &Feel'))439 self.actionLook_Feel.setText(translate(u'mainWindow', u'Look && &Feel'))
441 self.OptionsSettingsItem.setText(translate(u'main_window', u'&Settings'))440 self.OptionsSettingsItem.setText(translate(u'mainWindow', u'&Settings'))
442 self.ViewMediaManagerItem.setText(translate(u'main_window', u'&Media Manager'))441 self.ViewMediaManagerItem.setText(translate(u'mainWindow', u'&Media Manager'))
443 self.ViewMediaManagerItem.setToolTip(translate(u'main_window', u'Toggle Media Manager'))442 self.ViewMediaManagerItem.setToolTip(translate(u'mainWindow', u'Toggle Media Manager'))
444 self.ViewMediaManagerItem.setStatusTip(translate(u'main_window', u'Toggle the visibility of the Media Manager'))443 self.ViewMediaManagerItem.setStatusTip(translate(u'mainWindow', u'Toggle the visibility of the Media Manager'))
445 self.ViewMediaManagerItem.setShortcut(translate(u'main_window', u'F8'))444 self.ViewMediaManagerItem.setShortcut(translate(u'mainWindow', u'F8'))
446 self.ViewThemeManagerItem.setText(translate(u'main_window', u'&Theme Manager'))445 self.ViewThemeManagerItem.setText(translate(u'mainWindow', u'&Theme Manager'))
447 self.ViewThemeManagerItem.setToolTip(translate(u'main_window', u'Toggle Theme Manager'))446 self.ViewThemeManagerItem.setToolTip(translate(u'mainWindow', u'Toggle Theme Manager'))
448 self.ViewThemeManagerItem.setStatusTip(translate(u'main_window', u'Toggle the visibility of the Theme Manager'))447 self.ViewThemeManagerItem.setStatusTip(translate(u'mainWindow', u'Toggle the visibility of the Theme Manager'))
449 self.ViewThemeManagerItem.setShortcut(translate(u'main_window', u'F10'))448 self.ViewThemeManagerItem.setShortcut(translate(u'mainWindow', u'F10'))
450 self.ViewServiceManagerItem.setText(translate(u'main_window', u'&Service Manager'))449 self.ViewServiceManagerItem.setText(translate(u'mainWindow', u'&Service Manager'))
451 self.ViewServiceManagerItem.setToolTip(translate(u'main_window', u'Toggle Service Manager'))450 self.ViewServiceManagerItem.setToolTip(translate(u'mainWindow', u'Toggle Service Manager'))
452 self.ViewServiceManagerItem.setStatusTip(translate(u'main_window', u'Toggle the visibility of the Service Manager'))451 self.ViewServiceManagerItem.setStatusTip(translate(u'mainWindow', u'Toggle the visibility of the Service Manager'))
453 self.ViewServiceManagerItem.setShortcut(translate(u'main_window', u'F9'))452 self.ViewServiceManagerItem.setShortcut(translate(u'mainWindow', u'F9'))
454 self.ToolsAlertItem.setText(translate(u'main_window', u'&Alert'))453 self.ToolsAlertItem.setText(translate(u'mainWindow', u'&Alert'))
455 self.ToolsAlertItem.setStatusTip(translate(u'main_window', u'Show an alert message'))454 self.ToolsAlertItem.setStatusTip(translate(u'mainWindow', u'Show an alert message'))
456 self.ToolsAlertItem.setShortcut(translate(u'main_window', u'F7'))455 self.ToolsAlertItem.setShortcut(translate(u'mainWindow', u'F7'))
457 self.HelpDocumentationItem.setText(translate(u'main_window', u'&User Guide'))456 self.HelpDocumentationItem.setText(translate(u'mainWindow', u'&User Guide'))
458 self.HelpAboutItem.setText(translate(u'main_window', u'&About'))457 self.HelpAboutItem.setText(translate(u'mainWindow', u'&About'))
459 self.HelpAboutItem.setStatusTip(translate(u'main_window', u'More information about OpenLP'))458 self.HelpAboutItem.setStatusTip(translate(u'mainWindow', u'More information about OpenLP'))
460 self.HelpAboutItem.setShortcut(translate(u'main_window', u'Ctrl+F1'))459 self.HelpAboutItem.setShortcut(translate(u'mainWindow', u'Ctrl+F1'))
461 self.HelpOnlineHelpItem.setText(translate(u'main_window', u'&Online Help'))460 self.HelpOnlineHelpItem.setText(translate(u'mainWindow', u'&Online Help'))
462 self.HelpWebSiteItem.setText(translate(u'main_window', u'&Web Site'))461 self.HelpWebSiteItem.setText(translate(u'mainWindow', u'&Web Site'))
463 self.LanguageTranslateItem.setText(translate(u'main_window', u'&Translate'))462 self.LanguageTranslateItem.setText(translate(u'mainWindow', u'&Translate'))
464 self.LanguageTranslateItem.setStatusTip(translate(u'main_window', u'Translate the interface to your language'))463 self.LanguageTranslateItem.setStatusTip(translate(u'mainWindow', u'Translate the interface to your language'))
465 self.LanguageEnglishItem.setText(translate(u'main_window', u'English'))464 self.LanguageEnglishItem.setText(translate(u'mainWindow', u'English'))
466 self.LanguageEnglishItem.setStatusTip(translate(u'main_window', u'Set the interface language to English'))465 self.LanguageEnglishItem.setStatusTip(translate(u'mainWindow', u'Set the interface language to English'))
467 self.ToolsAddToolItem.setText(translate(u'main_window', u'&Add Tool...'))466 self.ToolsAddToolItem.setText(translate(u'mainWindow', u'&Add Tool...'))
468 self.ToolsAddToolItem.setStatusTip(translate(u'main_window', u'Add an application to the list of tools'))467 self.ToolsAddToolItem.setStatusTip(translate(u'mainWindow', u'Add an application to the list of tools'))
469 self.action_Preview_Panel.setText(translate(u'main_window', u'&Preview Pane'))468 self.action_Preview_Panel.setText(translate(u'mainWindow', u'&Preview Pane'))
470 self.ModeLiveItem.setText(translate(u'main_window', u'&Live'))469 self.ModeLiveItem.setText(translate(u'mainWindow', u'&Live'))
471470
472 def show(self):471 def show(self):
473 self.main_window.showMaximized()472 self.mainWindow.showMaximized()
474 self.main_display.setup(0)473 self.mainDisplay.setup(0)
475 self.main_display.show()474 self.mainDisplay.show()
476475
477 def onHelpAboutItemClicked(self):476 def onHelpAboutItemClicked(self):
478 self.about_form.exec_()477 self.aboutForm.exec_()
479478
480 def onToolsAlertItemClicked(self):479 def onToolsAlertItemClicked(self):
481 self.alert_form.exec_()480 self.alertForm.exec_()
482481
483 def onOptionsSettingsItemClicked(self):482 def onOptionsSettingsItemClicked(self):
484 self.settings_form.exec_()483 self.settingsForm.exec_()
485484
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py 2009-05-18 19:04:25 +0000
+++ openlp/core/ui/servicemanager.py 2009-05-22 18:30:25 +0000
@@ -21,13 +21,7 @@
21import logging21import logging
2222
23from PyQt4 import QtCore, QtGui23from PyQt4 import QtCore, QtGui
24from openlp.core.lib import PluginConfig24from openlp.core.lib import PluginConfig, OpenLPToolbar, ServiceItem, RenderManager, Event, EventType, EventManager, translate, buildIcon, contextMenuAction, contextMenuSeparator
25from openlp.core.lib import OpenLPToolbar
26from openlp.core.lib import ServiceItem
27from openlp.core.lib import RenderManager
28from openlp.core import translate
29from openlp import buildIcon
30from openlp.core.lib import Event, EventType, EventManager
3125
32class ServiceManager(QtGui.QWidget):26class ServiceManager(QtGui.QWidget):
3327
@@ -38,12 +32,12 @@
38 Also handles the UI tasks of moving things up and down etc.32 Also handles the UI tasks of moving things up and down etc.
39 """33 """
40 global log34 global log
41 log=logging.getLogger(u'ServiceManager')35 log = logging.getLogger(u'ServiceManager')
4236
43 def __init__(self, parent):37 def __init__(self, parent):
44 QtGui.QWidget.__init__(self)38 QtGui.QWidget.__init__(self)
45 self.parent=parent39 self.parent = parent
46 self.serviceItems=[]40 self.serviceItems = []
47 self.Layout = QtGui.QVBoxLayout(self)41 self.Layout = QtGui.QVBoxLayout(self)
48 self.Layout.setSpacing(0)42 self.Layout.setSpacing(0)
49 self.Layout.setMargin(0)43 self.Layout.setMargin(0)
@@ -57,15 +51,15 @@
57 self.Toolbar.addToolbarButton(u'Move to bottom', u':/services/service_bottom.png',51 self.Toolbar.addToolbarButton(u'Move to bottom', u':/services/service_bottom.png',
58 translate(u'ServiceManager', u'Move to end'), self.onServiceEnd)52 translate(u'ServiceManager', u'Move to end'), self.onServiceEnd)
59 self.Toolbar.addSeparator()53 self.Toolbar.addSeparator()
54 self.Toolbar.addToolbarButton(u'Delete From Service', u':/services/service_delete.png',
55 translate(u'ServiceManager', u'Delete From Service'), self.onDeleteFromService)
60 self.Toolbar.addToolbarButton(u'New Service', u':/services/service_new.png',56 self.Toolbar.addToolbarButton(u'New Service', u':/services/service_new.png',
61 translate(u'ServiceManager', u'Create a new Service'), self.onNewService)57 translate(u'ServiceManager', u'Create a new Service'), self.onNewService)
62 self.Toolbar.addToolbarButton(u'Delete From Service', u':/services/service_delete.png',58 self.Toolbar.addToolbarButton(u'Open Service', u':/services/service_open.png',
63 translate(u'ServiceManager', u'Delete From Service'), self.onDeleteFromService)59 translate(u'ServiceManager', u'Load Existing'), self.onLoadService)
64 self.Toolbar.addSeparator()60 self.Toolbar.addSeparator()
65 self.Toolbar.addToolbarButton(u'Save Service', u':/services/service_save.png',61 self.Toolbar.addToolbarButton(u'Save Service', u':/services/service_save.png',
66 translate(u'ServiceManager', u'Save Service'), self.onSaveService)62 translate(u'ServiceManager', u'Save Service'), self.onSaveService)
67 self.Toolbar.addToolbarButton(u'Load Service', u':/services/service_open.png',
68 translate(u'ServiceManager', u'Load Existing'), self.onLoadService)
6963
70 self.Toolbar.addSeparator()64 self.Toolbar.addSeparator()
71 self.ThemeComboBox = QtGui.QComboBox(self.Toolbar)65 self.ThemeComboBox = QtGui.QComboBox(self.Toolbar)
@@ -87,14 +81,14 @@
8781
88 self.ServiceManagerList.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)82 self.ServiceManagerList.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
8983
90 self.ServiceManagerList.addAction(self.contextMenuAction(84 self.ServiceManagerList.addAction(contextMenuAction(
91 self.ServiceManagerList, ':/system/system_preview.png',85 self.ServiceManagerList, ':/system/system_preview.png',
92 translate(u'ServiceManager',u'&Preview Verse'), self.makePreview))86 translate(u'ServiceManager',u'&Preview Verse'), self.makePreview))
93 self.ServiceManagerList.addAction(self.contextMenuAction(87 self.ServiceManagerList.addAction(contextMenuAction(
94 self.ServiceManagerList, ':/system/system_live.png',88 self.ServiceManagerList, ':/system/system_live.png',
95 translate(u'ServiceManager',u'&Show Live'), self.makeLive))89 translate(u'ServiceManager',u'&Show Live'), self.makeLive))
96 self.ServiceManagerList.addAction(self.contextMenuSeparator(self.ServiceManagerList))90 self.ServiceManagerList.addAction(contextMenuSeparator(self.ServiceManagerList))
97 self.ServiceManagerList.addAction(self.contextMenuAction(91 self.ServiceManagerList.addAction(contextMenuAction(
98 self.ServiceManagerList, ':/services/service_delete',92 self.ServiceManagerList, ':/services/service_delete',
99 translate(u'ServiceManager',u'&Remove from Service'), self.onDeleteFromService))93 translate(u'ServiceManager',u'&Remove from Service'), self.onDeleteFromService))
10094
@@ -106,20 +100,6 @@
106 self.config = PluginConfig(u'Main')100 self.config = PluginConfig(u'Main')
107 self.service_theme = self.config.get_config(u'theme service theme', u'')101 self.service_theme = self.config.get_config(u'theme service theme', u'')
108102
109 def contextMenuAction(self, base, icon, text, slot):
110 """
111 Utility method to help build context menus for plugins
112 """
113 action = QtGui.QAction(text, base)
114 action .setIcon(buildIcon(icon))
115 QtCore.QObject.connect(action, QtCore.SIGNAL("triggered()"), slot)
116 return action
117
118 def contextMenuSeparator(self, base):
119 action = QtGui.QAction("", base)
120 action.setSeparator(True)
121 return action
122
123 def onServiceTop(self):103 def onServiceTop(self):
124 pass104 pass
125105
@@ -160,7 +140,7 @@
160 count = 0140 count = 0
161 for frame in item.frames:141 for frame in item.frames:
162 treewidgetitem1 = QtGui.QTreeWidgetItem(treewidgetitem)142 treewidgetitem1 = QtGui.QTreeWidgetItem(treewidgetitem)
163 text = frame[u'formatted'][0]143 text = frame[u'title'][0]
164 treewidgetitem1.setText(0,text[:30])144 treewidgetitem1.setText(0,text[:30])
165 treewidgetitem1.setData(0, QtCore.Qt.UserRole,QtCore.QVariant(count))145 treewidgetitem1.setData(0, QtCore.Qt.UserRole,QtCore.QVariant(count))
166 count = count + 1146 count = count + 1
@@ -199,7 +179,7 @@
199 Handle the release of the event and trigger the plugin179 Handle the release of the event and trigger the plugin
200 to add the data180 to add the data
201 """181 """
202 link=event.mimeData()182 link = event.mimeData()
203 if link.hasText():183 if link.hasText():
204 plugin = event.mimeData().text()184 plugin = event.mimeData().text()
205 self.EventManager.post_event(Event(EventType.LoadServiceItem, plugin))185 self.EventManager.post_event(Event(EventType.LoadServiceItem, plugin))
@@ -233,7 +213,9 @@
233 for theme in theme_list:213 for theme in theme_list:
234 self.ThemeComboBox.addItem(theme)214 self.ThemeComboBox.addItem(theme)
235 id = self.ThemeComboBox.findText(str(self.service_theme), QtCore.Qt.MatchExactly)215 id = self.ThemeComboBox.findText(str(self.service_theme), QtCore.Qt.MatchExactly)
216 # Not Found
236 if id == -1:217 if id == -1:
237 id = 0 # Not Found218 id = 0
238 self.service_theme = u''219 self.service_theme = u''
239 self.ThemeComboBox.setCurrentIndex(id)220 self.ThemeComboBox.setCurrentIndex(id)
221 self.RenderManager.set_service_theme(self.service_theme)
240222
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2009-05-16 10:24:03 +0000
+++ openlp/core/ui/slidecontroller.py 2009-05-20 20:17:20 +0000
@@ -22,8 +22,7 @@
2222
23from PyQt4 import QtCore, QtGui23from PyQt4 import QtCore, QtGui
2424
25from openlp.core.lib import OpenLPToolbar25from openlp.core.lib import OpenLPToolbar, translate
26from openlp.core import translate
2726
28class SlideData(QtCore.QAbstractListModel):27class SlideData(QtCore.QAbstractListModel):
29 """28 """
3029
=== modified file 'openlp/core/ui/splashscreen.py'
--- openlp/core/ui/splashscreen.py 2009-05-01 22:26:43 +0000
+++ openlp/core/ui/splashscreen.py 2009-05-20 20:17:20 +0000
@@ -20,7 +20,7 @@
2020
21from PyQt4 import QtCore, QtGui21from PyQt4 import QtCore, QtGui
2222
23from openlp.core import translate23from openlp.core.lib import translate
2424
25class SplashScreen(object):25class SplashScreen(object):
26 def __init__(self, version):26 def __init__(self, version):
2727
=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py 2009-05-18 19:47:18 +0000
+++ openlp/core/ui/thememanager.py 2009-05-22 05:14:55 +0000
@@ -23,23 +23,17 @@
23import shutil23import shutil
2424
25from time import sleep25from time import sleep
26from copy import deepcopy
27from xml.etree.ElementTree import ElementTree, XML26from xml.etree.ElementTree import ElementTree, XML
28from PyQt4 import *
29from PyQt4 import QtCore, QtGui27from PyQt4 import QtCore, QtGui
30from PyQt4.QtCore import *
31from PyQt4.QtGui import *
3228
33from openlp.core.ui import AmendThemeForm, ServiceManager29from openlp.core.ui import AmendThemeForm, ServiceManager
34from openlp.core import translate, fileToXML
35from openlp.core.theme import Theme30from openlp.core.theme import Theme
36from openlp.core.lib import Event, EventType, EventManager, OpenLPToolbar, ThemeXML, Renderer31from openlp.core.lib import Event, EventType, EventManager, OpenLPToolbar, ThemeXML, Renderer, translate, file_to_xml
37from openlp.core.utils import ConfigHelper32from openlp.core.utils import ConfigHelper
38from openlp.core.resources import *
3933
40import logging34import logging
4135
42class ThemeData(QAbstractListModel):36class ThemeData(QtCore.QAbstractListModel):
43 """37 """
44 Tree of items for an order of Theme.38 Tree of items for an order of Theme.
45 Includes methods for reading and writing the contents to an OOS file39 Includes methods for reading and writing the contents to an OOS file
@@ -49,7 +43,7 @@
49 log=logging.getLogger(u'ThemeData')43 log=logging.getLogger(u'ThemeData')
5044
51 def __init__(self):45 def __init__(self):
52 QAbstractListModel.__init__(self)46 QtCore.QAbstractListModel.__init__(self)
53 self.items = []47 self.items = []
54 self.rowheight = 5048 self.rowheight = 50
55 self.maximagewidth = self.rowheight * 16 / 9.0;49 self.maximagewidth = self.rowheight * 16 / 9.0;
@@ -62,36 +56,36 @@
62 return len(self.items)56 return len(self.items)
6357
64 def insertRow(self, row, filename):58 def insertRow(self, row, filename):
65 self.beginInsertRows(QModelIndex(), row, row)59 self.beginInsertRows(QtCore.QModelIndex(), row, row)
66 log.info(u'insert row %d:%s' % (row, filename))60 log.info(u'insert row %d:%s' % (row, filename))
67 (prefix, shortfilename) = os.path.split(str(filename))61 (prefix, shortfilename) = os.path.split(str(filename))
68 log.info(u'shortfilename = %s' % shortfilename)62 log.info(u'shortfilename = %s' % shortfilename)
69 theme = shortfilename.split(u'.')63 theme = shortfilename.split(u'.')
70 # create a preview image64 # create a preview image
71 if os.path.exists(filename):65 if os.path.exists(filename):
72 preview = QPixmap(str(filename))66 preview = QtGui.QPixmap(str(filename))
73 width = self.maximagewidth67 width = self.maximagewidth
74 height = self.rowheight68 height = self.rowheight
75 preview = preview.scaled(width, height, Qt.KeepAspectRatio, Qt.SmoothTransformation)69 preview = preview.scaled(width, height, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
76 realwidth = preview.width()70 realwidth = preview.width()
77 realheight = preview.height()71 realheight = preview.height()
78 # and move it to the centre of the preview space72 # and move it to the centre of the preview space
79 pixmap = QPixmap(width, height)73 pixmap = QtGui.QPixmap(width, height)
80 pixmap.fill(Qt.transparent)74 pixmap.fill(QtCore.Qt.transparent)
81 painter = QPainter(pixmap)75 painter = QtGui.QPainter(pixmap)
82 painter.drawPixmap((width - realwidth) / 2, (height - realheight) / 2, preview)76 painter.drawPixmap((width - realwidth) / 2, (height - realheight) / 2, preview)
83 else:77 else:
84 width = self.maximagewidth78 width = self.maximagewidth
85 height = self.rowheight79 height = self.rowheight
86 pixmap = QPixmap(width, height)80 pixmap = QtGui.QtGui.QPixmap(width, height)
87 pixmap.fill(Qt.transparent)81 pixmap.fill(QtCore.Qt.transparent)
88 # finally create the row82 # finally create the row
89 self.items.insert(row, (filename, pixmap, shortfilename, theme[0]))83 self.items.insert(row, (filename, pixmap, shortfilename, theme[0]))
90 log.info(u'Items: %s' % self.items)84 log.info(u'Items: %s' % self.items)
91 self.endInsertRows()85 self.endInsertRows()
9286
93 def removeRow(self, row):87 def removeRow(self, row):
94 self.beginRemoveRows(QModelIndex(), row, row)88 self.beginRemoveRows(QtCore.QModelIndex(), row, row)
95 self.items.pop(row)89 self.items.pop(row)
96 self.endRemoveRows()90 self.endRemoveRows()
9791
@@ -102,16 +96,15 @@
102 row = index.row()96 row = index.row()
103 if row > len(self.items):97 if row > len(self.items):
104 # if the last row is selected and deleted, we then get called with an empty row!98 # if the last row is selected and deleted, we then get called with an empty row!
105 return QVariant()99 return QtCore.QVariant()
106 if role == Qt.DisplayRole:100 if role == QtCore.Qt.DisplayRole:
107 retval = self.items[row][3]101 retval = self.items[row][3]
108 elif role == Qt.DecorationRole:102 elif role == QtCore.Qt.DecorationRole:
109 retval = self.items[row][1]103 retval = self.items[row][1]
110 else:104 else:
111 retval = QVariant()105 retval = QtCore.QVariant()
112 #log.info("Returning"+ str(retval))106 if type(retval) is not type(QtCore.QVariant):
113 if type(retval) is not type(QVariant):107 return QtCore.QVariant(retval)
114 return QVariant(retval)
115 else:108 else:
116 return retval109 return retval
117110
@@ -131,15 +124,15 @@
131 filelist = [item[3] for item in self.items]124 filelist = [item[3] for item in self.items]
132 return filelist125 return filelist
133126
134class ThemeManager(QWidget):127class ThemeManager(QtGui.QWidget):
135 """128 """
136 Manages the orders of Theme.129 Manages the orders of Theme.
137 """130 """
138 global log131 global log
139 log=logging.getLogger(u'ThemeManager')132 log = logging.getLogger(u'ThemeManager')
140133
141 def __init__(self, parent):134 def __init__(self, parent):
142 QWidget.__init__(self)135 QtGui.QWidget.__init__(self)
143 self.parent = parent136 self.parent = parent
144 self.Layout = QtGui.QVBoxLayout(self)137 self.Layout = QtGui.QVBoxLayout(self)
145 self.Layout.setSpacing(0)138 self.Layout.setSpacing(0)
@@ -174,7 +167,7 @@
174 self.themelist = []167 self.themelist = []
175 self.path = os.path.join(ConfigHelper.get_data_path(), u'themes')168 self.path = os.path.join(ConfigHelper.get_data_path(), u'themes')
176 self.checkThemesExists(self.path)169 self.checkThemesExists(self.path)
177 self.amendThemeForm.themePath(self.path)170 self.amendThemeForm.path = self.path
178171
179 def onAddTheme(self):172 def onAddTheme(self):
180 self.amendThemeForm.loadTheme(None)173 self.amendThemeForm.loadTheme(None)
@@ -224,8 +217,7 @@
224 self.themeData.addRow(os.path.join(self.path, name))217 self.themeData.addRow(os.path.join(self.path, name))
225 self.EventManager.post_event(Event(EventType.ThemeListChanged))218 self.EventManager.post_event(Event(EventType.ThemeListChanged))
226 self.ServiceManager.updateThemeList(self.getThemes())219 self.ServiceManager.updateThemeList(self.getThemes())
227 self.parent.settings_form.ThemesTab.updateThemeList(self.getThemes())220 self.parent.settingsForm.ThemesTab.updateThemeList(self.getThemes())
228
229221
230 def getThemes(self):222 def getThemes(self):
231 return self.themeData.getList()223 return self.themeData.getList()
@@ -234,19 +226,19 @@
234 log.debug(u'getthemedata for theme %s', themename)226 log.debug(u'getthemedata for theme %s', themename)
235 xml_file = os.path.join(self.path, str(themename), str(themename) + u'.xml')227 xml_file = os.path.join(self.path, str(themename), str(themename) + u'.xml')
236 try:228 try:
237 xml = fileToXML(xml_file)229 xml = file_to_xml(xml_file)
238 except:230 except:
239 newtheme = ThemeXML()231 newtheme = ThemeXML()
240 newtheme.new_document(u'New Theme')232 newtheme.new_document(u'New Theme')
241 newtheme.add_background_solid(str(u'#000000'))233 newtheme.add_background_solid(str(u'#000000'))
242 newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(30), u'False')234 newtheme.add_font(str(QtGui.QFont().family()), str(u'#FFFFFF'), str(30), u'False')
243 newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(12), u'False', u'footer')235 newtheme.add_font(str(QtGui.QFont().family()), str(u'#FFFFFF'), str(12), u'False', u'footer')
244 newtheme.add_display(u'False', str(u'#FFFFFF'), u'False', str(u'#FFFFFF'),236 newtheme.add_display(u'False', str(u'#FFFFFF'), u'False', str(u'#FFFFFF'),
245 str(0), str(0), str(0))237 str(0), str(0), str(0))
246 xml = newtheme.extract_xml()238 xml = newtheme.extract_xml()
247 theme = ThemeXML()239 theme = ThemeXML()
248 theme.parse(xml)240 theme.parse(xml)
249 theme.extend_filename(self.path)241 theme.extend_image_filename(self.path)
250 return theme242 return theme
251243
252 def checkThemesExists(self, dir):244 def checkThemesExists(self, dir):
@@ -353,7 +345,7 @@
353 log.debug(u'generateAndSaveImage %s %s %s', dir, name, theme_xml)345 log.debug(u'generateAndSaveImage %s %s %s', dir, name, theme_xml)
354 theme = ThemeXML()346 theme = ThemeXML()
355 theme.parse(theme_xml)347 theme.parse(theme_xml)
356 theme.extend_filename(dir)348 theme.extend_image_filename(dir)
357 frame = self.generateImage(theme)349 frame = self.generateImage(theme)
358 im = frame.toImage()350 im = frame.toImage()
359 samplepathname = os.path.join(self.path, name + u'.png')351 samplepathname = os.path.join(self.path, name + u'.png')
360352
=== modified file 'openlp/core/ui/themestab.py'
--- openlp/core/ui/themestab.py 2009-05-18 19:47:18 +0000
+++ openlp/core/ui/themestab.py 2009-05-20 20:17:20 +0000
@@ -20,8 +20,7 @@
2020
21from PyQt4 import QtCore, QtGui21from PyQt4 import QtCore, QtGui
2222
23from openlp.core import translate23from openlp.core.lib import SettingsTab, translate
24from openlp.core.lib import SettingsTab
2524
26class ThemesTab(SettingsTab):25class ThemesTab(SettingsTab):
27 """26 """
2827
=== modified file 'openlp/plugins/bibles/bibleplugin.py'
--- openlp/plugins/bibles/bibleplugin.py 2009-05-17 08:25:15 +0000
+++ openlp/plugins/bibles/bibleplugin.py 2009-05-21 05:15:51 +0000
@@ -21,10 +21,8 @@
2121
22from PyQt4 import QtCore, QtGui22from PyQt4 import QtCore, QtGui
23from PyQt4.QtCore import *23from PyQt4.QtCore import *
24from PyQt4.QtGui import *
2524
26from openlp.core.lib import Plugin, Event25from openlp.core.lib import Plugin, Event, EventType, translate
27from openlp.core.lib import EventType
2826
29from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem27from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem
30from openlp.plugins.bibles.lib.tables import *28from openlp.plugins.bibles.lib.tables import *
@@ -59,7 +57,7 @@
59 self.ImportBibleItem = QtGui.QAction(import_menu)57 self.ImportBibleItem = QtGui.QAction(import_menu)
60 self.ImportBibleItem.setObjectName("ImportBibleItem")58 self.ImportBibleItem.setObjectName("ImportBibleItem")
61 import_menu.addAction(self.ImportBibleItem)59 import_menu.addAction(self.ImportBibleItem)
62 self.ImportBibleItem.setText(QtGui.QApplication.translate("main_window", "&Bible", None, QtGui.QApplication.UnicodeUTF8))60 self.ImportBibleItem.setText(translate("BiblePlugin", "&Bible"))
63 # Signals and slots61 # Signals and slots
64 QtCore.QObject.connect(self.ImportBibleItem, QtCore.SIGNAL("triggered()"), self.onBibleNewClick)62 QtCore.QObject.connect(self.ImportBibleItem, QtCore.SIGNAL("triggered()"), self.onBibleNewClick)
6563
@@ -67,8 +65,7 @@
67 self.ExportBibleItem = QtGui.QAction(export_menu)65 self.ExportBibleItem = QtGui.QAction(export_menu)
68 self.ExportBibleItem.setObjectName("ExportBibleItem")66 self.ExportBibleItem.setObjectName("ExportBibleItem")
69 export_menu.addAction(self.ExportBibleItem)67 export_menu.addAction(self.ExportBibleItem)
70 self.ExportBibleItem.setText(68 self.ExportBibleItem.setText(translate("BiblePlugin", u'&Bible'))
71 QtGui.QApplication.translate("main_window", u'&Bible', None, QtGui.QApplication.UnicodeUTF8))
7269
73 def initialise(self):70 def initialise(self):
74 pass71 pass
7572
=== modified file 'openlp/plugins/bibles/lib/biblestab.py'
--- openlp/plugins/bibles/lib/biblestab.py 2009-05-18 16:11:59 +0000
+++ openlp/plugins/bibles/lib/biblestab.py 2009-05-21 05:15:51 +0000
@@ -20,8 +20,7 @@
2020
21from PyQt4 import Qt, QtCore, QtGui21from PyQt4 import Qt, QtCore, QtGui
2222
23from openlp.core import translate23from openlp.core.lib import translate, str_to_bool
24from openlp import convertStringToBoolean
25from openlp.core.lib import SettingsTab24from openlp.core.lib import SettingsTab
2625
27class BiblesTab(SettingsTab):26class BiblesTab(SettingsTab):
@@ -187,11 +186,11 @@
187 self.bible_search = True186 self.bible_search = True
188187
189 def load(self):188 def load(self):
190 self.paragraph_style = convertStringToBoolean(self.config.get_config(u'paragraph style', u'True'))189 self.paragraph_style = str_to_bool(self.config.get_config(u'paragraph style', u'True'))
191 self.show_new_chapters = convertStringToBoolean(self.config.get_config(u'display new chapter', u"False"))190 self.show_new_chapters = str_to_bool(self.config.get_config(u'display new chapter', u"False"))
192 self.display_style = int(self.config.get_config(u'display brackets', u'0'))191 self.display_style = int(self.config.get_config(u'display brackets', u'0'))
193 self.bible_theme = self.config.get_config(u'bible theme', u'0')192 self.bible_theme = self.config.get_config(u'bible theme', u'0')
194 self.bible_search = convertStringToBoolean(self.config.get_config(u'search as type', u'True'))193 self.bible_search = str_to_bool(self.config.get_config(u'search as type', u'True'))
195 if self.paragraph_style:194 if self.paragraph_style:
196 self.ParagraphRadioButton.setChecked(True)195 self.ParagraphRadioButton.setChecked(True)
197 else:196 else:
198197
=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py 2009-05-18 16:11:59 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py 2009-05-22 19:36:16 +0000
@@ -21,10 +21,7 @@
2121
22from PyQt4 import QtCore, QtGui22from PyQt4 import QtCore, QtGui
2323
24from openlp.core import translate24from openlp.core.lib import ServiceItem, MediaManagerItem, Receiver, translate
25from openlp.core.lib import MediaManagerItem, Receiver
26from openlp.core.lib import ServiceItem
27
28from openlp.plugins.bibles.forms import BibleImportForm25from openlp.plugins.bibles.forms import BibleImportForm
29from openlp.plugins.bibles.lib import TextListData26from openlp.plugins.bibles.lib import TextListData
3027
@@ -57,7 +54,7 @@
57 This is the custom media manager item for Bibles.54 This is the custom media manager item for Bibles.
58 """55 """
59 global log56 global log
60 log=logging.getLogger(u'BibleMediaItem')57 log = logging.getLogger(u'BibleMediaItem')
61 log.info(u'Bible Media Item loaded')58 log.info(u'Bible Media Item loaded')
6259
63 def __init__(self, parent, icon, title):60 def __init__(self, parent, icon, title):
@@ -207,7 +204,7 @@
207 self.BibleListView.setAlternatingRowColors(True)204 self.BibleListView.setAlternatingRowColors(True)
208 self.BibleListData = TextListData()205 self.BibleListData = TextListData()
209 self.BibleListView.setModel(self.BibleListData)206 self.BibleListView.setModel(self.BibleListData)
210 self.BibleListView.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)207 self.BibleListView.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
211 self.BibleListView.setDragEnabled(True)208 self.BibleListView.setDragEnabled(True)
212209
213 self.PageLayout.addWidget(self.BibleListView)210 self.PageLayout.addWidget(self.BibleListView)
@@ -383,7 +380,7 @@
383 verse = str(self.search_results[0][2])380 verse = str(self.search_results[0][2])
384 text = self.search_results[0][3]381 text = self.search_results[0][3]
385 if self.parent.bibles_tab.paragraph_style: #Paragraph382 if self.parent.bibles_tab.paragraph_style: #Paragraph
386 text = text + u'\n'383 text = text + u'\n\n'
387 if self.parent.bibles_tab.display_style == 1:384 if self.parent.bibles_tab.display_style == 1:
388 loc = self.formatVerse(old_chapter, chapter, verse, u'(', u')')385 loc = self.formatVerse(old_chapter, chapter, verse, u'(', u')')
389 elif self.parent.bibles_tab.display_style == 2:386 elif self.parent.bibles_tab.display_style == 2:
390387
=== modified file 'openlp/plugins/custom/customplugin.py'
--- openlp/plugins/custom/customplugin.py 2009-05-16 10:24:03 +0000
+++ openlp/plugins/custom/customplugin.py 2009-05-21 16:07:01 +0000
@@ -21,10 +21,8 @@
2121
22from PyQt4 import QtCore, QtGui22from PyQt4 import QtCore, QtGui
2323
24from openlp.core.resources import *
25from openlp.core.lib import Plugin, Event
26from openlp.core.lib import EventType
27from forms import EditCustomForm24from forms import EditCustomForm
25from openlp.core.lib import Plugin, Event, EventType
28from openlp.plugins.custom.lib import CustomManager, CustomTab, CustomMediaItem, CustomServiceItem26from openlp.plugins.custom.lib import CustomManager, CustomTab, CustomMediaItem, CustomServiceItem
2927
3028
3129
=== modified file 'openlp/plugins/custom/forms/editcustomdialog.py'
--- openlp/plugins/custom/forms/editcustomdialog.py 2009-05-01 22:26:43 +0000
+++ openlp/plugins/custom/forms/editcustomdialog.py 2009-05-21 16:07:01 +0000
@@ -8,7 +8,7 @@
8# WARNING! All changes made in this file will be lost!8# WARNING! All changes made in this file will be lost!
99
10from PyQt4 import QtCore, QtGui10from PyQt4 import QtCore, QtGui
11from openlp.core import translate11from openlp.core.lib import translate
1212
13class Ui_customEditDialog(object):13class Ui_customEditDialog(object):
14 def setupUi(self, customEditDialog):14 def setupUi(self, customEditDialog):
1515
=== modified file 'openlp/plugins/custom/lib/customserviceitem.py'
--- openlp/plugins/custom/lib/customserviceitem.py 2009-03-17 05:05:04 +0000
+++ openlp/plugins/custom/lib/customserviceitem.py 2009-05-21 16:07:01 +0000
@@ -19,6 +19,7 @@
19"""19"""
20from PyQt4 import QtCore, QtGui20from PyQt4 import QtCore, QtGui
21import logging21import logging
22
22from openlp.core.lib import ServiceItem23from openlp.core.lib import ServiceItem
2324
24from openlp.plugins.custom.lib import TextListData25from openlp.plugins.custom.lib import TextListData
@@ -40,12 +41,12 @@
40 it simply tells the slide controller to use it???41 it simply tells the slide controller to use it???
4142
42 It contains 1 or more images43 It contains 1 or more images
43 44
44 """45 """
45 global log46 global log
46 log=logging.getLogger(u'CustomServiceItem')47 log=logging.getLogger(u'CustomServiceItem')
47 log.info(u'CustomServiceItem loaded')48 log.info(u'CustomServiceItem loaded')
48 49
49 def __init__(self, controller):50 def __init__(self, controller):
50 """51 """
51 Init Method52 Init Method
@@ -58,7 +59,7 @@
58# c.uniformItemSizes=True59# c.uniformItemSizes=True
59# c.setModel(self.imgs)60# c.setModel(self.imgs)
60# c.setGeometry(0,0,200,200)61# c.setGeometry(0,0,200,200)
61 62
62 def render(self):63 def render(self):
63 """64 """
64 The render method is what the plugin uses to render its meda to the65 The render method is what the plugin uses to render its meda to the
@@ -66,7 +67,7 @@
66 """67 """
67 # render the "image chooser first"68 # render the "image chooser first"
68# for f in self.imgs:69# for f in self.imgs:
69# fl , nm = os.path.split(str(f)) 70# fl , nm = os.path.split(str(f))
70# c = self.slide_controller.rowCount()71# c = self.slide_controller.rowCount()
71# self.slide_controller.setRowCount(c+1)72# self.slide_controller.setRowCount(c+1)
72# twi = QtGui.QTableWidgetItem(str(f))73# twi = QtGui.QTableWidgetItem(str(f))
@@ -74,7 +75,7 @@
74# twi = QtGui.QTableWidgetItem(str(nm))75# twi = QtGui.QTableWidgetItem(str(nm))
75# self.slide_controller.setItem(c , 1, twi)76# self.slide_controller.setItem(c , 1, twi)
76# self.slide_controller.setRowHeight(c, 80)77# self.slide_controller.setRowHeight(c, 80)
77 78
78 # render the preview screen here79 # render the preview screen here
7980
80 def get_parent_node(self):81 def get_parent_node(self):
@@ -83,7 +84,7 @@
83 Manager.84 Manager.
84 """85 """
85 pass86 pass
86 87
87 def add(self, data):88 def add(self, data):
88 """89 """
89 append an image to the list90 append an image to the list
@@ -95,7 +96,7 @@
95 log.info("add Item..."+str(data))96 log.info("add Item..."+str(data))
96 for filename in data.imgs.get_file_list():97 for filename in data.imgs.get_file_list():
97 self.add(filename)98 self.add(filename)
98 99
99100
100 def get_oos_text(self):101 def get_oos_text(self):
101 """102 """
@@ -114,4 +115,4 @@
114 files=text.split('\n')115 files=text.split('\n')
115 for f in files:116 for f in files:
116 self.imgs.addRow(f)117 self.imgs.addRow(f)
117 118
118119
=== modified file 'openlp/plugins/custom/lib/customtab.py'
--- openlp/plugins/custom/lib/customtab.py 2009-03-07 09:20:56 +0000
+++ openlp/plugins/custom/lib/customtab.py 2009-05-21 16:07:01 +0000
@@ -20,9 +20,7 @@
2020
21from PyQt4 import QtCore, QtGui21from PyQt4 import QtCore, QtGui
2222
23from openlp.core import translate23from openlp.core.lib import SettingsTab, translate
24from openlp.core.lib import SettingsTab
25from openlp.core.resources import *
2624
27class CustomTab(SettingsTab):25class CustomTab(SettingsTab):
28 """26 """
2927
=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
--- openlp/plugins/custom/lib/mediaitem.py 2009-05-12 21:06:35 +0000
+++ openlp/plugins/custom/lib/mediaitem.py 2009-05-21 16:07:01 +0000
@@ -21,11 +21,7 @@
2121
22from PyQt4 import QtCore, QtGui22from PyQt4 import QtCore, QtGui
2323
24from openlp.core import translate24from openlp.core.lib import MediaManagerItem, SongXMLParser, ServiceItem, translate
25from openlp.core.lib import MediaManagerItem
26from openlp.core.lib import SongXMLParser
27from openlp.core.lib import ServiceItem
28
29from openlp.plugins.custom.lib import TextListData25from openlp.plugins.custom.lib import TextListData
3026
31class CustomList(QtGui.QListView):27class CustomList(QtGui.QListView):
3228
=== modified file 'openlp/plugins/custom/lib/textlistdata.py'
--- openlp/plugins/custom/lib/textlistdata.py 2009-03-15 06:35:07 +0000
+++ openlp/plugins/custom/lib/textlistdata.py 2009-05-21 16:07:01 +0000
@@ -1,55 +1,50 @@
1import logging1import logging
22
3from PyQt4.QtCore import *3from PyQt4 import QtCore, QtGui
4from PyQt4.QtGui import *4
55class TextListData(QtCore.QAbstractListModel):
6
7class TextListData(QAbstractListModel):
8 """6 """
9 An abstract list of strings 7 An abstract list of strings
10 """8 """
11 global log9 global log
12 log=logging.getLogger(u'TextListData')10 log=logging.getLogger(u'TextListData')
13 log.info(u'started')11 log.info(u'started')
1412
15 def __init__(self):13 def __init__(self):
16 QAbstractListModel.__init__(self)14 QtCore.QAbstractListModel.__init__(self)
17 self.items=[] # will be a list of (database id , title) tuples15 self.items=[] # will be a list of (database id , title) tuples
1816
19 def resetStore(self):17 def resetStore(self):
20 #reset list so can be reloaded18 #reset list so can be reloaded
21 self.items=[] 19 self.items=[]
22 20
23 def rowCount(self, parent):21 def rowCount(self, parent):
24 return len(self.items)22 return len(self.items)
2523
26 def insertRow(self, row, id, title):24 def insertRow(self, row, id, title):
27 self.beginInsertRows(QModelIndex(),row,row)25 self.beginInsertRows(QtCore.QModelIndex(),row,row)
28 log.debug("insert row %d:%s for id %d"%(row,title, id))26 log.debug("insert row %d:%s for id %d" % (row,title, id))
29 self.items.insert(row, (id, title))27 self.items.insert(row, (id, title))
30 self.endInsertRows()28 self.endInsertRows()
3129
32 def removeRow(self, row):30 def removeRow(self, row):
33 self.beginRemoveRows(QModelIndex(), row,row)31 self.beginRemoveRows(QtCore.QModelIndex(), row,row)
34 self.items.pop(row)32 self.items.pop(row)
35 self.endRemoveRows()33 self.endRemoveRows()
3634
37 def addRow(self, id, title):35 def addRow(self, id, title):
38 self.insertRow(len(self.items), id, title)36 self.insertRow(len(self.items), id, title)
39 37
40 def data(self, index, role):38 def data(self, index, role):
41 row=index.row()39 row=index.row()
42 if row > len(self.items): # if the last row is selected and deleted, we then get called with an empty row!40 if row > len(self.items): # if the last row is selected and deleted, we then get called with an empty row!
43 return QVariant()41 return QtCore.QVariant()
44 if role==Qt.DisplayRole:42 if role == QtCore.Qt.DisplayRole:
45 retval= self.items[row][1]43 retval = self.items[row][1]
46# elif role == Qt.ToolTipRole: #not sure if need as it shows the database row number
47# retval= self.items[row][0]
48 else:44 else:
49 retval= QVariant()45 retval = QtCore.QVariant()
50# log.info("Returning"+ str(retval))46 if type(retval) is not type(QtCore.QVariant):
51 if type(retval) is not type(QVariant):47 return QtCore.QVariant(retval)
52 return QVariant(retval)
53 else:48 else:
54 return retval49 return retval
5550
@@ -60,10 +55,7 @@
60 def getId(self, index):55 def getId(self, index):
61 row = index.row()56 row = index.row()
62 return self.items[row][0]57 return self.items[row][0]
63 58
64 def deleteRow(self, index):59 def deleteRow(self, index):
65 row = index.row()60 row = index.row()
66 self.removeRow(row)61 self.removeRow(row)
67
68if __name__=="__main__":
69 sxml=TextListData()
7062
=== modified file 'openlp/plugins/images/imageplugin.py'
--- openlp/plugins/images/imageplugin.py 2009-05-16 10:24:03 +0000
+++ openlp/plugins/images/imageplugin.py 2009-05-21 16:07:01 +0000
@@ -21,14 +21,12 @@
2121
22from PyQt4 import QtCore, QtGui22from PyQt4 import QtCore, QtGui
2323
24from openlp.core.lib import Plugin, Event24from openlp.core.lib import Plugin, Event, EventType
25from openlp.core.lib import EventType
26
27from openlp.plugins.images.lib import ImageMediaItem, ImageServiceItem25from openlp.plugins.images.lib import ImageMediaItem, ImageServiceItem
2826
29class ImagePlugin(Plugin):27class ImagePlugin(Plugin):
30 global log28 global log
31 log=logging.getLogger(u'ImagePlugin')29 log = logging.getLogger(u'ImagePlugin')
32 log.info(u'Image Plugin loaded')30 log.info(u'Image Plugin loaded')
3331
34 def __init__(self, plugin_helpers):32 def __init__(self, plugin_helpers):
3533
=== modified file 'openlp/plugins/images/lib/imageserviceitem.py'
--- openlp/plugins/images/lib/imageserviceitem.py 2009-05-09 07:01:33 +0000
+++ openlp/plugins/images/lib/imageserviceitem.py 2009-05-22 18:30:25 +0000
@@ -17,8 +17,8 @@
17this program; if not, write to the Free Software Foundation, Inc., 59 Temple17this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18Place, Suite 330, Boston, MA 02111-1307 USA18Place, Suite 330, Boston, MA 02111-1307 USA
19"""19"""
20import logging
20from PyQt4 import QtCore, QtGui21from PyQt4 import QtCore, QtGui
21import logging
22from openlp.core.lib import ServiceItem22from openlp.core.lib import ServiceItem
23from listwithpreviews import ListWithPreviews23from listwithpreviews import ListWithPreviews
2424
2525
=== modified file 'openlp/plugins/images/lib/listwithpreviews.py'
--- openlp/plugins/images/lib/listwithpreviews.py 2009-05-11 05:09:43 +0000
+++ openlp/plugins/images/lib/listwithpreviews.py 2009-05-22 19:36:16 +0000
@@ -1,51 +1,74 @@
1# -*- coding: utf-8 -*-
2# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
3"""
4OpenLP - Open Source Lyrics Projection
5Copyright (c) 2008 Raoul Snyman
6Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU General Public License as published by the Free Software
10Foundation; version 2 of the License.
11
12This program is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14PARTICULAR PURPOSE. See the GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License along with
17this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18Place, Suite 330, Boston, MA 02111-1307 USA
19"""
1import os20import os
2import logging21import logging
3from PyQt4.QtCore import *22from PyQt4 import QtCore, QtGui
4from PyQt4.QtGui import *23
5class ListWithPreviews(QAbstractListModel):24
25class ListWithPreviews(QtCore.QAbstractListModel):
6 """26 """
7 An abstract list of strings and the preview icon to go with them27 An abstract list of strings and the preview icon to go with them
8 """28 """
9 global log29 global log
10 log=logging.getLogger("ListWithPreviews")30 log = logging.getLogger("ListWithPreviews")
11 log.info("started")31 log.info("started")
1232
13 def __init__(self):33 def __init__(self):
14 QAbstractListModel.__init__(self)34 QtCore.QAbstractListModel.__init__(self)
15 self.items=[] # will be a list of (full filename, QPixmap, shortname) tuples35 self.items = [] # will be a list of (full filename, QPixmap, shortname) tuples
16 self.rowheight=5036 self.rowheight = 50
17 self.maximagewidth=self.rowheight*16/9.0;37 self.maximagewidth = self.rowheight*16/9.0;
1838
19 def rowCount(self, parent):39 def rowCount(self, parent):
20 return len(self.items)40 return len(self.items)
2141
22 def insertRow(self, row, filename):42 def insertRow(self, row, filename):
23 self.beginInsertRows(QModelIndex(),row,row)43 self.beginInsertRows(QtCore.QModelIndex(),row,row)
24 log.info("insert row %d:%s"%(row,filename))44 log.info("insert row %d:%s"% (row,filename))
25 # get short filename to display next to image45 # get short filename to display next to image
26 (prefix, shortfilename) = os.path.split(str(filename))46 (prefix, shortfilename) = os.path.split(str(filename))
27 log.info("shortfilename=%s"%(shortfilename))47 log.info("shortfilename=%s"% (shortfilename))
28 # create a preview image48 # create a preview image
29 if os.path.exists(filename):49 if os.path.exists(filename):
30 preview = QPixmap(str(filename))50 preview = QtGui.QPixmap(str(filename))
31 w=self.maximagewidth;h=self.rowheight51 w = self.maximagewidth;
32 preview = preview.scaled(w,h, Qt.KeepAspectRatio, Qt.SmoothTransformation)52 h = self.rowheight
33 realw=preview.width(); realh=preview.height()53 preview = preview.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
54 realw = preview.width();
55 realh = preview.height()
34 # and move it to the centre of the preview space56 # and move it to the centre of the preview space
35 p=QPixmap(w,h)57 p = QtGui.QPixmap(w,h)
36 p.fill(Qt.transparent)58 p.fill(QtCore.Qt.transparent)
37 painter=QPainter(p)59 painter = QtGui.QPainter(p)
38 painter.drawPixmap((w-realw)/2,(h-realh)/2,preview)60 painter.drawPixmap((w-realw)/2,(h-realh)/2,preview)
39 else:61 else:
40 w=self.maximagewidth;h=self.rowheight62 w = self.maximagewidth;
41 p=QPixmap(w,h)63 h = self.rowheight
42 p.fill(Qt.transparent)64 p = QtGui.QPixmap(w,h)
65 p.fill(QtCore.Qt.transparent)
43 # finally create the row66 # finally create the row
44 self.items.insert(row, (filename, p, shortfilename))67 self.items.insert(row, (filename, p, shortfilename))
45 self.endInsertRows()68 self.endInsertRows()
4669
47 def removeRow(self, row):70 def removeRow(self, row):
48 self.beginRemoveRows(QModelIndex(), row,row)71 self.beginRemoveRows(QtCore.QModelIndex(), row, row)
49 self.items.pop(row)72 self.items.pop(row)
50 self.endRemoveRows()73 self.endRemoveRows()
5174
@@ -53,20 +76,20 @@
53 self.insertRow(len(self.items), filename)76 self.insertRow(len(self.items), filename)
5477
55 def data(self, index, role):78 def data(self, index, role):
56 row=index.row()79 row = index.row()
57 if row > len(self.items): # if the last row is selected and deleted, we then get called with an empty row!80 if row > len(self.items):
58 return QVariant()81 # if the last row is selected and deleted, we then get called with an empty row!
59 if role==Qt.DisplayRole:82 return QtCore.QVariant()
60 retval= self.items[row][2]83 if role == QtCore.Qt.DisplayRole:
61 elif role == Qt.DecorationRole:84 retval = self.items[row][2]
62 retval= self.items[row][1]85 elif role == QtCore.Qt.DecorationRole:
63 elif role == Qt.ToolTipRole:86 retval = self.items[row][1]
64 retval= self.items[row][0]87 elif role == QtCore.Qt.ToolTipRole:
88 retval = self.items[row][0]
65 else:89 else:
66 retval= QVariant()90 retval = QtCore.QVariant()
67# log.info("Returning"+ str(retval))91 if type(retval) is not type(QtCore.QVariant):
68 if type(retval) is not type(QVariant):92 return QtCore.QVariant(retval)
69 return QVariant(retval)
70 else:93 else:
71 return retval94 return retval
7295
7396
=== modified file 'openlp/plugins/images/lib/mediaitem.py'
--- openlp/plugins/images/lib/mediaitem.py 2009-05-16 10:24:03 +0000
+++ openlp/plugins/images/lib/mediaitem.py 2009-05-22 18:30:25 +0000
@@ -22,10 +22,7 @@
2222
23from PyQt4 import QtCore, QtGui23from PyQt4 import QtCore, QtGui
2424
25from openlp.core import translate25from openlp.core.lib import MediaManagerItem, ServiceItem, translate
26from openlp.core.lib import MediaManagerItem
27from openlp.core.lib import ServiceItem
28
29from openlp.plugins.images.lib import ListWithPreviews26from openlp.plugins.images.lib import ListWithPreviews
3027
31class ImageList(QtGui.QListView):28class ImageList(QtGui.QListView):
@@ -156,7 +153,7 @@
156 for index in indexes:153 for index in indexes:
157 filename = self.ImageListData.getFilename(index)154 filename = self.ImageListData.getFilename(index)
158 frame = QtGui.QPixmap(str(filename))155 frame = QtGui.QPixmap(str(filename))
159 service_item.frames.append({u'formatted': u'Image', u'image': frame})156 service_item.frames.append({u'title': filename , u'image': frame})
160157
161 def onImagePreviewClick(self):158 def onImagePreviewClick(self):
162 log.debug(u'Image Preview Requested')159 log.debug(u'Image Preview Requested')
163160
=== modified file 'openlp/plugins/media/lib/mediaitem.py'
--- openlp/plugins/media/lib/mediaitem.py 2009-05-18 04:41:49 +0000
+++ openlp/plugins/media/lib/mediaitem.py 2009-05-22 18:30:25 +0000
@@ -22,8 +22,7 @@
2222
23from PyQt4 import QtCore, QtGui23from PyQt4 import QtCore, QtGui
2424
25from openlp.core import translate25from openlp.core.lib import MediaManagerItem, translate
26from openlp.core.lib import MediaManagerItem
2726
28from openlp.plugins.media.lib import MediaTab27from openlp.plugins.media.lib import MediaTab
29from openlp.plugins.media.lib import FileListData28from openlp.plugins.media.lib import FileListData
@@ -33,7 +32,7 @@
33 This is the custom media manager item for Media Slides.32 This is the custom media manager item for Media Slides.
34 """33 """
35 global log34 global log
36 log=logging.getLogger(u'MediaMediaItem')35 log = logging.getLogger(u'MediaMediaItem')
37 log.info(u'Media Media Item loaded')36 log.info(u'Media Media Item loaded')
3837
39 def __init__(self, parent, icon, title):38 def __init__(self, parent, icon, title):
4039
=== modified file 'openlp/plugins/media/lib/mediatab.py'
--- openlp/plugins/media/lib/mediatab.py 2009-05-15 05:15:53 +0000
+++ openlp/plugins/media/lib/mediatab.py 2009-05-21 05:15:51 +0000
@@ -20,9 +20,7 @@
2020
21from PyQt4 import QtCore, QtGui21from PyQt4 import QtCore, QtGui
2222
23from openlp.core import translate23from openlp.core.lib import SettingsTab, str_to_bool, translate
24from openlp import convertStringToBoolean
25from openlp.core.lib import SettingsTab
2624
27class MediaTab(SettingsTab):25class MediaTab(SettingsTab):
28 """26 """
@@ -67,11 +65,12 @@
67 def onVMRCheckBoxChanged(self):65 def onVMRCheckBoxChanged(self):
68 use_vmr_mode = self.UseVMRCheckBox.checkState()66 use_vmr_mode = self.UseVMRCheckBox.checkState()
69 self.use_vmr_mode = False67 self.use_vmr_mode = False
70 if use_vmr_mode == 2: # we have a set value convert to True/False68 if use_vmr_mode == 2:
69 # we have a set value convert to True/False
71 self.use_vmr_mode = True70 self.use_vmr_mode = True
7271
73 def load(self):72 def load(self):
74 self.use_vmr_mode = convertStringToBoolean(self.config.get_config(u'use mode layout', u'False'))73 self.use_vmr_mode = str_to_bool(self.config.get_config(u'use mode layout', u'False'))
75 if self.use_vmr_mode :74 if self.use_vmr_mode :
76 self.UseVMRCheckBox.setChecked(True)75 self.UseVMRCheckBox.setChecked(True)
7776
7877
=== modified file 'openlp/plugins/media/mediaplugin.py'
--- openlp/plugins/media/mediaplugin.py 2009-05-15 05:15:53 +0000
+++ openlp/plugins/media/mediaplugin.py 2009-05-21 05:15:51 +0000
@@ -20,7 +20,6 @@
20import os20import os
21from PyQt4 import QtCore, QtGui21from PyQt4 import QtCore, QtGui
2222
23from openlp.core.resources import *
24from openlp.core.lib import Plugin, MediaManagerItem, SettingsTab23from openlp.core.lib import Plugin, MediaManagerItem, SettingsTab
25from openlp.plugins.media.lib import MediaTab,MediaMediaItem24from openlp.plugins.media.lib import MediaTab,MediaMediaItem
2625
2726
=== modified file 'openlp/plugins/presentations/lib/mediaitem.py'
--- openlp/plugins/presentations/lib/mediaitem.py 2009-05-18 19:04:25 +0000
+++ openlp/plugins/presentations/lib/mediaitem.py 2009-05-22 18:30:25 +0000
@@ -21,11 +21,7 @@
21import os21import os
2222
23from PyQt4 import QtCore, QtGui23from PyQt4 import QtCore, QtGui
2424from openlp.core.lib import MediaManagerItem, translate
25from openlp.core import translate
26from openlp.core.lib import MediaManagerItem
27from openlp.core.resources import *
28
29from openlp.plugins.presentations.lib import FileListData25from openlp.plugins.presentations.lib import FileListData
3026
31class PresentationMediaItem(MediaManagerItem):27class PresentationMediaItem(MediaManagerItem):
3228
=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py 2009-03-10 16:46:25 +0000
+++ openlp/plugins/songs/lib/mediaitem.py 2009-05-22 18:30:25 +0000
@@ -21,9 +21,7 @@
2121
22from PyQt4 import QtCore, QtGui22from PyQt4 import QtCore, QtGui
2323
24from openlp.core import translate24from openlp.core.lib import MediaManagerItem, translate
25from openlp.core.lib import MediaManagerItem
26from openlp.core.resources import *
2725
28from openlp.plugins.songs.forms import EditSongForm26from openlp.plugins.songs.forms import EditSongForm
2927
@@ -32,7 +30,7 @@
32 This is the custom media manager item for Songs.30 This is the custom media manager item for Songs.
33 """31 """
34 global log32 global log
35 log=logging.getLogger("SongMediaItem")33 log = logging.getLogger("SongMediaItem")
36 log.info("Song Media Item loaded")34 log.info("Song Media Item loaded")
3735
38 def __init__(self, parent, icon, title):36 def __init__(self, parent, icon, title):
3937
=== modified file 'openlp/plugins/songs/lib/songstab.py'
--- openlp/plugins/songs/lib/songstab.py 2009-02-28 23:31:24 +0000
+++ openlp/plugins/songs/lib/songstab.py 2009-05-21 16:07:01 +0000
@@ -20,9 +20,7 @@
2020
21from PyQt4 import QtCore, QtGui21from PyQt4 import QtCore, QtGui
2222
23from openlp.core import translate23from openlp.core.lib import SettingsTab, translate
24from openlp.core.lib import SettingsTab
25from openlp.core.resources import *
2624
27class SongsTab(SettingsTab):25class SongsTab(SettingsTab):
28 """26 """
2927
=== modified file 'openlp/plugins/songs/songsplugin.py'
--- openlp/plugins/songs/songsplugin.py 2009-05-16 16:38:03 +0000
+++ openlp/plugins/songs/songsplugin.py 2009-05-22 18:30:25 +0000
@@ -21,7 +21,6 @@
2121
22from PyQt4 import QtCore, QtGui22from PyQt4 import QtCore, QtGui
2323
24from openlp.core.resources import *
25from openlp.core.lib import Plugin, Event24from openlp.core.lib import Plugin, Event
26from openlp.core.lib import EventType25from openlp.core.lib import EventType
27from openlp.plugins.songs.lib import SongManager, SongsTab, SongMediaItem26from openlp.plugins.songs.lib import SongManager, SongsTab, SongMediaItem
@@ -31,7 +30,7 @@
31class SongsPlugin(Plugin):30class SongsPlugin(Plugin):
3231
33 global log32 global log
34 log=logging.getLogger(u'SongsPlugin')33 log = logging.getLogger(u'SongsPlugin')
35 log.info(u'Song Plugin loaded')34 log.info(u'Song Plugin loaded')
3635
37 def __init__(self, plugin_helpers):36 def __init__(self, plugin_helpers):
@@ -124,7 +123,7 @@
124 """123 """
125 Handle the event contained in the event object.124 Handle the event contained in the event object.
126 """125 """
127 log.debug(u'Handle event called with event %s'%event.event_type)126 log.debug(u'Handle event called with event %s' % event.event_type)
128 if event.event_type == EventType.ThemeListChanged:127 if event.event_type == EventType.ThemeListChanged:
129 log.debug(u'New Theme request received')128 log.debug(u'New Theme request received')
130 #self.edit_custom_form.loadThemes(self.theme_manager.getThemes())129 #self.edit_custom_form.loadThemes(self.theme_manager.getThemes())