Replaced the old logos and graphics with the new ones, did some coding-standards-cleanup, and fixed a bug in the OpenLPToolbar code where it discarded Unicode strings.

This commit is contained in:
Raoul Snyman 2009-05-02 00:26:43 +02:00
parent 2d9cfa9f75
commit 55cd0b90cd
20 changed files with 426 additions and 381 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE UserProject SYSTEM "UserProject-4.0.dtd"> <!DOCTYPE UserProject SYSTEM "UserProject-4.0.dtd">
<!-- eric4 user project file for project openlp.org 2.0 --> <!-- eric4 user project file for project openlp.org 2.0 -->
<!-- Saved: 2009-03-13, 00:02:12 --> <!-- Saved: 2009-05-02, 00:15:57 -->
<!-- Copyright (C) 2009 Raoul Snyman, raoulsnyman@openlp.org --> <!-- Copyright (C) 2009 Raoul Snyman, raoulsnyman@openlp.org -->
<UserProject version="4.0"> <UserProject version="4.0">
</UserProject> </UserProject>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Tasks SYSTEM "Tasks-4.2.dtd"> <!DOCTYPE Tasks SYSTEM "Tasks-4.2.dtd">
<!-- eric4 tasks file for project openlp.org 2.0 --> <!-- eric4 tasks file for project openlp.org 2.0 -->
<!-- Saved: 2009-03-13, 00:02:14 --> <!-- Saved: 2009-05-02, 00:15:57 -->
<Tasks version="4.2"> <Tasks version="4.2">
<Task priority="1" completed="False" bugfix="False"> <Task priority="1" completed="False" bugfix="False">
<Summary>TODO: what is the tags for bridge, pre-chorus?</Summary> <Summary>TODO: what is the tags for bridge, pre-chorus?</Summary>
@ -111,15 +111,6 @@
<Linenumber>534</Linenumber> <Linenumber>534</Linenumber>
</Resource> </Resource>
</Task> </Task>
<Task priority="1" completed="False" bugfix="False">
<Summary>TODO: need some way to make this geometry work properly!</Summary>
<Description></Description>
<Created>2009-03-01, 01:09:34</Created>
<Resource>
<Filename>openlp/core/ui/mainwindow.py</Filename>
<Linenumber>96</Linenumber>
</Resource>
</Task>
<Task priority="1" completed="False" bugfix="False"> <Task priority="1" completed="False" bugfix="False">
<Summary>TODO: need to get rid of this once all plugins are up to date</Summary> <Summary>TODO: need to get rid of this once all plugins are up to date</Summary>
<Description></Description> <Description></Description>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Project SYSTEM "Project-4.6.dtd"> <!DOCTYPE Project SYSTEM "Project-4.6.dtd">
<!-- eric4 project file for project openlp.org 2.0 --> <!-- eric4 project file for project openlp.org 2.0 -->
<!-- Saved: 2009-03-11, 21:25:53 --> <!-- Saved: 2009-05-02, 00:15:57 -->
<!-- Copyright (C) 2009 Raoul Snyman, raoulsnyman@openlp.org --> <!-- Copyright (C) 2009 Raoul Snyman, raoulsnyman@openlp.org -->
<Project version="4.6"> <Project version="4.6">
<Language>en</Language> <Language>en</Language>
@ -16,14 +16,11 @@
<Source>openlp/controls/__init__.py</Source> <Source>openlp/controls/__init__.py</Source>
<Source>openlp/core/test/test_render_theme.py</Source> <Source>openlp/core/test/test_render_theme.py</Source>
<Source>openlp/core/test/test_render.py</Source> <Source>openlp/core/test/test_render.py</Source>
<Source>openlp/core/interpolate.py</Source>
<Source>openlp/core/__init__.py</Source> <Source>openlp/core/__init__.py</Source>
<Source>openlp/core/render.py</Source>
<Source>openlp/__init__.py</Source> <Source>openlp/__init__.py</Source>
<Source>demo.py</Source> <Source>demo.py</Source>
<Source>openlp/core/settingsmanager.py</Source> <Source>openlp/core/settingsmanager.py</Source>
<Source>openlp/plugins/__init__.py</Source> <Source>openlp/plugins/__init__.py</Source>
<Source>openlp/core/pluginmanager.py</Source>
<Source>openlp/core/ui/__init__.py</Source> <Source>openlp/core/ui/__init__.py</Source>
<Source>openlp/core/ui/mainwindow.py</Source> <Source>openlp/core/ui/mainwindow.py</Source>
<Source>openlp/core/ui/splashscreen.py</Source> <Source>openlp/core/ui/splashscreen.py</Source>
@ -91,7 +88,6 @@
<Source>openlp/plugins/images/__init__.py</Source> <Source>openlp/plugins/images/__init__.py</Source>
<Source>openlp/plugins/images/imageplugin.py</Source> <Source>openlp/plugins/images/imageplugin.py</Source>
<Source>openlp/plugins/songs/forms/editsongdialog.py</Source> <Source>openlp/plugins/songs/forms/editsongdialog.py</Source>
<Source>openlp/core/lib/pluginutils.py</Source>
<Source>openlpcnv.pyw</Source> <Source>openlpcnv.pyw</Source>
<Source>openlp/plugins/songs/forms/songbookdialog.py</Source> <Source>openlp/plugins/songs/forms/songbookdialog.py</Source>
<Source>openlp/plugins/songs/forms/topicsdialog.py</Source> <Source>openlp/plugins/songs/forms/topicsdialog.py</Source>
@ -130,7 +126,6 @@
<Source>openlp/plugins/songs/lib/songstab.py</Source> <Source>openlp/plugins/songs/lib/songstab.py</Source>
<Source>openlp/plugins/videos/lib/__init__.py</Source> <Source>openlp/plugins/videos/lib/__init__.py</Source>
<Source>openlp/plugins/videos/lib/videotab.py</Source> <Source>openlp/plugins/videos/lib/videotab.py</Source>
<Source>openlp/plugins/bibles/lib/biblemediaitem.py</Source>
<Source>openlp/core/ui/test/test_service_manager.py</Source> <Source>openlp/core/ui/test/test_service_manager.py</Source>
<Source>openlp/plugins/images/lib/__init__.py</Source> <Source>openlp/plugins/images/lib/__init__.py</Source>
<Source>openlp/plugins/images/lib/imageserviceitem.py</Source> <Source>openlp/plugins/images/lib/imageserviceitem.py</Source>
@ -146,13 +141,32 @@
<Source>openlp/plugins/custom/lib/customtab.py</Source> <Source>openlp/plugins/custom/lib/customtab.py</Source>
<Source>openlp/plugins/custom/lib/classes.py</Source> <Source>openlp/plugins/custom/lib/classes.py</Source>
<Source>openlp/plugins/custom/lib/tables.py</Source> <Source>openlp/plugins/custom/lib/tables.py</Source>
<Source>openlp/plugins/custom/lib/custommediaitem.py</Source>
<Source>openlp/plugins/custom/lib/meta.py</Source> <Source>openlp/plugins/custom/lib/meta.py</Source>
<Source>openlp/plugins/custom/lib/models.py</Source> <Source>openlp/plugins/custom/lib/models.py</Source>
<Source>openlp/plugins/custom/lib/manager.py</Source> <Source>openlp/plugins/custom/lib/manager.py</Source>
<Source>openlp/plugins/images/lib/mediaitem.py</Source> <Source>openlp/plugins/images/lib/mediaitem.py</Source>
<Source>openlp/plugins/songs/lib/mediaitem.py</Source> <Source>openlp/plugins/songs/lib/mediaitem.py</Source>
<Source>xml1.py</Source> <Source>openlp/core/ui/maindisplay.py</Source>
<Source>openlp/core/ui/amendthemedialog.py</Source>
<Source>openlp/core/ui/thememanager.py</Source>
<Source>openlp/core/ui/amendthemeform.py</Source>
<Source>openlp/core/lib/eventmanager.py</Source>
<Source>openlp/core/lib/rendermanager.py</Source>
<Source>openlp/core/lib/renderer.py</Source>
<Source>openlp/core/lib/songxmlhandler.py</Source>
<Source>openlp/core/lib/pluginmanager.py</Source>
<Source>openlp/core/lib/themexmlhandler.py</Source>
<Source>openlp/plugins/bibles/lib/mediaitem.py</Source>
<Source>openlp/plugins/bibles/lib/textlistdata.py</Source>
<Source>openlp/plugins/presentations/lib/__init__.py</Source>
<Source>openlp/plugins/presentations/lib/mediaitem.py</Source>
<Source>openlp/plugins/presentations/lib/filelistdata.py</Source>
<Source>openlp/plugins/videos/lib/mediaitem.py</Source>
<Source>openlp/plugins/videos/lib/filelistdata.py</Source>
<Source>openlp/plugins/custom/lib/mediaitem.py</Source>
<Source>openlp/plugins/custom/lib/textlistdata.py</Source>
<Source>openlp/plugins/custom/lib/customserviceitem.py</Source>
<Source>resources/images/openlp-2_rc.py</Source>
</Sources> </Sources>
<Forms> <Forms>
<Form>resources/forms/openlpexportform.ui</Form> <Form>resources/forms/openlpexportform.ui</Form>
@ -173,6 +187,7 @@
<Form>resources/forms/editsongdialog.ui</Form> <Form>resources/forms/editsongdialog.ui</Form>
<Form>resources/forms/editversedialog.ui</Form> <Form>resources/forms/editversedialog.ui</Form>
<Form>resources/forms/editcustomdialog.ui</Form> <Form>resources/forms/editcustomdialog.ui</Form>
<Form>resources/forms/amendthemedialog.ui</Form>
</Forms> </Forms>
<Translations> <Translations>
</Translations> </Translations>
@ -189,7 +204,7 @@
</Others> </Others>
<MainScript>openlp.pyw</MainScript> <MainScript>openlp.pyw</MainScript>
<Vcs> <Vcs>
<VcsType>Subversion</VcsType> <VcsType>None</VcsType>
<VcsOptions> <VcsOptions>
<dict> <dict>
<key> <key>

View File

@ -29,9 +29,11 @@ class OpenLPToolbar(QtGui.QToolBar):
""" """
def __init__(self, parent): def __init__(self, parent):
QtGui.QToolBar.__init__(self, parent) QtGui.QToolBar.__init__(self, parent)
self.icons={} # useful to be able to reuse button icons... # useful to be able to reuse button icons...
self.log=logging.getLogger("OpenLPToolbar"+str(parent)) self.icons = {}
self.log.info("Init done") self.log = logging.getLogger(u'OpenLPToolbar')
self.log.info(u'Init done')
def addToolbarButton(self, title, icon, tooltip=None, slot=None, objectname=None): def addToolbarButton(self, title, icon, tooltip=None, slot=None, objectname=None):
""" """
A method to help developers easily add a button to the toolbar. A method to help developers easily add a button to the toolbar.
@ -39,9 +41,9 @@ class OpenLPToolbar(QtGui.QToolBar):
ButtonIcon = None ButtonIcon = None
if type(icon) is QtGui.QIcon: if type(icon) is QtGui.QIcon:
ButtonIcon = icon ButtonIcon = icon
elif type(icon) is types.StringType: elif type(icon) is types.StringType or type(icon) is types.UnicodeType:
ButtonIcon = QtGui.QIcon() ButtonIcon = QtGui.QIcon()
if icon.startswith(':/'): if icon.startswith(u':/'):
ButtonIcon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal, ButtonIcon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal,
QtGui.QIcon.Off) QtGui.QIcon.Off)
else: else:
@ -51,12 +53,13 @@ class OpenLPToolbar(QtGui.QToolBar):
ToolbarButton = self.addAction(ButtonIcon, title) ToolbarButton = self.addAction(ButtonIcon, title)
if tooltip is not None: if tooltip is not None:
ToolbarButton.setToolTip(tooltip) ToolbarButton.setToolTip(tooltip)
if slot is not None: if slot is not None:
QtCore.QObject.connect(ToolbarButton, QtCore.SIGNAL('triggered()'), slot) QtCore.QObject.connect(ToolbarButton, QtCore.SIGNAL('triggered()'), slot)
self.icons[title]=ButtonIcon self.icons[title] = ButtonIcon
def getIconFromTitle(self, title): def getIconFromTitle(self, title):
if self.icons.has_key(title): if self.icons.has_key(title):
return self.icons[title] return self.icons[title]
else: else:
self.log.error("getIconFromTitle - no icon for %s" %title) self.log.error("getIconFromTitle - no icon for %s" % title)
return QtGui.QIcon() return QtGui.QIcon()

View File

@ -34,7 +34,7 @@ class AboutForm(QDialog):
AboutForm.setObjectName("AboutForm") AboutForm.setObjectName("AboutForm")
AboutForm.resize(470, 481) AboutForm.resize(470, 481)
icon = QtGui.QIcon() icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon.addPixmap(QtGui.QPixmap(":/icon/openlp-logo-16x16.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
AboutForm.setWindowIcon(icon) AboutForm.setWindowIcon(icon)
AboutFormLayout = QtGui.QVBoxLayout(AboutForm) AboutFormLayout = QtGui.QVBoxLayout(AboutForm)
AboutFormLayout.setSpacing(8) AboutFormLayout.setSpacing(8)
@ -45,7 +45,7 @@ class AboutForm(QDialog):
self.Logo.setStyleSheet("background-color: rgb(255, 255, 255);") self.Logo.setStyleSheet("background-color: rgb(255, 255, 255);")
self.Logo.setFrameShape(QtGui.QFrame.StyledPanel) self.Logo.setFrameShape(QtGui.QFrame.StyledPanel)
self.Logo.setLineWidth(1) self.Logo.setLineWidth(1)
self.Logo.setPixmap(QtGui.QPixmap(":/graphics/about-new.bmp")) self.Logo.setPixmap(QtGui.QPixmap(":/graphics/openlp-about-logo.png"))
self.Logo.setScaledContents(False) self.Logo.setScaledContents(False)
self.Logo.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) self.Logo.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
self.Logo.setObjectName("Logo") self.Logo.setObjectName("Logo")

View File

@ -27,17 +27,17 @@ from openlp.core.resources import *
class AlertForm(QDialog): class AlertForm(QDialog):
global log global log
log=logging.getLogger(u'AlertForm') log=logging.getLogger(u'AlertForm')
def __init__(self, parent=None): def __init__(self, parent=None):
QDialog.__init__(self, parent) QDialog.__init__(self, parent)
self.setupUi(self) self.setupUi(self)
log.info(u'Defined') log.info(u'Defined')
def setupUi(self, AlertForm): def setupUi(self, AlertForm):
AlertForm.setObjectName("AlertForm") AlertForm.setObjectName("AlertForm")
AlertForm.resize(370, 110) AlertForm.resize(370, 110)
icon = QtGui.QIcon() icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon.addPixmap(QtGui.QPixmap(":/icon/openlp-logo-16x16.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
AlertForm.setWindowIcon(icon) AlertForm.setWindowIcon(icon)
self.AlertFormLayout = QtGui.QVBoxLayout(AlertForm) self.AlertFormLayout = QtGui.QVBoxLayout(AlertForm)
self.AlertFormLayout.setSpacing(8) self.AlertFormLayout.setSpacing(8)
@ -84,7 +84,7 @@ class AlertForm(QDialog):
self.AlertFormLayout.addWidget(self.ButtonBoxWidget) self.AlertFormLayout.addWidget(self.ButtonBoxWidget)
self.retranslateUi(AlertForm) self.retranslateUi(AlertForm)
QtCore.QObject.connect(self.CancelButton, QtCore.SIGNAL("clicked()"), AlertForm.close) QtCore.QObject.connect(self.CancelButton, QtCore.SIGNAL("clicked()"), AlertForm.close)
QtCore.QObject.connect(self.DisplayButton, QtCore.SIGNAL("clicked()"), self.onDisplayClicked) QtCore.QObject.connect(self.DisplayButton, QtCore.SIGNAL("clicked()"), self.onDisplayClicked)
QtCore.QMetaObject.connectSlotsByName(AlertForm) QtCore.QMetaObject.connectSlotsByName(AlertForm)
@ -95,10 +95,10 @@ class AlertForm(QDialog):
self.DisplayButton.setText(translate("AlertForm", u'Display')) self.DisplayButton.setText(translate("AlertForm", u'Display'))
self.CancelButton.setText(translate("AlertForm", u'Cancel')) self.CancelButton.setText(translate("AlertForm", u'Cancel'))
def load_settings(self): def load_settings(self):
pass pass
def save_settings(self): def save_settings(self):
pass pass

View File

@ -15,7 +15,7 @@ class Ui_AmendThemeDialog(object):
AmendThemeDialog.setWindowModality(QtCore.Qt.ApplicationModal) AmendThemeDialog.setWindowModality(QtCore.Qt.ApplicationModal)
AmendThemeDialog.resize(586, 651) AmendThemeDialog.resize(586, 651)
icon = QtGui.QIcon() icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon.addPixmap(QtGui.QPixmap(":/icon/openlp-logo-16x16.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
AmendThemeDialog.setWindowIcon(icon) AmendThemeDialog.setWindowIcon(icon)
AmendThemeDialog.setModal(True) AmendThemeDialog.setModal(True)
self.AmendThemeLayout = QtGui.QVBoxLayout(AmendThemeDialog) self.AmendThemeLayout = QtGui.QVBoxLayout(AmendThemeDialog)

View File

@ -28,7 +28,7 @@ from openlp.core.ui import AboutForm, SettingsForm, AlertForm, \
SlideController, ServiceManager, ThemeManager, MainDisplay SlideController, ServiceManager, ThemeManager, MainDisplay
from openlp.core.lib import Plugin, MediaManagerItem, SettingsTab, EventManager, RenderManager from openlp.core.lib import Plugin, MediaManagerItem, SettingsTab, EventManager, RenderManager
from openlp.core import PluginManager from openlp.core import PluginManager, translate
class MainWindow(object): class MainWindow(object):
global log global log
@ -45,7 +45,7 @@ class MainWindow(object):
self.settings_form = SettingsForm(self.screen_list) self.settings_form = SettingsForm(self.screen_list)
pluginpath = os.path.split(os.path.abspath(__file__))[0] pluginpath = os.path.split(os.path.abspath(__file__))[0]
pluginpath = os.path.abspath(os.path.join(pluginpath, '..', '..','plugins')) pluginpath = os.path.abspath(os.path.join(pluginpath, u'..', u'..', u'plugins'))
self.plugin_manager = PluginManager(pluginpath) self.plugin_manager = PluginManager(pluginpath)
self.plugin_helpers = {} self.plugin_helpers = {}
@ -95,15 +95,17 @@ class MainWindow(object):
self.ThemeManagerContents.loadThemes() self.ThemeManagerContents.loadThemes()
def setupUi(self): def setupUi(self):
self.main_window.setObjectName("main_window") self.main_window.setObjectName(u'main_window')
self.main_window.resize(1087, 847) self.main_window.resize(1087, 847)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0) sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.main_window.sizePolicy().hasHeightForWidth()) sizePolicy.setHeightForWidth(self.main_window.sizePolicy().hasHeightForWidth())
self.main_window.setSizePolicy(sizePolicy) self.main_window.setSizePolicy(sizePolicy)
main_icon = QtGui.QIcon() main_icon = QtGui.QIcon()
main_icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) main_icon.addPixmap(QtGui.QPixmap(u':/icon/openlp-logo-16x16.png'),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.main_window.setWindowIcon(main_icon) self.main_window.setWindowIcon(main_icon)
self.MainContent = QtGui.QWidget(self.main_window) self.MainContent = QtGui.QWidget(self.main_window)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
@ -111,43 +113,43 @@ class MainWindow(object):
sizePolicy.setVerticalStretch(0) sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.MainContent.sizePolicy().hasHeightForWidth()) sizePolicy.setHeightForWidth(self.MainContent.sizePolicy().hasHeightForWidth())
self.MainContent.setSizePolicy(sizePolicy) self.MainContent.setSizePolicy(sizePolicy)
self.MainContent.setObjectName("MainContent") self.MainContent.setObjectName(u'MainContent')
self.MainContentLayout = QtGui.QHBoxLayout(self.MainContent) self.MainContentLayout = QtGui.QHBoxLayout(self.MainContent)
self.MainContentLayout.setSpacing(0) self.MainContentLayout.setSpacing(0)
self.MainContentLayout.setMargin(0) self.MainContentLayout.setMargin(0)
self.MainContentLayout.setObjectName("MainContentLayout") self.MainContentLayout.setObjectName(u'MainContentLayout')
self.main_window.setCentralWidget(self.MainContent) self.main_window.setCentralWidget(self.MainContent)
self.ControlSplitter = QtGui.QSplitter(self.MainContent) self.ControlSplitter = QtGui.QSplitter(self.MainContent)
self.ControlSplitter.setOrientation(QtCore.Qt.Horizontal) self.ControlSplitter.setOrientation(QtCore.Qt.Horizontal)
self.ControlSplitter.setObjectName("ControlSplitter") self.ControlSplitter.setObjectName(u'ControlSplitter')
self.MainContentLayout.addWidget(self.ControlSplitter) self.MainContentLayout.addWidget(self.ControlSplitter)
self.PreviewController = SlideController(self.ControlSplitter) self.PreviewController = SlideController(self.ControlSplitter)
self.LiveController = SlideController(self.ControlSplitter) self.LiveController = SlideController(self.ControlSplitter)
self.MenuBar = QtGui.QMenuBar(self.main_window) self.MenuBar = QtGui.QMenuBar(self.main_window)
self.MenuBar.setGeometry(QtCore.QRect(0, 0, 1087, 27)) self.MenuBar.setGeometry(QtCore.QRect(0, 0, 1087, 27))
self.MenuBar.setObjectName("MenuBar") self.MenuBar.setObjectName(u'MenuBar')
self.FileMenu = QtGui.QMenu(self.MenuBar) self.FileMenu = QtGui.QMenu(self.MenuBar)
self.FileMenu.setObjectName("FileMenu") self.FileMenu.setObjectName(u'FileMenu')
self.FileImportMenu = QtGui.QMenu(self.FileMenu) self.FileImportMenu = QtGui.QMenu(self.FileMenu)
self.FileImportMenu.setObjectName("FileImportMenu") self.FileImportMenu.setObjectName(u'FileImportMenu')
self.FileExportMenu = QtGui.QMenu(self.FileMenu) self.FileExportMenu = QtGui.QMenu(self.FileMenu)
self.FileExportMenu.setObjectName("FileExportMenu") self.FileExportMenu.setObjectName(u'FileExportMenu')
self.OptionsMenu = QtGui.QMenu(self.MenuBar) self.OptionsMenu = QtGui.QMenu(self.MenuBar)
self.OptionsMenu.setObjectName("OptionsMenu") self.OptionsMenu.setObjectName(u'OptionsMenu')
self.OptionsViewMenu = QtGui.QMenu(self.OptionsMenu) self.OptionsViewMenu = QtGui.QMenu(self.OptionsMenu)
self.OptionsViewMenu.setObjectName("OptionsViewMenu") self.OptionsViewMenu.setObjectName(u'OptionsViewMenu')
self.ViewModeMenu = QtGui.QMenu(self.OptionsViewMenu) self.ViewModeMenu = QtGui.QMenu(self.OptionsViewMenu)
self.ViewModeMenu.setObjectName("ViewModeMenu") self.ViewModeMenu.setObjectName(u'ViewModeMenu')
self.OptionsLanguageMenu = QtGui.QMenu(self.OptionsMenu) self.OptionsLanguageMenu = QtGui.QMenu(self.OptionsMenu)
self.OptionsLanguageMenu.setObjectName("OptionsLanguageMenu") self.OptionsLanguageMenu.setObjectName(u'OptionsLanguageMenu')
self.ToolsMenu = QtGui.QMenu(self.MenuBar) self.ToolsMenu = QtGui.QMenu(self.MenuBar)
self.ToolsMenu.setObjectName("ToolsMenu") self.ToolsMenu.setObjectName(u'ToolsMenu')
self.HelpMenu = QtGui.QMenu(self.MenuBar) self.HelpMenu = QtGui.QMenu(self.MenuBar)
self.HelpMenu.setObjectName("HelpMenu") self.HelpMenu.setObjectName(u'HelpMenu')
self.main_window.setMenuBar(self.MenuBar) self.main_window.setMenuBar(self.MenuBar)
self.StatusBar = QtGui.QStatusBar(self.main_window) self.StatusBar = QtGui.QStatusBar(self.main_window)
self.StatusBar.setObjectName("StatusBar") self.StatusBar.setObjectName(u'StatusBar')
self.main_window.setStatusBar(self.StatusBar) self.main_window.setStatusBar(self.StatusBar)
self.MediaManagerDock = QtGui.QDockWidget(self.main_window) self.MediaManagerDock = QtGui.QDockWidget(self.main_window)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
@ -156,11 +158,12 @@ class MainWindow(object):
sizePolicy.setHeightForWidth(self.MediaManagerDock.sizePolicy().hasHeightForWidth()) sizePolicy.setHeightForWidth(self.MediaManagerDock.sizePolicy().hasHeightForWidth())
self.MediaManagerDock.setSizePolicy(sizePolicy) self.MediaManagerDock.setSizePolicy(sizePolicy)
icon = QtGui.QIcon() icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/system/system_mediamanager.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon.addPixmap(QtGui.QPixmap(u':/system/system_mediamanager.png'),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.MediaManagerDock.setWindowIcon(icon) self.MediaManagerDock.setWindowIcon(icon)
self.MediaManagerDock.setFloating(False) self.MediaManagerDock.setFloating(False)
self.MediaManagerDock.setObjectName("MediaManagerDock") self.MediaManagerDock.setObjectName(u'MediaManagerDock')
self.MediaManagerDock.setMinimumWidth(250) self.MediaManagerDock.setMinimumWidth(250)
self.MediaManagerContents = QtGui.QWidget() self.MediaManagerContents = QtGui.QWidget()
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
@ -168,13 +171,12 @@ class MainWindow(object):
sizePolicy.setVerticalStretch(0) sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.MediaManagerContents.sizePolicy().hasHeightForWidth()) sizePolicy.setHeightForWidth(self.MediaManagerContents.sizePolicy().hasHeightForWidth())
self.MediaManagerContents.setSizePolicy(sizePolicy) self.MediaManagerContents.setSizePolicy(sizePolicy)
self.MediaManagerContents.setObjectName("MediaManagerContents") self.MediaManagerContents.setObjectName(u'MediaManagerContents')
self.MediaManagerLayout = QtGui.QHBoxLayout(self.MediaManagerContents) self.MediaManagerLayout = QtGui.QHBoxLayout(self.MediaManagerContents)
self.MediaManagerLayout.setContentsMargins(0, 2, 0, 0) self.MediaManagerLayout.setContentsMargins(0, 2, 0, 0)
self.MediaManagerLayout.setObjectName("MediaManagerLayout") self.MediaManagerLayout.setObjectName(u'MediaManagerLayout')
self.MediaToolBox = QtGui.QToolBox(self.MediaManagerContents) self.MediaToolBox = QtGui.QToolBox(self.MediaManagerContents)
#self.MediaToolBox.setTabSpacing(0) self.MediaToolBox.setObjectName(u'MediaToolBox')
self.MediaToolBox.setObjectName("MediaToolBox")
self.MediaManagerLayout.addWidget(self.MediaToolBox) self.MediaManagerLayout.addWidget(self.MediaToolBox)
self.MediaManagerDock.setWidget(self.MediaManagerContents) self.MediaManagerDock.setWidget(self.MediaManagerContents)
@ -182,22 +184,22 @@ class MainWindow(object):
#Sevice Manager Defined #Sevice Manager Defined
self.ServiceManagerDock = QtGui.QDockWidget(self.main_window) self.ServiceManagerDock = QtGui.QDockWidget(self.main_window)
ServiceManagerIcon = QtGui.QIcon() ServiceManagerIcon = QtGui.QIcon()
ServiceManagerIcon.addPixmap(QtGui.QPixmap(":/system/system_servicemanager.png"), ServiceManagerIcon.addPixmap(QtGui.QPixmap(u':/system/system_servicemanager.png'),
QtGui.QIcon.Normal, QtGui.QIcon.Off) QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ServiceManagerDock.setWindowIcon(ServiceManagerIcon) self.ServiceManagerDock.setWindowIcon(ServiceManagerIcon)
self.ServiceManagerDock.setFeatures(QtGui.QDockWidget.AllDockWidgetFeatures) self.ServiceManagerDock.setFeatures(QtGui.QDockWidget.AllDockWidgetFeatures)
self.ServiceManagerDock.setObjectName("ServiceManagerDock") self.ServiceManagerDock.setObjectName(u'ServiceManagerDock')
self.ServiceManagerContents = ServiceManager(self) self.ServiceManagerContents = ServiceManager(self)
self.ServiceManagerDock.setWidget(self.ServiceManagerContents) self.ServiceManagerDock.setWidget(self.ServiceManagerContents)
self.main_window.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.ServiceManagerDock) self.main_window.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.ServiceManagerDock)
#Theme Manager Defined #Theme Manager Defined
self.ThemeManagerDock = QtGui.QDockWidget(self.main_window) self.ThemeManagerDock = QtGui.QDockWidget(self.main_window)
ThemeManagerIcon = QtGui.QIcon() ThemeManagerIcon = QtGui.QIcon()
ThemeManagerIcon.addPixmap(QtGui.QPixmap(":/system/system_thememanager.png"), ThemeManagerIcon.addPixmap(QtGui.QPixmap(u':/system/system_thememanager.png'),
QtGui.QIcon.Normal, QtGui.QIcon.Off) QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ThemeManagerDock.setWindowIcon(ThemeManagerIcon) self.ThemeManagerDock.setWindowIcon(ThemeManagerIcon)
self.ThemeManagerDock.setFloating(False) self.ThemeManagerDock.setFloating(False)
self.ThemeManagerDock.setObjectName("ThemeManagerDock") self.ThemeManagerDock.setObjectName(u'ThemeManagerDock')
self.ThemeManagerContents = ThemeManager(self) self.ThemeManagerContents = ThemeManager(self)
@ -205,79 +207,94 @@ class MainWindow(object):
self.main_window.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.ThemeManagerDock) self.main_window.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.ThemeManagerDock)
self.FileNewItem = QtGui.QAction(self.main_window) self.FileNewItem = QtGui.QAction(self.main_window)
self.FileNewItem.setIcon(self.ServiceManagerContents.Toolbar.getIconFromTitle("New Service")) self.FileNewItem.setIcon(
self.FileNewItem.setObjectName("FileNewItem") self.ServiceManagerContents.Toolbar.getIconFromTitle(u'New Service'))
self.FileNewItem.setObjectName(u'FileNewItem')
self.FileOpenItem = QtGui.QAction(self.main_window) self.FileOpenItem = QtGui.QAction(self.main_window)
self.FileOpenItem.setIcon(self.ServiceManagerContents.Toolbar.getIconFromTitle("Open Service")) self.FileOpenItem.setIcon(
self.FileOpenItem.setObjectName("FileOpenItem") self.ServiceManagerContents.Toolbar.getIconFromTitle(u'Open Service'))
self.FileOpenItem.setObjectName(u'FileOpenItem')
self.FileSaveItem = QtGui.QAction(self.main_window) self.FileSaveItem = QtGui.QAction(self.main_window)
self.FileSaveItem.setIcon(self.ServiceManagerContents.Toolbar.getIconFromTitle("Save Service")) self.FileSaveItem.setIcon(
self.FileSaveItem.setObjectName("FileSaveItem") self.ServiceManagerContents.Toolbar.getIconFromTitle(u'Save Service'))
self.FileSaveItem.setObjectName(u'FileSaveItem')
self.FileSaveAsItem = QtGui.QAction(self.main_window) self.FileSaveAsItem = QtGui.QAction(self.main_window)
self.FileSaveAsItem.setObjectName("FileSaveAsItem") self.FileSaveAsItem.setObjectName(u'FileSaveAsItem')
self.FileExitItem = QtGui.QAction(self.main_window) self.FileExitItem = QtGui.QAction(self.main_window)
icon34 = QtGui.QIcon() ExitIcon = QtGui.QIcon()
icon34.addPixmap(QtGui.QPixmap(":/system/system_exit.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) ExitIcon.addPixmap(QtGui.QPixmap(u':/system/system_exit.png'),
self.FileExitItem.setIcon(icon34) QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.FileExitItem.setObjectName("FileExitItem") self.FileExitItem.setIcon(ExitIcon)
self.FileExitItem.setObjectName(u'FileExitItem')
self.ImportThemeItem = QtGui.QAction(self.main_window) self.ImportThemeItem = QtGui.QAction(self.main_window)
self.ImportThemeItem.setObjectName("ImportThemeItem") self.ImportThemeItem.setObjectName(u'ImportThemeItem')
self.ImportLanguageItem = QtGui.QAction(self.main_window) self.ImportLanguageItem = QtGui.QAction(self.main_window)
self.ImportLanguageItem.setObjectName("ImportLanguageItem") self.ImportLanguageItem.setObjectName(u'ImportLanguageItem')
self.ExportThemeItem = QtGui.QAction(self.main_window) self.ExportThemeItem = QtGui.QAction(self.main_window)
self.ExportThemeItem.setObjectName("ExportThemeItem") self.ExportThemeItem.setObjectName(u'ExportThemeItem')
self.ExportLanguageItem = QtGui.QAction(self.main_window) self.ExportLanguageItem = QtGui.QAction(self.main_window)
self.ExportLanguageItem.setObjectName("ExportLanguageItem") self.ExportLanguageItem.setObjectName(u'ExportLanguageItem')
self.actionLook_Feel = QtGui.QAction(self.main_window) self.actionLook_Feel = QtGui.QAction(self.main_window)
self.actionLook_Feel.setObjectName("actionLook_Feel") self.actionLook_Feel.setObjectName(u'actionLook_Feel')
self.OptionsSettingsItem = QtGui.QAction(self.main_window) self.OptionsSettingsItem = QtGui.QAction(self.main_window)
icon35 = QtGui.QIcon() SettingsIcon = QtGui.QIcon()
icon35.addPixmap(QtGui.QPixmap(":/system/system_settings.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) SettingsIcon.addPixmap(QtGui.QPixmap(u':/system/system_settings.png'),
self.OptionsSettingsItem.setIcon(icon35) QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.OptionsSettingsItem.setObjectName("OptionsSettingsItem") self.OptionsSettingsItem.setIcon(SettingsIcon)
self.OptionsSettingsItem.setObjectName(u'OptionsSettingsItem')
self.ViewMediaManagerItem = QtGui.QAction(self.main_window) self.ViewMediaManagerItem = QtGui.QAction(self.main_window)
self.ViewMediaManagerItem.setCheckable(True) self.ViewMediaManagerItem.setCheckable(True)
self.ViewMediaManagerItem.setChecked(True) self.ViewMediaManagerItem.setChecked(True)
self.ViewMediaManagerItem.setIcon(icon) self.ViewMediaManagerItem.setIcon(icon)
self.ViewMediaManagerItem.setObjectName("ViewMediaManagerItem") self.ViewMediaManagerItem.setObjectName(u'ViewMediaManagerItem')
self.ViewThemeManagerItem = QtGui.QAction(self.main_window) self.ViewThemeManagerItem = QtGui.QAction(self.main_window)
self.ViewThemeManagerItem.setCheckable(True) self.ViewThemeManagerItem.setCheckable(True)
self.ViewThemeManagerItem.setChecked(True) self.ViewThemeManagerItem.setChecked(True)
self.ViewThemeManagerItem.setIcon(ThemeManagerIcon) self.ViewThemeManagerItem.setIcon(ThemeManagerIcon)
self.ViewThemeManagerItem.setObjectName("ViewThemeManagerItem") self.ViewThemeManagerItem.setObjectName(u'ViewThemeManagerItem')
self.ViewServiceManagerItem = QtGui.QAction(self.main_window) self.ViewServiceManagerItem = QtGui.QAction(self.main_window)
self.ViewServiceManagerItem.setCheckable(True) self.ViewServiceManagerItem.setCheckable(True)
self.ViewServiceManagerItem.setChecked(True) self.ViewServiceManagerItem.setChecked(True)
self.ViewServiceManagerItem.setIcon(ServiceManagerIcon) self.ViewServiceManagerItem.setIcon(ServiceManagerIcon)
self.ViewServiceManagerItem.setObjectName("ViewServiceManagerItem") self.ViewServiceManagerItem.setObjectName(u'ViewServiceManagerItem')
self.ToolsAlertItem = QtGui.QAction(self.main_window) self.ToolsAlertItem = QtGui.QAction(self.main_window)
icon36 = QtGui.QIcon() AlertIcon = QtGui.QIcon()
icon36.addPixmap(QtGui.QPixmap(":/tools/tools_alert.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) AlertIcon.addPixmap(QtGui.QPixmap(u':/tools/tools_alert.png'),
self.ToolsAlertItem.setIcon(icon36) QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ToolsAlertItem.setObjectName("ToolsAlertItem") self.ToolsAlertItem.setIcon(AlertIcon)
self.ToolsAlertItem.setObjectName(u'ToolsAlertItem')
self.HelpDocumentationItem = QtGui.QAction(self.main_window) self.HelpDocumentationItem = QtGui.QAction(self.main_window)
self.HelpDocumentationItem.setObjectName("HelpDocumentationItem") ContentsIcon = QtGui.QIcon()
ContentsIcon.addPixmap(QtGui.QPixmap(u':/system/system_help_contents.png'),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.HelpDocumentationItem.setIcon(ContentsIcon)
self.HelpDocumentationItem.setObjectName(u'HelpDocumentationItem')
self.HelpAboutItem = QtGui.QAction(self.main_window) self.HelpAboutItem = QtGui.QAction(self.main_window)
self.HelpAboutItem.setObjectName("HelpAboutItem") AboutIcon = QtGui.QIcon()
AboutIcon.addPixmap(QtGui.QPixmap(u':/system/system_about.png'),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.HelpAboutItem.setIcon(AboutIcon)
self.HelpAboutItem.setObjectName(u'HelpAboutItem')
self.HelpOnlineHelpItem = QtGui.QAction(self.main_window) self.HelpOnlineHelpItem = QtGui.QAction(self.main_window)
self.HelpOnlineHelpItem.setObjectName("HelpOnlineHelpItem") self.HelpOnlineHelpItem.setObjectName(u'HelpOnlineHelpItem')
self.HelpWebSiteItem = QtGui.QAction(self.main_window) self.HelpWebSiteItem = QtGui.QAction(self.main_window)
self.HelpWebSiteItem.setObjectName("HelpWebSiteItem") self.HelpWebSiteItem.setObjectName(u'HelpWebSiteItem')
self.LanguageTranslateItem = QtGui.QAction(self.main_window) self.LanguageTranslateItem = QtGui.QAction(self.main_window)
self.LanguageTranslateItem.setObjectName("LanguageTranslateItem") self.LanguageTranslateItem.setObjectName(u'LanguageTranslateItem')
self.LanguageEnglishItem = QtGui.QAction(self.main_window) self.LanguageEnglishItem = QtGui.QAction(self.main_window)
self.LanguageEnglishItem.setObjectName("LanguageEnglishItem") self.LanguageEnglishItem.setObjectName(u'LanguageEnglishItem')
self.ToolsAddToolItem = QtGui.QAction(self.main_window) self.ToolsAddToolItem = QtGui.QAction(self.main_window)
icon37 = QtGui.QIcon() AddToolIcon = QtGui.QIcon()
icon37.addPixmap(QtGui.QPixmap(":/tools/tools_add.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) AddToolIcon.addPixmap(QtGui.QPixmap(u':/tools/tools_add.png'),
self.ToolsAddToolItem.setIcon(icon37) QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.ToolsAddToolItem.setObjectName("ToolsAddToolItem") self.ToolsAddToolItem.setIcon(AddToolIcon)
self.ToolsAddToolItem.setObjectName(u'ToolsAddToolItem')
self.action_Preview_Pane = QtGui.QAction(self.main_window) self.action_Preview_Pane = QtGui.QAction(self.main_window)
self.action_Preview_Pane.setCheckable(True) self.action_Preview_Pane.setCheckable(True)
self.action_Preview_Pane.setChecked(True) self.action_Preview_Pane.setChecked(True)
self.action_Preview_Pane.setObjectName("action_Preview_Pane") self.action_Preview_Pane.setObjectName(u'action_Preview_Pane')
self.ModeLiveItem = QtGui.QAction(self.main_window) self.ModeLiveItem = QtGui.QAction(self.main_window)
self.ModeLiveItem.setObjectName("ModeLiveItem") self.ModeLiveItem.setObjectName(u'ModeLiveItem')
self.FileImportMenu.addAction(self.ImportThemeItem) self.FileImportMenu.addAction(self.ImportThemeItem)
self.FileImportMenu.addAction(self.ImportLanguageItem) self.FileImportMenu.addAction(self.ImportLanguageItem)
self.FileExportMenu.addAction(self.ExportThemeItem) self.FileExportMenu.addAction(self.ExportThemeItem)
@ -321,103 +338,114 @@ class MainWindow(object):
self.retranslateUi() self.retranslateUi()
self.MediaToolBox.setCurrentIndex(0) self.MediaToolBox.setCurrentIndex(0)
QtCore.QObject.connect(self.FileExitItem, QtCore.SIGNAL("triggered()"), self.main_window.close) QtCore.QObject.connect(self.FileExitItem,
QtCore.QObject.connect(self.ViewMediaManagerItem, QtCore.SIGNAL("triggered(bool)"), self.MediaManagerDock.setVisible) QtCore.SIGNAL(u'triggered()'), self.main_window.close)
QtCore.QObject.connect(self.ViewServiceManagerItem, QtCore.SIGNAL("triggered(bool)"), self.ServiceManagerDock.setVisible) QtCore.QObject.connect(self.ViewMediaManagerItem,
QtCore.QObject.connect(self.ViewThemeManagerItem, QtCore.SIGNAL("triggered(bool)"), self.ThemeManagerDock.setVisible) QtCore.SIGNAL(u'triggered(bool)'), self.MediaManagerDock.setVisible)
QtCore.QObject.connect(self.action_Preview_Pane, QtCore.SIGNAL("toggled(bool)"), self.PreviewController.Pane.setVisible) QtCore.QObject.connect(self.ViewServiceManagerItem,
QtCore.QObject.connect(self.MediaManagerDock, QtCore.SIGNAL("visibilityChanged(bool)"), self.ViewMediaManagerItem.setChecked) QtCore.SIGNAL(u'triggered(bool)'), self.ServiceManagerDock.setVisible)
QtCore.QObject.connect(self.ServiceManagerDock, QtCore.SIGNAL("visibilityChanged(bool)"), self.ViewServiceManagerItem.setChecked) QtCore.QObject.connect(self.ViewThemeManagerItem,
QtCore.QObject.connect(self.ThemeManagerDock, QtCore.SIGNAL("visibilityChanged(bool)"), self.ViewThemeManagerItem.setChecked) QtCore.SIGNAL(u'triggered(bool)'), self.ThemeManagerDock.setVisible)
QtCore.QObject.connect(self.action_Preview_Pane,
QtCore.SIGNAL(u'toggled(bool)'), self.PreviewController.Pane.setVisible)
QtCore.QObject.connect(self.MediaManagerDock,
QtCore.SIGNAL(u'visibilityChanged(bool)'), self.ViewMediaManagerItem.setChecked)
QtCore.QObject.connect(self.ServiceManagerDock,
QtCore.SIGNAL(u'visibilityChanged(bool)'), self.ViewServiceManagerItem.setChecked)
QtCore.QObject.connect(self.ThemeManagerDock,
QtCore.SIGNAL(u'visibilityChanged(bool)'), self.ViewThemeManagerItem.setChecked)
QtCore.QObject.connect(self.HelpAboutItem,
QtCore.SIGNAL(u'triggered()'), self.onHelpAboutItemClicked)
QtCore.QObject.connect(self.ToolsAlertItem,
QtCore.SIGNAL(u'triggered()'), self.onToolsAlertItemClicked)
QtCore.QObject.connect(self.OptionsSettingsItem,
QtCore.SIGNAL(u'triggered()'), self.onOptionsSettingsItemClicked)
QtCore.QMetaObject.connectSlotsByName(self.main_window) QtCore.QMetaObject.connectSlotsByName(self.main_window)
QtCore.QObject.connect(self.HelpAboutItem, QtCore.SIGNAL("triggered()"), self.onHelpAboutItemClicked)
QtCore.QObject.connect(self.ToolsAlertItem, QtCore.SIGNAL("triggered()"), self.onToolsAlertItemClicked)
QtCore.QObject.connect(self.OptionsSettingsItem, QtCore.SIGNAL("triggered()"), self.onOptionsSettingsItemClicked)
def retranslateUi(self): def retranslateUi(self):
self.main_window.setWindowTitle(QtGui.QApplication.translate("main_window", "openlp.org 2.0", None, QtGui.QApplication.UnicodeUTF8)) self.main_window.setWindowTitle(translate(u'main_window', u'openlp.org 2.0'))
self.FileMenu.setTitle(QtGui.QApplication.translate("main_window", "&File", None, QtGui.QApplication.UnicodeUTF8)) self.FileMenu.setTitle(translate(u'main_window', u'&File'))
self.FileImportMenu.setTitle(QtGui.QApplication.translate("main_window", "&Import", None, QtGui.QApplication.UnicodeUTF8)) self.FileImportMenu.setTitle(translate(u'main_window', u'&Import'))
self.FileExportMenu.setTitle(QtGui.QApplication.translate("main_window", "&Export", None, QtGui.QApplication.UnicodeUTF8)) self.FileExportMenu.setTitle(translate(u'main_window', u'&Export'))
self.OptionsMenu.setTitle(QtGui.QApplication.translate("main_window", "&Options", None, QtGui.QApplication.UnicodeUTF8)) self.OptionsMenu.setTitle(translate(u'main_window', u'&Options'))
self.OptionsViewMenu.setTitle(QtGui.QApplication.translate("main_window", "&View", None, QtGui.QApplication.UnicodeUTF8)) self.OptionsViewMenu.setTitle(translate(u'main_window', u'&View'))
self.ViewModeMenu.setTitle(QtGui.QApplication.translate("main_window", "M&ode", None, QtGui.QApplication.UnicodeUTF8)) self.ViewModeMenu.setTitle(translate(u'main_window', u'M&ode'))
self.OptionsLanguageMenu.setTitle(QtGui.QApplication.translate("main_window", "&Language", None, QtGui.QApplication.UnicodeUTF8)) self.OptionsLanguageMenu.setTitle(translate(u'main_window', u'&Language'))
self.ToolsMenu.setTitle(QtGui.QApplication.translate("main_window", "&Tools", None, QtGui.QApplication.UnicodeUTF8)) self.ToolsMenu.setTitle(translate(u'main_window', u'&Tools'))
self.HelpMenu.setTitle(QtGui.QApplication.translate("main_window", "&Help", None, QtGui.QApplication.UnicodeUTF8)) self.HelpMenu.setTitle(translate(u'main_window', u'&Help'))
self.MediaManagerDock.setWindowTitle(QtGui.QApplication.translate("main_window", "Media Manager", None, QtGui.QApplication.UnicodeUTF8)) self.MediaManagerDock.setWindowTitle(translate(u'main_window', u'Media Manager'))
self.ServiceManagerDock.setWindowTitle(QtGui.QApplication.translate("main_window", "Service Manager", None, QtGui.QApplication.UnicodeUTF8)) self.ServiceManagerDock.setWindowTitle(translate(u'main_window', u'Service Manager'))
# self.ServiceManagerContents.MoveTopButton.setText(QtGui.QApplication.translate("main_window", "Move To Top", None, QtGui.QApplication.UnicodeUTF8)) # self.ServiceManagerContents.MoveTopButton.setText(translate(u'main_window', u'Move To Top'))
# self.ServiceManagerContents.MoveUpButton.setText(QtGui.QApplication.translate("main_window", "Move Up", None, QtGui.QApplication.UnicodeUTF8)) # self.ServiceManagerContents.MoveUpButton.setText(translate(u'main_window', u'Move Up'))
# self.ServiceManagerContents.MoveDownButton.setText(QtGui.QApplication.translate("main_window", "Move Down", None, QtGui.QApplication.UnicodeUTF8)) # self.ServiceManagerContents.MoveDownButton.setText(translate(u'main_window', u'Move Down'))
# self.ServiceManagerContents.MoveBottomButton.setText(QtGui.QApplication.translate("main_window", "Move To Bottom", None, QtGui.QApplication.UnicodeUTF8)) # self.ServiceManagerContents.MoveBottomButton.setText(translate(u'main_window', u'Move To Bottom'))
# self.ServiceManagerContents.NewItem.setText(QtGui.QApplication.translate("main_window", "New Service", None, QtGui.QApplication.UnicodeUTF8)) # self.ServiceManagerContents.NewItem.setText(translate(u'main_window', u'New Service'))
# self.ServiceManagerContents.OpenItem.setText(QtGui.QApplication.translate("main_window", "Open Service", None, QtGui.QApplication.UnicodeUTF8)) # self.ServiceManagerContents.OpenItem.setText(translate(u'main_window', u'Open Service'))
# self.ServiceManagerContents.SaveItem.setText(QtGui.QApplication.translate("main_window", "Save Service", None, QtGui.QApplication.UnicodeUTF8)) # self.ServiceManagerContents.SaveItem.setText(translate(u'main_window', u'Save Service'))
# self.ServiceManagerContents.ThemeComboBox.setItemText(0, QtGui.QApplication.translate("main_window", "African Sunset", None, QtGui.QApplication.UnicodeUTF8)) # self.ServiceManagerContents.ThemeComboBox.setItemText(0, translate(u'main_window', u'African Sunset'))
# self.ServiceManagerContents.ThemeComboBox.setItemText(1, QtGui.QApplication.translate("main_window", "Snowy Mountains", None, QtGui.QApplication.UnicodeUTF8)) # self.ServiceManagerContents.ThemeComboBox.setItemText(1, translate(u'main_window', u'Snowy Mountains'))
# self.ServiceManagerContents.ThemeComboBox.setItemText(2, QtGui.QApplication.translate("main_window", "Wilderness", None, QtGui.QApplication.UnicodeUTF8)) # self.ServiceManagerContents.ThemeComboBox.setItemText(2, translate(u'main_window', u'Wilderness'))
self.ThemeManagerDock.setWindowTitle(QtGui.QApplication.translate("main_window", "Theme Manager", None, QtGui.QApplication.UnicodeUTF8)) self.ThemeManagerDock.setWindowTitle(translate(u'main_window', u'Theme Manager'))
# self.ThemeNewItem.setText(QtGui.QApplication.translate("main_window", "New Theme", None, QtGui.QApplication.UnicodeUTF8)) # self.ThemeNewItem.setText(translate(u'main_window', u'New Theme'))
# self.ThemeEditItem.setText(QtGui.QApplication.translate("main_window", "Edit Theme", None, QtGui.QApplication.UnicodeUTF8)) # self.ThemeEditItem.setText(translate(u'main_window', u'Edit Theme'))
# self.ThemeDeleteButton.setText(QtGui.QApplication.translate("main_window", "Delete Theme", None, QtGui.QApplication.UnicodeUTF8)) # self.ThemeDeleteButton.setText(translate(u'main_window', u'Delete Theme'))
# self.ThemeImportButton.setText(QtGui.QApplication.translate("main_window", "Import Theme", None, QtGui.QApplication.UnicodeUTF8)) # self.ThemeImportButton.setText(translate(u'main_window', u'Import Theme'))
# self.ThemeExportButton.setText(QtGui.QApplication.translate("main_window", "Export Theme", None, QtGui.QApplication.UnicodeUTF8)) # self.ThemeExportButton.setText(translate(u'main_window', u'Export Theme'))
self.FileNewItem.setText(QtGui.QApplication.translate("main_window", "&New", None, QtGui.QApplication.UnicodeUTF8)) self.FileNewItem.setText(translate(u'main_window', u'&New'))
self.FileNewItem.setToolTip(QtGui.QApplication.translate("main_window", "New Service", None, QtGui.QApplication.UnicodeUTF8)) self.FileNewItem.setToolTip(translate(u'main_window', u'New Service'))
self.FileNewItem.setStatusTip(QtGui.QApplication.translate("main_window", "Create a new Service", None, QtGui.QApplication.UnicodeUTF8)) self.FileNewItem.setStatusTip(translate(u'main_window', u'Create a new Service'))
self.FileNewItem.setShortcut(QtGui.QApplication.translate("main_window", "Ctrl+N", None, QtGui.QApplication.UnicodeUTF8)) self.FileNewItem.setShortcut(translate(u'main_window', u'Ctrl+N'))
self.FileOpenItem.setText(QtGui.QApplication.translate("main_window", "&Open", None, QtGui.QApplication.UnicodeUTF8)) self.FileOpenItem.setText(translate(u'main_window', u'&Open'))
self.FileOpenItem.setToolTip(QtGui.QApplication.translate("main_window", "Open Service", None, QtGui.QApplication.UnicodeUTF8)) self.FileOpenItem.setToolTip(translate(u'main_window', u'Open Service'))
self.FileOpenItem.setStatusTip(QtGui.QApplication.translate("main_window", "Open an existing service", None, QtGui.QApplication.UnicodeUTF8)) self.FileOpenItem.setStatusTip(translate(u'main_window', u'Open an existing service'))
self.FileOpenItem.setShortcut(QtGui.QApplication.translate("main_window", "Ctrl+O", None, QtGui.QApplication.UnicodeUTF8)) self.FileOpenItem.setShortcut(translate(u'main_window', u'Ctrl+O'))
self.FileSaveItem.setText(QtGui.QApplication.translate("main_window", "&Save", None, QtGui.QApplication.UnicodeUTF8)) self.FileSaveItem.setText(translate(u'main_window', u'&Save'))
self.FileSaveItem.setToolTip(QtGui.QApplication.translate("main_window", "Save Service", None, QtGui.QApplication.UnicodeUTF8)) self.FileSaveItem.setToolTip(translate(u'main_window', u'Save Service'))
self.FileSaveItem.setStatusTip(QtGui.QApplication.translate("main_window", "Save the current service to disk", None, QtGui.QApplication.UnicodeUTF8)) self.FileSaveItem.setStatusTip(translate(u'main_window', u'Save the current service to disk'))
self.FileSaveItem.setShortcut(QtGui.QApplication.translate("main_window", "Ctrl+S", None, QtGui.QApplication.UnicodeUTF8)) self.FileSaveItem.setShortcut(translate(u'main_window', u'Ctrl+S'))
self.FileSaveAsItem.setText(QtGui.QApplication.translate("main_window", "Save &As...", None, QtGui.QApplication.UnicodeUTF8)) self.FileSaveAsItem.setText(translate(u'main_window', u'Save &As...'))
self.FileSaveAsItem.setToolTip(QtGui.QApplication.translate("main_window", "Save Service As", None, QtGui.QApplication.UnicodeUTF8)) self.FileSaveAsItem.setToolTip(translate(u'main_window', u'Save Service As'))
self.FileSaveAsItem.setStatusTip(QtGui.QApplication.translate("main_window", "Save the current service under a new name", None, QtGui.QApplication.UnicodeUTF8)) self.FileSaveAsItem.setStatusTip(translate(u'main_window', u'Save the current service under a new name'))
self.FileSaveAsItem.setShortcut(QtGui.QApplication.translate("main_window", "F12", None, QtGui.QApplication.UnicodeUTF8)) self.FileSaveAsItem.setShortcut(translate(u'main_window', u'F12'))
self.FileExitItem.setText(QtGui.QApplication.translate("main_window", "E&xit", None, QtGui.QApplication.UnicodeUTF8)) self.FileExitItem.setText(translate(u'main_window', u'E&xit'))
self.FileExitItem.setStatusTip(QtGui.QApplication.translate("main_window", "Quit OpenLP 2.0", None, QtGui.QApplication.UnicodeUTF8)) self.FileExitItem.setStatusTip(translate(u'main_window', u'Quit OpenLP 2.0'))
self.FileExitItem.setShortcut(QtGui.QApplication.translate("main_window", "Alt+F4", None, QtGui.QApplication.UnicodeUTF8)) self.FileExitItem.setShortcut(translate(u'main_window', u'Alt+F4'))
self.ImportThemeItem.setText(QtGui.QApplication.translate("main_window", "&Theme", None, QtGui.QApplication.UnicodeUTF8)) self.ImportThemeItem.setText(translate(u'main_window', u'&Theme'))
self.ImportLanguageItem.setText(QtGui.QApplication.translate("main_window", "&Language", None, QtGui.QApplication.UnicodeUTF8)) self.ImportLanguageItem.setText(translate(u'main_window', u'&Language'))
self.ExportThemeItem.setText(QtGui.QApplication.translate("main_window", "&Theme", None, QtGui.QApplication.UnicodeUTF8)) self.ExportThemeItem.setText(translate(u'main_window', u'&Theme'))
self.ExportLanguageItem.setText(QtGui.QApplication.translate("main_window", "&Language", None, QtGui.QApplication.UnicodeUTF8)) self.ExportLanguageItem.setText(translate(u'main_window', u'&Language'))
self.actionLook_Feel.setText(QtGui.QApplication.translate("main_window", "Look && &Feel", None, QtGui.QApplication.UnicodeUTF8)) self.actionLook_Feel.setText(translate(u'main_window', u'Look && &Feel'))
self.OptionsSettingsItem.setText(QtGui.QApplication.translate("main_window", "&Settings", None, QtGui.QApplication.UnicodeUTF8)) self.OptionsSettingsItem.setText(translate(u'main_window', u'&Settings'))
self.ViewMediaManagerItem.setText(QtGui.QApplication.translate("main_window", "&Media Manager", None, QtGui.QApplication.UnicodeUTF8)) self.ViewMediaManagerItem.setText(translate(u'main_window', u'&Media Manager'))
self.ViewMediaManagerItem.setToolTip(QtGui.QApplication.translate("main_window", "Toggle Media Manager", None, QtGui.QApplication.UnicodeUTF8)) self.ViewMediaManagerItem.setToolTip(translate(u'main_window', u'Toggle Media Manager'))
self.ViewMediaManagerItem.setStatusTip(QtGui.QApplication.translate("main_window", "Toggle the visibility of the Media Manager", None, QtGui.QApplication.UnicodeUTF8)) self.ViewMediaManagerItem.setStatusTip(translate(u'main_window', u'Toggle the visibility of the Media Manager'))
self.ViewMediaManagerItem.setShortcut(QtGui.QApplication.translate("main_window", "F8", None, QtGui.QApplication.UnicodeUTF8)) self.ViewMediaManagerItem.setShortcut(translate(u'main_window', u'F8'))
self.ViewThemeManagerItem.setText(QtGui.QApplication.translate("main_window", "&Theme Manager", None, QtGui.QApplication.UnicodeUTF8)) self.ViewThemeManagerItem.setText(translate(u'main_window', u'&Theme Manager'))
self.ViewThemeManagerItem.setToolTip(QtGui.QApplication.translate("main_window", "Toggle Theme Manager", None, QtGui.QApplication.UnicodeUTF8)) self.ViewThemeManagerItem.setToolTip(translate(u'main_window', u'Toggle Theme Manager'))
self.ViewThemeManagerItem.setStatusTip(QtGui.QApplication.translate("main_window", "Toggle the visibility of the Theme Manager", None, QtGui.QApplication.UnicodeUTF8)) self.ViewThemeManagerItem.setStatusTip(translate(u'main_window', u'Toggle the visibility of the Theme Manager'))
self.ViewThemeManagerItem.setShortcut(QtGui.QApplication.translate("main_window", "F10", None, QtGui.QApplication.UnicodeUTF8)) self.ViewThemeManagerItem.setShortcut(translate(u'main_window', u'F10'))
self.ViewServiceManagerItem.setText(QtGui.QApplication.translate("main_window", "&Service Manager", None, QtGui.QApplication.UnicodeUTF8)) self.ViewServiceManagerItem.setText(translate(u'main_window', u'&Service Manager'))
self.ViewServiceManagerItem.setToolTip(QtGui.QApplication.translate("main_window", "Toggle Service Manager", None, QtGui.QApplication.UnicodeUTF8)) self.ViewServiceManagerItem.setToolTip(translate(u'main_window', u'Toggle Service Manager'))
self.ViewServiceManagerItem.setStatusTip(QtGui.QApplication.translate("main_window", "Toggle the visibility of the Service Manager", None, QtGui.QApplication.UnicodeUTF8)) self.ViewServiceManagerItem.setStatusTip(translate(u'main_window', u'Toggle the visibility of the Service Manager'))
self.ViewServiceManagerItem.setShortcut(QtGui.QApplication.translate("main_window", "F9", None, QtGui.QApplication.UnicodeUTF8)) self.ViewServiceManagerItem.setShortcut(translate(u'main_window', u'F9'))
self.ToolsAlertItem.setText(QtGui.QApplication.translate("main_window", "&Alert", None, QtGui.QApplication.UnicodeUTF8)) self.ToolsAlertItem.setText(translate(u'main_window', u'&Alert'))
self.ToolsAlertItem.setStatusTip(QtGui.QApplication.translate("main_window", "Show an alert message", None, QtGui.QApplication.UnicodeUTF8)) self.ToolsAlertItem.setStatusTip(translate(u'main_window', u'Show an alert message'))
self.ToolsAlertItem.setShortcut(QtGui.QApplication.translate("main_window", "F7", None, QtGui.QApplication.UnicodeUTF8)) self.ToolsAlertItem.setShortcut(translate(u'main_window', u'F7'))
self.HelpDocumentationItem.setText(QtGui.QApplication.translate("main_window", "&User Guide", None, QtGui.QApplication.UnicodeUTF8)) self.HelpDocumentationItem.setText(translate(u'main_window', u'&User Guide'))
self.HelpAboutItem.setText(QtGui.QApplication.translate("main_window", "&About", None, QtGui.QApplication.UnicodeUTF8)) self.HelpAboutItem.setText(translate(u'main_window', u'&About'))
self.HelpAboutItem.setStatusTip(QtGui.QApplication.translate("main_window", "More information about OpenLP", None, QtGui.QApplication.UnicodeUTF8)) self.HelpAboutItem.setStatusTip(translate(u'main_window', u'More information about OpenLP'))
self.HelpAboutItem.setShortcut(QtGui.QApplication.translate("main_window", "Ctrl+F1", None, QtGui.QApplication.UnicodeUTF8)) self.HelpAboutItem.setShortcut(translate(u'main_window', u'Ctrl+F1'))
self.HelpOnlineHelpItem.setText(QtGui.QApplication.translate("main_window", "&Online Help", None, QtGui.QApplication.UnicodeUTF8)) self.HelpOnlineHelpItem.setText(translate(u'main_window', u'&Online Help'))
self.HelpWebSiteItem.setText(QtGui.QApplication.translate("main_window", "&Web Site", None, QtGui.QApplication.UnicodeUTF8)) self.HelpWebSiteItem.setText(translate(u'main_window', u'&Web Site'))
self.LanguageTranslateItem.setText(QtGui.QApplication.translate("main_window", "&Translate", None, QtGui.QApplication.UnicodeUTF8)) self.LanguageTranslateItem.setText(translate(u'main_window', u'&Translate'))
self.LanguageTranslateItem.setStatusTip(QtGui.QApplication.translate("main_window", "Translate the interface to your language", None, QtGui.QApplication.UnicodeUTF8)) self.LanguageTranslateItem.setStatusTip(translate(u'main_window', u'Translate the interface to your language'))
self.LanguageEnglishItem.setText(QtGui.QApplication.translate("main_window", "English", None, QtGui.QApplication.UnicodeUTF8)) self.LanguageEnglishItem.setText(translate(u'main_window', u'English'))
self.LanguageEnglishItem.setStatusTip(QtGui.QApplication.translate("main_window", "Set the interface language to English", None, QtGui.QApplication.UnicodeUTF8)) self.LanguageEnglishItem.setStatusTip(translate(u'main_window', u'Set the interface language to English'))
self.ToolsAddToolItem.setText(QtGui.QApplication.translate("main_window", "&Add Tool...", None, QtGui.QApplication.UnicodeUTF8)) self.ToolsAddToolItem.setText(translate(u'main_window', u'&Add Tool...'))
self.ToolsAddToolItem.setStatusTip(QtGui.QApplication.translate("main_window", "Add an application to the list of tools", None, QtGui.QApplication.UnicodeUTF8)) self.ToolsAddToolItem.setStatusTip(translate(u'main_window', u'Add an application to the list of tools'))
self.action_Preview_Pane.setText(QtGui.QApplication.translate("main_window", "&Preview Pane", None, QtGui.QApplication.UnicodeUTF8)) self.action_Preview_Pane.setText(translate(u'main_window', u'&Preview Pane'))
self.ModeLiveItem.setText(QtGui.QApplication.translate("main_window", "&Live", None, QtGui.QApplication.UnicodeUTF8)) self.ModeLiveItem.setText(translate(u'main_window', u'&Live'))
def show(self): def show(self):
self.main_window.showMaximized() self.main_window.showMaximized()

View File

@ -33,7 +33,7 @@ class SplashScreen(object):
self.splash_screen.setObjectName("splash_screen") self.splash_screen.setObjectName("splash_screen")
self.splash_screen.setWindowModality(QtCore.Qt.NonModal) self.splash_screen.setWindowModality(QtCore.Qt.NonModal)
self.splash_screen.setEnabled(True) self.splash_screen.setEnabled(True)
self.splash_screen.resize(400, 300) self.splash_screen.resize(370, 370)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0) sizePolicy.setVerticalStretch(0)
@ -41,12 +41,12 @@ class SplashScreen(object):
self.splash_screen.setSizePolicy(sizePolicy) self.splash_screen.setSizePolicy(sizePolicy)
self.splash_screen.setContextMenuPolicy(QtCore.Qt.PreventContextMenu) self.splash_screen.setContextMenuPolicy(QtCore.Qt.PreventContextMenu)
icon = QtGui.QIcon() icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon.addPixmap(QtGui.QPixmap(":/icon/openlp-logo-16x16.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
splash_image = QtGui.QPixmap(":/graphics/openlp-splash-screen.png")
self.splash_screen.setWindowIcon(icon) self.splash_screen.setWindowIcon(icon)
self.splash_screen.setPixmap(splash_image)
self.splash_screen.setPixmap(QtGui.QPixmap(":/graphics/splash-screen-2.png")) self.splash_screen.setMask(splash_image.mask())
self.splash_screen.setWindowFlags(QtCore.Qt.SplashScreen | QtCore.Qt.WindowStaysOnTopHint) self.splash_screen.setWindowFlags(QtCore.Qt.SplashScreen | QtCore.Qt.WindowStaysOnTopHint)
self.retranslateUi() self.retranslateUi()
QtCore.QMetaObject.connectSlotsByName(self.splash_screen) QtCore.QMetaObject.connectSlotsByName(self.splash_screen)

View File

@ -17,7 +17,7 @@ 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA Place, Suite 330, Boston, MA 02111-1307 USA
""" """
import os,os.path import os
import sys import sys
import zipfile import zipfile
import shutil import shutil
@ -30,18 +30,12 @@ from PyQt4 import QtCore, QtGui
from PyQt4.QtCore import * from PyQt4.QtCore import *
from PyQt4.QtGui import * from PyQt4.QtGui import *
from openlp.core.ui import AmendThemeForm from openlp.core.ui import AmendThemeForm, ServiceManager
from openlp.core.ui import ServiceManager from openlp.core import translate, fileToXML
from openlp.core import translate
from openlp.core import fileToXML
from openlp.core.theme import Theme from openlp.core.theme import Theme
from openlp.core.lib import Event from openlp.core.lib import Event, EventType, EventManager, OpenLPToolbar, ThemeXML, Renderer
from openlp.core.lib import EventType
from openlp.core.lib import EventManager
from openlp.core.lib import OpenLPToolbar
from openlp.core.lib import ThemeXML
from openlp.core.lib import Renderer
from openlp.core.utils import ConfigHelper from openlp.core.utils import ConfigHelper
from openlp.core.resources import *
import logging import logging
@ -56,45 +50,48 @@ class ThemeData(QAbstractListModel):
def __init__(self): def __init__(self):
QAbstractListModel.__init__(self) QAbstractListModel.__init__(self)
self.items=[] self.items = []
self.rowheight=50 self.rowheight = 50
self.maximagewidth=self.rowheight*16/9.0; self.maximagewidth = self.rowheight * 16 / 9.0;
log.info(u'Starting') log.info(u'Starting')
def clearItems(self): def clearItems(self):
self.items=[] self.items = []
def rowCount(self, parent): def rowCount(self, parent):
return len(self.items) return len(self.items)
def insertRow(self, row, filename): def insertRow(self, row, filename):
self.beginInsertRows(QModelIndex(),row,row) self.beginInsertRows(QModelIndex(), row, row)
log.info(u'insert row %d:%s'%(row,filename)) log.info(u'insert row %d:%s' % (row, filename))
(prefix, shortfilename) = os.path.split(str(filename)) (prefix, shortfilename) = os.path.split(str(filename))
log.info(u'shortfilename=%s'%(shortfilename)) log.info(u'shortfilename = %s' % shortfilename)
theme = shortfilename.split(u'.') theme = shortfilename.split(u'.')
# create a preview image # create a preview image
if os.path.exists(filename): if os.path.exists(filename):
preview = QPixmap(str(filename)) preview = QPixmap(str(filename))
w=self.maximagewidth;h=self.rowheight width = self.maximagewidth
preview = preview.scaled(w,h, Qt.KeepAspectRatio) height = self.rowheight
realw=preview.width(); realh=preview.height() preview = preview.scaled(width, height, Qt.KeepAspectRatio)
realwidth = preview.width()
realheight = preview.height()
# and move it to the centre of the preview space # and move it to the centre of the preview space
p=QPixmap(w,h) pixmap = QPixmap(width, height)
p.fill(Qt.transparent) pixmap.fill(Qt.transparent)
painter=QPainter(p) painter = QPainter(pixmap)
painter.drawPixmap((w-realw)/2,(h-realh)/2,preview) painter.drawPixmap((width - realwidth) / 2, (height - realheight) / 2, preview)
else: else:
w=self.maximagewidth;h=self.rowheight width = self.maximagewidth
p=QPixmap(w,h) height = self.rowheight
p.fill(Qt.transparent) pixmap = QPixmap(width, height)
pixmap.fill(Qt.transparent)
# finally create the row # finally create the row
self.items.insert(row,(filename, p, shortfilename, theme[0])) self.items.insert(row, (filename, pixmap, shortfilename, theme[0]))
log.info(u'Items: %s' % self.items) log.info(u'Items: %s' % self.items)
self.endInsertRows() self.endInsertRows()
def removeRow(self, row): def removeRow(self, row):
self.beginRemoveRows(QModelIndex(), row,row) self.beginRemoveRows(QModelIndex(), row, row)
self.items.pop(row) self.items.pop(row)
self.endRemoveRows() self.endRemoveRows()
@ -102,35 +99,36 @@ class ThemeData(QAbstractListModel):
self.insertRow(len(self.items), item) self.insertRow(len(self.items), item)
def data(self, index, role): def data(self, index, role):
row=index.row() row = index.row()
if row > len(self.items): # if the last row is selected and deleted, we then get called with an empty row! if row > len(self.items):
# if the last row is selected and deleted, we then get called with an empty row!
return QVariant() return QVariant()
if role==Qt.DisplayRole: if role == Qt.DisplayRole:
retval= self.items[row][3] retval = self.items[row][3]
elif role == Qt.DecorationRole: elif role == Qt.DecorationRole:
retval= self.items[row][1] retval = self.items[row][1]
else: else:
retval= QVariant() retval = QVariant()
# log.info("Returning"+ str(retval)) #log.info("Returning"+ str(retval))
if type(retval) is not type(QVariant): if type(retval) is not type(QVariant):
return QVariant(retval) return QVariant(retval)
else: else:
return retval return retval
def __iter__(self): def __iter__(self):
for i in self.items: for item in self.items:
yield i yield item
def getValue(self, index): def getValue(self, index):
row = index.row() row = index.row()
return self.items[row] return self.items[row]
def getItem(self, row): def getItem(self, row):
log.info(u'Get Item:%d -> %s' %(row, str(self.items))) log.info(u'Get Item:%d -> %s' % (row, str(self.items)))
return self.items[row] return self.items[row]
def getList(self): def getList(self):
filelist = [item[3] for item in self.items]; filelist = [item[3] for item in self.items]
return filelist return filelist
class ThemeManager(QWidget): class ThemeManager(QWidget):
@ -142,36 +140,37 @@ class ThemeManager(QWidget):
def __init__(self, parent): def __init__(self, parent):
QWidget.__init__(self) QWidget.__init__(self)
self.parent=parent self.parent = parent
self.Layout = QtGui.QVBoxLayout(self) self.Layout = QtGui.QVBoxLayout(self)
self.Layout.setSpacing(0) self.Layout.setSpacing(0)
self.Layout.setMargin(0) self.Layout.setMargin(0)
self.amendThemeForm = AmendThemeForm(self) self.amendThemeForm = AmendThemeForm(self)
self.Toolbar = OpenLPToolbar(self) self.Toolbar = OpenLPToolbar(self)
self.Toolbar.addToolbarButton(translate('ThemeManager',u'New Theme'), ":/themes/theme_new.png", self.Toolbar.addToolbarButton(
translate('ThemeManager',u'Allows a Theme to be created'), self.onAddTheme) translate(u'ThemeManager', u'New Theme'), u':/themes/theme_new.png',
self.Toolbar.addToolbarButton(translate('ThemeManager',u'Edit Theme'), ":/themes/theme_edit.png", translate(u'ThemeManager', u'Create a new theme'), self.onAddTheme)
translate('ThemeManager',u'Allows a Theme to be amended'), self.onEditTheme) self.Toolbar.addToolbarButton(
self.Toolbar.addToolbarButton(translate('ThemeManager',u'Delete Theme'), ":/themes/theme_delete.png", translate(u'ThemeManager', u'Edit Theme'), u':/themes/theme_edit.png',
translate('ThemeManager',u'Allows a Theme to be deleted'), self.onDeleteTheme) translate(u'ThemeManager', u'Edit a theme'), self.onEditTheme)
self.Toolbar.addToolbarButton(
translate(u'ThemeManager', u'Delete Theme'), u':/themes/theme_delete.png',
translate(u'ThemeManager', u'Delete a theme'), self.onDeleteTheme)
self.Toolbar.addSeparator() self.Toolbar.addSeparator()
self.Toolbar.addToolbarButton(translate('ThemeManager',u'Import Theme'), ":/themes/theme_import.png", self.Toolbar.addToolbarButton(
translate('ThemeManager',u'Allows Themes to be imported'), self.onImportTheme) translate(u'ThemeManager', u'Import Theme'), u':/themes/theme_import.png',
self.Toolbar.addToolbarButton(translate('ThemeManager',u'Export Theme'), ":/themes/theme_export.png", translate(u'ThemeManager', u'Import a theme'), self.onImportTheme)
translate('ThemeManager',u'Allows Themes to be exported'), self.onExportTheme) self.Toolbar.addToolbarButton(
translate(u'ThemeManager', u'Export Theme'), u':/themes/theme_export.png',
translate(u'ThemeManager', u'Export a theme'), self.onExportTheme)
self.ThemeWidget = QtGui.QWidgetAction(self.Toolbar) self.ThemeWidget = QtGui.QWidgetAction(self.Toolbar)
self.Toolbar.addAction(self.ThemeWidget)
self.Layout.addWidget(self.Toolbar) self.Layout.addWidget(self.Toolbar)
self.ThemeListView = QtGui.QListView(self) self.ThemeListView = QtGui.QListView(self)
self.Theme_data=ThemeData() self.themeData = ThemeData()
self.ThemeListView.setModel(self.Theme_data) self.ThemeListView.setModel(self.themeData)
self.ThemeListView.setAlternatingRowColors(True) self.ThemeListView.setAlternatingRowColors(True)
self.Layout.addWidget(self.ThemeListView) self.Layout.addWidget(self.ThemeListView)
self.ThemeListView.setAlternatingRowColors(True) self.ThemeListView.setAlternatingRowColors(True)
self.themelist = []
self.themelist= []
self.path = os.path.join(ConfigHelper.get_data_path(), u'themes') self.path = os.path.join(ConfigHelper.get_data_path(), u'themes')
self.checkThemesExists(self.path) self.checkThemesExists(self.path)
self.amendThemeForm.themePath(self.path) self.amendThemeForm.themePath(self.path)
@ -183,15 +182,15 @@ class ThemeManager(QWidget):
def onEditTheme(self): def onEditTheme(self):
items = self.ThemeListView.selectedIndexes() items = self.ThemeListView.selectedIndexes()
for item in items: for item in items:
data = self.Theme_data.getValue(item) data = self.themeData.getValue(item)
self.amendThemeForm.loadTheme(data[3]) self.amendThemeForm.loadTheme(data[3])
self.amendThemeForm.exec_() self.amendThemeForm.exec_()
def onDeleteTheme(self): def onDeleteTheme(self):
items = self.ThemeListView.selectedIndexes() items = self.ThemeListView.selectedIndexes()
theme = '' theme = u''
for item in items: for item in items:
data = self.Theme_data.getValue(item) data = self.themeData.getValue(item)
theme = data[3] theme = data[3]
th = theme + u'.png' th = theme + u'.png'
try: try:
@ -199,7 +198,7 @@ class ThemeManager(QWidget):
except: except:
pass #if not present do not worry pass #if not present do not worry
shutil.rmtree(os.path.join(self.path, theme)) shutil.rmtree(os.path.join(self.path, theme))
self.Theme_data.clearItems() self.themeData.clearItems()
self.loadThemes() self.loadThemes()
def onExportTheme(self): def onExportTheme(self):
@ -207,14 +206,13 @@ class ThemeManager(QWidget):
def onImportTheme(self): def onImportTheme(self):
files = QtGui.QFileDialog.getOpenFileNames(None, files = QtGui.QFileDialog.getOpenFileNames(None,
translate('ThemeManager', u'Select Import File'), translate(u'ThemeManager', u'Select Import File'),
self.path, self.path, u'Theme (*.theme)')
u'Theme (*.theme)')
log.info(u'New Themes %s', str(files)) log.info(u'New Themes %s', str(files))
if len(files) > 0: if len(files) > 0:
for file in files: for file in files:
self.unzipTheme(file, self.path) self.unzipTheme(file, self.path)
self.Theme_data.clearItems() self.themeData.clearItems()
self.loadThemes() self.loadThemes()
def loadThemes(self): def loadThemes(self):
@ -222,17 +220,16 @@ class ThemeManager(QWidget):
for root, dirs, files in os.walk(self.path): for root, dirs, files in os.walk(self.path):
for name in files: for name in files:
if name.endswith(u'.png'): if name.endswith(u'.png'):
self.Theme_data.addRow(os.path.join(self.path, name)) self.themeData.addRow(os.path.join(self.path, name))
self.eventManager.post_event(Event(EventType.ThemeListChanged)) self.eventManager.post_event(Event(EventType.ThemeListChanged))
self.serviceManager.updateThemeList(self.getThemes()) self.serviceManager.updateThemeList(self.getThemes())
def getThemes(self): def getThemes(self):
return self.Theme_data.getList() return self.themeData.getList()
def getThemeData(self, themename): def getThemeData(self, themename):
log.debug(u'getthemedata for theme %s', themename) log.debug(u'getthemedata for theme %s', themename)
xml_file = os.path.join(self.path, str(themename), str(themename)+u'.xml') xml_file = os.path.join(self.path, str(themename), str(themename) + u'.xml')
xml = fileToXML(xml_file) xml = fileToXML(xml_file)
theme = ThemeXML() theme = ThemeXML()
theme.parse(xml) theme.parse(xml)
@ -245,7 +242,7 @@ class ThemeManager(QWidget):
def unzipTheme(self, filename, dir): def unzipTheme(self, filename, dir):
""" """
Unzip the theme , remove the preview file if stored Unzip the theme, remove the preview file if stored
Generate a new preview fileCheck the XML theme version and upgrade if Generate a new preview fileCheck the XML theme version and upgrade if
necessary. necessary.
""" """
@ -254,66 +251,73 @@ class ThemeManager(QWidget):
filexml = None filexml = None
themename = None themename = None
for file in zip.namelist(): for file in zip.namelist():
if file.endswith('/'): if file.endswith(os.path.sep):
theme_dir = os.path.join(dir, file) theme_dir = os.path.join(dir, file)
if os.path.exists(theme_dir) == False: if os.path.exists(theme_dir) == False:
os.mkdir(os.path.join(dir, file)) os.mkdir(os.path.join(dir, file))
else: else:
fullpath = os.path.join(dir, file) fullpath = os.path.join(dir, file)
names = file.split(u'/') names = file.split(os.path.sep)
if len(names) > 1: # not preview file if len(names) > 1:
# not preview file
if themename is None: if themename is None:
themename = names[0] themename = names[0]
xml_data = zip.read(file) xml_data = zip.read(file)
if os.path.splitext (file) [1].lower () in [u'.xml']: if os.path.splitext(file)[1].lower() in [u'.xml']:
if self.checkVersion1(xml_data): if self.checkVersion1(xml_data):
filexml = self.migrateVersion122(filename, fullpath, xml_data) # upgrade theme xml # upgrade theme xml
filexml = self.migrateVersion122(filename, fullpath, xml_data)
else: else:
filexml = xml_data filexml = xml_data
outfile = open(fullpath, 'w') outfile = open(fullpath, u'w')
outfile.write(filexml) outfile.write(filexml)
outfile.close() outfile.close()
else: else:
outfile = open(fullpath, 'w') outfile = open(fullpath, u'w')
outfile.write(zip.read(file)) outfile.write(zip.read(file))
outfile.close() outfile.close()
self.generateAndSaveImage(dir,themename, filexml) self.generateAndSaveImage(dir, themename, filexml)
def checkVersion1(self, xmlfile): def checkVersion1(self, xmlfile):
log.debug(u'checkVersion1 ') log.debug(u'checkVersion1 ')
t = xmlfile theme = xmlfile
tree = ElementTree(element=XML(t)).getroot() tree = ElementTree(element=XML(theme)).getroot()
if tree.find(u'BackgroundType') is None : if tree.find(u'BackgroundType') is None:
return False return False
else: else:
return True return True
def migrateVersion122(self, filename , fullpath, xml_data): def migrateVersion122(self, filename, fullpath, xml_data):
log.debug(u'migrateVersion122 %s %s', filename , fullpath) log.debug(u'migrateVersion122 %s %s', filename, fullpath)
t=Theme(xml_data) theme = Theme(xml_data)
newtheme = ThemeXML() newtheme = ThemeXML()
newtheme.new_document(t.Name) newtheme.new_document(theme.Name)
if t.BackgroundType == 0: if theme.BackgroundType == 0:
newtheme.add_background_solid(str(t.BackgroundParameter1.name())) newtheme.add_background_solid(str(theme.BackgroundParameter1.name()))
elif t.BackgroundType == 1: elif theme.BackgroundType == 1:
direction = "vertical" direction = u'vertical'
if t.BackgroundParameter3.name() == 1: if theme.BackgroundParameter3.name() == 1:
direction = "horizontal" direction = u'horizontal'
newtheme.add_background_gradient(str(t.BackgroundParameter1.name()), str(t.BackgroundParameter2.name()), direction) newtheme.add_background_gradient(
str(theme.BackgroundParameter1.name()),
str(theme.BackgroundParameter2.name()), direction)
else: else:
newtheme.add_background_image(str(t.BackgroundParameter1)) newtheme.add_background_image(str(theme.BackgroundParameter1))
newtheme.add_font(str(t.FontName), str(t.FontColor.name()), str(t.FontProportion * 2), u'False') newtheme.add_font(str(theme.FontName), str(theme.FontColor.name()),
newtheme.add_font(str(t.FontName), str(t.FontColor.name()), str(12), u'False', u'footer') str(theme.FontProportion * 2), u'False')
newtheme.add_font(str(theme.FontName), str(theme.FontColor.name()),
str(12), u'False', u'footer')
outline = False outline = False
shadow = False shadow = False
if t.Shadow == 1: if theme.Shadow == 1:
shadow = True shadow = True
if t.Outline == 1: if theme.Outline == 1:
outline = True outline = True
newtheme.add_display(str(shadow), str(t.ShadowColor.name()), str(outline), str(t.OutlineColor.name()), newtheme.add_display(str(shadow), str(theme.ShadowColor.name()),
str(t.HorizontalAlign), str(t.VerticalAlign), str(t.WrapStyle)) str(outline), str(theme.OutlineColor.name()),
str(theme.HorizontalAlign), str(theme.VerticalAlign),
str(theme.WrapStyle))
return newtheme.extract_xml() return newtheme.extract_xml()
def saveTheme(self, name, theme_xml) : def saveTheme(self, name, theme_xml) :
@ -322,30 +326,27 @@ class ThemeManager(QWidget):
theme_dir = os.path.join(self.path, name) theme_dir = os.path.join(self.path, name)
if os.path.exists(theme_dir) == False: if os.path.exists(theme_dir) == False:
os.mkdir(os.path.join(self.path, name)) os.mkdir(os.path.join(self.path, name))
theme_file = os.path.join(theme_dir, name + u'.xml')
theme_file = os.path.join(theme_dir, name+u'.xml') outfile = open(theme_file, u'w')
outfile = open(theme_file, 'w')
outfile.write(theme_xml) outfile.write(theme_xml)
outfile.close() outfile.close()
self.Theme_data.clearItems() self.themeData.clearItems()
self.loadThemes() self.loadThemes()
def generateAndSaveImage(self, dir, name, theme_xml): def generateAndSaveImage(self, dir, name, theme_xml):
log.debug(u'generateAndSaveImage %s %s %s', dir, name, theme_xml) log.debug(u'generateAndSaveImage %s %s %s', dir, name, theme_xml)
theme = ThemeXML() theme = ThemeXML()
theme.parse(theme_xml) theme.parse(theme_xml)
frame = self.generateImage(theme) frame = self.generateImage(theme)
im = frame.toImage()
im=frame.toImage() samplepathname = os.path.join(self.path, name + u'.png')
samplepathname=os.path.join(self.path, name+u'.png')
if os.path.exists(samplepathname): if os.path.exists(samplepathname):
os.unlink(samplepathname) os.unlink(samplepathname)
im.save(samplepathname, u'png') im.save(samplepathname, u'png')
log.debug(u'Theme image written to %s',samplepathname) log.debug(u'Theme image written to %s', samplepathname)
def generateImage(self, themedata): def generateImage(self, themedata):
log.debug(u'generateImage %s ', themedata) log.debug(u'generateImage %s ', themedata)
frame = self.renderManager.generate_preview(themedata) frame = self.renderManager.generate_preview(themedata)
return frame return frame

View File

@ -14,7 +14,7 @@ class Ui_BibleImportDialog(object):
BibleImportDialog.setObjectName("BibleImportDialog") BibleImportDialog.setObjectName("BibleImportDialog")
BibleImportDialog.resize(494, 725) BibleImportDialog.resize(494, 725)
icon = QtGui.QIcon() icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon.addPixmap(QtGui.QPixmap(":/icon/openlp-logo-16x16.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
BibleImportDialog.setWindowIcon(icon) BibleImportDialog.setWindowIcon(icon)
self.ImportToolBox = QtGui.QToolBox(BibleImportDialog) self.ImportToolBox = QtGui.QToolBox(BibleImportDialog)
self.ImportToolBox.setGeometry(QtCore.QRect(20, 20, 451, 401)) self.ImportToolBox.setGeometry(QtCore.QRect(20, 20, 451, 401))

View File

@ -29,18 +29,18 @@ from openlp.plugins.bibles.lib.tables import *
from openlp.plugins.bibles.lib.classes import * from openlp.plugins.bibles.lib.classes import *
class BibleDBImpl(BibleCommon): class BibleDBImpl(BibleCommon):
global log global log
log=logging.getLogger(u'BibleDBImpl') log=logging.getLogger(u'BibleDBImpl')
log.info(u'BibleDBimpl loaded') log.info(u'BibleDBimpl loaded')
def __init__(self, biblepath , biblename, config): def __init__(self, biblepath , biblename, config):
# Connect to database # Connect to database
self.config = config self.config = config
self.biblefile = os.path.join(biblepath, biblename+u'.sqlite') self.biblefile = os.path.join(biblepath, biblename+u'.sqlite')
log.debug( "Load bible %s on path %s", biblename, self.biblefile) log.debug( "Load bible %s on path %s", biblename, self.biblefile)
db_type = self.config.get_config(u'db type') db_type = self.config.get_config(u'db type')
if db_type == u'sqlite': if db_type == u'sqlite':
self.db = create_engine("sqlite:///"+self.biblefile) self.db = create_engine("sqlite:///" + self.biblefile)
else: else:
self.db_url = u'%s://%s:%s@%s/%s' % \ self.db_url = u'%s://%s:%s@%s/%s' % \
(db_type, self.config.get_config(u'db username'), (db_type, self.config.get_config(u'db username'),
@ -53,14 +53,14 @@ class BibleDBImpl(BibleCommon):
self.session = scoped_session(sessionmaker(autoflush=True, autocommit=False)) self.session = scoped_session(sessionmaker(autoflush=True, autocommit=False))
self.session.configure(bind=self.db) self.session.configure(bind=self.db)
metadata.create_all(self.db) metadata.create_all(self.db)
def create_tables(self): def create_tables(self):
log.debug( u'createTables') log.debug( u'createTables')
self.save_meta(u'dbversion', u'2') self.save_meta(u'dbversion', u'2')
self._load_testament("Old Testament") self._load_testament("Old Testament")
self._load_testament("New Testament") self._load_testament("New Testament")
self._load_testament("Apocrypha") self._load_testament("Apocrypha")
def add_verse(self, bookid, chap, vse, text): def add_verse(self, bookid, chap, vse, text):
#log.debug( "add_verse %s,%s,%s", bookid, chap, vse) #log.debug( "add_verse %s,%s,%s", bookid, chap, vse)
metadata.bind.echo = False metadata.bind.echo = False
@ -70,7 +70,7 @@ class BibleDBImpl(BibleCommon):
verse.chapter = chap verse.chapter = chap
verse.verse = vse verse.verse = vse
verse.text = text verse.text = text
session.add(verse) session.add(verse)
session.commit() session.commit()
def create_chapter(self, bookid, chap, textlist): def create_chapter(self, bookid, chap, textlist):
@ -87,10 +87,10 @@ class BibleDBImpl(BibleCommon):
verse.text = t verse.text = t
session.add(verse) session.add(verse)
session.commit() session.commit()
def create_book(self, bookname, bookabbrev, testament = 1): def create_book(self, bookname, bookabbrev, testament = 1):
log.debug( "create_book %s,%s", bookname, bookabbrev) log.debug( "create_book %s,%s", bookname, bookabbrev)
metadata.bind.echo = False metadata.bind.echo = False
session = self.session() session = self.session()
book = Book() book = Book()
book.testament_id = testament book.testament_id = testament
@ -99,9 +99,9 @@ class BibleDBImpl(BibleCommon):
session.add(book) session.add(book)
session.commit() session.commit()
return book return book
def save_meta(self, key, value): def save_meta(self, key, value):
metadata.bind.echo = False metadata.bind.echo = False
session = self.session() session = self.session()
bmeta= BibleMeta() bmeta= BibleMeta()
bmeta.key = key bmeta.key = key
@ -110,7 +110,7 @@ class BibleDBImpl(BibleCommon):
session.commit() session.commit()
def get_meta(self, metakey): def get_meta(self, metakey):
log.debug( "get meta %s", metakey) log.debug( "get meta %s", metakey)
return self.session.query(BibleMeta).filter_by(key = metakey).first() return self.session.query(BibleMeta).filter_by(key = metakey).first()
def delete_meta(self, metakey): def delete_meta(self, metakey):
@ -124,58 +124,58 @@ class BibleDBImpl(BibleCommon):
def _load_testament(self, testament): def _load_testament(self, testament):
log.debug("load_testaments %s", testament) log.debug("load_testaments %s", testament)
metadata.bind.echo = False metadata.bind.echo = False
session = self.session() session = self.session()
test = ONTestament() test = ONTestament()
test.name = testament test.name = testament
session.add(test) session.add(test)
session.commit() session.commit()
def get_bible_books(self): def get_bible_books(self):
log.debug( "get_bible_books ") log.debug( "get_bible_books ")
return self.session.query(Book).order_by(Book.id).all() return self.session.query(Book).order_by(Book.id).all()
def get_max_bible_book_verses(self, bookname, chapter): def get_max_bible_book_verses(self, bookname, chapter):
log.debug( "get_max_bible_book_verses %s,%s ", bookname , chapter) log.debug( "get_max_bible_book_verses %s,%s ", bookname , chapter)
metadata.bind.echo = False metadata.bind.echo = False
s = text (""" select max(verse.verse) from verse,book where chapter = :c and book_id = book.id and book.name = :b """) s = text (""" select max(verse.verse) from verse,book where chapter = :c and book_id = book.id and book.name = :b """)
return self.db.execute(s, c=chapter, b=bookname).fetchone() return self.db.execute(s, c=chapter, b=bookname).fetchone()
def get_max_bible_book_chapter(self, bookname): def get_max_bible_book_chapter(self, bookname):
log.debug( "get_max_bible_book_chapter %s ", bookname ) log.debug( "get_max_bible_book_chapter %s ", bookname )
metadata.bind.echo = False metadata.bind.echo = False
s = text (""" select max(verse.chapter) from verse,book where book_id = book.id and book.name = :b """) s = text (""" select max(verse.chapter) from verse,book where book_id = book.id and book.name = :b """)
return self.db.execute(s, b=bookname).fetchone() return self.db.execute(s, b=bookname).fetchone()
def get_bible_book(self, bookname): def get_bible_book(self, bookname):
log.debug( "get_bible_book %s", bookname) log.debug( "get_bible_book %s", bookname)
bk = self.session.query(Book).filter(Book.name.like(bookname+u"%")).first() bk = self.session.query(Book).filter(Book.name.like(bookname+u"%")).first()
if bk == None: if bk == None:
bk = self.session.query(Book).filter(Book.abbreviation.like(bookname+u"%")).first() bk = self.session.query(Book).filter(Book.abbreviation.like(bookname+u"%")).first()
return bk return bk
def get_bible_chapter(self, id, chapter): def get_bible_chapter(self, id, chapter):
log.debug( "get_bible_chapter %s,%s", id, chapter ) log.debug( "get_bible_chapter %s,%s", id, chapter )
metadata.bind.echo = False metadata.bind.echo = False
return self.session.query(Verse).filter_by(chapter = chapter ).filter_by(book_id = id).first() return self.session.query(Verse).filter_by(chapter = chapter ).filter_by(book_id = id).first()
def get_bible_text(self, bookname, chapter, sverse, everse): def get_bible_text(self, bookname, chapter, sverse, everse):
log.debug( "get_bible_text %s,%s,%s,%s ", bookname, chapter, sverse, everse) log.debug( "get_bible_text %s,%s,%s,%s ", bookname, chapter, sverse, everse)
metadata.bind.echo = False metadata.bind.echo = False
bookname = bookname + u"%" bookname = bookname + u"%"
s = text (""" select name,chapter,verse.verse, verse.text FROM verse , book where verse.book_id == book.id AND verse.chapter == :c AND (verse.verse between :v1 and :v2) and (book.name like :b) """) s = text (""" select name,chapter,verse.verse, verse.text FROM verse , book where verse.book_id == book.id AND verse.chapter == :c AND (verse.verse between :v1 and :v2) and (book.name like :b) """)
return self.db.execute(s, c=chapter, v1=sverse , v2=everse, b=bookname).fetchall() return self.db.execute(s, c=chapter, v1=sverse , v2=everse, b=bookname).fetchall()
def get_verses_from_text(self,versetext): def get_verses_from_text(self,versetext):
log.debug( "get_verses_from_text %s",versetext) log.debug( "get_verses_from_text %s",versetext)
metadata.bind.echo = False metadata.bind.echo = False
versetext = "%"+versetext+"%" versetext = "%"+versetext+"%"
s = text (""" select book.name, verse.chapter, verse.verse, verse.text FROM verse , book where verse.book_id == book.id and verse.text like :t """) s = text (""" select book.name, verse.chapter, verse.verse, verse.text FROM verse , book where verse.book_id == book.id and verse.text like :t """)
return self.db.execute(s, t=versetext).fetchall() return self.db.execute(s, t=versetext).fetchall()
def dump_bible(self): def dump_bible(self):
log.debug( u'.........Dumping Bible Database') log.debug( u'.........Dumping Bible Database')
log.debug( '...............................Books ') log.debug( '...............................Books ')
s = text (""" select * FROM book """) s = text (""" select * FROM book """)
log.debug( self.db.execute(s).fetchall()) log.debug( self.db.execute(s).fetchall())
log.debug( u'...............................Verses ') log.debug( u'...............................Verses ')

View File

@ -15,7 +15,7 @@ class Ui_customEditDialog(object):
customEditDialog.setObjectName("customEditDialog") customEditDialog.setObjectName("customEditDialog")
customEditDialog.resize(590, 541) customEditDialog.resize(590, 541)
icon = QtGui.QIcon() icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon.addPixmap(QtGui.QPixmap(":/icon/openlp-logo-16x16.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
customEditDialog.setWindowIcon(icon) customEditDialog.setWindowIcon(icon)
self.gridLayout = QtGui.QGridLayout(customEditDialog) self.gridLayout = QtGui.QGridLayout(customEditDialog)
self.gridLayout.setObjectName("gridLayout") self.gridLayout.setObjectName("gridLayout")
@ -80,7 +80,7 @@ class Ui_customEditDialog(object):
self.ButtonLayout.addWidget(self.DeleteButton) self.ButtonLayout.addWidget(self.DeleteButton)
self.ClearButton = QtGui.QPushButton(self.ButtonWidget) self.ClearButton = QtGui.QPushButton(self.ButtonWidget)
self.ClearButton.setObjectName("ClearButton") self.ClearButton.setObjectName("ClearButton")
self.ButtonLayout.addWidget(self.ClearButton) self.ButtonLayout.addWidget(self.ClearButton)
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.ButtonLayout.addItem(spacerItem1) self.ButtonLayout.addItem(spacerItem1)
self.EditLayout.addWidget(self.ButtonWidget) self.EditLayout.addWidget(self.ButtonWidget)
@ -118,7 +118,7 @@ class Ui_customEditDialog(object):
customEditDialog.setTabOrder(self.VerseListView, self.AddButton) customEditDialog.setTabOrder(self.VerseListView, self.AddButton)
customEditDialog.setTabOrder(self.AddButton, self.DeleteButton) customEditDialog.setTabOrder(self.AddButton, self.DeleteButton)
customEditDialog.setTabOrder(self.DeleteButton, self.buttonBox) customEditDialog.setTabOrder(self.DeleteButton, self.buttonBox)
def retranslateUi(self, customEditDialog): def retranslateUi(self, customEditDialog):
customEditDialog.setWindowTitle(translate("customEditDialog", "Edit Custom Slides")) customEditDialog.setWindowTitle(translate("customEditDialog", "Edit Custom Slides"))
self.TitleLabel.setText(translate("customEditDialog", "Title:")) self.TitleLabel.setText(translate("customEditDialog", "Title:"))

View File

@ -14,7 +14,7 @@ class Ui_EditSongDialog(object):
EditSongDialog.setObjectName("EditSongDialog") EditSongDialog.setObjectName("EditSongDialog")
EditSongDialog.resize(786, 704) EditSongDialog.resize(786, 704)
icon = QtGui.QIcon() icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon.addPixmap(QtGui.QPixmap(":/icon/openlp-logo-16x16.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
EditSongDialog.setWindowIcon(icon) EditSongDialog.setWindowIcon(icon)
EditSongDialog.setModal(True) EditSongDialog.setModal(True)
self.EditSongLayout = QtGui.QVBoxLayout(EditSongDialog) self.EditSongLayout = QtGui.QVBoxLayout(EditSongDialog)

View File

@ -32,7 +32,7 @@ class OpenLPExportForm(object):
self.OpenLPExportForm.setObjectName("OpenLPExportForm") self.OpenLPExportForm.setObjectName("OpenLPExportForm")
self.OpenLPExportForm.resize(473, 459) self.OpenLPExportForm.resize(473, 459)
icon = QtGui.QIcon() icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon.addPixmap(QtGui.QPixmap(":/icon/openlp-logo-16x16.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.OpenLPExportForm.setWindowIcon(icon) self.OpenLPExportForm.setWindowIcon(icon)
self.verticalLayout_5 = QtGui.QVBoxLayout(self.OpenLPExportForm) self.verticalLayout_5 = QtGui.QVBoxLayout(self.OpenLPExportForm)
self.verticalLayout_5.setMargin(8) self.verticalLayout_5.setMargin(8)

View File

@ -32,7 +32,7 @@ class OpenLPImportForm(object):
self.OpenLPImportForm.setObjectName("OpenLPImportForm") self.OpenLPImportForm.setObjectName("OpenLPImportForm")
self.OpenLPImportForm.resize(473, 459) self.OpenLPImportForm.resize(473, 459)
icon = QtGui.QIcon() icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon.addPixmap(QtGui.QPixmap(":/icon/openlp-logo-16x16.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.OpenLPImportForm.setWindowIcon(icon) self.OpenLPImportForm.setWindowIcon(icon)
self.verticalLayout_5 = QtGui.QVBoxLayout(self.OpenLPImportForm) self.verticalLayout_5 = QtGui.QVBoxLayout(self.OpenLPImportForm)
self.verticalLayout_5.setMargin(8) self.verticalLayout_5.setMargin(8)

View File

@ -32,7 +32,7 @@ class OpenSongExportForm(object):
self.OpenSongExportForm.setObjectName("OpenSongExportForm") self.OpenSongExportForm.setObjectName("OpenSongExportForm")
self.OpenSongExportForm.resize(473, 459) self.OpenSongExportForm.resize(473, 459)
icon = QtGui.QIcon() icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon.addPixmap(QtGui.QPixmap(":/icon/openlp-logo-16x16.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.OpenSongExportForm.setWindowIcon(icon) self.OpenSongExportForm.setWindowIcon(icon)
self.verticalLayout_5 = QtGui.QVBoxLayout(self.OpenSongExportForm) self.verticalLayout_5 = QtGui.QVBoxLayout(self.OpenSongExportForm)
self.verticalLayout_5.setMargin(8) self.verticalLayout_5.setMargin(8)

View File

@ -32,7 +32,7 @@ class OpenSongImportForm(object):
self.OpenSongImportForm.setObjectName("OpenSongImportForm") self.OpenSongImportForm.setObjectName("OpenSongImportForm")
self.OpenSongImportForm.resize(481, 153) self.OpenSongImportForm.resize(481, 153)
icon = QtGui.QIcon() icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icon/openlp.org-icon-32.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off) icon.addPixmap(QtGui.QPixmap(":/icon/openlp-logo-16x16.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.OpenSongImportForm.setWindowIcon(icon) self.OpenSongImportForm.setWindowIcon(icon)
self.verticalLayout = QtGui.QVBoxLayout(self.OpenSongImportForm) self.verticalLayout = QtGui.QVBoxLayout(self.OpenSongImportForm)
self.verticalLayout.setSpacing(6) self.verticalLayout.setSpacing(6)

View File

@ -59,7 +59,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>252</width> <width>283</width>
<height>539</height> <height>539</height>
</rect> </rect>
</property> </property>
@ -99,7 +99,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>252</width> <width>283</width>
<height>539</height> <height>539</height>
</rect> </rect>
</property> </property>
@ -290,8 +290,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>257</width> <width>201</width>
<height>603</height> <height>604</height>
</rect> </rect>
</property> </property>
<attribute name="label" > <attribute name="label" >
@ -521,8 +521,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>257</width> <width>201</width>
<height>603</height> <height>604</height>
</rect> </rect>
</property> </property>
<attribute name="label" > <attribute name="label" >
@ -723,8 +723,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>257</width> <width>201</width>
<height>603</height> <height>604</height>
</rect> </rect>
</property> </property>
<attribute name="label" > <attribute name="label" >
@ -948,8 +948,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>257</width> <width>201</width>
<height>603</height> <height>604</height>
</rect> </rect>
</property> </property>
<attribute name="label" > <attribute name="label" >
@ -1118,8 +1118,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>257</width> <width>201</width>
<height>603</height> <height>604</height>
</rect> </rect>
</property> </property>
<attribute name="label" > <attribute name="label" >
@ -1282,8 +1282,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>257</width> <width>201</width>
<height>603</height> <height>604</height>
</rect> </rect>
</property> </property>
<attribute name="label" > <attribute name="label" >

View File

@ -6,14 +6,19 @@
<file>song_new.png</file> <file>song_new.png</file>
</qresource> </qresource>
<qresource prefix="icon" > <qresource prefix="icon" >
<file>openlp.org-icon-32.bmp</file> <file>openlp-logo-16x16.png</file>
<file>openlp.org.ico</file> <file>openlp-logo-32x32.png</file>
<file>openlp-logo-48x48.png</file>
<file>openlp-logo-64x64.png</file>
<file>openlp-logo-128x128.png</file>
<file>openlp-logo-256x256.png</file>
</qresource> </qresource>
<qresource prefix="graphics" > <qresource prefix="graphics" >
<file>splash-screen-new.bmp</file> <file>splash-screen-new.bmp</file>
<file>splash-screen-2.png</file>
<file>openlp2.png</file>
<file>about-new.bmp</file> <file>about-new.bmp</file>
<file>openlp-about-logo.png</file>
<file>openlp-splash-screen.png</file>
<file>openlp-splash-screen.svg</file>
</qresource> </qresource>
<qresource prefix="imports" > <qresource prefix="imports" >
<file>import_selectall.png</file> <file>import_selectall.png</file>
@ -58,6 +63,8 @@
<file>service_save.png</file> <file>service_save.png</file>
</qresource> </qresource>
<qresource prefix="system" > <qresource prefix="system" >
<file>system_about.png</file>
<file>system_help_contents.png</file>
<file>system_add.png</file> <file>system_add.png</file>
<file>system_live.png</file> <file>system_live.png</file>
<file>system_preview.png</file> <file>system_preview.png</file>