openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #06129
[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)
For more details, see:
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/49175
More UiStrings
Fix UiStrings sentence case - still unsure about plugin item names, do we so stuff to songs or Songs?
Button box rearranging
Fix failure to grab Impress on close (Support #38) - looks like Support 79 is probably the same just for PowerPoint.
On closer inspection it appears 79 is happening in spite of having error handling in place. A look at http://oreilly.com/catalog/pythonwin32/chapter/ch12.html seems to say we should be using pythoncom.com_error. Anyone have any opinions on switching all those except com_error lines in powerpointcontroller.py?
--
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/49175
Your team OpenLP Core is requested to review the proposed merge of lp:~meths/openlp/trivialfixes into lp:openlp.
=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py 2011-02-05 18:01:08 +0000
+++ openlp/core/lib/mediamanageritem.py 2011-02-10 04:44:59 +0000
@@ -500,7 +500,7 @@
"""
if not self.listView.selectedIndexes() and not self.remoteTriggered:
QtGui.QMessageBox.information(self,
- translate('OpenLP.MediaManagerItem', 'No items selected'),
+ translate('OpenLP.MediaManagerItem', 'No Items Selected'),
translate('OpenLP.MediaManagerItem',
'You must select one or more items'))
else:
=== modified file 'openlp/core/lib/ui.py'
--- openlp/core/lib/ui.py 2011-02-09 17:30:38 +0000
+++ openlp/core/lib/ui.py 2011-02-10 04:44:59 +0000
@@ -41,16 +41,18 @@
# These strings should need a good reason to be retranslated elsewhere.
# Should some/more/less of these have an & attached?
Add = translate('OpenLP.Ui', '&Add')
- AddANew = unicode(translate('OpenLP.Ui', 'Add a new %s'))
+ AddANew = unicode(translate('OpenLP.Ui', 'Add a new %s.'))
AddSelectService = unicode(translate('OpenLP.Ui',
- 'Add the selected %s to the service'))
+ 'Add the selected %s to the service.'))
+ Advanced = translate('OpenLP.Ui', 'Advanced')
AllFiles = translate('OpenLP.Ui', 'All Files')
Authors = translate('OpenLP.Ui', 'Authors')
+ CreateANew = unicode(translate('OpenLP.Ui', 'Create a new %s.'))
Delete = translate('OpenLP.Ui', '&Delete')
- DeleteSelect = unicode(translate('OpenLP.Ui', 'Delete the selected %s'))
+ DeleteSelect = unicode(translate('OpenLP.Ui', 'Delete the selected %s.'))
DeleteType = unicode(translate('OpenLP.Ui', 'Delete %s'))
Edit = translate('OpenLP.Ui', '&Edit')
- EditSelect = unicode(translate('OpenLP.Ui', 'Edit the selected %s'))
+ EditSelect = unicode(translate('OpenLP.Ui', 'Edit the selected %s.'))
EditType = unicode(translate('OpenLP.Ui', 'Edit %s'))
Error = translate('OpenLP.Ui', 'Error')
ExportType = unicode(translate('OpenLP.Ui', 'Export %s'))
@@ -58,14 +60,18 @@
ImportType = unicode(translate('OpenLP.Ui', 'Import %s'))
Live = translate('OpenLP.Ui', 'Live')
Load = translate('OpenLP.Ui', 'Load')
- LoadANew = unicode(translate('OpenLP.Ui', 'Load a new %s'))
+ LoadANew = unicode(translate('OpenLP.Ui', 'Load a new %s.'))
New = translate('OpenLP.Ui', 'New')
NewType = unicode(translate('OpenLP.Ui', 'New %s'))
OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0')
Preview = translate('OpenLP.Ui', 'Preview')
- PreviewSelect = unicode(translate('OpenLP.Ui', 'Preview the selected %s'))
+ PreviewSelect = unicode(translate('OpenLP.Ui', 'Preview the selected %s.'))
+ ReplaceBG = translate('OpenLP.Ui', 'Replace Background')
+ ReplaceLiveBG = translate('OpenLP.Ui', 'Replace Live Background')
+ ResetBG = translate('OpenLP.Ui', 'Reset Background')
+ ResetLiveBG = translate('OpenLP.Ui', 'Reset Live Background')
SendSelectLive = unicode(translate('OpenLP.Ui',
- 'Send the selected %s live'))
+ 'Send the selected %s live.'))
Service = translate('OpenLP.Ui', 'Service')
Theme = translate('OpenLP.Ui', 'Theme')
Themes = translate('OpenLP.Ui', 'Themes')
@@ -98,18 +104,25 @@
parent.welcomeLayout.addStretch()
parent.addPage(parent.welcomePage)
-def create_save_cancel_button_box(parent):
+def create_accept_reject_button_box(parent, okay=False):
"""
- Creates a standard dialog button box with save and cancel buttons. The
- button box is connected to the parent's ``accept()`` and ``reject()``
+ Creates a standard dialog button box with two buttons. The buttons default
+ to save and cancel but the ``okay`` parameter can be used to make the
+ buttons okay and cancel instead.
+ The button box is connected to the parent's ``accept()`` and ``reject()``
methods to handle the default ``accepted()`` and ``rejected()`` signals.
``parent``
The parent object. This should be a ``QWidget`` descendant.
+
+ ``okay``
+ If true creates an okay/cancel combination instead of save/cancel.
"""
button_box = QtGui.QDialogButtonBox(parent)
- button_box.setStandardButtons(
- QtGui.QDialogButtonBox.Save | QtGui.QDialogButtonBox.Cancel)
+ accept_button = QtGui.QDialogButtonBox.Save
+ if okay:
+ accept_button = QtGui.QDialogButtonBox.Ok
+ button_box.setStandardButtons(accept_button | QtGui.QDialogButtonBox.Cancel)
button_box.setObjectName(u'%sButtonBox' % parent)
QtCore.QObject.connect(button_box, QtCore.SIGNAL(u'accepted()'),
parent.accept)
=== modified file 'openlp/core/ui/advancedtab.py'
--- openlp/core/ui/advancedtab.py 2011-02-04 18:00:59 +0000
+++ openlp/core/ui/advancedtab.py 2011-02-10 04:44:59 +0000
@@ -29,6 +29,7 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab, translate
+from openlp.core.lib.ui import UiStrings
class AdvancedTab(SettingsTab):
"""
@@ -112,7 +113,7 @@
"""
Setup the interface translation strings.
"""
- self.tabTitleVisible = translate('OpenLP.AdvancedTab', 'Advanced')
+ self.tabTitleVisible = UiStrings.Advanced
self.uiGroupBox.setTitle(translate('OpenLP.AdvancedTab', 'UI Settings'))
self.recentLabel.setText(
translate('OpenLP.AdvancedTab',
=== modified file 'openlp/core/ui/exceptionform.py'
--- openlp/core/ui/exceptionform.py 2011-02-04 17:15:48 +0000
+++ openlp/core/ui/exceptionform.py 2011-02-10 04:44:59 +0000
@@ -56,6 +56,7 @@
from openlp.core.lib import translate, SettingsManager
from openlp.core.lib.mailto import mailto
+from openlp.core.lib.ui import UiStrings
from exceptiondialog import Ui_ExceptionDialog
@@ -176,8 +177,7 @@
self,translate('ImagePlugin.ExceptionDialog',
'Select Attachment'),
SettingsManager.get_last_dir(u'exceptions'),
- u'%s (*.*) (*)' %
- unicode(translate('ImagePlugin.MediaItem', 'All Files')))
+ u'%s (*.*) (*)' % UiStrings.AllFiles)
log.info(u'New files(s) %s', unicode(files))
if files:
self.fileAttachment = unicode(files)
=== modified file 'openlp/core/ui/filerenamedialog.py'
--- openlp/core/ui/filerenamedialog.py 2011-01-07 13:43:03 +0000
+++ openlp/core/ui/filerenamedialog.py 2011-02-10 04:44:59 +0000
@@ -27,30 +27,28 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate
+from openlp.core.lib.ui import create_accept_reject_button_box
class Ui_FileRenameDialog(object):
- def setupUi(self, FileRenameDialog):
- FileRenameDialog.setObjectName(u'FileRenameDialog')
- FileRenameDialog.resize(300, 10)
- self.dialogLayout = QtGui.QGridLayout(FileRenameDialog)
+ def setupUi(self, fileRenameDialog):
+ fileRenameDialog.setObjectName(u'fileRenameDialog')
+ fileRenameDialog.resize(300, 10)
+ self.dialogLayout = QtGui.QGridLayout(fileRenameDialog)
self.dialogLayout.setObjectName(u'dialogLayout')
- self.fileNameLabel = QtGui.QLabel(FileRenameDialog)
+ self.fileNameLabel = QtGui.QLabel(fileRenameDialog)
self.fileNameLabel.setObjectName(u'fileNameLabel')
self.dialogLayout.addWidget(self.fileNameLabel, 0, 0)
- self.fileNameEdit = QtGui.QLineEdit(FileRenameDialog)
+ self.fileNameEdit = QtGui.QLineEdit(fileRenameDialog)
self.fileNameEdit.setValidator(QtGui.QRegExpValidator(
QtCore.QRegExp(r'[^/\\?*|<>\[\]":<>+%]+'), self))
self.fileNameEdit.setObjectName(u'fileNameEdit')
self.dialogLayout.addWidget(self.fileNameEdit, 0, 1)
- self.buttonBox = QtGui.QDialogButtonBox(FileRenameDialog)
- self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel |
- QtGui.QDialogButtonBox.Ok)
- self.buttonBox.setObjectName(u'buttonBox')
+ self.buttonBox = create_accept_reject_button_box(fileRenameDialog, True)
self.dialogLayout.addWidget(self.buttonBox, 1, 0, 1, 2)
- self.retranslateUi(FileRenameDialog)
+ self.retranslateUi(fileRenameDialog)
self.setMaximumHeight(self.sizeHint().height())
- QtCore.QMetaObject.connectSlotsByName(FileRenameDialog)
+ QtCore.QMetaObject.connectSlotsByName(fileRenameDialog)
- def retranslateUi(self, FileRenameDialog):
+ def retranslateUi(self, fileRenameDialog):
self.fileNameLabel.setText(translate('OpenLP.FileRenameForm',
'New File Name:'))
=== modified file 'openlp/core/ui/filerenameform.py'
--- openlp/core/ui/filerenameform.py 2011-01-05 16:57:49 +0000
+++ openlp/core/ui/filerenameform.py 2011-02-10 04:44:59 +0000
@@ -37,10 +37,6 @@
def __init__(self, parent):
QtGui.QDialog.__init__(self, parent)
self.setupUi(self)
- QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'accepted()'),
- self.accept)
- QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'),
- self.reject)
def exec_(self, copy=False):
"""
@@ -51,5 +47,5 @@
'File Copy'))
else:
self.setWindowTitle(translate('OpenLP.FileRenameForm',
- 'File Rename'))
+ 'File Rename'))
return QtGui.QDialog.exec_(self)
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2011-02-09 05:04:12 +0000
+++ openlp/core/ui/mainwindow.py 2011-02-10 04:44:59 +0000
@@ -315,10 +315,9 @@
self.themeManagerDock.setWindowTitle(
translate('OpenLP.MainWindow', 'Theme Manager'))
self.FileNewItem.setText(translate('OpenLP.MainWindow', '&New'))
- self.FileNewItem.setToolTip(
- translate('OpenLP.MainWindow', 'New Service'))
+ self.FileNewItem.setToolTip(UiStrings.NewType % UiStrings.Service)
self.FileNewItem.setStatusTip(
- translate('OpenLP.MainWindow', 'Create a new service.'))
+ UiStrings.CreateANew % UiStrings.Service.toLower())
self.FileNewItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+N'))
self.FileOpenItem.setText(translate('OpenLP.MainWindow', '&Open'))
self.FileOpenItem.setToolTip(
=== modified file 'openlp/core/ui/serviceitemeditdialog.py'
--- openlp/core/ui/serviceitemeditdialog.py 2011-02-05 01:24:19 +0000
+++ openlp/core/ui/serviceitemeditdialog.py 2011-02-10 04:44:59 +0000
@@ -27,7 +27,7 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate
-from openlp.core.lib.ui import create_save_cancel_button_box, \
+from openlp.core.lib.ui import create_accept_reject_button_box, \
create_delete_push_button, create_up_down_push_button_set
class Ui_ServiceItemEditDialog(object):
@@ -50,7 +50,7 @@
self.buttonLayout.addWidget(self.downButton)
self.dialogLayout.addLayout(self.buttonLayout, 0, 1)
self.dialogLayout.addWidget(
- create_save_cancel_button_box(serviceItemEditDialog), 1, 0, 1, 2)
+ create_accept_reject_button_box(serviceItemEditDialog), 1, 0, 1, 2)
self.retranslateUi(serviceItemEditDialog)
QtCore.QMetaObject.connectSlotsByName(serviceItemEditDialog)
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py 2011-02-06 20:26:32 +0000
+++ openlp/core/ui/servicemanager.py 2011-02-10 04:44:59 +0000
@@ -35,7 +35,7 @@
from openlp.core.lib import OpenLPToolbar, ServiceItem, context_menu_action, \
Receiver, build_icon, ItemCapabilities, SettingsManager, translate, \
ThemeLevel
-from openlp.core.lib.ui import critical_error_message_box
+from openlp.core.lib.ui import UiStrings, critical_error_message_box
from openlp.core.ui import ServiceNoteForm, ServiceItemEditForm
from openlp.core.ui.printserviceorderform import PrintServiceOrderForm
from openlp.core.utils import AppLocation, delete_file, file_is_unicode, \
@@ -95,9 +95,9 @@
# Create the top toolbar
self.toolbar = OpenLPToolbar(self)
self.toolbar.addToolbarButton(
- translate('OpenLP.ServiceManager', 'New Service'),
+ UiStrings.NewType % UiStrings.Service,
u':/general/general_new.png',
- translate('OpenLP.ServiceManager', 'Create a new service'),
+ UiStrings.CreateANew % UiStrings.Service.toLower(),
self.onNewServiceClicked)
self.toolbar.addToolbarButton(
translate('OpenLP.ServiceManager', 'Open Service'),
=== modified file 'openlp/core/ui/servicenoteform.py'
--- openlp/core/ui/servicenoteform.py 2011-02-06 14:28:45 +0000
+++ openlp/core/ui/servicenoteform.py 2011-02-10 04:44:59 +0000
@@ -27,7 +27,7 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate
-from openlp.core.lib.ui import create_save_cancel_button_box
+from openlp.core.lib.ui import create_accept_reject_button_box
class ServiceNoteForm(QtGui.QDialog):
"""
@@ -48,7 +48,7 @@
self.textEdit = QtGui.QTextEdit(self)
self.textEdit.setObjectName(u'textEdit')
self.dialogLayout.addWidget(self.textEdit)
- self.dialogLayout.addWidget(create_save_cancel_button_box(self))
+ self.dialogLayout.addWidget(create_accept_reject_button_box(self))
QtCore.QMetaObject.connectSlotsByName(self)
def retranslateUi(self):
=== modified file 'openlp/core/ui/settingsdialog.py'
--- openlp/core/ui/settingsdialog.py 2011-01-08 09:17:08 +0000
+++ openlp/core/ui/settingsdialog.py 2011-02-10 04:44:59 +0000
@@ -27,6 +27,7 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate, build_icon
+from openlp.core.lib.ui import create_accept_reject_button_box
class Ui_SettingsDialog(object):
def setupUi(self, settingsDialog):
@@ -40,16 +41,9 @@
self.settingsTabWidget = QtGui.QTabWidget(settingsDialog)
self.settingsTabWidget.setObjectName(u'settingsTabWidget')
self.settingsLayout.addWidget(self.settingsTabWidget)
- self.buttonBox = QtGui.QDialogButtonBox(settingsDialog)
- self.buttonBox.setStandardButtons(
- QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok)
- self.buttonBox.setObjectName(u'buttonBox')
+ self.buttonBox = create_accept_reject_button_box(settingsDialog, True)
self.settingsLayout.addWidget(self.buttonBox)
self.retranslateUi(settingsDialog)
- QtCore.QObject.connect(self.buttonBox,
- QtCore.SIGNAL(u'accepted()'), settingsDialog.accept)
- QtCore.QObject.connect(self.buttonBox,
- QtCore.SIGNAL(u'rejected()'), settingsDialog.reject)
QtCore.QMetaObject.connectSlotsByName(settingsDialog)
def retranslateUi(self, settingsDialog):
=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py 2011-02-09 17:30:38 +0000
+++ openlp/core/ui/thememanager.py 2011-02-10 04:44:59 +0000
@@ -64,7 +64,7 @@
self.toolbar.addToolbarButton(
UiStrings.NewType % UiStrings.Theme,
u':/themes/theme_new.png',
- translate('OpenLP.ThemeManager', 'Create a new theme.'),
+ UiStrings.CreateANew % UiStrings.Theme.toLower(),
self.onAddTheme)
self.toolbar.addToolbarButton(
UiStrings.EditType % UiStrings.Theme,
@@ -406,7 +406,7 @@
translate('OpenLP.ThemeManager', 'Select Theme Import File'),
SettingsManager.get_last_dir(self.settingsSection),
translate('OpenLP.ThemeManager', 'Theme v1 (*.theme);;'
- 'Theme v2 (*.otz);;All Files (*.*)'))
+ 'Theme v2 (*.otz);;%s (*.*)') % UiStrings.AllFiles)
log.info(u'New Themes %s', unicode(files))
if files:
for file in files:
=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py 2011-02-04 18:17:28 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py 2011-02-10 04:44:59 +0000
@@ -30,8 +30,8 @@
from openlp.core.lib import MediaManagerItem, Receiver, BaseListWithDnD, \
ItemCapabilities, translate
-from openlp.core.lib.ui import add_widget_completer, media_item_combo_box, \
- critical_error_message_box
+from openlp.core.lib.ui import UiStrings, add_widget_completer, \
+ media_item_combo_box, critical_error_message_box
from openlp.plugins.bibles.forms import BibleImportForm
from openlp.plugins.bibles.lib import get_reference_match
@@ -192,8 +192,7 @@
self.advancedSearchButtonLayout.addWidget(self.advancedSearchButton)
self.advancedLayout.addLayout(
self.advancedSearchButtonLayout, 7, 0, 1, 3)
- self.searchTabWidget.addTab(self.advancedTab,
- translate('BiblesPlugin.MediaItem', 'Advanced'))
+ self.searchTabWidget.addTab(self.advancedTab, UiStrings.Advanced)
# Add the search tab widget to the page layout.
self.pageLayout.addWidget(self.searchTabWidget)
# Combo Boxes
=== modified file 'openlp/plugins/custom/forms/editcustomdialog.py'
--- openlp/plugins/custom/forms/editcustomdialog.py 2011-02-09 05:04:12 +0000
+++ openlp/plugins/custom/forms/editcustomdialog.py 2011-02-10 04:44:59 +0000
@@ -27,7 +27,7 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import build_icon, translate
-from openlp.core.lib.ui import UiStrings, create_save_cancel_button_box, \
+from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box, \
create_delete_push_button, create_up_down_push_button_set
class Ui_CustomEditDialog(object):
@@ -94,7 +94,7 @@
self.creditLabel.setBuddy(self.creditEdit)
self.bottomFormLayout.addRow(self.creditLabel, self.creditEdit)
self.dialogLayout.addLayout(self.bottomFormLayout)
- self.buttonBox = create_save_cancel_button_box(customEditDialog)
+ self.buttonBox = create_accept_reject_button_box(customEditDialog)
self.previewButton = QtGui.QPushButton()
self.buttonBox.addButton(
self.previewButton, QtGui.QDialogButtonBox.ActionRole)
=== modified file 'openlp/plugins/custom/forms/editcustomslidedialog.py'
--- openlp/plugins/custom/forms/editcustomslidedialog.py 2011-02-05 01:24:19 +0000
+++ openlp/plugins/custom/forms/editcustomslidedialog.py 2011-02-10 04:44:59 +0000
@@ -27,7 +27,7 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate, SpellTextEdit
-from openlp.core.lib.ui import create_save_cancel_button_box
+from openlp.core.lib.ui import create_accept_reject_button_box
class Ui_CustomSlideEditDialog(object):
def setupUi(self, customSlideEditDialog):
@@ -37,7 +37,7 @@
self.slideTextEdit = SpellTextEdit(self)
self.slideTextEdit.setObjectName(u'slideTextEdit')
self.dialogLayout.addWidget(self.slideTextEdit)
- self.buttonBox = create_save_cancel_button_box(customSlideEditDialog)
+ self.buttonBox = create_accept_reject_button_box(customSlideEditDialog)
self.splitButton = QtGui.QPushButton(customSlideEditDialog)
self.splitButton.setObjectName(u'splitButton')
self.buttonBox.addButton(self.splitButton,
=== modified file 'openlp/plugins/images/imageplugin.py'
--- openlp/plugins/images/imageplugin.py 2011-02-09 17:30:38 +0000
+++ openlp/plugins/images/imageplugin.py 2011-02-10 04:44:59 +0000
@@ -27,7 +27,6 @@
import logging
from openlp.core.lib import Plugin, StringContent, build_icon, translate
-from openlp.core.lib.ui import UiStrings
from openlp.plugins.images.lib import ImageMediaItem
log = logging.getLogger(__name__)
=== modified file 'openlp/plugins/images/lib/mediaitem.py'
--- openlp/plugins/images/lib/mediaitem.py 2011-02-09 05:04:12 +0000
+++ openlp/plugins/images/lib/mediaitem.py 2011-02-10 04:44:59 +0000
@@ -64,15 +64,11 @@
'Select Image(s)')
file_formats = get_images_filter()
self.OnNewFileMasks = u'%s;;%s (*.*) (*)' % (file_formats,
- unicode(UiStrings.AllFiles))
- self.replaceAction.setText(
- translate('ImagePlugin.MediaItem', 'Replace Background'))
- self.replaceAction.setToolTip(
- translate('ImagePlugin.MediaItem', 'Replace Live Background'))
- self.resetAction.setText(
- translate('ImagePlugin.MediaItem', 'Reset Background'))
- self.resetAction.setToolTip(
- translate('ImagePlugin.MediaItem', 'Reset Live Background'))
+ UiStrings.AllFiles)
+ self.replaceAction.setText(UiStrings.ReplaceBG)
+ self.replaceAction.setToolTip(UiStrings.ReplaceLiveBG)
+ self.resetAction.setText(UiStrings.ResetBG)
+ self.resetAction.setToolTip(UiStrings.ResetLiveBG)
def requiredIcons(self):
MediaManagerItem.requiredIcons(self)
=== modified file 'openlp/plugins/media/lib/mediaitem.py'
--- openlp/plugins/media/lib/mediaitem.py 2011-02-06 19:37:35 +0000
+++ openlp/plugins/media/lib/mediaitem.py 2011-02-10 04:44:59 +0000
@@ -31,7 +31,7 @@
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \
ItemCapabilities, SettingsManager, translate, check_item_selected, Receiver
-from openlp.core.lib.ui import critical_error_message_box
+from openlp.core.lib.ui import UiStrings, critical_error_message_box
log = logging.getLogger(__name__)
@@ -64,16 +64,12 @@
def retranslateUi(self):
self.OnNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media')
self.OnNewFileMasks = unicode(translate('MediaPlugin.MediaItem',
- 'Videos (%s);;Audio (%s);;All files (*)')) % \
- (self.parent.video_list, self.parent.audio_list)
- self.replaceAction.setText(
- translate('MediaPlugin.MediaItem', 'Replace Background'))
- self.replaceAction.setToolTip(
- translate('MediaPlugin.MediaItem', 'Replace Live Background'))
- self.resetAction.setText(
- translate('MediaPlugin.MediaItem', 'Reset Background'))
- self.resetAction.setToolTip(
- translate('ImagePlugin.MediaItem', 'Reset Live Background'))
+ 'Videos (%s);;Audio (%s);;%s (*)')) % (self.parent.video_list,
+ self.parent.audio_list, UiStrings.AllFiles)
+ self.replaceAction.setText(UiStrings.ReplaceBG)
+ self.replaceAction.setToolTip(UiStrings.ReplaceLiveBG)
+ self.resetAction.setText(UiStrings.ResetBG)
+ self.resetAction.setToolTip(UiStrings.ResetLiveBG)
def requiredIcons(self):
MediaManagerItem.requiredIcons(self)
=== modified file 'openlp/plugins/media/mediaplugin.py'
--- openlp/plugins/media/mediaplugin.py 2011-02-09 17:30:38 +0000
+++ openlp/plugins/media/mediaplugin.py 2011-02-10 04:44:59 +0000
@@ -30,7 +30,6 @@
from PyQt4.phonon import Phonon
from openlp.core.lib import Plugin, StringContent, build_icon, translate
-from openlp.core.lib.ui import UiStrings
from openlp.plugins.media.lib import MediaMediaItem, MediaTab
log = logging.getLogger(__name__)
=== modified file 'openlp/plugins/presentations/lib/impresscontroller.py'
--- openlp/plugins/presentations/lib/impresscontroller.py 2011-02-09 14:04:50 +0000
+++ openlp/plugins/presentations/lib/impresscontroller.py 2011-02-10 04:44:59 +0000
@@ -145,7 +145,12 @@
log.debug(u'get COM Desktop OpenOffice')
if not self.manager:
return None
- return self.manager.createInstance(u'com.sun.star.frame.Desktop')
+ desktop = None
+ try:
+ desktop = self.manager.createInstance(u'com.sun.star.frame.Desktop')
+ except AttributeError:
+ log.exception(u'Failure to find desktop - Impress may have closed')
+ return desktop if desktop else None
def get_com_servicemanager(self):
"""
@@ -166,14 +171,17 @@
log.debug(u'Kill OpenOffice')
while self.docs:
self.docs[0].close_presentation()
- if os.name != u'nt':
- desktop = self.get_uno_desktop()
- else:
- desktop = self.get_com_desktop()
- #Sometimes we get a failure and desktop is None
- if not desktop:
+ desktop = None
+ try:
+ if os.name != u'nt':
+ desktop = self.get_uno_desktop()
+ else:
+ desktop = self.get_com_desktop()
+ except:
log.exception(u'Failed to find an OpenOffice desktop to terminate')
- return
+ finally:
+ if not desktop:
+ return
docs = desktop.getComponents()
if docs.hasElements():
log.debug(u'OpenOffice not terminated as docs are still open')
=== modified file 'openlp/plugins/presentations/lib/presentationtab.py'
--- openlp/plugins/presentations/lib/presentationtab.py 2011-01-08 02:44:12 +0000
+++ openlp/plugins/presentations/lib/presentationtab.py 2011-02-10 04:44:59 +0000
@@ -27,6 +27,7 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import Receiver, SettingsTab, translate
+from openlp.core.lib.ui import UiStrings
class PresentationTab(SettingsTab):
"""
@@ -85,9 +86,7 @@
checkbox.setText(
unicode(translate('PresentationPlugin.PresentationTab',
'%s (unvailable)')) % controller.name)
- self.AdvancedGroupBox.setTitle(
- translate('PresentationPlugin.PresentationTab',
- 'Advanced'))
+ self.AdvancedGroupBox.setTitle(UiStrings.Advanced)
self.OverrideAppCheckBox.setText(
translate('PresentationPlugin.PresentationTab',
'Allow presentation application to be overriden'))
=== modified file 'openlp/plugins/presentations/presentationplugin.py'
--- openlp/plugins/presentations/presentationplugin.py 2011-02-09 17:30:38 +0000
+++ openlp/plugins/presentations/presentationplugin.py 2011-02-10 04:44:59 +0000
@@ -31,7 +31,6 @@
import logging
from openlp.core.lib import Plugin, StringContent, build_icon, translate
-from openlp.core.lib.ui import UiStrings
from openlp.core.utils import AppLocation
from openlp.plugins.presentations.lib import PresentationController, \
PresentationMediaItem, PresentationTab
=== modified file 'openlp/plugins/songs/forms/authorsdialog.py'
--- openlp/plugins/songs/forms/authorsdialog.py 2011-02-05 01:24:19 +0000
+++ openlp/plugins/songs/forms/authorsdialog.py 2011-02-10 04:44:59 +0000
@@ -27,7 +27,7 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate
-from openlp.core.lib.ui import create_save_cancel_button_box
+from openlp.core.lib.ui import create_accept_reject_button_box
class Ui_AuthorsDialog(object):
def setupUi(self, authorsDialog):
@@ -57,7 +57,7 @@
self.authorLayout.addRow(self.displayLabel, self.displayEdit)
self.dialogLayout.addLayout(self.authorLayout)
self.dialogLayout.addWidget(
- create_save_cancel_button_box(authorsDialog))
+ create_accept_reject_button_box(authorsDialog))
self.retranslateUi(authorsDialog)
authorsDialog.setMaximumHeight(authorsDialog.sizeHint().height())
QtCore.QMetaObject.connectSlotsByName(authorsDialog)
=== modified file 'openlp/plugins/songs/forms/editsongdialog.py'
--- openlp/plugins/songs/forms/editsongdialog.py 2011-02-09 05:04:12 +0000
+++ openlp/plugins/songs/forms/editsongdialog.py 2011-02-10 04:44:59 +0000
@@ -27,7 +27,7 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import build_icon, translate
-from openlp.core.lib.ui import UiStrings, create_save_cancel_button_box
+from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box
class Ui_EditSongDialog(object):
def setupUi(self, editSongDialog):
@@ -241,7 +241,7 @@
self.themeTabLayout.addWidget(self.commentsGroupBox)
self.songTabWidget.addTab(self.themeTab, u'')
self.dialogLayout.addWidget(self.songTabWidget)
- self.buttonBox = create_save_cancel_button_box(editSongDialog)
+ self.buttonBox = create_accept_reject_button_box(editSongDialog)
self.dialogLayout.addWidget(self.buttonBox)
self.retranslateUi(editSongDialog)
QtCore.QMetaObject.connectSlotsByName(editSongDialog)
=== modified file 'openlp/plugins/songs/forms/editversedialog.py'
--- openlp/plugins/songs/forms/editversedialog.py 2011-02-05 01:24:19 +0000
+++ openlp/plugins/songs/forms/editversedialog.py 2011-02-10 04:44:59 +0000
@@ -27,7 +27,7 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import build_icon, translate, SpellTextEdit
-from openlp.core.lib.ui import create_save_cancel_button_box
+from openlp.core.lib.ui import create_accept_reject_button_box
from openlp.plugins.songs.lib import VerseType
class Ui_EditVerseDialog(object):
@@ -61,7 +61,7 @@
self.verseTypeLayout.addStretch()
self.dialogLayout.addLayout(self.verseTypeLayout)
self.dialogLayout.addWidget(
- create_save_cancel_button_box(editVerseDialog))
+ create_accept_reject_button_box(editVerseDialog))
self.retranslateUi(editVerseDialog)
QtCore.QMetaObject.connectSlotsByName(editVerseDialog)
=== modified file 'openlp/plugins/songs/forms/songbookdialog.py'
--- openlp/plugins/songs/forms/songbookdialog.py 2011-02-05 01:24:19 +0000
+++ openlp/plugins/songs/forms/songbookdialog.py 2011-02-10 04:44:59 +0000
@@ -27,7 +27,7 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate
-from openlp.core.lib.ui import create_save_cancel_button_box
+from openlp.core.lib.ui import create_accept_reject_button_box
class Ui_SongBookDialog(object):
def setupUi(self, songBookDialog):
@@ -51,7 +51,7 @@
self.bookLayout.addRow(self.publisherLabel, self.publisherEdit)
self.dialogLayout.addLayout(self.bookLayout)
self.dialogLayout.addWidget(
- create_save_cancel_button_box(songBookDialog))
+ create_accept_reject_button_box(songBookDialog))
self.retranslateUi(songBookDialog)
songBookDialog.setMaximumHeight(songBookDialog.sizeHint().height())
QtCore.QMetaObject.connectSlotsByName(songBookDialog)
=== modified file 'openlp/plugins/songs/forms/songimportform.py'
--- openlp/plugins/songs/forms/songimportform.py 2011-02-09 05:04:12 +0000
+++ openlp/plugins/songs/forms/songimportform.py 2011-02-10 04:44:59 +0000
@@ -460,8 +460,7 @@
"""
if filters:
filters += u';;'
- filters += u'%s (*)' % translate('SongsPlugin.ImportWizardForm',
- 'All Files')
+ filters += u'%s (*)' % UiStrings.AllFiles
filename = QtGui.QFileDialog.getOpenFileName(self, title,
SettingsManager.get_last_dir(self.plugin.settingsSection, 1),
filters)
=== modified file 'openlp/plugins/songs/forms/topicsdialog.py'
--- openlp/plugins/songs/forms/topicsdialog.py 2011-02-05 01:24:19 +0000
+++ openlp/plugins/songs/forms/topicsdialog.py 2011-02-10 04:44:59 +0000
@@ -27,7 +27,7 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate
-from openlp.core.lib.ui import create_save_cancel_button_box
+from openlp.core.lib.ui import create_accept_reject_button_box
class Ui_TopicsDialog(object):
def setupUi(self, topicsDialog):
@@ -45,7 +45,7 @@
self.nameLayout.addRow(self.nameLabel, self.nameEdit)
self.dialogLayout.addLayout(self.nameLayout)
self.dialogLayout.addWidget(
- create_save_cancel_button_box(topicsDialog))
+ create_accept_reject_button_box(topicsDialog))
self.retranslateUi(topicsDialog)
topicsDialog.setMaximumHeight(topicsDialog.sizeHint().height())
QtCore.QMetaObject.connectSlotsByName(topicsDialog)
=== modified file 'openlp/plugins/songs/songsplugin.py'
--- openlp/plugins/songs/songsplugin.py 2011-02-09 17:30:38 +0000
+++ openlp/plugins/songs/songsplugin.py 2011-02-10 04:44:59 +0000
@@ -31,7 +31,6 @@
from openlp.core.lib import Plugin, StringContent, build_icon, translate
from openlp.core.lib.db import Manager
-from openlp.core.lib.ui import UiStrings
from openlp.plugins.songs.lib import SongMediaItem, SongsTab, SongXML
from openlp.plugins.songs.lib.db import init_schema, Song
from openlp.plugins.songs.lib.importer import SongFormat
=== modified file 'openlp/plugins/songusage/forms/songusagedeletedialog.py'
--- openlp/plugins/songusage/forms/songusagedeletedialog.py 2010-12-26 11:04:47 +0000
+++ openlp/plugins/songusage/forms/songusagedeletedialog.py 2011-02-10 04:44:59 +0000
@@ -25,7 +25,9 @@
###############################################################################
from PyQt4 import QtCore, QtGui
+
from openlp.core.lib import translate
+from openlp.core.lib.ui import create_accept_reject_button_box
class Ui_SongUsageDeleteDialog(object):
def setupUi(self, songUsageDeleteDialog):
@@ -43,22 +45,14 @@
QtGui.QCalendarWidget.NoVerticalHeader)
self.deleteCalendar.setObjectName(u'deleteCalendar')
self.verticalLayout.addWidget(self.deleteCalendar)
- self.buttonBox = QtGui.QDialogButtonBox(songUsageDeleteDialog)
+ self.buttonBox = create_accept_reject_button_box(
+ songUsageDeleteDialog, True)
self.buttonBox.setGeometry(QtCore.QRect(30, 210, 245, 25))
- self.buttonBox.setStandardButtons(
- QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName(u'buttonBox')
-
self.retranslateUi(songUsageDeleteDialog)
- QtCore.QObject.connect(
- self.buttonBox, QtCore.SIGNAL(u'accepted()'),
- songUsageDeleteDialog.accept)
- QtCore.QObject.connect(
- self.buttonBox, QtCore.SIGNAL(u'rejected()'),
- songUsageDeleteDialog.close)
QtCore.QMetaObject.connectSlotsByName(songUsageDeleteDialog)
def retranslateUi(self, songUsageDeleteDialog):
songUsageDeleteDialog.setWindowTitle(
translate('SongUsagePlugin.SongUsageDeleteForm',
- 'Delete Song Usage Data'))
\ No newline at end of file
+ 'Delete Song Usage Data'))
=== modified file 'openlp/plugins/songusage/forms/songusagedetaildialog.py'
--- openlp/plugins/songusage/forms/songusagedetaildialog.py 2011-01-29 08:26:14 +0000
+++ openlp/plugins/songusage/forms/songusagedetaildialog.py 2011-02-10 04:44:59 +0000
@@ -27,6 +27,7 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import build_icon, translate
+from openlp.core.lib.ui import create_accept_reject_button_box
class Ui_SongUsageDetailDialog(object):
def setupUi(self, songUsageDetailDialog):
@@ -71,17 +72,10 @@
self.verticalLayout4.addLayout(self.horizontalLayout)
self.verticalLayout2.addWidget(self.fileGroupBox)
self.verticalLayout.addWidget(self.dateRangeGroupBox)
- self.buttonBox = QtGui.QDialogButtonBox(songUsageDetailDialog)
- self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel |
- QtGui.QDialogButtonBox.Ok)
- self.buttonBox.setObjectName(u'buttonBox')
+ self.buttonBox = create_accept_reject_button_box(
+ songUsageDetailDialog, True)
self.verticalLayout.addWidget(self.buttonBox)
-
self.retranslateUi(songUsageDetailDialog)
- QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'accepted()'),
- songUsageDetailDialog.accept)
- QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'),
- songUsageDetailDialog.close)
QtCore.QObject.connect(self.saveFilePushButton,
QtCore.SIGNAL(u'pressed()'),
songUsageDetailDialog.defineOutputLocation)
Follow ups