From c34d452bb6baad6cc7ef5a5e4223e9f7cd934f56 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Wed, 28 Oct 2009 01:17:35 +0000 Subject: [PATCH 1/4] Fix plugintab.py i18n --- openlp/plugins/bibles/lib/biblestab.py | 4 ++-- openlp/plugins/images/lib/imagetab.py | 4 ++-- openlp/plugins/media/lib/mediatab.py | 4 ++-- openlp/plugins/presentations/lib/presentationtab.py | 3 ++- openlp/plugins/remotes/lib/remotetab.py | 3 ++- openlp/plugins/songs/lib/songstab.py | 3 ++- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/openlp/plugins/bibles/lib/biblestab.py b/openlp/plugins/bibles/lib/biblestab.py index bf08acbec..3cdb03ce4 100644 --- a/openlp/plugins/bibles/lib/biblestab.py +++ b/openlp/plugins/bibles/lib/biblestab.py @@ -41,11 +41,11 @@ class BiblesTab(SettingsTab): self.paragraph_style = True self.show_new_chapters = False self.display_style = 0 - SettingsTab.__init__(self, u'Bibles', u'Bibles') - #SettingsTab.__init__(self, self.trUtf8(u'Bibles'), u'Bibles') + SettingsTab.__init__(self, section=u'Bibles') def setupUi(self): self.setObjectName(u'BiblesTab') + self.setTitle(self.trUtf8(u'Bibles')) self.BibleLayout = QtGui.QHBoxLayout(self) self.BibleLayout.setSpacing(8) self.BibleLayout.setMargin(8) diff --git a/openlp/plugins/images/lib/imagetab.py b/openlp/plugins/images/lib/imagetab.py index f5472b02c..ef6de959e 100644 --- a/openlp/plugins/images/lib/imagetab.py +++ b/openlp/plugins/images/lib/imagetab.py @@ -31,11 +31,11 @@ class ImageTab(SettingsTab): ImageTab is the Image settings tab in the settings dialog. """ def __init__(self): - #SettingsTab.__init__(self, self.trUtf8(u'Images'), u'Images') - SettingsTab.__init__(self, u'Images', u'Images') + SettingsTab.__init__(self, section=u'Images') def setupUi(self): self.setObjectName(u'ImageTab') + self.setTitle(self.trUtf8(u'Images')) self.ImageLayout = QtGui.QFormLayout(self) self.ImageLayout.setObjectName(u'ImageLayout') self.ImageSettingsGroupBox = QtGui.QGroupBox(self) diff --git a/openlp/plugins/media/lib/mediatab.py b/openlp/plugins/media/lib/mediatab.py index 69440faa8..20de4be52 100644 --- a/openlp/plugins/media/lib/mediatab.py +++ b/openlp/plugins/media/lib/mediatab.py @@ -31,11 +31,11 @@ class MediaTab(SettingsTab): mediaTab is the media settings tab in the settings dialog. """ def __init__(self): - SettingsTab.__init__(self, u'Media', u'Media') - #SettingsTab.__init__(self, self.trUtf8(u'Media'), u'Media') + SettingsTab.__init__(self, section=u'Media') def setupUi(self): self.setObjectName(u'MediaTab') + self.setTitle(self.trUtf8(u'Media')) self.MediaLayout = QtGui.QFormLayout(self) self.MediaLayout.setObjectName(u'MediaLayout') self.MediaModeGroupBox = QtGui.QGroupBox(self) diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index 410e3cde9..27b85c7d9 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -32,10 +32,11 @@ class PresentationTab(SettingsTab): """ def __init__(self, controllers): self.controllers = controllers - SettingsTab.__init__(self, u'Presentation', u'Presentations') + SettingsTab.__init__(self, section=u'Presentations') def setupUi(self): self.setObjectName(u'PresentationTab') + self.setTitle(self.trUtf8(u'Presentations')) self.PresentationLayout = QtGui.QHBoxLayout(self) self.PresentationLayout.setSpacing(8) self.PresentationLayout.setMargin(8) diff --git a/openlp/plugins/remotes/lib/remotetab.py b/openlp/plugins/remotes/lib/remotetab.py index a1f473c7c..deb0e42c7 100644 --- a/openlp/plugins/remotes/lib/remotetab.py +++ b/openlp/plugins/remotes/lib/remotetab.py @@ -27,10 +27,11 @@ class RemoteTab(SettingsTab): RemoteTab is the Remotes settings tab in the settings dialog. """ def __init__(self): - SettingsTab.__init__(self, u'Remotes', u'Remotes') + SettingsTab.__init__(self, section=u'Remotes') def setupUi(self): self.setObjectName(u'RemoteTab') + self.setTitle(self.trUtf8(u'Remotes')) self.RemoteLayout = QtGui.QFormLayout(self) self.RemoteLayout.setObjectName(u'RemoteLayout') self.RemoteModeGroupBox = QtGui.QGroupBox(self) diff --git a/openlp/plugins/songs/lib/songstab.py b/openlp/plugins/songs/lib/songstab.py index c5c2adbdc..2f1114423 100644 --- a/openlp/plugins/songs/lib/songstab.py +++ b/openlp/plugins/songs/lib/songstab.py @@ -31,10 +31,11 @@ class SongsTab(SettingsTab): SongsTab is the Songs settings tab in the settings dialog. """ def __init__(self): - SettingsTab.__init__(self, u'Songs', u'Songs') + SettingsTab.__init__(self, section=u'Songs') def setupUi(self): self.setObjectName(u'SongsTab') + self.setTitle(self.trUtf8(u'Songs')) self.SongsLayout = QtGui.QFormLayout(self) self.SongsLayout.setObjectName(u'SongsLayout') self.SongsModeGroupBox = QtGui.QGroupBox(self) From 439c3c90ca68650d300a8ee1c6da5d5cb59434d5 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Wed, 28 Oct 2009 21:04:14 +0000 Subject: [PATCH 2/4] Fix i18n for visible and non-visible title use --- openlp/core/lib/settingstab.py | 3 ++- openlp/plugins/bibles/lib/biblestab.py | 4 ++-- openlp/plugins/images/lib/imagetab.py | 4 ++-- openlp/plugins/media/lib/mediatab.py | 4 ++-- openlp/plugins/presentations/lib/presentationtab.py | 4 ++-- openlp/plugins/remotes/lib/remotetab.py | 4 ++-- openlp/plugins/songs/lib/songstab.py | 4 ++-- 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/openlp/core/lib/settingstab.py b/openlp/core/lib/settingstab.py index bd9f22661..b82860618 100644 --- a/openlp/core/lib/settingstab.py +++ b/openlp/core/lib/settingstab.py @@ -44,7 +44,8 @@ class SettingsTab(QtGui.QWidget): to write to when the ``save`` method is called. """ QtGui.QWidget.__init__(self) - self.tabTitle = self.trUtf8(title) + self.tabTitle = title + self.tabTitleVisible = None # Use the line below when pulling the translation template file. #self.tabTitle = title self.setupUi() diff --git a/openlp/plugins/bibles/lib/biblestab.py b/openlp/plugins/bibles/lib/biblestab.py index 3cdb03ce4..91e051169 100644 --- a/openlp/plugins/bibles/lib/biblestab.py +++ b/openlp/plugins/bibles/lib/biblestab.py @@ -41,11 +41,11 @@ class BiblesTab(SettingsTab): self.paragraph_style = True self.show_new_chapters = False self.display_style = 0 - SettingsTab.__init__(self, section=u'Bibles') + SettingsTab.__init__(self, u'Bibles', u'Bibles') def setupUi(self): self.setObjectName(u'BiblesTab') - self.setTitle(self.trUtf8(u'Bibles')) + self.tabTitleVisible = self.trUtf8(u'Bibles') self.BibleLayout = QtGui.QHBoxLayout(self) self.BibleLayout.setSpacing(8) self.BibleLayout.setMargin(8) diff --git a/openlp/plugins/images/lib/imagetab.py b/openlp/plugins/images/lib/imagetab.py index ef6de959e..893d156a5 100644 --- a/openlp/plugins/images/lib/imagetab.py +++ b/openlp/plugins/images/lib/imagetab.py @@ -31,11 +31,11 @@ class ImageTab(SettingsTab): ImageTab is the Image settings tab in the settings dialog. """ def __init__(self): - SettingsTab.__init__(self, section=u'Images') + SettingsTab.__init__(self, u'Images', u'Images') def setupUi(self): self.setObjectName(u'ImageTab') - self.setTitle(self.trUtf8(u'Images')) + self.tabTitleVisible = self.trUtf8(u'Images') self.ImageLayout = QtGui.QFormLayout(self) self.ImageLayout.setObjectName(u'ImageLayout') self.ImageSettingsGroupBox = QtGui.QGroupBox(self) diff --git a/openlp/plugins/media/lib/mediatab.py b/openlp/plugins/media/lib/mediatab.py index 20de4be52..398aa7ca6 100644 --- a/openlp/plugins/media/lib/mediatab.py +++ b/openlp/plugins/media/lib/mediatab.py @@ -31,11 +31,11 @@ class MediaTab(SettingsTab): mediaTab is the media settings tab in the settings dialog. """ def __init__(self): - SettingsTab.__init__(self, section=u'Media') + SettingsTab.__init__(self, u'Media', u'Media') def setupUi(self): self.setObjectName(u'MediaTab') - self.setTitle(self.trUtf8(u'Media')) + self.tabTitleVisible = self.trUtf8(u'Media') self.MediaLayout = QtGui.QFormLayout(self) self.MediaLayout.setObjectName(u'MediaLayout') self.MediaModeGroupBox = QtGui.QGroupBox(self) diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index 27b85c7d9..83921f234 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -32,11 +32,11 @@ class PresentationTab(SettingsTab): """ def __init__(self, controllers): self.controllers = controllers - SettingsTab.__init__(self, section=u'Presentations') + SettingsTab.__init__(self, u'Presentations', u'Presentations') def setupUi(self): self.setObjectName(u'PresentationTab') - self.setTitle(self.trUtf8(u'Presentations')) + self.tabTitleVisible = self.trUtf8(u'Presentations') self.PresentationLayout = QtGui.QHBoxLayout(self) self.PresentationLayout.setSpacing(8) self.PresentationLayout.setMargin(8) diff --git a/openlp/plugins/remotes/lib/remotetab.py b/openlp/plugins/remotes/lib/remotetab.py index deb0e42c7..26b5eea30 100644 --- a/openlp/plugins/remotes/lib/remotetab.py +++ b/openlp/plugins/remotes/lib/remotetab.py @@ -27,11 +27,11 @@ class RemoteTab(SettingsTab): RemoteTab is the Remotes settings tab in the settings dialog. """ def __init__(self): - SettingsTab.__init__(self, section=u'Remotes') + SettingsTab.__init__(self, u'Remotes', u'Remotes') def setupUi(self): self.setObjectName(u'RemoteTab') - self.setTitle(self.trUtf8(u'Remotes')) + self.tabTitleVisible = self.trUtf8(u'Remotes') self.RemoteLayout = QtGui.QFormLayout(self) self.RemoteLayout.setObjectName(u'RemoteLayout') self.RemoteModeGroupBox = QtGui.QGroupBox(self) diff --git a/openlp/plugins/songs/lib/songstab.py b/openlp/plugins/songs/lib/songstab.py index 2f1114423..d347c74a6 100644 --- a/openlp/plugins/songs/lib/songstab.py +++ b/openlp/plugins/songs/lib/songstab.py @@ -31,11 +31,11 @@ class SongsTab(SettingsTab): SongsTab is the Songs settings tab in the settings dialog. """ def __init__(self): - SettingsTab.__init__(self, section=u'Songs') + SettingsTab.__init__(self, u'Songs', u'Songs') def setupUi(self): self.setObjectName(u'SongsTab') - self.setTitle(self.trUtf8(u'Songs')) + self.tabTitleVisible = self.trUtf8(u'Songs') self.SongsLayout = QtGui.QFormLayout(self) self.SongsLayout.setObjectName(u'SongsLayout') self.SongsModeGroupBox = QtGui.QGroupBox(self) From fcd5836e0fd5eb9b193bfa89d7e7ee6794e9fa20 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Wed, 28 Oct 2009 21:52:13 +0000 Subject: [PATCH 3/4] Fix i18n for tabs v3 --- openlp/core/lib/settingstab.py | 17 ----------------- openlp/core/ui/alertstab.py | 3 +-- openlp/core/ui/generaltab.py | 3 +-- openlp/core/ui/settingsdialog.py | 15 ++++++++++----- openlp/core/ui/settingsform.py | 10 +++++----- openlp/core/ui/themestab.py | 3 +-- 6 files changed, 18 insertions(+), 33 deletions(-) diff --git a/openlp/core/lib/settingstab.py b/openlp/core/lib/settingstab.py index b82860618..f9eb60964 100644 --- a/openlp/core/lib/settingstab.py +++ b/openlp/core/lib/settingstab.py @@ -46,8 +46,6 @@ class SettingsTab(QtGui.QWidget): QtGui.QWidget.__init__(self) self.tabTitle = title self.tabTitleVisible = None - # Use the line below when pulling the translation template file. - #self.tabTitle = title self.setupUi() self.retranslateUi() self.initialise() @@ -57,21 +55,6 @@ class SettingsTab(QtGui.QWidget): self.config = PluginConfig(section) self.load() - def setTitle(self, title): - """ - Set the title of the tab. - - ``title`` - The title of the tab, which is usually displayed on the tab. - """ - self.tabTitle = title - - def title(self): - """ - Get the title of the tab. - """ - return self.tabTitle - def setupUi(self): """ Setup the tab's interface. diff --git a/openlp/core/ui/alertstab.py b/openlp/core/ui/alertstab.py index e7ce0a013..e2b8892fa 100644 --- a/openlp/core/ui/alertstab.py +++ b/openlp/core/ui/alertstab.py @@ -32,13 +32,12 @@ class AlertsTab(SettingsTab): """ def __init__(self): SettingsTab.__init__(self, u'Alerts', u'Alerts') - # Use the line below when pulling the translation template file. - #SettingsTab.__init__(self, self.trUtf8(u'Alerts'), u'Alerts') self.font_color = '#ffffff' self.bg_color = '#660000' def setupUi(self): self.setObjectName(u'AlertsTab') + self.tabTitleVisible = self.trUtf8(u'Alerts') self.AlertsLayout = QtGui.QHBoxLayout(self) self.AlertsLayout.setSpacing(8) self.AlertsLayout.setMargin(8) diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index 98479af3e..54031ec1a 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -33,11 +33,10 @@ class GeneralTab(SettingsTab): def __init__(self, screen_list): self.screen_list = screen_list SettingsTab.__init__(self, u'General', u'General') - # Use this line when pulling the translation template - #SettingsTab.__init__(self, self.trUtf8(u'General'), u'General') def setupUi(self): self.setObjectName(u'GeneralTab') + self.tabTitleVisible = self.trUtf8(u'General') self.GeneralLayout = QtGui.QHBoxLayout(self) self.GeneralLayout.setSpacing(8) self.GeneralLayout.setMargin(8) diff --git a/openlp/core/ui/settingsdialog.py b/openlp/core/ui/settingsdialog.py index a936f9f2f..28618ea3f 100644 --- a/openlp/core/ui/settingsdialog.py +++ b/openlp/core/ui/settingsdialog.py @@ -36,20 +36,25 @@ class Ui_SettingsDialog(object): self.SettingsTabWidget.setObjectName(u'SettingsTabWidget') self.SettingsLayout.addWidget(self.SettingsTabWidget) self.ButtonsBox = QtGui.QDialogButtonBox(SettingsDialog) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + sizePolicy = QtGui.QSizePolicy( + QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.ButtonsBox.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.ButtonsBox.sizePolicy().hasHeightForWidth()) self.ButtonsBox.setSizePolicy(sizePolicy) self.ButtonsBox.setMaximumSize(QtCore.QSize(16777215, 16777215)) self.ButtonsBox.setOrientation(QtCore.Qt.Horizontal) - self.ButtonsBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) + self.ButtonsBox.setStandardButtons( + QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.ButtonsBox.setObjectName(u'ButtonsBox') self.SettingsLayout.addWidget(self.ButtonsBox) self.retranslateUi(SettingsDialog) self.SettingsTabWidget.setCurrentIndex(0) - QtCore.QObject.connect(self.ButtonsBox, QtCore.SIGNAL(u'accepted()'), SettingsDialog.accept) - QtCore.QObject.connect(self.ButtonsBox, QtCore.SIGNAL(u'rejected()'), SettingsDialog.reject) + QtCore.QObject.connect(self.ButtonsBox, + QtCore.SIGNAL(u'accepted()'), SettingsDialog.accept) + QtCore.QObject.connect(self.ButtonsBox, + QtCore.SIGNAL(u'rejected()'), SettingsDialog.reject) QtCore.QMetaObject.connectSlotsByName(SettingsDialog) def retranslateUi(self, SettingsDialog): diff --git a/openlp/core/ui/settingsform.py b/openlp/core/ui/settingsform.py index 6d17009af..6c6de14b2 100644 --- a/openlp/core/ui/settingsform.py +++ b/openlp/core/ui/settingsform.py @@ -48,18 +48,18 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog): self.addTab(u'Alerts', self.AlertsTab) def addTab(self, name, tab): - log.info(u'Adding %s tab' % tab.title()) - self.SettingsTabWidget.addTab(tab, tab.title()) + log.info(u'Adding %s tab' % tab.tabTitle) + self.SettingsTabWidget.addTab(tab, tab.tabTitleVisible) def insertTab(self, tab, location): - log.debug(u'Inserting %s tab' % tab.title()) - self.SettingsTabWidget.insertTab(location + 13, tab, tab.title()) + log.debug(u'Inserting %s tab' % tab.tabTitle) + self.SettingsTabWidget.insertTab(location + 13, tab, tab.tabTitleVisible) def removeTab(self, name): log.debug(u'remove %s tab' % name) for tab_index in range(0, self.SettingsTabWidget.count()): if self.SettingsTabWidget.widget(tab_index) is not None: - if self.SettingsTabWidget.widget(tab_index).title() == name: + if self.SettingsTabWidget.widget(tab_index).tabTitle == name: self.SettingsTabWidget.removeTab(tab_index) def accept(self): diff --git a/openlp/core/ui/themestab.py b/openlp/core/ui/themestab.py index f50e6d227..d53ebb7d9 100644 --- a/openlp/core/ui/themestab.py +++ b/openlp/core/ui/themestab.py @@ -33,11 +33,10 @@ class ThemesTab(SettingsTab): def __init__(self, parent): self.parent = parent SettingsTab.__init__(self, u'Themes', u'Themes') - # Use the line below when pulling the translation template file. - #SettingsTab.__init__(self, self.trUtf8(u'Themes'), u'Themes') def setupUi(self): self.setObjectName(u'ThemesTab') + self.tabTitleVisible = self.trUtf8(u'Themes') self.ThemesTabLayout = QtGui.QHBoxLayout(self) self.ThemesTabLayout.setSpacing(8) self.ThemesTabLayout.setMargin(8) From 5ed004c772f66eb6b005dc24d3653430230c346a Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Wed, 28 Oct 2009 22:22:35 +0000 Subject: [PATCH 4/4] Fix PresentationPlugin finalising --- openlp/plugins/presentations/presentationplugin.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index b5ea37ece..0fcfa1e20 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -62,7 +62,11 @@ class PresentationPlugin(Plugin): def finalise(self): log.info(u'Plugin Finalise') - Plugin.finalise(self) + #Ask each controller to tidy up + for key in self.controllers: + controller = self.controllers[key] + if controller.enabled: + controller.kill() self.remove_toolbox_item() def get_media_manager_item(self): @@ -105,13 +109,5 @@ class PresentationPlugin(Plugin): else: return False - def finalise(self): - log.debug(u'Finalise') - #Ask each controller to tidy up - for key in self.controllers: - controller = self.controllers[key] - if controller.enabled: - controller.kill() - def about(self): return u'Presentation Plugin
Delivers the ability to show presentations using a number of different programs. The choice of available presentaion programs is available in a drop down.'