← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~mahfiaz/openlp/unicode_warning_fix into lp:openlp

 

mahfiaz has proposed merging lp:~mahfiaz/openlp/unicode_warning_fix into lp:openlp.

Requested reviews:
  Raoul Snyman (raoul-snyman)
  Tim Bentley (trb143)

For more details, see:
https://code.launchpad.net/~mahfiaz/openlp/unicode_warning_fix/+merge/85121

Ensure that action category names are unicode, to prevent warnings on comparison. Also a fix for a path problem.
-- 
https://code.launchpad.net/~mahfiaz/openlp/unicode_warning_fix/+merge/85121
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/__init__.py'
--- openlp/core/lib/__init__.py	2011-10-01 07:28:45 +0000
+++ openlp/core/lib/__init__.py	2011-12-09 12:38:35 +0000
@@ -191,10 +191,10 @@
     ``thumb_path``
         The path to the thumb.
     """
-    if not os.path.exists(unicode(thumb_path)):
+    if not os.path.exists(thumb_path):
         return False
-    image_date = os.stat(unicode(file_path)).st_mtime
-    thumb_date = os.stat(unicode(thumb_path)).st_mtime
+    image_date = os.stat(file_path).st_mtime
+    thumb_date = os.stat(thumb_path).st_mtime
     return image_date <= thumb_date
 
 def resize_image(image_path, width, height, background=u'#000000'):

=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py	2011-12-05 21:40:56 +0000
+++ openlp/core/ui/mainwindow.py	2011-12-09 12:38:35 +0000
@@ -176,92 +176,100 @@
             self.themeManagerDock)
         # Create the menu items
         action_list = ActionList.get_instance()
-        action_list.add_category(UiStrings().File, CategoryOrder.standardMenu)
+        action_list.add_category(unicode(UiStrings().File),
+            CategoryOrder.standardMenu)
         self.fileNewItem = shortcut_action(mainWindow, u'fileNewItem',
             [QtGui.QKeySequence(u'Ctrl+N')],
             self.serviceManagerContents.onNewServiceClicked,
-            u':/general/general_new.png', category=UiStrings().File)
+            u':/general/general_new.png', category=unicode(UiStrings().File))
         self.fileOpenItem = shortcut_action(mainWindow, u'fileOpenItem',
             [QtGui.QKeySequence(u'Ctrl+O')],
             self.serviceManagerContents.onLoadServiceClicked,
-            u':/general/general_open.png', category=UiStrings().File)
+            u':/general/general_open.png', category=unicode(UiStrings().File))
         self.fileSaveItem = shortcut_action(mainWindow, u'fileSaveItem',
             [QtGui.QKeySequence(u'Ctrl+S')],
             self.serviceManagerContents.saveFile,
-            u':/general/general_save.png', category=UiStrings().File)
+            u':/general/general_save.png', category=unicode(UiStrings().File))
         self.fileSaveAsItem = shortcut_action(mainWindow, u'fileSaveAsItem',
             [QtGui.QKeySequence(u'Ctrl+Shift+S')],
-            self.serviceManagerContents.saveFileAs, category=UiStrings().File)
+            self.serviceManagerContents.saveFileAs,
+            category=unicode(UiStrings().File))
         self.printServiceOrderItem = shortcut_action(mainWindow,
             u'printServiceItem', [QtGui.QKeySequence(u'Ctrl+P')],
             self.serviceManagerContents.printServiceOrder,
-            category=UiStrings().File)
+            category=unicode(UiStrings().File))
         self.fileExitItem = shortcut_action(mainWindow, u'fileExitItem',
             [QtGui.QKeySequence(u'Alt+F4')], mainWindow.close,
-            u':/system/system_exit.png', category=UiStrings().File)
-        action_list.add_category(UiStrings().Import, CategoryOrder.standardMenu)
+            u':/system/system_exit.png', category=unicode(UiStrings().File))
+        action_list.add_category(unicode(UiStrings().Import),
+            CategoryOrder.standardMenu)
         self.importThemeItem = base_action(
-            mainWindow, u'importThemeItem', UiStrings().Import)
+            mainWindow, u'importThemeItem', unicode(UiStrings().Import))
         self.importLanguageItem = base_action(
-            mainWindow, u'importLanguageItem')#, UiStrings().Import)
-        action_list.add_category(UiStrings().Export, CategoryOrder.standardMenu)
+            mainWindow, u'importLanguageItem')#, unicode(UiStrings().Import))
+        action_list.add_category(unicode(UiStrings().Export),
+            CategoryOrder.standardMenu)
         self.exportThemeItem = base_action(
-            mainWindow, u'exportThemeItem', UiStrings().Export)
+            mainWindow, u'exportThemeItem', unicode(UiStrings().Export))
         self.exportLanguageItem = base_action(
-            mainWindow, u'exportLanguageItem')#, UiStrings().Export)
-        action_list.add_category(UiStrings().View, CategoryOrder.standardMenu)
+            mainWindow, u'exportLanguageItem')#, unicode(UiStrings().Export))
+        action_list.add_category(unicode(UiStrings().View),
+            CategoryOrder.standardMenu)
         self.viewMediaManagerItem = shortcut_action(mainWindow,
             u'viewMediaManagerItem', [QtGui.QKeySequence(u'F8')],
             self.toggleMediaManager, u':/system/system_mediamanager.png',
-            self.mediaManagerDock.isVisible(), UiStrings().View)
+            self.mediaManagerDock.isVisible(), unicode(UiStrings().View))
         self.viewThemeManagerItem = shortcut_action(mainWindow,
             u'viewThemeManagerItem', [QtGui.QKeySequence(u'F10')],
             self.toggleThemeManager, u':/system/system_thememanager.png',
-            self.themeManagerDock.isVisible(), UiStrings().View)
+            self.themeManagerDock.isVisible(), unicode(UiStrings().View))
         self.viewServiceManagerItem = shortcut_action(mainWindow,
             u'viewServiceManagerItem', [QtGui.QKeySequence(u'F9')],
             self.toggleServiceManager, u':/system/system_servicemanager.png',
-            self.serviceManagerDock.isVisible(), UiStrings().View)
+            self.serviceManagerDock.isVisible(), unicode(UiStrings().View))
         self.viewPreviewPanel = shortcut_action(mainWindow,
             u'viewPreviewPanel', [QtGui.QKeySequence(u'F11')],
             self.setPreviewPanelVisibility, checked=previewVisible,
-            category=UiStrings().View)
+            category=unicode(UiStrings().View))
         self.viewLivePanel = shortcut_action(mainWindow, u'viewLivePanel',
             [QtGui.QKeySequence(u'F12')], self.setLivePanelVisibility,
-            checked=liveVisible, category=UiStrings().View)
+            checked=liveVisible, category=unicode(UiStrings().View))
         self.lockPanel = shortcut_action(mainWindow, u'lockPanel',
             None, self.setLockPanel,
             checked=panelLocked, category=None)
-        action_list.add_category(UiStrings().ViewMode,
+        action_list.add_category(unicode(UiStrings().ViewMode),
             CategoryOrder.standardMenu)
         self.modeDefaultItem = checkable_action(
-            mainWindow, u'modeDefaultItem', category=UiStrings().ViewMode)
+            mainWindow, u'modeDefaultItem',
+            category=unicode(UiStrings().ViewMode))
         self.modeSetupItem = checkable_action(
-            mainWindow, u'modeSetupItem', category=UiStrings().ViewMode)
+            mainWindow, u'modeSetupItem',
+            category=unicode(UiStrings().ViewMode))
         self.modeLiveItem = checkable_action(
-            mainWindow, u'modeLiveItem', True, UiStrings().ViewMode)
+            mainWindow, u'modeLiveItem', True, unicode(UiStrings().ViewMode))
         self.modeGroup = QtGui.QActionGroup(mainWindow)
         self.modeGroup.addAction(self.modeDefaultItem)
         self.modeGroup.addAction(self.modeSetupItem)
         self.modeGroup.addAction(self.modeLiveItem)
         self.modeDefaultItem.setChecked(True)
-        action_list.add_category(UiStrings().Tools, CategoryOrder.standardMenu)
+        action_list.add_category(unicode(UiStrings().Tools),
+            CategoryOrder.standardMenu)
         self.toolsAddToolItem = icon_action(mainWindow, u'toolsAddToolItem',
-            u':/tools/tools_add.png', category=UiStrings().Tools)
+            u':/tools/tools_add.png', category=unicode(UiStrings().Tools))
         self.toolsOpenDataFolder = icon_action(mainWindow,
             u'toolsOpenDataFolder', u':/general/general_open.png',
-            category=UiStrings().Tools)
+            category=unicode(UiStrings().Tools))
         self.toolsFirstTimeWizard = icon_action(mainWindow,
             u'toolsFirstTimeWizard', u':/general/general_revert.png',
-            category=UiStrings().Tools)
+            category=unicode(UiStrings().Tools))
         self.updateThemeImages = base_action(mainWindow,
-            u'updateThemeImages', category=UiStrings().Tools)
-        action_list.add_category(UiStrings().Settings,
+            u'updateThemeImages', category=unicode(UiStrings().Tools))
+        action_list.add_category(unicode(UiStrings().Settings),
             CategoryOrder.standardMenu)
         self.settingsPluginListItem = shortcut_action(mainWindow,
             u'settingsPluginListItem', [QtGui.QKeySequence(u'Alt+F7')],
             self.onPluginItemClicked, u':/system/settings_plugin_list.png',
-            category=UiStrings().Settings)
+            category=unicode(UiStrings().Settings))
         # i18n Language Items
         self.autoLanguageItem = checkable_action(mainWindow,
             u'autoLanguageItem', LanguageManager.auto_language)
@@ -278,35 +286,38 @@
         self.settingsShortcutsItem = icon_action(mainWindow,
             u'settingsShortcutsItem',
             u':/system/system_configure_shortcuts.png',
-            category=UiStrings().Settings)
+            category=unicode(UiStrings().Settings))
         # Formatting Tags were also known as display tags.
         self.formattingTagItem = icon_action(mainWindow,
             u'displayTagItem', u':/system/tag_editor.png',
-            category=UiStrings().Settings)
+            category=unicode(UiStrings().Settings))
         self.settingsConfigureItem = icon_action(mainWindow,
             u'settingsConfigureItem', u':/system/system_settings.png',
-            category=UiStrings().Settings)
+            category=unicode(UiStrings().Settings))
         self.settingsImportItem = base_action(mainWindow,
-           u'settingsImportItem', category=UiStrings().Settings)
+           u'settingsImportItem', category=unicode(UiStrings().Settings))
         self.settingsExportItem = base_action(mainWindow,
-           u'settingsExportItem', category=UiStrings().Settings)
-        action_list.add_category(UiStrings().Help, CategoryOrder.standardMenu)
+           u'settingsExportItem', category=unicode(UiStrings().Settings))
+        action_list.add_category(unicode(UiStrings().Help),
+            CategoryOrder.standardMenu)
         self.aboutItem = shortcut_action(mainWindow, u'aboutItem',
             [QtGui.QKeySequence(u'Ctrl+F1')], self.onAboutItemClicked,
-            u':/system/system_about.png', category=UiStrings().Help)
+            u':/system/system_about.png', category=unicode(UiStrings().Help))
         if os.name == u'nt':
             self.localHelpFile = os.path.join(
                 AppLocation.get_directory(AppLocation.AppDir), 'OpenLP.chm')
             self.offlineHelpItem = shortcut_action(
                 mainWindow, u'offlineHelpItem', [QtGui.QKeySequence(u'F1')],
                 self.onOfflineHelpClicked,
-                u':/system/system_help_contents.png', category=UiStrings().Help)
+                u':/system/system_help_contents.png',
+                category=unicode(UiStrings().Help))
         self.onlineHelpItem = shortcut_action(
             mainWindow, u'onlineHelpItem',
             [QtGui.QKeySequence(u'Alt+F1')], self.onOnlineHelpClicked,
-            u':/system/system_online_help.png', category=UiStrings().Help)
+            u':/system/system_online_help.png',
+            category=unicode(UiStrings().Help))
         self.webSiteItem = base_action(
-            mainWindow, u'webSiteItem', category=UiStrings().Help)
+            mainWindow, u'webSiteItem', category=unicode(UiStrings().Help))
         add_actions(self.fileImportMenu, (self.settingsImportItem, None,
             self.importThemeItem, self.importLanguageItem))
         add_actions(self.fileExportMenu, (self.settingsExportItem, None,

=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py	2011-12-02 20:17:57 +0000
+++ openlp/core/ui/servicemanager.py	2011-12-09 12:38:35 +0000
@@ -177,9 +177,9 @@
         self.serviceManagerList.moveTop.setObjectName(u'moveTop')
         action_list = ActionList.get_instance()
         action_list.add_category(
-            UiStrings().Service, CategoryOrder.standardToolbar)
+            unicode(UiStrings().Service), CategoryOrder.standardToolbar)
         action_list.add_action(
-            self.serviceManagerList.moveTop, UiStrings().Service)
+            self.serviceManagerList.moveTop, unicode(UiStrings().Service))
         self.serviceManagerList.moveUp = self.orderToolbar.addToolbarButton(
             translate('OpenLP.ServiceManager', 'Move &up'),
             u':/services/service_up.png',
@@ -188,7 +188,7 @@
             self.onServiceUp, shortcuts=[QtCore.Qt.Key_PageUp])
         self.serviceManagerList.moveUp.setObjectName(u'moveUp')
         action_list.add_action(
-            self.serviceManagerList.moveUp, UiStrings().Service)
+            self.serviceManagerList.moveUp, unicode(UiStrings().Service))
         self.serviceManagerList.moveDown = self.orderToolbar.addToolbarButton(
             translate('OpenLP.ServiceManager', 'Move &down'),
             u':/services/service_down.png',
@@ -197,7 +197,7 @@
             self.onServiceDown, shortcuts=[QtCore.Qt.Key_PageDown])
         self.serviceManagerList.moveDown.setObjectName(u'moveDown')
         action_list.add_action(
-            self.serviceManagerList.moveDown, UiStrings().Service)
+            self.serviceManagerList.moveDown, unicode(UiStrings().Service))
         self.serviceManagerList.moveBottom = self.orderToolbar.addToolbarButton(
             translate('OpenLP.ServiceManager', 'Move to &bottom'),
             u':/services/service_bottom.png',
@@ -206,7 +206,7 @@
             self.onServiceEnd, shortcuts=[QtCore.Qt.Key_End])
         self.serviceManagerList.moveBottom.setObjectName(u'moveBottom')
         action_list.add_action(
-            self.serviceManagerList.moveBottom, UiStrings().Service)
+            self.serviceManagerList.moveBottom, unicode(UiStrings().Service))
         self.serviceManagerList.down = self.orderToolbar.addToolbarButton(
             translate('OpenLP.ServiceManager', 'Move &down'),
             None,
@@ -241,7 +241,7 @@
             self.onExpandAll, shortcuts=[QtCore.Qt.Key_Plus])
         self.serviceManagerList.expand.setObjectName(u'expand')
         action_list.add_action(
-            self.serviceManagerList.expand, UiStrings().Service)
+            self.serviceManagerList.expand, unicode(UiStrings().Service))
         self.serviceManagerList.collapse = self.orderToolbar.addToolbarButton(
             translate('OpenLP.ServiceManager', '&Collapse all'),
             u':/services/service_collapse_all.png',
@@ -250,7 +250,7 @@
             self.onCollapseAll, shortcuts=[QtCore.Qt.Key_Minus])
         self.serviceManagerList.collapse.setObjectName(u'collapse')
         action_list.add_action(
-            self.serviceManagerList.collapse, UiStrings().Service)
+            self.serviceManagerList.collapse, unicode(UiStrings().Service))
         self.orderToolbar.addSeparator()
         self.serviceManagerList.makeLive = self.orderToolbar.addToolbarButton(
             translate('OpenLP.ServiceManager', 'Go Live'),
@@ -260,7 +260,7 @@
             shortcuts=[QtCore.Qt.Key_Enter, QtCore.Qt.Key_Return])
         self.serviceManagerList.makeLive.setObjectName(u'orderToolbar')
         action_list.add_action(
-            self.serviceManagerList.makeLive, UiStrings().Service)
+            self.serviceManagerList.makeLive, unicode(UiStrings().Service))
         self.layout.addWidget(self.orderToolbar)
         # Connect up our signals and slots
         QtCore.QObject.connect(self.themeComboBox,

=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py	2011-12-03 13:40:48 +0000
+++ openlp/core/ui/slidecontroller.py	2011-12-09 12:38:35 +0000
@@ -187,18 +187,20 @@
                 translate('OpenLP.SlideController', 'Hide'), self.toolbar))
             self.blankScreen = shortcut_action(self.hideMenu, u'blankScreen',
                 [QtCore.Qt.Key_Period], self.onBlankDisplay,
-                u':/slides/slide_blank.png', False, UiStrings().LiveToolbar)
+                u':/slides/slide_blank.png', False, 
+                unicode(UiStrings().LiveToolbar))
             self.blankScreen.setText(
                 translate('OpenLP.SlideController', 'Blank Screen'))
             self.themeScreen = shortcut_action(self.hideMenu, u'themeScreen',
                 [QtGui.QKeySequence(u'T')], self.onThemeDisplay,
-                u':/slides/slide_theme.png', False, UiStrings().LiveToolbar)
+                u':/slides/slide_theme.png', False,
+                unicode(UiStrings().LiveToolbar))
             self.themeScreen.setText(
                 translate('OpenLP.SlideController', 'Blank to Theme'))
             self.desktopScreen = shortcut_action(self.hideMenu,
                 u'desktopScreen', [QtGui.QKeySequence(u'D')],
                 self.onHideDisplay, u':/slides/slide_desktop.png', False,
-                UiStrings().LiveToolbar)
+                unicode(UiStrings().LiveToolbar))
             self.desktopScreen.setText(
                 translate('OpenLP.SlideController', 'Show Desktop'))
             self.hideMenu.setDefaultAction(self.blankScreen)
@@ -218,11 +220,13 @@
                 self.toolbar))
             self.playSlidesLoop = shortcut_action(self.playSlidesMenu,
                 u'playSlidesLoop', [], self.onPlaySlidesLoop,
-                u':/media/media_time.png', False, UiStrings().LiveToolbar)
+                u':/media/media_time.png', False,
+                unicode(UiStrings().LiveToolbar))
             self.playSlidesLoop.setText(UiStrings().PlaySlidesInLoop)
             self.playSlidesOnce = shortcut_action(self.playSlidesMenu,
                 u'playSlidesOnce', [], self.onPlaySlidesOnce,
-                u':/media/media_time.png', False, UiStrings().LiveToolbar)
+                u':/media/media_time.png', False,
+                unicode(UiStrings().LiveToolbar))
             self.playSlidesOnce.setText(UiStrings().PlaySlidesToEnd)
             if QtCore.QSettings().value(self.parent().generalSettingsSection +
                 u'/enable slide loop', QtCore.QVariant(True)).toBool():
@@ -320,7 +324,7 @@
             self.shortcutTimer.setSingleShot(True)
             self.verseShortcut = shortcut_action(self, u'verseShortcut',
                 [QtGui.QKeySequence(u'V')], self.slideShortcutActivated,
-                category=UiStrings().LiveToolbar,
+                category=unicode(UiStrings().LiveToolbar),
                 context=QtCore.Qt.WidgetWithChildrenShortcut)
             self.verseShortcut.setText(translate(
                 'OpenLP.SlideController', 'Go to "Verse"'))
@@ -356,37 +360,37 @@
                 context=QtCore.Qt.WidgetWithChildrenShortcut)
             self.chorusShortcut = shortcut_action(self, u'chorusShortcut',
                 [QtGui.QKeySequence(u'C')], self.slideShortcutActivated,
-                category=UiStrings().LiveToolbar,
+                category=unicode(UiStrings().LiveToolbar),
                 context=QtCore.Qt.WidgetWithChildrenShortcut)
             self.chorusShortcut.setText(translate(
                 'OpenLP.SlideController', 'Go to "Chorus"'))
             self.bridgeShortcut = shortcut_action(self, u'bridgeShortcut',
                 [QtGui.QKeySequence(u'B')], self.slideShortcutActivated,
-                category=UiStrings().LiveToolbar,
+                category=unicode(UiStrings().LiveToolbar),
                 context=QtCore.Qt.WidgetWithChildrenShortcut)
             self.bridgeShortcut.setText(translate(
                 'OpenLP.SlideController', 'Go to "Bridge"'))
             self.preChorusShortcut = shortcut_action(self, u'preChorusShortcut',
                 [QtGui.QKeySequence(u'P')], self.slideShortcutActivated,
-                category=UiStrings().LiveToolbar,
+                category=unicode(UiStrings().LiveToolbar),
                 context=QtCore.Qt.WidgetWithChildrenShortcut)
             self.preChorusShortcut.setText(translate(
                 'OpenLP.SlideController', 'Go to "Pre-Chorus"'))
             self.introShortcut = shortcut_action(self, u'introShortcut',
                 [QtGui.QKeySequence(u'I')], self.slideShortcutActivated,
-                category=UiStrings().LiveToolbar,
+                category=unicode(UiStrings().LiveToolbar),
                 context=QtCore.Qt.WidgetWithChildrenShortcut)
             self.introShortcut.setText(translate(
                 'OpenLP.SlideController', 'Go to "Intro"'))
             self.endingShortcut = shortcut_action(self, u'endingShortcut',
                 [QtGui.QKeySequence(u'E')], self.slideShortcutActivated,
-                category=UiStrings().LiveToolbar,
+                category=unicode(UiStrings().LiveToolbar),
                 context=QtCore.Qt.WidgetWithChildrenShortcut)
             self.endingShortcut.setText(translate(
                 'OpenLP.SlideController', 'Go to "Ending"'))
             self.otherShortcut = shortcut_action(self, u'otherShortcut',
                 [QtGui.QKeySequence(u'O')], self.slideShortcutActivated,
-                category=UiStrings().LiveToolbar,
+                category=unicode(UiStrings().LiveToolbar),
                 context=QtCore.Qt.WidgetWithChildrenShortcut)
             self.otherShortcut.setText(translate(
                 'OpenLP.SlideController', 'Go to "Other"'))
@@ -540,24 +544,24 @@
         self.nextItem.setObjectName(u'nextItemLive')
         action_list = ActionList.get_instance()
         action_list.add_category(
-            UiStrings().LiveToolbar, CategoryOrder.standardToolbar)
+            unicode(UiStrings().LiveToolbar), CategoryOrder.standardToolbar)
         action_list.add_action(self.previousItem)
         action_list.add_action(self.nextItem)
         self.previousService = shortcut_action(parent, u'previousService',
             [QtCore.Qt.Key_Left], self.servicePrevious,
-            category=UiStrings().LiveToolbar,
+            category=unicode(UiStrings().LiveToolbar),
             context=QtCore.Qt.WidgetWithChildrenShortcut)
         self.previousService.setText(
             translate('OpenLP.SlideController', 'Previous Service'))
         self.nextService = shortcut_action(parent, 'nextService',
             [QtCore.Qt.Key_Right], self.serviceNext,
-            category=UiStrings().LiveToolbar,
+            category=unicode(UiStrings().LiveToolbar),
             context=QtCore.Qt.WidgetWithChildrenShortcut)
         self.nextService.setText(
             translate('OpenLP.SlideController', 'Next Service'))
         self.escapeItem = shortcut_action(parent, 'escapeItem',
             [QtCore.Qt.Key_Escape], self.liveEscape,
-            category=UiStrings().LiveToolbar,
+            category=unicode(UiStrings().LiveToolbar),
             context=QtCore.Qt.WidgetWithChildrenShortcut)
         self.escapeItem.setText(
             translate('OpenLP.SlideController', 'Escape Item'))

=== modified file 'openlp/core/utils/actions.py'
--- openlp/core/utils/actions.py	2011-12-06 19:25:12 +0000
+++ openlp/core/utils/actions.py	2011-12-09 12:38:35 +0000
@@ -217,8 +217,6 @@
             The weight specifies how important a category is. However, this only
             has an impact on the order the categories are displayed.
         """
-        if category is not None:
-            category = unicode(category)
         if category not in self.categories:
             self.categories.append(category)
         action.defaultShortcuts = action.shortcuts()
@@ -226,7 +224,7 @@
             self.categories[category].actions.append(action)
         else:
             self.categories[category].actions.add(action, weight)
-        if category is None:
+        if not category:
             # Stop here, as this action is not configurable.
             return
         # Load the shortcut from the config.
@@ -250,8 +248,6 @@
             The name (unicode string) of the category, which contains the
             action. Defaults to None.
         """
-        if category is not None:
-            category = unicode(category)
         if category not in self.categories:
             return
         self.categories[category].actions.remove(action)

=== modified file 'openlp/plugins/alerts/alertsplugin.py'
--- openlp/plugins/alerts/alertsplugin.py	2011-10-30 20:24:04 +0000
+++ openlp/plugins/alerts/alertsplugin.py	2011-12-09 12:38:35 +0000
@@ -149,7 +149,7 @@
         Plugin.initialise(self)
         self.toolsAlertItem.setVisible(True)
         action_list = ActionList.get_instance()
-        action_list.add_action(self.toolsAlertItem, UiStrings().Tools)
+        action_list.add_action(self.toolsAlertItem, unicode(UiStrings().Tools))
 
     def finalise(self):
         """

=== modified file 'openlp/plugins/bibles/bibleplugin.py'
--- openlp/plugins/bibles/bibleplugin.py	2011-08-29 12:59:19 +0000
+++ openlp/plugins/bibles/bibleplugin.py	2011-12-09 12:38:35 +0000
@@ -55,9 +55,11 @@
         Plugin.initialise(self)
         self.importBibleItem.setVisible(True)
         action_list = ActionList.get_instance()
-        action_list.add_action(self.importBibleItem, UiStrings().Import)
+        action_list.add_action(self.importBibleItem,
+            unicode(UiStrings().Import))
         # Do not add the action to the list yet.
-        #action_list.add_action(self.exportBibleItem, UiStrings().Export)
+        #action_list.add_action(self.exportBibleItem,
+        #    unicode(UiStrings().Export))
         # Set to invisible until we can export bibles
         self.exportBibleItem.setVisible(False)
         if len(self.manager.old_bible_databases):
@@ -71,7 +73,8 @@
         self.manager.finalise()
         Plugin.finalise(self)
         action_list = ActionList.get_instance()
-        action_list.remove_action(self.importBibleItem, UiStrings().Import)
+        action_list.remove_action(self.importBibleItem,
+            unicode(UiStrings().Import))
         self.importBibleItem.setVisible(False)
         #action_list.remove_action(self.exportBibleItem, UiStrings().Export)
         self.exportBibleItem.setVisible(False)

=== modified file 'openlp/plugins/images/lib/mediaitem.py'
--- openlp/plugins/images/lib/mediaitem.py	2011-11-26 20:32:47 +0000
+++ openlp/plugins/images/lib/mediaitem.py	2011-12-09 12:38:35 +0000
@@ -127,13 +127,13 @@
                 self.plugin.formparent.incrementProgressBar()
             filename = os.path.split(unicode(imageFile))[1]
             thumb = os.path.join(self.servicePath, filename)
-            if not os.path.exists(imageFile):
+            if not os.path.exists(unicode(imageFile)):
                 icon = build_icon(u':/general/general_delete.png')
             else:
-                if validate_thumb(imageFile, thumb):
+                if validate_thumb(unicode(imageFile), thumb):
                     icon = build_icon(thumb)
                 else:
-                    icon = create_thumb(imageFile, thumb)
+                    icon = create_thumb(unicode(imageFile), thumb)
             item_name = QtGui.QListWidgetItem(filename)
             item_name.setIcon(icon)
             item_name.setToolTip(imageFile)

=== modified file 'openlp/plugins/songs/songsplugin.py'
--- openlp/plugins/songs/songsplugin.py	2011-12-03 13:32:19 +0000
+++ openlp/plugins/songs/songsplugin.py	2011-12-09 12:38:35 +0000
@@ -74,9 +74,10 @@
         self.songExportItem.setVisible(True)
         self.toolsReindexItem.setVisible(True)
         action_list = ActionList.get_instance()
-        action_list.add_action(self.songImportItem, UiStrings().Import)
-        action_list.add_action(self.songExportItem, UiStrings().Export)
-        action_list.add_action(self.toolsReindexItem, UiStrings().Tools)
+        action_list.add_action(self.songImportItem, unicode(UiStrings().Import))
+        action_list.add_action(self.songExportItem, unicode(UiStrings().Export))
+        action_list.add_action(self.toolsReindexItem,
+            unicode(UiStrings().Tools))
 
     def addImportMenuItem(self, import_menu):
         """
@@ -269,7 +270,10 @@
         self.songExportItem.setVisible(False)
         self.toolsReindexItem.setVisible(False)
         action_list = ActionList.get_instance()
-        action_list.remove_action(self.songImportItem, UiStrings().Import)
-        action_list.remove_action(self.songExportItem, UiStrings().Export)
-        action_list.remove_action(self.toolsReindexItem, UiStrings().Tools)
+        action_list.remove_action(self.songImportItem,
+            unicode(UiStrings().Import))
+        action_list.remove_action(self.songExportItem,
+            unicode(UiStrings().Export))
+        action_list.remove_action(self.toolsReindexItem,
+            unicode(UiStrings().Tools))
         Plugin.finalise(self)

=== modified file 'openlp/plugins/songusage/songusageplugin.py'
--- openlp/plugins/songusage/songusageplugin.py	2011-12-03 13:32:19 +0000
+++ openlp/plugins/songusage/songusageplugin.py	2011-12-09 12:38:35 +0000
@@ -136,11 +136,11 @@
         self.setButtonState()
         action_list = ActionList.get_instance()
         action_list.add_action(self.songUsageStatus,
-            translate('SongUsagePlugin', 'Song Usage'))
+            unicode(translate('SongUsagePlugin', 'Song Usage')))
         action_list.add_action(self.songUsageDelete,
-            translate('SongUsagePlugin', 'Song Usage'))
+            unicode(translate('SongUsagePlugin', 'Song Usage')))
         action_list.add_action(self.songUsageReport,
-            translate('SongUsagePlugin', 'Song Usage'))
+            unicode(translate('SongUsagePlugin', 'Song Usage')))
         self.songUsageDeleteForm = SongUsageDeleteForm(self.manager,
             self.formparent)
         self.songUsageDetailForm = SongUsageDetailForm(self, self.formparent)
@@ -157,11 +157,11 @@
         self.songUsageMenu.menuAction().setVisible(False)
         action_list = ActionList.get_instance()
         action_list.remove_action(self.songUsageStatus,
-            translate('SongUsagePlugin', 'Song Usage'))
+            unicode(translate('SongUsagePlugin', 'Song Usage')))
         action_list.remove_action(self.songUsageDelete,
-            translate('SongUsagePlugin', 'Song Usage'))
+            unicode(translate('SongUsagePlugin', 'Song Usage')))
         action_list.remove_action(self.songUsageReport,
-            translate('SongUsagePlugin', 'Song Usage'))
+            unicode(translate('SongUsagePlugin', 'Song Usage')))
         self.songUsageActiveButton.hide()
         # stop any events being processed
         self.songUsageActive = False


Follow ups