← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~meths/openlp/trivialfixes into lp:openlp

 

Jon Tibble has proposed merging lp:~meths/openlp/trivialfixes into lp:openlp.

    Requested reviews:
    OpenLP Core (openlp-core)


Original log:
The way we do titles in plugintabs at the moment will not let scripts/pylupdate4 get the correct context for translation so you would end up with all plugins translating their title to the same string - obviously not helpful.

New log:
This new submission should cover all tabs and uses an internal string and a user-visible translated string.  This patch should take care of the tab title users in the code too (thanks TRB for pointing out).
FIX: This patch also fixes a bug in PresentationPlugin.finalise()
-- 
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/14119
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/settingstab.py'
--- openlp/core/lib/settingstab.py	2009-10-23 13:17:43 +0000
+++ openlp/core/lib/settingstab.py	2009-10-28 22:30:26 +0000
@@ -44,9 +44,8 @@
             to write to when the ``save`` method is called.
         """
         QtGui.QWidget.__init__(self)
-        self.tabTitle = self.trUtf8(title)
-        # Use the line below when pulling the translation template file.
-        #self.tabTitle = title
+        self.tabTitle = title
+        self.tabTitleVisible = None
         self.setupUi()
         self.retranslateUi()
         self.initialise()
@@ -56,21 +55,6 @@
             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.

=== modified file 'openlp/core/ui/alertstab.py'
--- openlp/core/ui/alertstab.py	2009-10-24 16:40:36 +0000
+++ openlp/core/ui/alertstab.py	2009-10-28 22:30:26 +0000
@@ -32,13 +32,12 @@
     """
     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)

=== modified file 'openlp/core/ui/generaltab.py'
--- openlp/core/ui/generaltab.py	2009-10-24 16:40:36 +0000
+++ openlp/core/ui/generaltab.py	2009-10-28 22:30:26 +0000
@@ -33,11 +33,10 @@
     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)

=== modified file 'openlp/core/ui/settingsdialog.py'
--- openlp/core/ui/settingsdialog.py	2009-10-24 16:40:36 +0000
+++ openlp/core/ui/settingsdialog.py	2009-10-28 22:30:26 +0000
@@ -36,20 +36,25 @@
         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):

=== modified file 'openlp/core/ui/settingsform.py'
--- openlp/core/ui/settingsform.py	2009-10-19 14:56:44 +0000
+++ openlp/core/ui/settingsform.py	2009-10-28 22:30:26 +0000
@@ -48,18 +48,18 @@
         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):

=== modified file 'openlp/core/ui/themestab.py'
--- openlp/core/ui/themestab.py	2009-10-24 16:40:36 +0000
+++ openlp/core/ui/themestab.py	2009-10-28 22:30:26 +0000
@@ -33,11 +33,10 @@
     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)

=== modified file 'openlp/plugins/bibles/lib/biblestab.py'
--- openlp/plugins/bibles/lib/biblestab.py	2009-10-24 16:40:36 +0000
+++ openlp/plugins/bibles/lib/biblestab.py	2009-10-28 22:30:26 +0000
@@ -42,10 +42,10 @@
         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')
 
     def setupUi(self):
         self.setObjectName(u'BiblesTab')
+        self.tabTitleVisible = self.trUtf8(u'Bibles')
         self.BibleLayout = QtGui.QHBoxLayout(self)
         self.BibleLayout.setSpacing(8)
         self.BibleLayout.setMargin(8)

=== modified file 'openlp/plugins/images/lib/imagetab.py'
--- openlp/plugins/images/lib/imagetab.py	2009-10-24 16:40:36 +0000
+++ openlp/plugins/images/lib/imagetab.py	2009-10-28 22:30:26 +0000
@@ -31,11 +31,11 @@
     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')
 
     def setupUi(self):
         self.setObjectName(u'ImageTab')
+        self.tabTitleVisible = self.trUtf8(u'Images')
         self.ImageLayout = QtGui.QFormLayout(self)
         self.ImageLayout.setObjectName(u'ImageLayout')
         self.ImageSettingsGroupBox = QtGui.QGroupBox(self)

=== modified file 'openlp/plugins/media/lib/mediatab.py'
--- openlp/plugins/media/lib/mediatab.py	2009-10-24 16:40:36 +0000
+++ openlp/plugins/media/lib/mediatab.py	2009-10-28 22:30:26 +0000
@@ -32,10 +32,10 @@
     """
     def __init__(self):
         SettingsTab.__init__(self, u'Media', u'Media')
-        #SettingsTab.__init__(self, self.trUtf8(u'Media'), u'Media')
 
     def setupUi(self):
         self.setObjectName(u'MediaTab')
+        self.tabTitleVisible = self.trUtf8(u'Media')
         self.MediaLayout = QtGui.QFormLayout(self)
         self.MediaLayout.setObjectName(u'MediaLayout')
         self.MediaModeGroupBox = QtGui.QGroupBox(self)

=== modified file 'openlp/plugins/presentations/lib/presentationtab.py'
--- openlp/plugins/presentations/lib/presentationtab.py	2009-10-24 16:40:36 +0000
+++ openlp/plugins/presentations/lib/presentationtab.py	2009-10-28 22:30:26 +0000
@@ -32,10 +32,11 @@
     """
     def __init__(self, controllers):
         self.controllers = controllers
-        SettingsTab.__init__(self, u'Presentation', u'Presentations')
+        SettingsTab.__init__(self, u'Presentations', u'Presentations')
 
     def setupUi(self):
         self.setObjectName(u'PresentationTab')
+        self.tabTitleVisible = self.trUtf8(u'Presentations')
         self.PresentationLayout = QtGui.QHBoxLayout(self)
         self.PresentationLayout.setSpacing(8)
         self.PresentationLayout.setMargin(8)

=== modified file 'openlp/plugins/presentations/presentationplugin.py'
--- openlp/plugins/presentations/presentationplugin.py	2009-10-17 17:44:07 +0000
+++ openlp/plugins/presentations/presentationplugin.py	2009-10-28 22:30:26 +0000
@@ -62,7 +62,11 @@
 
     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 @@
         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'<b>Presentation Plugin</b> <br> Delivers the ability to show presentations using a number of different programs. The choice of available presentaion programs is available in a drop down.'

=== modified file 'openlp/plugins/remotes/lib/remotetab.py'
--- openlp/plugins/remotes/lib/remotetab.py	2009-10-24 16:40:36 +0000
+++ openlp/plugins/remotes/lib/remotetab.py	2009-10-28 22:30:26 +0000
@@ -31,6 +31,7 @@
 
     def setupUi(self):
         self.setObjectName(u'RemoteTab')
+        self.tabTitleVisible = self.trUtf8(u'Remotes')
         self.RemoteLayout = QtGui.QFormLayout(self)
         self.RemoteLayout.setObjectName(u'RemoteLayout')
         self.RemoteModeGroupBox = QtGui.QGroupBox(self)

=== modified file 'openlp/plugins/songs/lib/songstab.py'
--- openlp/plugins/songs/lib/songstab.py	2009-10-26 06:30:08 +0000
+++ openlp/plugins/songs/lib/songstab.py	2009-10-28 22:30:26 +0000
@@ -35,6 +35,7 @@
 
     def setupUi(self):
         self.setObjectName(u'SongsTab')
+        self.tabTitleVisible = self.trUtf8(u'Songs')
         self.SongsLayout = QtGui.QFormLayout(self)
         self.SongsLayout.setObjectName(u'SongsLayout')
         self.SongsModeGroupBox = QtGui.QGroupBox(self)


Follow ups