← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~m2j/openlp/cleanups into lp:openlp

 

Meinert Jordan has proposed merging lp:~m2j/openlp/cleanups into lp:openlp.

Requested reviews:
  Raoul Snyman (raoul-snyman)
  Tim Bentley (trb143)
  Jonathan Corwin (j-corwin)

For more details, see:
https://code.launchpad.net/~m2j/openlp/cleanups/+merge/100663

- reorganisation of methods in openlp.core.lib.ui to make them more comprehensive
- some small restatements of some code in bibles parse_reference() method
- remove QMetaObject.connectSlotsByName() calls as they do nothing in our code
- trigger push button actions with click signal instead of push signal (in case this makes sense)

-- 
https://code.launchpad.net/~m2j/openlp/cleanups/+merge/100663
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py	2012-03-15 06:15:21 +0000
+++ openlp/core/lib/mediamanageritem.py	2012-04-03 18:01:36 +0000
@@ -260,7 +260,7 @@
         self.menu.addActions(self.listView.actions())
         QtCore.QObject.connect(self.listView,
             QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
-            self.onClickPressed)
+            self.onDoubleClicked)
         QtCore.QObject.connect(self.listView,
             QtCore.SIGNAL(u'itemSelectionChanged()'),
             self.onSelectionChange)
@@ -295,9 +295,9 @@
         self.pageLayout.addWidget(self.searchWidget)
         # Signals and slots
         QtCore.QObject.connect(self.searchTextEdit,
-            QtCore.SIGNAL(u'returnPressed()'), self.onSearchTextButtonClick)
+            QtCore.SIGNAL(u'returnPressed()'), self.onSearchTextButtonClicked)
         QtCore.QObject.connect(self.searchTextButton,
-            QtCore.SIGNAL(u'pressed()'), self.onSearchTextButtonClick)
+            QtCore.SIGNAL(u'clicked()'), self.onSearchTextButtonClicked)
         QtCore.QObject.connect(self.searchTextEdit,
             QtCore.SIGNAL(u'textChanged(const QString&)'),
             self.onSearchTextEditChanged)
@@ -458,7 +458,7 @@
         raise NotImplementedError(u'MediaManagerItem.generateSlideData needs '
             u'to be defined by the plugin')
 
-    def onClickPressed(self):
+    def onDoubleClicked(self):
         """
         Allows the list click action to be determined dynamically
         """

=== modified file 'openlp/core/lib/searchedit.py'
--- openlp/core/lib/searchedit.py	2012-03-25 21:36:09 +0000
+++ openlp/core/lib/searchedit.py	2012-04-03 18:01:36 +0000
@@ -189,7 +189,7 @@
 
     def _onClearButtonClicked(self):
         """
-        Internally implemented slot to react to the clear button being pressed
+        Internally implemented slot to react to the clear button being clicked
         to clear the line edit. Once it has cleared the line edit, it emits the
         ``cleared()`` signal so that an application can react to the clearing
         of the line edit.

=== modified file 'openlp/core/lib/settingstab.py'
--- openlp/core/lib/settingstab.py	2011-12-27 10:33:55 +0000
+++ openlp/core/lib/settingstab.py	2012-04-03 18:01:36 +0000
@@ -112,7 +112,7 @@
 
     def cancel(self):
         """
-        Reset any settings if cancel pressed
+        Reset any settings if cancel triggered
         """
         self.load()
 

=== modified file 'openlp/core/lib/theme.py'
--- openlp/core/lib/theme.py	2012-01-04 17:19:49 +0000
+++ openlp/core/lib/theme.py	2012-04-03 18:01:36 +0000
@@ -306,7 +306,7 @@
 
     def add_font(self, name, color, size, override, fonttype=u'main',
         bold=u'False', italics=u'False', line_adjustment=0,
-        xpos=0, ypos=0, width=0, height=0 , outline=u'False',
+        xpos=0, ypos=0, width=0, height=0, outline=u'False',
         outline_color=u'#ffffff', outline_pixel=2, shadow=u'False',
         shadow_color=u'#ffffff', shadow_pixel=5):
         """
@@ -550,7 +550,7 @@
             element = u'size'
         return False, master, element, value
 
-    def _create_attr(self, master , element, value):
+    def _create_attr(self, master, element, value):
         """
         Create the attributes with the correct data types and name format
         """

=== modified file 'openlp/core/lib/ui.py'
--- openlp/core/lib/ui.py	2012-04-02 21:00:24 +0000
+++ openlp/core/lib/ui.py	2012-04-03 18:01:36 +0000
@@ -170,31 +170,50 @@
     parent.welcomeLayout.addStretch()
     parent.addPage(parent.welcomePage)
 
-def create_accept_reject_button_box(parent, okay=False):
-    """
-    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)
-    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)
+def create_button_box(dialog, name, standard_buttons, custom_buttons=[]):
+    """
+    Creates a QDialogButtonBox with the given buttons. The ``accepted()`` and
+    ``rejected()`` signals of the button box are connected with the dialogs
+    ``accept()`` and ``reject()`` slots.
+
+    ``dialog``
+        The parent object. This has to be a ``QDialog`` descendant.
+
+    ``name``
+        A string which is set as object name.
+
+    ``standard_buttons``
+        A list of strings for the used buttons. It might contain: ``ok``,
+        ``save``, ``cancel``, ``close``, and ``defaults``.
+
+    ``custom_buttons``
+        A list of additional buttons. If a item is a instance of
+        QtGui.QAbstractButton it is added with QDialogButtonBox.ActionRole.
+        Otherwhise the item has to be a tuple of a button and a ButtonRole.
+    """
+    buttons = QtGui.QDialogButtonBox.NoButton
+    if u'ok' in standard_buttons:
+        buttons |= QtGui.QDialogButtonBox.Ok
+    if u'save' in standard_buttons:
+        buttons |= QtGui.QDialogButtonBox.Save
+    if u'cancel' in standard_buttons:
+        buttons |= QtGui.QDialogButtonBox.Cancel
+    if u'close' in standard_buttons:
+        buttons |= QtGui.QDialogButtonBox.Close
+    if u'defaults' in standard_buttons:
+        buttons |= QtGui.QDialogButtonBox.RestoreDefaults
+    button_box = QtGui.QDialogButtonBox(dialog)
+    button_box.setObjectName(name)
+    button_box.setStandardButtons(buttons)
+    for button in custom_buttons:
+        if isinstance(button, QtGui.QAbstractButton):
+            button_box.addButton(button, QtGui.QDialogButtonBox.ActionRole)
+        else:
+            button_box.addButton(*button)
     QtCore.QObject.connect(button_box, QtCore.SIGNAL(u'accepted()'),
-        parent.accept)
+        dialog.accept)
     QtCore.QObject.connect(button_box, QtCore.SIGNAL(u'rejected()'),
-        parent.reject)
+        dialog.reject)
     return button_box
 
 def critical_error_message_box(title=None, message=None, parent=None,
@@ -223,9 +242,15 @@
     data[u'title'] = title if title else UiStrings().Error
     return Receiver.send_message(u'openlp_error_message', data)
 
-def media_item_combo_box(parent, name):
+def create_horizontal_adjusting_combo_box(parent, name):
     """
-    Provide a standard combo box for media items.
+    Creates a QComboBox with adapting width for media items.
+
+    ``parent``
+        The parent widget.
+
+    ``name``
+        A string set as object name for the combo box.
     """
     combo = QtGui.QComboBox(parent)
     combo.setObjectName(name)
@@ -233,55 +258,71 @@
     combo.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
     return combo
 
-def create_delete_push_button(parent, icon=None):
+def create_button(parent, name, **kwargs):
     """
-    Creates a standard push button with a delete label and optional icon. The
-    button is connected to the parent's ``onDeleteButtonClicked()`` method to
-    handle the ``clicked()`` signal.
-
+    Return an button with the object name set and the given parameters.
+   
     ``parent``
-        The parent object. This should be a ``QWidget`` descendant.
+        A QtCore.QWidget for the buttons parent (required).
+
+    ``name``
+        A string which is set as object name (required).
+
+    ``role``
+        A string which can have one value out of ``delete``, ``up``, and
+        ``down``. This decides about default values for properties like text,
+        icon, or tooltip.
+
+    ``text``
+        A string for the action text.
 
     ``icon``
-        An icon to display on the button. This can be either a ``QIcon``, a
-        resource path or a file name.
-    """
-    delete_button = QtGui.QPushButton(parent)
-    delete_button.setObjectName(u'deleteButton')
-    delete_icon = icon if icon else u':/general/general_delete.png'
-    delete_button.setIcon(build_icon(delete_icon))
-    delete_button.setText(UiStrings().Delete)
-    delete_button.setToolTip(
-        translate('OpenLP.Ui', 'Delete the selected item.'))
-    QtCore.QObject.connect(delete_button,
-        QtCore.SIGNAL(u'clicked()'), parent.onDeleteButtonClicked)
-    return delete_button
-
-def create_up_down_push_button_set(parent):
-    """
-    Creates a standard set of two push buttons, one for up and the other for
-    down, for use with lists. The buttons use arrow icons and no text and are
-    connected to the parent's ``onUpButtonClicked()`` and
-    ``onDownButtonClicked()`` to handle their respective ``clicked()`` signals.
-
-    ``parent``
-        The parent object. This should be a ``QWidget`` descendant.
-    """
-    up_button = QtGui.QPushButton(parent)
-    up_button.setIcon(build_icon(u':/services/service_up.png'))
-    up_button.setObjectName(u'upButton')
-    up_button.setToolTip(
-        translate('OpenLP.Ui', 'Move selection up one position.'))
-    down_button = QtGui.QPushButton(parent)
-    down_button.setIcon(build_icon(u':/services/service_down.png'))
-    down_button.setObjectName(u'downButton')
-    down_button.setToolTip(
-        translate('OpenLP.Ui', 'Move selection down one position.'))
-    QtCore.QObject.connect(up_button,
-        QtCore.SIGNAL(u'clicked()'), parent.onUpButtonClicked)
-    QtCore.QObject.connect(down_button,
-        QtCore.SIGNAL(u'clicked()'), parent.onDownButtonClicked)
-    return up_button, down_button
+        Either a QIcon, a resource string, or a file location string for the
+        action icon.
+
+    ``tooltip``
+        A string for the action tool tip.
+
+    ``enabled``
+        False in case the button should be disabled.
+    """
+    if u'role' in kwargs:
+        role = kwargs.pop(u'role')
+        if role == u'delete':
+            kwargs.setdefault(u'text', UiStrings().Delete)
+            kwargs.setdefault(u'tooltip',
+                translate('OpenLP.Ui', 'Delete the selected item.'))
+        elif role == u'up':
+            kwargs.setdefault(u'icon', u':/services/service_up.png')
+            kwargs.setdefault(u'tooltip',
+                translate('OpenLP.Ui', 'Move selection up one position.'))
+        elif role == u'down':
+            kwargs.setdefault(u'icon', u':/services/service_down.png')
+            kwargs.setdefault(u'tooltip',
+                translate('OpenLP.Ui', 'Move selection down one position.'))
+        else:
+            log.warn(u'The role "%s" is not defined in create_push_button().',
+                role)
+    if kwargs.pop(u'class', u'') == u'toolbutton':
+        button = QtGui.QToolButton(parent)
+    else:
+        button = QtGui.QPushButton(parent)
+    button.setObjectName(name)
+    if kwargs.get(u'text'):
+        button.setText(kwargs.pop(u'text'))
+    if kwargs.get(u'icon'):
+        button.setIcon(build_icon(kwargs.pop(u'icon')))
+    if kwargs.get(u'tooltip'):
+        button.setToolTip(kwargs.pop(u'tooltip'))
+    if not kwargs.pop(u'enabled', True):
+        button.setEnabled(False)
+    if kwargs.get(u'click'):
+        QtCore.QObject.connect(button, QtCore.SIGNAL(u'clicked()'),
+            kwargs.pop(u'click'))
+    for key in kwargs.keys():
+        if key not in [u'text', u'icon', u'tooltip', u'click']:
+            log.warn(u'Parameter %s was not consumed in create_button().', key)
+    return button
 
 def create_action(parent, name, **kwargs):
     """
@@ -381,61 +422,38 @@
     parent.addAction(action)
     return action
 
-def context_menu(base, icon, text):
-    """
-    Utility method to help build context menus.
-
-    ``base``
-        The parent object to add this menu to
-
-    ``icon``
-        An icon for this menu
-
-    ``text``
-        The text to display for this menu
-    """
-    action = QtGui.QMenu(text, base)
-    action.setIcon(build_icon(icon))
-    return action
-
-def add_widget_completer(cache, widget):
-    """
-    Adds a text autocompleter to a widget.
+def set_case_insensitive_completer(cache, widget):
+    """
+    Sets a case insensitive text completer for a widget.
 
     ``cache``
         The list of items to use as suggestions.
 
     ``widget``
-        The object to use the completer.
+        A widget to set the completer (QComboBox or QTextEdit instance)
     """
     completer = QtGui.QCompleter(cache)
     completer.setCaseSensitivity(QtCore.Qt.CaseInsensitive)
     widget.setCompleter(completer)
 
-def create_valign_combo(form, parent, layout):
+def create_valign_selection_widgets(parent):
     """
     Creates a standard label and combo box for asking users to select a
     vertical alignment.
 
-    ``form``
-        The UI screen that the label and combo will appear on.
-
     ``parent``
         The parent object. This should be a ``QWidget`` descendant.
 
-    ``layout``
-        A layout object to add the label and combo widgets to.
+    Returns a tuple of QLabel and QComboBox.
     """
-    verticalLabel = QtGui.QLabel(parent)
-    verticalLabel.setObjectName(u'VerticalLabel')
-    verticalLabel.setText(translate('OpenLP.Ui', '&Vertical Align:'))
-    form.verticalComboBox = QtGui.QComboBox(parent)
-    form.verticalComboBox.setObjectName(u'VerticalComboBox')
-    form.verticalComboBox.addItem(UiStrings().Top)
-    form.verticalComboBox.addItem(UiStrings().Middle)
-    form.verticalComboBox.addItem(UiStrings().Bottom)
-    verticalLabel.setBuddy(form.verticalComboBox)
-    layout.addRow(verticalLabel, form.verticalComboBox)
+    label = QtGui.QLabel(parent)
+    label.setText(translate('OpenLP.Ui', '&Vertical Align:'))
+    combo_box = QtGui.QComboBox(parent)
+    combo_box.addItem(UiStrings().Top)
+    combo_box.addItem(UiStrings().Middle)
+    combo_box.addItem(UiStrings().Bottom)
+    label.setBuddy(combo_box)
+    return label, combo_box
 
 def find_and_set_in_combo_box(combo_box, value_to_find):
     """

=== modified file 'openlp/core/ui/aboutdialog.py'
--- openlp/core/ui/aboutdialog.py	2011-12-27 10:33:55 +0000
+++ openlp/core/ui/aboutdialog.py	2012-04-03 18:01:36 +0000
@@ -28,7 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import build_icon, translate
-from openlp.core.lib.ui import UiStrings
+from openlp.core.lib.ui import UiStrings, create_button, create_button_box
 
 class Ui_AboutDialog(object):
     def setupUi(self, aboutDialog):
@@ -71,21 +71,13 @@
         self.licenseTabLayout.addWidget(self.licenseTextEdit)
         self.aboutNotebook.addTab(self.licenseTab, u'')
         self.aboutDialogLayout.addWidget(self.aboutNotebook)
-        self.buttonBox = QtGui.QDialogButtonBox(aboutDialog)
-        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Close)
-        self.buttonBox.setObjectName(u'buttonBox')
-        self.contributeButton = QtGui.QPushButton()
-        self.contributeButton.setIcon(
-            build_icon(u':/system/system_contribute.png'))
-        self.contributeButton.setObjectName(u'contributeButton')
-        self.buttonBox.addButton(self.contributeButton,
-            QtGui.QDialogButtonBox.ActionRole)
+        self.contributeButton = create_button(None, u'contributeButton',
+            icon=u':/system/system_contribute.png')
+        self.buttonBox = create_button_box(aboutDialog, u'buttonBox',
+            [u'close'], [self.contributeButton])
         self.aboutDialogLayout.addWidget(self.buttonBox)
         self.retranslateUi(aboutDialog)
         self.aboutNotebook.setCurrentIndex(0)
-        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'),
-            aboutDialog.close)
-        QtCore.QMetaObject.connectSlotsByName(aboutDialog)
 
     def retranslateUi(self, aboutDialog):
         aboutDialog.setWindowTitle(u'%s OpenLP' % UiStrings().About)

=== modified file 'openlp/core/ui/advancedtab.py'
--- openlp/core/ui/advancedtab.py	2012-04-03 16:15:17 +0000
+++ openlp/core/ui/advancedtab.py	2012-04-03 18:01:36 +0000
@@ -233,22 +233,22 @@
             QtCore.SIGNAL(u'textChanged(QString)'),
             self.updateServiceNameExample)
         QtCore.QObject.connect(self.serviceNameRevertButton,
-            QtCore.SIGNAL(u'pressed()'),
-            self.onServiceNameRevertButtonPressed)
+            QtCore.SIGNAL(u'clicked()'),
+            self.onServiceNameRevertButtonClicked)
         QtCore.QObject.connect(self.defaultColorButton,
-            QtCore.SIGNAL(u'pressed()'), self.onDefaultColorButtonPressed)
+            QtCore.SIGNAL(u'clicked()'), self.onDefaultColorButtonClicked)
         QtCore.QObject.connect(self.defaultBrowseButton,
-            QtCore.SIGNAL(u'pressed()'), self.onDefaultBrowseButtonPressed)
+            QtCore.SIGNAL(u'clicked()'), self.onDefaultBrowseButtonClicked)
         QtCore.QObject.connect(self.defaultRevertButton,
-            QtCore.SIGNAL(u'pressed()'), self.onDefaultRevertButtonPressed)
+            QtCore.SIGNAL(u'clicked()'), self.onDefaultRevertButtonClicked)
         QtCore.QObject.connect(self.x11BypassCheckBox,
             QtCore.SIGNAL(u'toggled(bool)'), self.onX11BypassCheckBoxToggled)
         QtCore.QObject.connect(self.endSlideRadioButton,
-            QtCore.SIGNAL(u'pressed()'), self.onEndSlideButtonPressed)
+            QtCore.SIGNAL(u'clicked()'), self.onEndSlideButtonClicked)
         QtCore.QObject.connect(self.wrapSlideRadioButton,
-            QtCore.SIGNAL(u'pressed()'), self.onWrapSlideButtonPressed)
+            QtCore.SIGNAL(u'clicked()'), self.onWrapSlideButtonClicked)
         QtCore.QObject.connect(self.nextItemRadioButton,
-            QtCore.SIGNAL(u'pressed()'), self.onnextItemButtonPressed)
+            QtCore.SIGNAL(u'clicked()'), self.onnextItemButtonClicked)
 
     def retranslateUi(self):
         """
@@ -485,11 +485,11 @@
         self.serviceNameTime.setEnabled(service_day is not 7)
         self.updateServiceNameExample(None)
 
-    def onServiceNameRevertButtonPressed(self):
+    def onServiceNameRevertButtonClicked(self):
         self.serviceNameEdit.setText(self.defaultServiceName)
         self.serviceNameEdit.setFocus()
 
-    def onDefaultColorButtonPressed(self):
+    def onDefaultColorButtonClicked(self):
         new_color = QtGui.QColorDialog.getColor(
             QtGui.QColor(self.defaultColor), self)
         if new_color.isValid():
@@ -497,7 +497,7 @@
             self.defaultColorButton.setStyleSheet(
                 u'background-color: %s' % self.defaultColor)
 
-    def onDefaultBrowseButtonPressed(self):
+    def onDefaultBrowseButtonClicked(self):
         file_filters = u'%s;;%s (*.*) (*)' % (get_images_filter(),
             UiStrings().AllFiles)
         filename = QtGui.QFileDialog.getOpenFileName(self,
@@ -507,7 +507,7 @@
             self.defaultFileEdit.setText(filename)
         self.defaultFileEdit.setFocus()
 
-    def onDefaultRevertButtonPressed(self):
+    def onDefaultRevertButtonClicked(self):
         self.defaultFileEdit.setText(u':/graphics/openlp-splash-screen.png')
         self.defaultFileEdit.setFocus()
 
@@ -520,11 +520,11 @@
         """
         self.displayChanged = True
 
-    def onEndSlideButtonPressed(self):
+    def onEndSlideButtonClicked(self):
         self.slide_limits = SlideLimits.End
 
-    def onWrapSlideButtonPressed(self):
+    def onWrapSlideButtonClicked(self):
         self.slide_limits = SlideLimits.Wrap
 
-    def onnextItemButtonPressed(self):
+    def onnextItemButtonClicked(self):
         self.slide_limits = SlideLimits.Next

=== modified file 'openlp/core/ui/exceptiondialog.py'
--- openlp/core/ui/exceptiondialog.py	2011-12-27 10:33:55 +0000
+++ openlp/core/ui/exceptiondialog.py	2012-04-03 18:01:36 +0000
@@ -28,6 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import translate, build_icon
+from openlp.core.lib.ui import create_button, create_button_box
 
 class Ui_ExceptionDialog(object):
     def setupUi(self, exceptionDialog):
@@ -62,39 +63,23 @@
         self.exceptionTextEdit.setReadOnly(True)
         self.exceptionTextEdit.setObjectName(u'exceptionTextEdit')
         self.exceptionLayout.addWidget(self.exceptionTextEdit)
-        self.exceptionButtonBox = QtGui.QDialogButtonBox(exceptionDialog)
-        self.exceptionButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Close)
-        self.exceptionButtonBox.setObjectName(u'exceptionButtonBox')
-        self.exceptionLayout.addWidget(self.exceptionButtonBox)
-        self.sendReportButton = QtGui.QPushButton(exceptionDialog)
-        self.sendReportButton.setIcon(build_icon(
-            u':/general/general_email.png'))
-        self.sendReportButton.setObjectName(u'sendReportButton')
-        self.exceptionButtonBox.addButton(self.sendReportButton,
-            QtGui.QDialogButtonBox.ActionRole)
-        self.saveReportButton = QtGui.QPushButton(exceptionDialog)
-        self.saveReportButton.setIcon(build_icon(u':/general/general_save.png'))
-        self.saveReportButton.setObjectName(u'saveReportButton')
-        self.exceptionButtonBox.addButton(self.saveReportButton,
-            QtGui.QDialogButtonBox.ActionRole)
-        self.attachFileButton = QtGui.QPushButton(exceptionDialog)
-        self.attachFileButton.setIcon(build_icon(u':/general/general_open.png'))
-        self.attachFileButton.setObjectName(u'attachFileButton')
-        self.exceptionButtonBox.addButton(self.attachFileButton,
-            QtGui.QDialogButtonBox.ActionRole)
+        self.sendReportButton = create_button(exceptionDialog,
+            u'sendReportButton', icon=u':/general/general_email.png',
+            click=self.onSendReportButtonClicked)
+        self.saveReportButton = create_button(exceptionDialog,
+            u'saveReportButton', icon=u':/general/general_save.png',
+            click=self.onSaveReportButtonClicked)
+        self.attachFileButton = create_icon(exceptionDialog,
+            u'attachFileButton', icon=u':/general/general_open.png',
+            click=self.onAttachFileButtonClicked)
+        self.buttonBox = create_button_box(exceptionDialog, u'buttonBox',
+            [u'close'], [self.sendReportButton, self.saveReportButton,
+            self.attachFileButton])
+        self.exceptionLayout.addWidget(self.buttonBox)
 
         self.retranslateUi(exceptionDialog)
         QtCore.QObject.connect(self.descriptionTextEdit,
             QtCore.SIGNAL(u'textChanged()'), self.onDescriptionUpdated)
-        QtCore.QObject.connect(self.exceptionButtonBox,
-            QtCore.SIGNAL(u'rejected()'), exceptionDialog.reject)
-        QtCore.QObject.connect(self.sendReportButton,
-            QtCore.SIGNAL(u'pressed()'), self.onSendReportButtonPressed)
-        QtCore.QObject.connect(self.saveReportButton,
-            QtCore.SIGNAL(u'pressed()'), self.onSaveReportButtonPressed)
-        QtCore.QObject.connect(self.attachFileButton,
-            QtCore.SIGNAL(u'pressed()'), self.onAttachFileButtonPressed)
-        QtCore.QMetaObject.connectSlotsByName(exceptionDialog)
 
     def retranslateUi(self, exceptionDialog):
         exceptionDialog.setWindowTitle(

=== modified file 'openlp/core/ui/exceptionform.py'
--- openlp/core/ui/exceptionform.py	2012-02-26 21:09:22 +0000
+++ openlp/core/ui/exceptionform.py	2012-04-03 18:01:36 +0000
@@ -133,7 +133,7 @@
                 system = system + u'Desktop: GNOME\n'
         return (openlp_version, description, traceback, system, libraries)
 
-    def onSaveReportButtonPressed(self):
+    def onSaveReportButtonClicked(self):
         """
         Saving exception log and system informations to a file.
         """
@@ -169,7 +169,7 @@
             finally:
                 report_file.close()
 
-    def onSendReportButtonPressed(self):
+    def onSendReportButtonClicked(self):
         """
         Opening systems default email client and inserting exception log and
         system informations.
@@ -210,7 +210,7 @@
             unicode(translate('OpenLP.ExceptionDialog',
             'Description characters to enter : %s')) % count)
 
-    def onAttachFileButtonPressed(self):
+    def onAttachFileButtonClicked(self):
         files = QtGui.QFileDialog.getOpenFileName(
             self,translate('ImagePlugin.ExceptionDialog',
             'Select Attachment'),

=== modified file 'openlp/core/ui/filerenamedialog.py'
--- openlp/core/ui/filerenamedialog.py	2011-12-27 10:33:55 +0000
+++ openlp/core/ui/filerenamedialog.py	2012-04-03 18:01:36 +0000
@@ -28,7 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import translate
-from openlp.core.lib.ui import create_accept_reject_button_box
+from openlp.core.lib.ui import create_button_box
 
 class Ui_FileRenameDialog(object):
     def setupUi(self, fileRenameDialog):
@@ -44,11 +44,11 @@
             QtCore.QRegExp(r'[^/\\?*|<>\[\]":+%]+'), self))
         self.fileNameEdit.setObjectName(u'fileNameEdit')
         self.dialogLayout.addWidget(self.fileNameEdit, 0, 1)
-        self.buttonBox = create_accept_reject_button_box(fileRenameDialog, True)
+        self.buttonBox = create_button_box(fileRenameDialog, u'buttonBox',
+            [u'cancel', u'ok'])
         self.dialogLayout.addWidget(self.buttonBox, 1, 0, 1, 2)
         self.retranslateUi(fileRenameDialog)
         self.setMaximumHeight(self.sizeHint().height())
-        QtCore.QMetaObject.connectSlotsByName(fileRenameDialog)
 
     def retranslateUi(self, fileRenameDialog):
         self.fileNameLabel.setText(translate('OpenLP.FileRenameForm',

=== modified file 'openlp/core/ui/firsttimeform.py'
--- openlp/core/ui/firsttimeform.py	2011-12-30 07:59:02 +0000
+++ openlp/core/ui/firsttimeform.py	2012-04-03 18:01:36 +0000
@@ -183,7 +183,7 @@
         """
         Detects Page changes and updates as approprate.
         """
-        # Keep track of the page we are at.  Pressing "Cancel" causes pageId
+        # Keep track of the page we are at.  Triggering "Cancel" causes pageId
         # to be a -1.
         if pageId != -1:
             self.lastId = pageId
@@ -239,7 +239,7 @@
 
     def onCancelButtonClicked(self):
         """
-        Process the pressing of the cancel button.
+        Process the triggering of the cancel button.
         """
         if self.lastId == FirstTimePage.NoInternet or \
             (self.lastId <= FirstTimePage.Plugins and \
@@ -251,7 +251,7 @@
 
     def onNoInternetFinishButtonClicked(self):
         """
-        Process the pressing of the "Finish" button on the No Internet page.
+        Process the triggering of the "Finish" button on the No Internet page.
         """
         Receiver.send_message(u'cursor_busy')
         self._performWizard()

=== modified file 'openlp/core/ui/firsttimelanguagedialog.py'
--- openlp/core/ui/firsttimelanguagedialog.py	2011-12-27 10:33:55 +0000
+++ openlp/core/ui/firsttimelanguagedialog.py	2012-04-03 18:01:36 +0000
@@ -28,7 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import translate
-from openlp.core.lib.ui import create_accept_reject_button_box
+from openlp.core.lib.ui import create_button_box
 
 class Ui_FirstTimeLanguageDialog(object):
     def setupUi(self, languageDialog):
@@ -52,12 +52,12 @@
         self.languageComboBox.setObjectName("languageComboBox")
         self.languageLayout.addWidget(self.languageComboBox)
         self.dialogLayout.addLayout(self.languageLayout)
-        self.buttonBox = create_accept_reject_button_box(languageDialog, True)
+        self.buttonBox = create_button_box(languageDialog, u'buttonBox',
+            [u'cancel', u'ok'])
         self.dialogLayout.addWidget(self.buttonBox)
 
         self.retranslateUi(languageDialog)
         self.setMaximumHeight(self.sizeHint().height())
-        QtCore.QMetaObject.connectSlotsByName(languageDialog)
 
     def retranslateUi(self, languageDialog):
         self.setWindowTitle(translate('OpenLP.FirstTimeLanguageForm',

=== modified file 'openlp/core/ui/firsttimewizard.py'
--- openlp/core/ui/firsttimewizard.py	2011-12-27 10:33:55 +0000
+++ openlp/core/ui/firsttimewizard.py	2012-04-03 18:01:36 +0000
@@ -233,14 +233,14 @@
         self.noInternetText = translate('OpenLP.FirstTimeWizard',
             'No Internet connection was found. The First Time Wizard needs an '
             'Internet connection in order to be able to download sample '
-            'songs, Bibles and themes.  Press the Finish button now to start '
+            'songs, Bibles and themes.  Click the Finish button now to start '
             'OpenLP with initial settings and no sample data.\n\nTo re-run the '
             'First Time Wizard and import this sample data at a later time, '
             'check your Internet connection and re-run this wizard by '
             'selecting "Tools/Re-run First Time Wizard" from OpenLP.')
         self.cancelWizardText = translate('OpenLP.FirstTimeWizard',
             '\n\nTo cancel the First Time Wizard completely (and not start '
-            'OpenLP), press the Cancel button now.')
+            'OpenLP), click the Cancel button now.')
         self.songsPage.setTitle(translate('OpenLP.FirstTimeWizard',
             'Sample Songs'))
         self.songsPage.setSubTitle(translate('OpenLP.FirstTimeWizard',

=== modified file 'openlp/core/ui/formattingtagdialog.py'
--- openlp/core/ui/formattingtagdialog.py	2011-12-27 10:33:55 +0000
+++ openlp/core/ui/formattingtagdialog.py	2012-04-03 18:01:36 +0000
@@ -28,7 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import translate
-from openlp.core.lib.ui import UiStrings
+from openlp.core.lib.ui import UiStrings, create_button_box
 
 class Ui_FormattingTagDialog(object):
 
@@ -112,13 +112,11 @@
         self.savePushButton.setObjectName(u'savePushButton')
         self.dataGridLayout.addWidget(self.savePushButton, 4, 2, 1, 1)
         self.listdataGridLayout.addWidget(self.editGroupBox, 2, 0, 1, 1)
-        self.buttonBox = QtGui.QDialogButtonBox(formattingTagDialog)
-        self.buttonBox.setObjectName('formattingTagDialogButtonBox')
-        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Close)
+        self.buttonBox = create_button_box(formattingTagDialog, 'buttonBox',
+            [u'close'])
         self.listdataGridLayout.addWidget(self.buttonBox, 3, 0, 1, 1)
 
         self.retranslateUi(formattingTagDialog)
-        QtCore.QMetaObject.connectSlotsByName(formattingTagDialog)
 
     def retranslateUi(self, formattingTagDialog):
         formattingTagDialog.setWindowTitle(translate(

=== modified file 'openlp/core/ui/formattingtagform.py'
--- openlp/core/ui/formattingtagform.py	2011-12-27 10:33:55 +0000
+++ openlp/core/ui/formattingtagform.py	2012-04-03 18:01:36 +0000
@@ -50,11 +50,11 @@
         QtCore.QObject.connect(self.tagTableWidget,
             QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onRowSelected)
         QtCore.QObject.connect(self.newPushButton,
-            QtCore.SIGNAL(u'pressed()'), self.onNewPushed)
+            QtCore.SIGNAL(u'clicked()'), self.onNewClicked)
         QtCore.QObject.connect(self.savePushButton,
-            QtCore.SIGNAL(u'pressed()'), self.onSavedPushed)
+            QtCore.SIGNAL(u'clicked()'), self.onSavedClicked)
         QtCore.QObject.connect(self.deletePushButton,
-            QtCore.SIGNAL(u'pressed()'), self.onDeletePushed)
+            QtCore.SIGNAL(u'clicked()'), self.onDeleteClicked)
         QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'),
             self.close)
         # Forces reloading of tags from openlp configuration.
@@ -95,7 +95,7 @@
             self.savePushButton.setEnabled(True)
             self.deletePushButton.setEnabled(True)
 
-    def onNewPushed(self):
+    def onNewClicked(self):
         """
         Add a new tag to list only if it is not a duplicate.
         """
@@ -123,7 +123,7 @@
         self.onRowSelected()
         self.tagTableWidget.scrollToBottom()
 
-    def onDeletePushed(self):
+    def onDeleteClicked(self):
         """
         Delete selected custom tag.
         """
@@ -133,7 +133,7 @@
         self._resetTable()
         FormattingTags.save_html_tags()
 
-    def onSavedPushed(self):
+    def onSavedClicked(self):
         """
         Update Custom Tag details if not duplicate and save the data.
         """

=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py	2012-03-04 14:52:09 +0000
+++ openlp/core/ui/mainwindow.py	2012-04-03 18:01:36 +0000
@@ -372,7 +372,6 @@
         # Connect up some signals and slots
         QtCore.QObject.connect(self.fileMenu,
             QtCore.SIGNAL(u'aboutToShow()'), self.updateRecentFilesMenu)
-        QtCore.QMetaObject.connectSlotsByName(mainWindow)
         # Hide the entry, as it does not have any functionality yet.
         self.toolsAddToolItem.setVisible(False)
         self.importLanguageItem.setVisible(False)
@@ -986,11 +985,11 @@
         # We have a good file, import it.
         for section_key in import_keys:
             value = import_settings.value(section_key)
-            settings.setValue(u'%s' % (section_key) ,
+            settings.setValue(u'%s' % (section_key),
                 QtCore.QVariant(value))
         now = datetime.now()
         settings.beginGroup(self.headerSection)
-        settings.setValue( u'file_imported' , QtCore.QVariant(import_file_name))
+        settings.setValue(u'file_imported', QtCore.QVariant(import_file_name))
         settings.setValue(u'file_date_imported',
             now.strftime("%Y-%m-%d %H:%M"))
         settings.endGroup()

=== modified file 'openlp/core/ui/plugindialog.py'
--- openlp/core/ui/plugindialog.py	2011-12-27 10:33:55 +0000
+++ openlp/core/ui/plugindialog.py	2012-04-03 18:01:36 +0000
@@ -28,7 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import translate
-from openlp.core.lib.ui import UiStrings
+from openlp.core.lib.ui import UiStrings, create_button_box
 
 class Ui_PluginViewDialog(object):
     def setupUi(self, pluginViewDialog):
@@ -65,14 +65,10 @@
         self.pluginInfoLayout.addRow(self.aboutLabel, self.aboutTextBrowser)
         self.listLayout.addWidget(self.pluginInfoGroupBox)
         self.pluginLayout.addLayout(self.listLayout)
-        self.pluginListButtonBox = QtGui.QDialogButtonBox(pluginViewDialog)
-        self.pluginListButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
-        self.pluginListButtonBox.setObjectName(u'pluginListButtonBox')
-        self.pluginLayout.addWidget(self.pluginListButtonBox)
+        self.buttonBox = create_button_box(pluginViewDialog, u'buttonBox',
+            [u'ok'])
+        self.pluginLayout.addWidget(self.buttonBox)
         self.retranslateUi(pluginViewDialog)
-        QtCore.QObject.connect(self.pluginListButtonBox,
-            QtCore.SIGNAL(u'accepted()'), pluginViewDialog.close)
-        QtCore.QMetaObject.connectSlotsByName(pluginViewDialog)
 
     def retranslateUi(self, pluginViewDialog):
         pluginViewDialog.setWindowTitle(

=== modified file 'openlp/core/ui/printservicedialog.py'
--- openlp/core/ui/printservicedialog.py	2011-12-27 10:33:55 +0000
+++ openlp/core/ui/printservicedialog.py	2012-04-03 18:01:36 +0000
@@ -126,7 +126,6 @@
         self.optionsLayout.addWidget(self.optionsGroupBox)
 
         self.retranslateUi(printServiceDialog)
-        QtCore.QMetaObject.connectSlotsByName(printServiceDialog)
         QtCore.QObject.connect(self.optionsButton,
             QtCore.SIGNAL(u'toggled(bool)'), self.toggleOptions)
 

=== modified file 'openlp/core/ui/serviceitemeditdialog.py'
--- openlp/core/ui/serviceitemeditdialog.py	2011-12-27 10:33:55 +0000
+++ openlp/core/ui/serviceitemeditdialog.py	2012-04-03 18:01:36 +0000
@@ -28,8 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import translate
-from openlp.core.lib.ui import create_accept_reject_button_box, \
-    create_delete_push_button, create_up_down_push_button_set
+from openlp.core.lib.ui import create_button_box, create_button
 
 class Ui_ServiceItemEditDialog(object):
     def setupUi(self, serviceItemEditDialog):
@@ -44,18 +43,22 @@
         self.dialogLayout.addWidget(self.listWidget, 0, 0)
         self.buttonLayout = QtGui.QVBoxLayout()
         self.buttonLayout.setObjectName(u'buttonLayout')
-        self.deleteButton = create_delete_push_button(serviceItemEditDialog)
+        self.deleteButton = create_button(serviceItemEditDialog,
+            u'deleteButton', role=u'delete',
+            click=serviceItemEditDialog.onDeleteButtonClicked)
         self.buttonLayout.addWidget(self.deleteButton)
         self.buttonLayout.addStretch()
-        self.upButton, self.downButton = create_up_down_push_button_set(
-            serviceItemEditDialog)
+        self.upButton = create_button(serviceItemEditDialog, u'upButton',
+            role=u'up', click=serviceItemEditDialog.onUpButtonClicked)
+        self.downButton = create_button(serviceItemEditDialog, u'downButton',
+            role=u'down', click=serviceItemEditDialog.onDownButtonClicked)
         self.buttonLayout.addWidget(self.upButton)
         self.buttonLayout.addWidget(self.downButton)
         self.dialogLayout.addLayout(self.buttonLayout, 0, 1)
-        self.dialogLayout.addWidget(
-            create_accept_reject_button_box(serviceItemEditDialog), 1, 0, 1, 2)
+        self.buttonBox = create_button_box(serviceItemEditDialog, u'buttonBox',
+            [u'cancel', u'save'])
+        self.dialogLayout.addWidget(self.buttonBox, 1, 0, 1, 2)
         self.retranslateUi(serviceItemEditDialog)
-        QtCore.QMetaObject.connectSlotsByName(serviceItemEditDialog)
 
     def retranslateUi(self, serviceItemEditDialog):
         serviceItemEditDialog.setWindowTitle(

=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py	2012-04-02 21:12:51 +0000
+++ openlp/core/ui/servicemanager.py	2012-04-03 18:01:36 +0000
@@ -181,7 +181,7 @@
         self.serviceManagerList.moveUp = self.orderToolbar.addToolbarAction(
             u'moveUp', text=translate('OpenLP.ServiceManager', 'Move &up'),
             icon=u':/services/service_up.png',
-            tooltip=translate( 'OpenLP.ServiceManager',
+            tooltip=translate('OpenLP.ServiceManager',
             'Move item up one position in the service.'),
             shortcuts=[QtCore.Qt.Key_PageUp], category=UiStrings().Service,
             triggers=self.onServiceUp)

=== modified file 'openlp/core/ui/servicenoteform.py'
--- openlp/core/ui/servicenoteform.py	2011-12-27 10:33:55 +0000
+++ openlp/core/ui/servicenoteform.py	2012-04-03 18:01:36 +0000
@@ -28,7 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import translate, SpellTextEdit
-from openlp.core.lib.ui import create_accept_reject_button_box
+from openlp.core.lib.ui import create_button_box
 
 class ServiceNoteForm(QtGui.QDialog):
     """
@@ -55,8 +55,9 @@
         self.textEdit = SpellTextEdit(self, False)
         self.textEdit.setObjectName(u'textEdit')
         self.dialogLayout.addWidget(self.textEdit)
-        self.dialogLayout.addWidget(create_accept_reject_button_box(self))
-        QtCore.QMetaObject.connectSlotsByName(self)
+        self.buttonBox = create_button_box(self, u'buttonBox',
+            [u'cancel', u'save'])
+        self.dialogLayout.addWidget(self.buttonBox)
 
     def retranslateUi(self):
         self.setWindowTitle(

=== modified file 'openlp/core/ui/settingsdialog.py'
--- openlp/core/ui/settingsdialog.py	2011-12-27 10:33:55 +0000
+++ openlp/core/ui/settingsdialog.py	2012-04-03 18:01:36 +0000
@@ -28,7 +28,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
+from openlp.core.lib.ui import create_button_box
 
 class Ui_SettingsDialog(object):
     def setupUi(self, settingsDialog):
@@ -49,10 +49,10 @@
         self.stackedLayout = QtGui.QStackedLayout()
         self.stackedLayout.setObjectName(u'stackedLayout')
         self.dialogLayout.addLayout(self.stackedLayout, 0, 1, 1, 1)
-        self.buttonBox = create_accept_reject_button_box(settingsDialog, True)
+        self.buttonBox = create_button_box(settingsDialog, u'buttonBox',
+            [u'cancel', u'ok'])
         self.dialogLayout.addWidget(self.buttonBox, 1, 1, 1, 1)
         self.retranslateUi(settingsDialog)
-        QtCore.QMetaObject.connectSlotsByName(settingsDialog)
         QtCore.QObject.connect(self.settingListWidget,
             QtCore.SIGNAL(u'currentRowChanged(int)'),
             self.tabChanged)

=== modified file 'openlp/core/ui/shortcutlistdialog.py'
--- openlp/core/ui/shortcutlistdialog.py	2011-12-27 10:33:55 +0000
+++ openlp/core/ui/shortcutlistdialog.py	2012-04-03 18:01:36 +0000
@@ -28,6 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import translate, build_icon
+from openlp.core.lib.ui import create_button_box
 
 class CaptureShortcutButton(QtGui.QPushButton):
     """
@@ -108,18 +109,11 @@
         self.alternateLabel.setObjectName(u'alternateLabel')
         self.detailsLayout.addWidget(self.alternateLabel, 0, 2, 1, 1)
         self.shortcutListLayout.addLayout(self.detailsLayout)
-        self.buttonBox = QtGui.QDialogButtonBox(shortcutListDialog)
-        self.buttonBox.setObjectName(u'buttonBox')
+        self.buttonBox = create_button_box(shortcutListDialog, u'buttonBox',
+            [u'cancel', u'ok', u'defaults'])
         self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
-        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel |
-            QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.RestoreDefaults)
         self.shortcutListLayout.addWidget(self.buttonBox)
         self.retranslateUi(shortcutListDialog)
-        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'accepted()'),
-            shortcutListDialog.accept)
-        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'),
-            shortcutListDialog.reject)
-        QtCore.QMetaObject.connectSlotsByName(shortcutListDialog)
 
     def retranslateUi(self, shortcutListDialog):
         shortcutListDialog.setWindowTitle(

=== modified file 'openlp/core/ui/splashscreen.py'
--- openlp/core/ui/splashscreen.py	2011-12-27 10:33:55 +0000
+++ openlp/core/ui/splashscreen.py	2012-04-03 18:01:36 +0000
@@ -42,4 +42,3 @@
         self.setPixmap(splash_image)
         self.setMask(splash_image.mask())
         self.resize(370, 370)
-        QtCore.QMetaObject.connectSlotsByName(self)

=== modified file 'openlp/core/ui/starttimedialog.py'
--- openlp/core/ui/starttimedialog.py	2011-12-27 10:33:55 +0000
+++ openlp/core/ui/starttimedialog.py	2012-04-03 18:01:36 +0000
@@ -28,7 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import translate
-from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box
+from openlp.core.lib.ui import UiStrings, create_button_box
 
 class Ui_StartTimeDialog(object):
     def setupUi(self, StartTimeDialog):
@@ -99,11 +99,11 @@
         self.secondFinishLabel.setAlignment(QtCore.Qt.AlignRight)
         self.dialogLayout.addWidget(self.secondFinishLabel, 3, 3, 1, 1)
         self.dialogLayout.addWidget(self.secondSpinBox, 3, 1, 1, 1)
-        self.buttonBox = create_accept_reject_button_box(StartTimeDialog, True)
+        self.buttonBox = create_button_box(StartTimeDialog, u'buttonBox',
+            [u'cancel', u'ok'])
         self.dialogLayout.addWidget(self.buttonBox, 5, 2, 1, 2)
         self.retranslateUi(StartTimeDialog)
         self.setMaximumHeight(self.sizeHint().height())
-        QtCore.QMetaObject.connectSlotsByName(StartTimeDialog)
 
     def retranslateUi(self, StartTimeDialog):
         self.setWindowTitle(translate('OpenLP.StartTimeForm',

=== modified file 'openlp/core/ui/themeform.py'
--- openlp/core/ui/themeform.py	2012-01-04 17:19:49 +0000
+++ openlp/core/ui/themeform.py	2012-04-03 18:01:36 +0000
@@ -608,7 +608,7 @@
 
     def accept(self):
         """
-        Lets save the theme as Finish has been pressed
+        Lets save the theme as Finish has been triggered
         """
         # Save the theme name
         self.theme.theme_name = unicode(self.field(u'name').toString())

=== modified file 'openlp/core/ui/themelayoutdialog.py'
--- openlp/core/ui/themelayoutdialog.py	2011-12-27 10:33:55 +0000
+++ openlp/core/ui/themelayoutdialog.py	2012-04-03 18:01:36 +0000
@@ -28,6 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import translate
+from openlp.core.lib.ui import create_button_box
 
 
 class Ui_ThemeLayoutDialog(object):
@@ -35,34 +36,30 @@
         themeLayoutDialog.setObjectName(u'themeLayoutDialogDialog')
         #themeLayoutDialog.resize(300, 200)
         self.previewLayout = QtGui.QVBoxLayout(themeLayoutDialog)
-        self.previewLayout.setObjectName(u'PreviewLayout')
+        self.previewLayout.setObjectName(u'previewLayout')
         self.previewArea = QtGui.QWidget(themeLayoutDialog)
-        self.previewArea.setObjectName(u'PreviewArea')
+        self.previewArea.setObjectName(u'previewArea')
         self.previewAreaLayout = QtGui.QGridLayout(self.previewArea)
         self.previewAreaLayout.setMargin(0)
         self.previewAreaLayout.setColumnStretch(0, 1)
         self.previewAreaLayout.setRowStretch(0, 1)
-        self.previewAreaLayout.setObjectName(u'PreviewAreaLayout')
+        self.previewAreaLayout.setObjectName(u'previewAreaLayout')
         self.themeDisplayLabel = QtGui.QLabel(self.previewArea)
         self.themeDisplayLabel.setFrameShape(QtGui.QFrame.Box)
         self.themeDisplayLabel.setScaledContents(True)
-        self.themeDisplayLabel.setObjectName(u'ThemeDisplayLabel')
+        self.themeDisplayLabel.setObjectName(u'themeDisplayLabel')
         self.previewAreaLayout.addWidget(self.themeDisplayLabel)
         self.previewLayout.addWidget(self.previewArea)
         self.mainColourLabel = QtGui.QLabel(self.previewArea)
-        self.mainColourLabel.setObjectName(u'MainColourLabel')
+        self.mainColourLabel.setObjectName(u'mainColourLabel')
         self.previewLayout.addWidget(self.mainColourLabel)
         self.footerColourLabel = QtGui.QLabel(self.previewArea)
-        self.footerColourLabel.setObjectName(u'FooterColourLabel')
+        self.footerColourLabel.setObjectName(u'footerColourLabel')
         self.previewLayout.addWidget(self.footerColourLabel)
-        self.buttonBox = QtGui.QDialogButtonBox(themeLayoutDialog)
-        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
-        self.buttonBox.setObjectName(u'ButtonBox')
-        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'accepted()'),
-            themeLayoutDialog.accept)
+        self.buttonBox = create_button_box(themeLayoutDialog, u'buttonBox',
+            [u'ok'])
         self.previewLayout.addWidget(self.buttonBox)
         self.retranslateUi(themeLayoutDialog)
-        QtCore.QMetaObject.connectSlotsByName(themeLayoutDialog)
 
     def retranslateUi(self, themeLayoutDialog):
         themeLayoutDialog.setWindowTitle(

=== modified file 'openlp/core/ui/themestab.py'
--- openlp/core/ui/themestab.py	2012-04-02 10:32:52 +0000
+++ openlp/core/ui/themestab.py	2012-04-03 18:01:36 +0000
@@ -96,11 +96,11 @@
         self.rightLayout.addWidget(self.LevelGroupBox)
         self.rightLayout.addStretch()
         QtCore.QObject.connect(self.SongLevelRadioButton,
-            QtCore.SIGNAL(u'pressed()'), self.onSongLevelButtonPressed)
+            QtCore.SIGNAL(u'clicked()'), self.onSongLevelButtonClicked)
         QtCore.QObject.connect(self.ServiceLevelRadioButton,
-            QtCore.SIGNAL(u'pressed()'), self.onServiceLevelButtonPressed)
+            QtCore.SIGNAL(u'clicked()'), self.onServiceLevelButtonClicked)
         QtCore.QObject.connect(self.GlobalLevelRadioButton,
-            QtCore.SIGNAL(u'pressed()'), self.onGlobalLevelButtonPressed)
+            QtCore.SIGNAL(u'clicked()'), self.onGlobalLevelButtonClicked)
         QtCore.QObject.connect(self.DefaultComboBox,
             QtCore.SIGNAL(u'activated(int)'), self.onDefaultComboBoxChanged)
         QtCore.QObject.connect(Receiver.get_receiver(),
@@ -158,13 +158,13 @@
     def postSetUp(self):
         Receiver.send_message(u'theme_update_global', self.global_theme)
 
-    def onSongLevelButtonPressed(self):
+    def onSongLevelButtonClicked(self):
         self.theme_level = ThemeLevel.Song
 
-    def onServiceLevelButtonPressed(self):
+    def onServiceLevelButtonClicked(self):
         self.theme_level = ThemeLevel.Service
 
-    def onGlobalLevelButtonPressed(self):
+    def onGlobalLevelButtonClicked(self):
         self.theme_level = ThemeLevel.Global
 
     def onDefaultComboBoxChanged(self, value):

=== modified file 'openlp/core/ui/themewizard.py'
--- openlp/core/ui/themewizard.py	2012-01-04 17:19:49 +0000
+++ openlp/core/ui/themewizard.py	2012-04-03 18:01:36 +0000
@@ -30,7 +30,8 @@
 from openlp.core.lib import translate, build_icon
 from openlp.core.lib.theme import HorizontalType, BackgroundType, \
     BackgroundGradientType
-from openlp.core.lib.ui import UiStrings, add_welcome_page, create_valign_combo
+from openlp.core.lib.ui import UiStrings, add_welcome_page, \
+    create_valign_selection_widgets
 
 class Ui_ThemeWizard(object):
     def setupUi(self, themeWizard):
@@ -257,8 +258,11 @@
         self.horizontalComboBox.setObjectName(u'HorizontalComboBox')
         self.alignmentLayout.addRow(self.horizontalLabel,
             self.horizontalComboBox)
-        create_valign_combo(themeWizard, self.alignmentPage,
-            self.alignmentLayout)
+        self.verticalLabel, self.verticalComboBox = \
+            create_valign_selection_widgets(self.alignmentPage)
+        self.verticalLabel.setObjectName(u'verticalLabel')
+        self.verticalComboBox.setObjectName(u'verticalComboBox')
+        self.alignmentLayout.addRow(self.verticalLabel, self.verticalComboBox)
         self.transitionsLabel = QtGui.QLabel(self.alignmentPage)
         self.transitionsLabel.setObjectName(u'TransitionsLabel')
         self.transitionsCheckBox = QtGui.QCheckBox(self.alignmentPage)
@@ -413,7 +417,6 @@
         QtCore.QObject.connect(self.footerPositionCheckBox,
             QtCore.SIGNAL(u'toggled(bool)'), self.footerHeightSpinBox,
             QtCore.SLOT(u'setDisabled(bool)'))
-        QtCore.QMetaObject.connectSlotsByName(themeWizard)
 
     def retranslateUi(self, themeWizard):
         themeWizard.setWindowTitle(

=== modified file 'openlp/core/ui/wizard.py'
--- openlp/core/ui/wizard.py	2011-12-31 14:18:05 +0000
+++ openlp/core/ui/wizard.py	2012-04-03 18:01:36 +0000
@@ -114,7 +114,6 @@
         self.addCustomPages()
         self.addProgressPage()
         self.retranslateUi()
-        QtCore.QMetaObject.connectSlotsByName(self)
 
     def registerFields(self):
         """

=== modified file 'openlp/plugins/alerts/forms/alertdialog.py'
--- openlp/plugins/alerts/forms/alertdialog.py	2011-12-27 10:33:55 +0000
+++ openlp/plugins/alerts/forms/alertdialog.py	2012-04-03 18:01:36 +0000
@@ -28,7 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import build_icon, translate
-from openlp.core.lib.ui import create_delete_push_button
+from openlp.core.lib.ui import create_button, create_button_box
 
 class Ui_AlertDialog(object):
     def setupUi(self, alertDialog):
@@ -67,31 +67,21 @@
         self.saveButton.setIcon(build_icon(u':/general/general_save.png'))
         self.saveButton.setObjectName(u'saveButton')
         self.manageButtonLayout.addWidget(self.saveButton)
-        self.deleteButton = create_delete_push_button(alertDialog)
-        self.deleteButton.setEnabled(False)
+        self.deleteButton = create_button(alertDialog, u'deleteButton',
+            role=u'delete', enabled=False,
+            click=alertDialog.onDeleteButtonClicked)
         self.manageButtonLayout.addWidget(self.deleteButton)
         self.manageButtonLayout.addStretch()
         self.alertDialogLayout.addLayout(self.manageButtonLayout, 1, 1)
-        self.buttonBox = QtGui.QDialogButtonBox(alertDialog)
-        self.buttonBox.addButton(QtGui.QDialogButtonBox.Close)
         displayIcon = build_icon(u':/general/general_live.png')
-        self.displayButton = QtGui.QPushButton(alertDialog)
-        self.displayButton.setEnabled(False)
-        self.displayButton.setIcon(displayIcon)
-        self.displayButton.setObjectName(u'displayButton')
-        self.buttonBox.addButton(self.displayButton,
-            QtGui.QDialogButtonBox.ActionRole)
-        self.displayCloseButton = QtGui.QPushButton(alertDialog)
-        self.displayCloseButton.setEnabled(False)
-        self.displayCloseButton.setIcon(displayIcon)
-        self.displayCloseButton.setObjectName(u'displayCloseButton')
-        self.buttonBox.addButton(self.displayCloseButton,
-            QtGui.QDialogButtonBox.ActionRole)
+        self.displayButton = create_button(alertDialog, u'displayButton',
+            icon=displayIcon, enabled=False)
+        self.displayCloseButton = create_button(alertDialog,
+            u'displayCloseButton', icon=displayIcon, enabled=False)
+        self.buttonBox = create_button_box(alertDialog, u'buttonBox',
+            [u'close'], [self.displayButton, self.displayCloseButton])
         self.alertDialogLayout.addWidget(self.buttonBox, 2, 0, 1, 2)
         self.retranslateUi(alertDialog)
-        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'),
-            alertDialog.close)
-        QtCore.QMetaObject.connectSlotsByName(alertDialog)
 
     def retranslateUi(self, alertDialog):
         alertDialog.setWindowTitle(

=== modified file 'openlp/plugins/alerts/lib/alertstab.py'
--- openlp/plugins/alerts/lib/alertstab.py	2011-12-27 10:33:55 +0000
+++ openlp/plugins/alerts/lib/alertstab.py	2012-04-03 18:01:36 +0000
@@ -29,7 +29,7 @@
 
 from openlp.core.lib import SettingsTab, translate, Receiver
 from openlp.core.ui import AlertLocation
-from openlp.core.lib.ui import UiStrings, create_valign_combo
+from openlp.core.lib.ui import UiStrings, create_valign_selection_widgets
 
 class AlertsTab(SettingsTab):
     """
@@ -76,7 +76,11 @@
         self.timeoutSpinBox.setMaximum(180)
         self.timeoutSpinBox.setObjectName(u'timeoutSpinBox')
         self.fontLayout.addRow(self.timeoutLabel, self.timeoutSpinBox)
-        create_valign_combo(self, self.fontGroupBox, self.fontLayout)
+        self.verticalLabel, self.verticalComboBox = \
+            create_valign_selection_widgets(self.fontGroupBox)
+        self.verticalLabel.setObjectName(u'verticalLabel')
+        self.verticalComboBox.setObjectName(u'verticalComboBox')
+        self.fontLayout.addRow(self.verticalLabel, self.verticalComboBox)
         self.leftLayout.addWidget(self.fontGroupBox)
         self.leftLayout.addStretch()
         self.previewGroupBox = QtGui.QGroupBox(self.rightColumn)
@@ -90,9 +94,9 @@
         self.rightLayout.addStretch()
         # Signals and slots
         QtCore.QObject.connect(self.backgroundColorButton,
-            QtCore.SIGNAL(u'pressed()'), self.onBackgroundColorButtonClicked)
+            QtCore.SIGNAL(u'clicked()'), self.onBackgroundColorButtonClicked)
         QtCore.QObject.connect(self.fontColorButton,
-            QtCore.SIGNAL(u'pressed()'), self.onFontColorButtonClicked)
+            QtCore.SIGNAL(u'clicked()'), self.onFontColorButtonClicked)
         QtCore.QObject.connect(self.fontComboBox,
             QtCore.SIGNAL(u'activated(int)'), self.onFontComboBoxClicked)
         QtCore.QObject.connect(self.timeoutSpinBox,

=== modified file 'openlp/plugins/bibles/forms/booknamedialog.py'
--- openlp/plugins/bibles/forms/booknamedialog.py	2011-12-27 10:33:55 +0000
+++ openlp/plugins/bibles/forms/booknamedialog.py	2012-04-03 18:01:36 +0000
@@ -27,6 +27,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import translate
+from openlp.core.lib.ui import create_button_box
 
 class Ui_BookNameDialog(object):
     def setupUi(self, bookNameDialog):
@@ -78,21 +79,11 @@
         self.apocryphaCheckBox.setCheckState(QtCore.Qt.Checked)
         self.optionsLayout.addWidget(self.apocryphaCheckBox)
         self.bookNameLayout.addWidget(self.optionsGroupBox)
-        self.buttonBox = QtGui.QDialogButtonBox(bookNameDialog)
-        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
-        self.buttonBox.setStandardButtons(
-            QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
-        self.buttonBox.setObjectName(u'buttonBox')
+        self.buttonBox = create_button_box(bookNameDialog, u'buttonBox',
+            [u'cancel', u'ok'])
         self.bookNameLayout.addWidget(self.buttonBox)
 
         self.retranslateUi(bookNameDialog)
-        QtCore.QObject.connect(
-            self.buttonBox, QtCore.SIGNAL(u'accepted()'),
-            bookNameDialog.accept)
-        QtCore.QObject.connect(
-            self.buttonBox, QtCore.SIGNAL(u'rejected()'),
-            bookNameDialog.reject)
-        QtCore.QMetaObject.connectSlotsByName(bookNameDialog)
 
     def retranslateUi(self, bookNameDialog):
         bookNameDialog.setWindowTitle(translate('BiblesPlugin.BookNameDialog', 

=== modified file 'openlp/plugins/bibles/forms/languagedialog.py'
--- openlp/plugins/bibles/forms/languagedialog.py	2011-12-27 10:33:55 +0000
+++ openlp/plugins/bibles/forms/languagedialog.py	2012-04-03 18:01:36 +0000
@@ -27,6 +27,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import translate
+from openlp.core.lib.ui import create_button_box
 
 class Ui_LanguageDialog(object):
     def setupUi(self, languageDialog):
@@ -60,18 +61,11 @@
         self.languageComboBox.setObjectName(u'languageComboBox')
         self.languageHBoxLayout.addWidget(self.languageComboBox)
         self.languageLayout.addLayout(self.languageHBoxLayout)
-        self.buttonBox = QtGui.QDialogButtonBox(languageDialog)
-        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
-        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|
-            QtGui.QDialogButtonBox.Ok)
-        self.buttonBox.setObjectName(u'buttonBox')
+        self.buttonBox = create_button_box(languageDialog, u'buttonBox',
+            [u'cancel', u'ok'])
         self.languageLayout.addWidget(self.buttonBox)
 
         self.retranslateUi(languageDialog)
-        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'accepted()'), 
-            languageDialog.accept)
-        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'), 
-            languageDialog.reject)
 
     def retranslateUi(self, languageDialog):
         languageDialog.setWindowTitle(

=== modified file 'openlp/plugins/bibles/lib/__init__.py'
--- openlp/plugins/bibles/lib/__init__.py	2012-03-17 21:30:53 +0000
+++ openlp/plugins/bibles/lib/__init__.py	2012-04-03 18:01:36 +0000
@@ -368,37 +368,26 @@
                 if db_book:
                     book_ref_id = db_book.book_reference_id
             elif language_selection == LanguageSelection.Application:
-                book_list = []
-                for key, value in booknames.iteritems():
-                    if regex_book.match(unicode(value)):
-                        book_list.append(key)
-                books = []
-                if book_list:
-                    for value in book_list:
-                        item = BiblesResourcesDB.get_book(value)
-                        if item:
-                            books.append(item)
-                if books:
-                    for value in books:        
-                        if bible.get_book_by_book_ref_id(value[u'id']):
-                            book_ref_id = value[u'id']
-                            break
+                books = filter(lambda key:
+                    regex_book.match(unicode(booknames[key])), booknames.keys())
+                books = filter(None, map(BiblesResourcesDB.get_book, books))
+                for value in books:
+                    if bible.get_book_by_book_ref_id(value[u'id']):
+                        book_ref_id = value[u'id']
+                        break
             elif language_selection == LanguageSelection.English:
                 books = BiblesResourcesDB.get_books_like(book)
                 if books:
-                    book_list = []
-                    for value in books:
-                        if regex_book.match(value[u'name']):
-                            book_list.append(value)
+                    book_list = filter(
+                        lambda value: regex_book.match(value[u'name']), books)
                     if not book_list:
                         book_list = books
                     for value in book_list:        
                         if bible.get_book_by_book_ref_id(value[u'id']):
                             book_ref_id = value[u'id']
                             break
-        else:
-            if not bible.get_book_by_book_ref_id(book_ref_id):
-                book_ref_id = False
+        elif bible.get_book_by_book_ref_id(book_ref_id):
+            book_ref_id = False
         ranges = match.group(u'ranges')
         range_list = get_reference_match(u'range_separator').split(ranges)
         ref_list = []

=== modified file 'openlp/plugins/bibles/lib/http.py'
--- openlp/plugins/bibles/lib/http.py	2011-12-27 10:33:55 +0000
+++ openlp/plugins/bibles/lib/http.py	2012-04-03 18:01:36 +0000
@@ -363,7 +363,7 @@
 
 
 class HTTPBible(BibleDB):
-    log.info(u'%s HTTPBible loaded' , __name__)
+    log.info(u'%s HTTPBible loaded', __name__)
 
     def __init__(self, parent, **kwargs):
         """

=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py	2012-03-31 13:30:06 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py	2012-04-03 18:01:36 +0000
@@ -33,8 +33,8 @@
 from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \
     translate, create_separated_list
 from openlp.core.lib.searchedit import SearchEdit
-from openlp.core.lib.ui import UiStrings, add_widget_completer, \
-    media_item_combo_box, critical_error_message_box, \
+from openlp.core.lib.ui import UiStrings, set_case_insensitive_completer, \
+    create_horizontal_adjusting_combo_box, critical_error_message_box, \
     find_and_set_in_combo_box, build_icon
 from openlp.plugins.bibles.forms import BibleImportForm
 from openlp.plugins.bibles.lib import LayoutStyle, DisplayStyle, \
@@ -142,20 +142,22 @@
         versionLabel = QtGui.QLabel(tab)
         versionLabel.setObjectName(prefix + u'VersionLabel')
         layout.addWidget(versionLabel, idx, 0, QtCore.Qt.AlignRight)
-        versionComboBox = media_item_combo_box(tab,
+        versionComboBox = create_horizontal_adjusting_combo_box(tab,
             prefix + u'VersionComboBox')
         versionLabel.setBuddy(versionComboBox)
         layout.addWidget(versionComboBox, idx, 1, 1, 2)
         secondLabel = QtGui.QLabel(tab)
         secondLabel.setObjectName(prefix + u'SecondLabel')
         layout.addWidget(secondLabel, idx + 1, 0, QtCore.Qt.AlignRight)
-        secondComboBox = media_item_combo_box(tab, prefix + u'SecondComboBox')
+        secondComboBox = create_horizontal_adjusting_combo_box(
+            tab, prefix + u'SecondComboBox')
         versionLabel.setBuddy(secondComboBox)
         layout.addWidget(secondComboBox, idx + 1, 1, 1, 2)
         styleLabel = QtGui.QLabel(tab)
         styleLabel.setObjectName(prefix + u'StyleLabel')
         layout.addWidget(styleLabel, idx + 2, 0, QtCore.Qt.AlignRight)
-        styleComboBox = media_item_combo_box(tab, prefix + u'StyleComboBox')
+        styleComboBox = create_horizontal_adjusting_combo_box(
+            tab, prefix + u'StyleComboBox')
         styleComboBox.addItems([u'', u'', u''])
         layout.addWidget(styleComboBox, idx + 2, 1, 1, 2)
         searchButtonLayout = QtGui.QHBoxLayout()
@@ -209,8 +211,8 @@
         self.advancedBookLabel.setObjectName(u'advancedBookLabel')
         self.advancedLayout.addWidget(self.advancedBookLabel, 0, 0,
             QtCore.Qt.AlignRight)
-        self.advancedBookComboBox = media_item_combo_box(self.advancedTab,
-            u'advancedBookComboBox')
+        self.advancedBookComboBox = create_horizontal_adjusting_combo_box(
+            self.advancedTab, u'advancedBookComboBox')
         self.advancedBookLabel.setBuddy(self.advancedBookComboBox)
         self.advancedLayout.addWidget(self.advancedBookComboBox, 0, 1, 1, 2)
         self.advancedChapterLabel = QtGui.QLabel(self.advancedTab)
@@ -269,9 +271,9 @@
             self.onAdvancedStyleComboBoxChanged)
         # Buttons
         QtCore.QObject.connect(self.advancedSearchButton,
-            QtCore.SIGNAL(u'pressed()'), self.onAdvancedSearchButton)
+            QtCore.SIGNAL(u'clicked()'), self.onAdvancedSearchButton)
         QtCore.QObject.connect(self.quickSearchButton,
-            QtCore.SIGNAL(u'pressed()'), self.onQuickSearchButton)
+            QtCore.SIGNAL(u'clicked()'), self.onQuickSearchButton)
         QtCore.QObject.connect(Receiver.get_receiver(),
             QtCore.SIGNAL(u'config_updated'), self.configUpdated)
         # Other stuff
@@ -520,7 +522,7 @@
                         book.book_reference_id)
                         books.append(data[u'name'] + u' ')
                 books.sort(cmp=locale.strcoll)
-        add_widget_completer(books, self.quickSearchEdit)
+        set_case_insensitive_completer(books, self.quickSearchEdit)
 
     def onQuickVersionComboBox(self):
         self.updateAutoCompleter()
@@ -665,7 +667,7 @@
         """
         Does an advanced search and saves the search results.
         """
-        log.debug(u'Advanced Search Button pressed')
+        log.debug(u'Advanced Search Button clicked')
         self.advancedSearchButton.setEnabled(False)
         Receiver.send_message(u'openlp_process_events')
         bible = unicode(self.advancedVersionComboBox.currentText())
@@ -704,7 +706,7 @@
         Does a quick search and saves the search results. Quick search can
         either be "Reference Search" or "Text Search".
         """
-        log.debug(u'Quick Search Button pressed')
+        log.debug(u'Quick Search Button clicked')
         self.quickSearchButton.setEnabled(False)
         Receiver.send_message(u'openlp_process_events')
         bible = unicode(self.quickVersionComboBox.currentText())

=== modified file 'openlp/plugins/custom/forms/editcustomdialog.py'
--- openlp/plugins/custom/forms/editcustomdialog.py	2011-12-27 10:33:55 +0000
+++ openlp/plugins/custom/forms/editcustomdialog.py	2012-04-03 18:01:36 +0000
@@ -28,8 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import build_icon, translate
-from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box, \
-    create_delete_push_button, create_up_down_push_button_set
+from openlp.core.lib.ui import UiStrings, create_button_box, create_button
 
 class Ui_CustomEditDialog(object):
     def setupUi(self, customEditDialog):
@@ -67,14 +66,16 @@
         self.editAllButton = QtGui.QPushButton(customEditDialog)
         self.editAllButton.setObjectName(u'editAllButton')
         self.buttonLayout.addWidget(self.editAllButton)
-        self.deleteButton = create_delete_push_button(customEditDialog)
+        self.deleteButton = create_button(customEditDialog, u'deleteButton',
+            role=u'delete', click=customEditDialog.onDeleteButtonClicked)
         self.deleteButton.setEnabled(False)
         self.buttonLayout.addWidget(self.deleteButton)
         self.buttonLayout.addStretch()
-        self.upButton, self.downButton = create_up_down_push_button_set(
-            customEditDialog)
-        self.upButton.setEnabled(False)
-        self.downButton.setEnabled(False)
+        self.upButton = create_button(customEditDialog, u'upButton', role=u'up',
+            enable=False, click=customEditDialog.onUpButtonClicked)
+        self.downButton = create_button(customEditDialog, u'downButton',
+            role=u'down', enable=False,
+            click=customEditDialog.onDownButtonClicked)
         self.buttonLayout.addWidget(self.upButton)
         self.buttonLayout.addWidget(self.downButton)
         self.centralLayout.addLayout(self.buttonLayout)
@@ -95,13 +96,11 @@
         self.creditLabel.setBuddy(self.creditEdit)
         self.bottomFormLayout.addRow(self.creditLabel, self.creditEdit)
         self.dialogLayout.addLayout(self.bottomFormLayout)
-        self.buttonBox = create_accept_reject_button_box(customEditDialog)
         self.previewButton = QtGui.QPushButton()
-        self.buttonBox.addButton(
-            self.previewButton, QtGui.QDialogButtonBox.ActionRole)
+        self.buttonBox = create_button_box(customEditDialog, u'buttonBox',
+            [u'cancel', u'save'], [self.previewButton])
         self.dialogLayout.addWidget(self.buttonBox)
         self.retranslateUi(customEditDialog)
-        QtCore.QMetaObject.connectSlotsByName(customEditDialog)
 
     def retranslateUi(self, customEditDialog):
         customEditDialog.setWindowTitle(

=== modified file 'openlp/plugins/custom/forms/editcustomform.py'
--- openlp/plugins/custom/forms/editcustomform.py	2011-12-27 10:33:55 +0000
+++ openlp/plugins/custom/forms/editcustomform.py	2012-04-03 18:01:36 +0000
@@ -56,20 +56,20 @@
         self.editSlideForm = EditCustomSlideForm(self)
         # Connecting signals and slots
         QtCore.QObject.connect(self.previewButton,
-            QtCore.SIGNAL(u'pressed()'), self.onPreviewButtonPressed)
+            QtCore.SIGNAL(u'clicked()'), self.onPreviewButtonClicked)
         QtCore.QObject.connect(self.addButton,
-            QtCore.SIGNAL(u'pressed()'), self.onAddButtonPressed)
+            QtCore.SIGNAL(u'clicked()'), self.onAddButtonClicked)
         QtCore.QObject.connect(self.editButton,
-            QtCore.SIGNAL(u'pressed()'), self.onEditButtonPressed)
+            QtCore.SIGNAL(u'clicked()'), self.onEditButtonClicked)
         QtCore.QObject.connect(self.editAllButton,
-            QtCore.SIGNAL(u'pressed()'), self.onEditAllButtonPressed)
+            QtCore.SIGNAL(u'clicked()'), self.onEditAllButtonClicked)
         QtCore.QObject.connect(Receiver.get_receiver(),
             QtCore.SIGNAL(u'theme_update_list'), self.loadThemes)
         QtCore.QObject.connect(self.slideListView,
             QtCore.SIGNAL(u'currentRowChanged(int)'), self.onCurrentRowChanged)
         QtCore.QObject.connect(self.slideListView,
             QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
-            self.onEditButtonPressed)
+            self.onEditButtonClicked)
 
     def loadThemes(self, themelist):
         self.themeComboBox.clear()
@@ -154,18 +154,18 @@
             self.slideListView.insertItem(selectedRow + 1, qw)
             self.slideListView.setCurrentRow(selectedRow + 1)
 
-    def onAddButtonPressed(self):
+    def onAddButtonClicked(self):
         self.editSlideForm.setText(u'')
         if self.editSlideForm.exec_():
             for slide in self.editSlideForm.getText():
                 self.slideListView.addItem(slide)
 
-    def onEditButtonPressed(self):
+    def onEditButtonClicked(self):
         self.editSlideForm.setText(self.slideListView.currentItem().text())
         if self.editSlideForm.exec_():
             self.updateSlideList(self.editSlideForm.getText())
 
-    def onEditAllButtonPressed(self):
+    def onEditAllButtonClicked(self):
         """
         Edits all slides.
         """
@@ -179,7 +179,7 @@
         if self.editSlideForm.exec_():
             self.updateSlideList(self.editSlideForm.getText(), True)
 
-    def onPreviewButtonPressed(self):
+    def onPreviewButtonClicked(self):
         """
         Save the custom item and preview it.
         """

=== modified file 'openlp/plugins/custom/forms/editcustomslidedialog.py'
--- openlp/plugins/custom/forms/editcustomslidedialog.py	2011-12-27 10:33:55 +0000
+++ openlp/plugins/custom/forms/editcustomslidedialog.py	2012-04-03 18:01:36 +0000
@@ -28,7 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import translate, SpellTextEdit, build_icon
-from openlp.core.lib.ui import create_accept_reject_button_box, UiStrings
+from openlp.core.lib.ui import UiStrings, create_button, create_button_box
 
 class Ui_CustomSlideEditDialog(object):
     def setupUi(self, customSlideEditDialog):
@@ -38,20 +38,14 @@
         self.slideTextEdit = SpellTextEdit(self)
         self.slideTextEdit.setObjectName(u'slideTextEdit')
         self.dialogLayout.addWidget(self.slideTextEdit)
-        self.buttonBox = create_accept_reject_button_box(customSlideEditDialog)
-        self.splitButton = QtGui.QPushButton(customSlideEditDialog)
-        self.splitButton.setIcon(build_icon(u':/general/general_add.png'))
-        self.splitButton.setObjectName(u'splitButton')
-        self.buttonBox.addButton(self.splitButton,
-            QtGui.QDialogButtonBox.ActionRole)
-        self.insertButton = QtGui.QPushButton(customSlideEditDialog)
-        self.insertButton.setIcon(build_icon(u':/general/general_add.png'))
-        self.insertButton.setObjectName(u'insertButton')
-        self.buttonBox.addButton(self.insertButton,
-            QtGui.QDialogButtonBox.ActionRole)
+        self.splitButton = create_button(customSlideEditDialog, u'splitButton',
+            icon=u':/general/general_add.png')
+        self.insertButton = create_button(customSlideEditDialog,
+            u'insertButton', icon=u':/general/general_add.png')
+        self.buttonBox = create_button_box(customSlideEditDialog, u'buttonBox',
+            [u'cancel', u'save'], [self.splitButton, self.insertButton])
         self.dialogLayout.addWidget(self.buttonBox)
         self.retranslateUi(customSlideEditDialog)
-        QtCore.QMetaObject.connectSlotsByName(customSlideEditDialog)
 
     def retranslateUi(self, customSlideEditDialog):
         self.splitButton.setText(UiStrings().Split)

=== modified file 'openlp/plugins/custom/forms/editcustomslideform.py'
--- openlp/plugins/custom/forms/editcustomslideform.py	2012-04-02 14:23:25 +0000
+++ openlp/plugins/custom/forms/editcustomslideform.py	2012-04-03 18:01:36 +0000
@@ -46,9 +46,9 @@
         self.setupUi(self)
         # Connecting signals and slots
         QtCore.QObject.connect(self.insertButton,
-            QtCore.SIGNAL(u'clicked()'), self.onInsertButtonPressed)
+            QtCore.SIGNAL(u'clicked()'), self.onInsertButtonClicked)
         QtCore.QObject.connect(self.splitButton,
-            QtCore.SIGNAL(u'clicked()'), self.onSplitButtonPressed)
+            QtCore.SIGNAL(u'clicked()'), self.onSplitButtonClicked)
 
     def setText(self, text):
         """
@@ -68,14 +68,14 @@
         """
         return self.slideTextEdit.toPlainText().split(u'\n[===]\n')
 
-    def onInsertButtonPressed(self):
+    def onInsertButtonClicked(self):
         """
         Adds a slide split at the cursor.
         """
         self.insertSingleLineTextAtCursor(u'[===]')
         self.slideTextEdit.setFocus()
 
-    def onSplitButtonPressed(self):
+    def onSplitButtonClicked(self):
         """
         Adds a virtual split at cursor.
         """

=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
--- openlp/plugins/custom/lib/mediaitem.py	2012-03-26 09:41:59 +0000
+++ openlp/plugins/custom/lib/mediaitem.py	2012-04-03 18:01:36 +0000
@@ -75,7 +75,7 @@
             QtCore.SIGNAL(u'cleared()'), self.onClearTextButtonClick)
         QtCore.QObject.connect(self.searchTextEdit,
             QtCore.SIGNAL(u'searchTypeChanged(int)'),
-            self.onSearchTextButtonClick)
+            self.onSearchTextButtonClicked)
         QtCore.QObject.connect(Receiver.get_receiver(),
             QtCore.SIGNAL(u'custom_edit'), self.onRemoteEdit)
         QtCore.QObject.connect(Receiver.get_receiver(),
@@ -154,7 +154,7 @@
             self.edit_custom_form.loadCustom(custom_id, (remote_type == u'P'))
             self.edit_custom_form.exec_()
             self.autoSelectId = -1
-            self.onSearchTextButtonClick()
+            self.onSearchTextButtonClicked()
 
     def onEditClick(self):
         """
@@ -166,7 +166,7 @@
             self.edit_custom_form.loadCustom(item_id, False)
             self.edit_custom_form.exec_()
             self.autoSelectId = -1
-            self.onSearchTextButtonClick()
+            self.onSearchTextButtonClicked()
 
     def onDeleteClick(self):
         """
@@ -190,7 +190,7 @@
                 for item in self.listView.selectedIndexes()]
             for id in id_list:
                 self.plugin.manager.delete_object(CustomSlide, id)
-            self.onSearchTextButtonClick()
+            self.onSearchTextButtonClicked()
 
     def onFocus(self):
         self.searchTextEdit.setFocus()
@@ -226,7 +226,7 @@
         service_item.raw_footer = raw_footer
         return True
 
-    def onSearchTextButtonClick(self):
+    def onSearchTextButtonClicked(self):
         # Save the current search type to the configuration.
         QtCore.QSettings().setValue(u'%s/last search type' %
             self.settingsSection,
@@ -257,7 +257,7 @@
         """
         search_length = 2
         if len(text) > search_length:
-            self.onSearchTextButtonClick()
+            self.onSearchTextButtonClicked()
         elif len(text) == 0:
             self.onClearTextButtonClick()
 
@@ -266,7 +266,7 @@
         Clear the search text.
         """
         self.searchTextEdit.clear()
-        self.onSearchTextButtonClick()
+        self.onSearchTextButtonClicked()
 
     def search(self, string, showError):
         search_results = self.manager.get_all_objects(CustomSlide,

=== modified file 'openlp/plugins/images/lib/imagetab.py'
--- openlp/plugins/images/lib/imagetab.py	2012-04-02 10:32:52 +0000
+++ openlp/plugins/images/lib/imagetab.py	2012-04-03 18:01:36 +0000
@@ -62,7 +62,7 @@
         self.rightLayout.addStretch()
         # Signals and slots
         QtCore.QObject.connect(self.backgroundColorButton,
-            QtCore.SIGNAL(u'pressed()'), self.onbackgroundColorButtonClicked)
+            QtCore.SIGNAL(u'clicked()'), self.onbackgroundColorButtonClicked)
 
     def retranslateUi(self):
         self.bgColorGroupBox.setTitle(

=== modified file 'openlp/plugins/media/lib/mediaitem.py'
--- openlp/plugins/media/lib/mediaitem.py	2012-03-21 19:30:18 +0000
+++ openlp/plugins/media/lib/mediaitem.py	2012-04-03 18:01:36 +0000
@@ -35,7 +35,7 @@
     SettingsManager, translate, check_item_selected, Receiver, MediaType, \
     ServiceItem, build_html
 from openlp.core.lib.ui import UiStrings, critical_error_message_box, \
-    media_item_combo_box
+    create_horizontal_adjusting_combo_box
 from openlp.core.ui import Controller, Display
 from openlp.core.ui.media import get_media_players, set_media_players
 
@@ -131,7 +131,7 @@
         self.displayLayout.setObjectName(u'displayLayout')
         self.displayTypeLabel = QtGui.QLabel(self.mediaWidget)
         self.displayTypeLabel.setObjectName(u'displayTypeLabel')
-        self.displayTypeComboBox = media_item_combo_box(
+        self.displayTypeComboBox = create_horizontal_adjusting_combo_box(
             self.mediaWidget, u'displayTypeComboBox')
         self.displayTypeLabel.setBuddy(self.displayTypeComboBox)
         self.displayLayout.addRow(self.displayTypeLabel,

=== modified file 'openlp/plugins/media/lib/mediatab.py'
--- openlp/plugins/media/lib/mediatab.py	2012-03-21 19:30:18 +0000
+++ openlp/plugins/media/lib/mediatab.py	2012-04-03 18:01:36 +0000
@@ -28,7 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import SettingsTab, translate, Receiver
-from openlp.core.lib.ui import UiStrings, create_up_down_push_button_set
+from openlp.core.lib.ui import UiStrings, create_button
 from openlp.core.ui.media import get_media_players, set_media_players
 class MediaQCheckBox(QtGui.QCheckBox):
     """
@@ -87,8 +87,10 @@
         self.orderingButtonLayout = QtGui.QVBoxLayout()
         self.orderingButtonLayout.setObjectName(u'orderingButtonLayout')
         self.orderingButtonLayout.addStretch(1)
-        self.orderingUpButton, self.orderingDownButton = \
-            create_up_down_push_button_set(self)
+        self.orderingUpButton = create_button(self, u'orderingUpButton',
+            role=u'up', click=self.onUpButtonClicked)
+        self.orderingDownButton = create_button(self, u'orderingDownButton',
+            role=u'down', click=self.onDownButtonClicked)
         self.orderingButtonLayout.addWidget(self.orderingUpButton)
         self.orderingButtonLayout.addWidget(self.orderingDownButton)
         self.orderingButtonLayout.addStretch(1)

=== modified file 'openlp/plugins/presentations/lib/mediaitem.py'
--- openlp/plugins/presentations/lib/mediaitem.py	2012-03-15 06:15:21 +0000
+++ openlp/plugins/presentations/lib/mediaitem.py	2012-04-03 18:01:36 +0000
@@ -35,7 +35,7 @@
     translate, check_item_selected, Receiver, ItemCapabilities, create_thumb, \
     validate_thumb
 from openlp.core.lib.ui import UiStrings, critical_error_message_box, \
-    media_item_combo_box
+    create_horizontal_adjusting_combo_box
 from openlp.plugins.presentations.lib import MessageListener
 
 log = logging.getLogger(__name__)
@@ -110,7 +110,7 @@
         self.displayLayout.setObjectName(u'displayLayout')
         self.displayTypeLabel = QtGui.QLabel(self.presentationWidget)
         self.displayTypeLabel.setObjectName(u'displayTypeLabel')
-        self.displayTypeComboBox = media_item_combo_box(
+        self.displayTypeComboBox = create_horizontal_adjusting_combo_box(
             self.presentationWidget, u'displayTypeComboBox')
         self.displayTypeLabel.setBuddy(self.displayTypeComboBox)
         self.displayLayout.addRow(self.displayTypeLabel,

=== modified file 'openlp/plugins/songs/forms/authorsdialog.py'
--- openlp/plugins/songs/forms/authorsdialog.py	2011-12-27 10:33:55 +0000
+++ openlp/plugins/songs/forms/authorsdialog.py	2012-04-03 18:01:36 +0000
@@ -28,7 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import translate
-from openlp.core.lib.ui import create_accept_reject_button_box
+from openlp.core.lib.ui import create_button_box
 
 class Ui_AuthorsDialog(object):
     def setupUi(self, authorsDialog):
@@ -57,11 +57,11 @@
         self.displayLabel.setBuddy(self.displayEdit)
         self.authorLayout.addRow(self.displayLabel, self.displayEdit)
         self.dialogLayout.addLayout(self.authorLayout)
-        self.dialogLayout.addWidget(
-            create_accept_reject_button_box(authorsDialog))
+        self.buttonBox = create_button_box(authorsDialog, u'buttonBox',
+            [u'cancel', u'save'])
+        self.dialogLayout.addWidget(self.buttonBox)
         self.retranslateUi(authorsDialog)
         authorsDialog.setMaximumHeight(authorsDialog.sizeHint().height())
-        QtCore.QMetaObject.connectSlotsByName(authorsDialog)
 
     def retranslateUi(self, authorsDialog):
         authorsDialog.setWindowTitle(

=== modified file 'openlp/plugins/songs/forms/editsongdialog.py'
--- openlp/plugins/songs/forms/editsongdialog.py	2012-04-02 13:27:08 +0000
+++ openlp/plugins/songs/forms/editsongdialog.py	2012-04-03 18:01:36 +0000
@@ -28,8 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import build_icon, translate
-from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box, \
-    create_up_down_push_button_set
+from openlp.core.lib.ui import UiStrings, create_button_box, create_button
 from openlp.plugins.songs.lib.ui import SongStrings
 
 class Ui_EditSongDialog(object):
@@ -268,8 +267,10 @@
         self.audioRemoveAllButton.setObjectName(u'audioRemoveAllButton')
         self.audioButtonsLayout.addWidget(self.audioRemoveAllButton)
         self.audioButtonsLayout.addStretch(1)
-        self.upButton, self.downButton = \
-            create_up_down_push_button_set(self)
+        self.upButton = create_button(self, u'upButton', role=u'up',
+            click=self.onUpButtonClicked)
+        self.downButton = create_button(self, u'downButton', role=u'down',
+            click=self.onDownButtonClicked)
         self.audioButtonsLayout.addWidget(self.upButton)
         self.audioButtonsLayout.addWidget(self.downButton)
         self.audioLayout.addLayout(self.audioButtonsLayout)
@@ -282,11 +283,11 @@
         self.warningLabel.setObjectName(u'warningLabel')
         self.warningLabel.setVisible(False)
         self.bottomLayout.addWidget(self.warningLabel)
-        self.buttonBox = create_accept_reject_button_box(editSongDialog)
+        self.buttonBox = create_button_box(editSongDialog, u'buttonBox',
+            [u'cancel', u'save'])
         self.bottomLayout.addWidget(self.buttonBox)
         self.dialogLayout.addLayout(self.bottomLayout)
         self.retranslateUi(editSongDialog)
-        QtCore.QMetaObject.connectSlotsByName(editSongDialog)
 
     def retranslateUi(self, editSongDialog):
         editSongDialog.setWindowTitle(

=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py	2012-04-03 16:24:52 +0000
+++ openlp/plugins/songs/forms/editsongform.py	2012-04-03 18:01:36 +0000
@@ -34,7 +34,7 @@
 
 from openlp.core.lib import PluginStatus, Receiver, MediaType, translate, \
     create_separated_list
-from openlp.core.lib.ui import UiStrings, add_widget_completer, \
+from openlp.core.lib.ui import UiStrings, set_case_insensitive_completer, \
     critical_error_message_box, find_and_set_in_combo_box
 from openlp.core.utils import AppLocation
 from openlp.plugins.songs.forms import EditVerseForm, MediaFilesForm
@@ -68,14 +68,14 @@
             QtCore.SIGNAL(u'clicked()'), self.onAuthorRemoveButtonClicked)
         QtCore.QObject.connect(self.authorsListView,
             QtCore.SIGNAL(u'itemClicked(QListWidgetItem*)'),
-            self.onAuthorsListViewPressed)
+            self.onAuthorsListViewClicked)
         QtCore.QObject.connect(self.topicAddButton,
             QtCore.SIGNAL(u'clicked()'), self.onTopicAddButtonClicked)
         QtCore.QObject.connect(self.topicRemoveButton,
             QtCore.SIGNAL(u'clicked()'), self.onTopicRemoveButtonClicked)
         QtCore.QObject.connect(self.topicsListView,
             QtCore.SIGNAL(u'itemClicked(QListWidgetItem*)'),
-            self.onTopicListViewPressed)
+            self.onTopicListViewClicked)
         QtCore.QObject.connect(self.copyrightInsertButton,
             QtCore.SIGNAL(u'clicked()'), self.onCopyrightInsertButtonTriggered)
         QtCore.QObject.connect(self.verseAddButton,
@@ -91,7 +91,7 @@
             QtCore.SIGNAL(u'clicked()'), self.onVerseDeleteButtonClicked)
         QtCore.QObject.connect(self.verseListWidget,
             QtCore.SIGNAL(u'itemClicked(QTableWidgetItem*)'),
-            self.onVerseListViewPressed)
+            self.onVerseListViewClicked)
         QtCore.QObject.connect(self.verseOrderEdit,
             QtCore.SIGNAL(u'textChanged(QString)'),
             self.onVerseOrderTextChanged)
@@ -148,7 +148,7 @@
             self.authorsComboBox.setItemData(
                 row, QtCore.QVariant(author.id))
             self.authors.append(author.display_name)
-        add_widget_completer(self.authors, self.authorsComboBox)
+        set_case_insensitive_completer(self.authors, self.authorsComboBox)
 
     def loadTopics(self):
         self.topics = []
@@ -167,7 +167,7 @@
             combo.addItem(object.name)
             cache.append(object.name)
             combo.setItemData(row, QtCore.QVariant(object.id))
-        add_widget_completer(cache, combo)
+        set_case_insensitive_completer(cache, combo)
 
     def loadThemes(self, theme_list):
         self.themeComboBox.clear()
@@ -176,7 +176,7 @@
         for theme in theme_list:
             self.themeComboBox.addItem(theme)
             self.themes.append(theme)
-        add_widget_completer(self.themes, self.themeComboBox)
+        set_case_insensitive_completer(self.themes, self.themeComboBox)
 
     def loadMediaFiles(self):
         self.audioAddFromMediaButton.setVisible(False)
@@ -399,7 +399,7 @@
         author_item.setData(QtCore.Qt.UserRole, QtCore.QVariant(author.id))
         self.authorsListView.addItem(author_item)
 
-    def onAuthorsListViewPressed(self):
+    def onAuthorsListViewClicked(self):
         if self.authorsListView.count() > 1:
             self.authorRemoveButton.setEnabled(True)
 
@@ -450,7 +450,7 @@
                 'type in a new topic and click the "Add Topic to Song" '
                 'button to add the new topic.'))
 
-    def onTopicListViewPressed(self):
+    def onTopicListViewClicked(self):
         self.topicRemoveButton.setEnabled(True)
 
     def onTopicRemoveButtonClicked(self):
@@ -459,7 +459,7 @@
         row = self.topicsListView.row(item)
         self.topicsListView.takeItem(row)
 
-    def onVerseListViewPressed(self):
+    def onVerseListViewClicked(self):
         self.verseEditButton.setEnabled(True)
         self.verseDeleteButton.setEnabled(True)
 
@@ -716,7 +716,7 @@
 
     def onPreview(self, button):
         """
-        Save and Preview button pressed.
+        Save and Preview button clicked.
         The Song is valid so as the plugin to add it to preview to see.
 
         ``button``

=== modified file 'openlp/plugins/songs/forms/editversedialog.py'
--- openlp/plugins/songs/forms/editversedialog.py	2011-12-27 10:33:55 +0000
+++ openlp/plugins/songs/forms/editversedialog.py	2012-04-03 18:01:36 +0000
@@ -28,7 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import build_icon, translate, SpellTextEdit
-from openlp.core.lib.ui import create_accept_reject_button_box, UiStrings
+from openlp.core.lib.ui import create_button_box, UiStrings
 from openlp.plugins.songs.lib import VerseType
 
 class Ui_EditVerseDialog(object):
@@ -65,10 +65,10 @@
         self.verseTypeLayout.addWidget(self.insertButton)
         self.verseTypeLayout.addStretch()
         self.dialogLayout.addLayout(self.verseTypeLayout)
-        self.dialogLayout.addWidget(
-            create_accept_reject_button_box(editVerseDialog))
+        self.buttonBox = create_button_box(editVerseDialog, u'buttonBox',
+            [u'cancel', u'save'])
+        self.dialogLayout.addWidget(self.buttonBox)
         self.retranslateUi(editVerseDialog)
-        QtCore.QMetaObject.connectSlotsByName(editVerseDialog)
 
     def retranslateUi(self, editVerseDialog):
         editVerseDialog.setWindowTitle(

=== modified file 'openlp/plugins/songs/forms/mediafilesdialog.py'
--- openlp/plugins/songs/forms/mediafilesdialog.py	2011-12-27 10:33:55 +0000
+++ openlp/plugins/songs/forms/mediafilesdialog.py	2012-04-03 18:01:36 +0000
@@ -28,6 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import translate, build_icon
+from openlp.core.lib.ui import create_button_box
 
 class Ui_MediaFilesDialog(object):
     def setupUi(self, mediaFilesDialog):
@@ -51,19 +52,11 @@
             QtGui.QAbstractItemView.ExtendedSelection)
         self.fileListWidget.setObjectName(u'fileListWidget')
         self.filesVerticalLayout.addWidget(self.fileListWidget)
-        self.buttonBox = QtGui.QDialogButtonBox(mediaFilesDialog)
-        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
-        self.buttonBox.setStandardButtons(
-            QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok)
-        self.buttonBox.setObjectName(u'buttonBox')
+        self.buttonBox = create_button_box(mediaFilesDialog, u'buttonBox',
+            [u'cancel', u'ok'])
         self.filesVerticalLayout.addWidget(self.buttonBox)
 
         self.retranslateUi(mediaFilesDialog)
-        QtCore.QObject.connect(self.buttonBox,
-            QtCore.SIGNAL(u'accepted()'), mediaFilesDialog.accept)
-        QtCore.QObject.connect(self.buttonBox,
-            QtCore.SIGNAL(u'rejected()'), mediaFilesDialog.reject)
-        QtCore.QMetaObject.connectSlotsByName(mediaFilesDialog)
 
     def retranslateUi(self, mediaFilesDialog):
         mediaFilesDialog.setWindowTitle(

=== modified file 'openlp/plugins/songs/forms/songbookdialog.py'
--- openlp/plugins/songs/forms/songbookdialog.py	2011-12-27 10:33:55 +0000
+++ openlp/plugins/songs/forms/songbookdialog.py	2012-04-03 18:01:36 +0000
@@ -28,7 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import translate
-from openlp.core.lib.ui import create_accept_reject_button_box
+from openlp.core.lib.ui import create_button_box
 
 class Ui_SongBookDialog(object):
     def setupUi(self, songBookDialog):
@@ -51,11 +51,11 @@
         self.publisherLabel.setBuddy(self.publisherEdit)
         self.bookLayout.addRow(self.publisherLabel, self.publisherEdit)
         self.dialogLayout.addLayout(self.bookLayout)
-        self.dialogLayout.addWidget(
-            create_accept_reject_button_box(songBookDialog))
+        self.buttonBox = create_button_box(songBookDialog, u'buttonBox',
+            [u'cancel', u'save'])
+        self.dialogLayout.addWidget(self.buttonBox)
         self.retranslateUi(songBookDialog)
         songBookDialog.setMaximumHeight(songBookDialog.sizeHint().height())
-        QtCore.QMetaObject.connectSlotsByName(songBookDialog)
 
     def retranslateUi(self, songBookDialog):
         songBookDialog.setWindowTitle(

=== modified file 'openlp/plugins/songs/forms/songexportform.py'
--- openlp/plugins/songs/forms/songexportform.py	2012-02-16 20:36:35 +0000
+++ openlp/plugins/songs/forms/songexportform.py	2012-04-03 18:01:36 +0000
@@ -90,7 +90,7 @@
         """
         QtCore.QObject.connect(self.availableListWidget,
             QtCore.SIGNAL(u'itemActivated(QListWidgetItem*)'),
-            self.onItemPressed)
+            self.onItemActivated)
         QtCore.QObject.connect(self.searchLineEdit,
             QtCore.SIGNAL(u'textEdited(const QString&)'),
             self.onSearchLineEditChanged)
@@ -312,14 +312,14 @@
             QtCore.QString(unicode(text)), QtCore.Qt.MatchContains)
         ]
 
-    def onItemPressed(self, item):
+    def onItemActivated(self, item):
         """
-        Called, when an item in the *availableListWidget* has been pressed. Thes
-        item is check if it was not checked, whereas it is unchecked when it was
-        checked.
+        Called, when an item in the *availableListWidget* has been triggered.
+        The item is check if it was not checked, whereas it is unchecked when it
+        was checked.
 
         ``item``
-            The *QListWidgetItem* which was pressed.
+            The *QListWidgetItem* which was triggered.
         """
         item.setCheckState(
             QtCore.Qt.Unchecked if item.checkState() else QtCore.Qt.Checked)

=== modified file 'openlp/plugins/songs/forms/songmaintenancedialog.py'
--- openlp/plugins/songs/forms/songmaintenancedialog.py	2011-12-27 10:33:55 +0000
+++ openlp/plugins/songs/forms/songmaintenancedialog.py	2012-04-03 18:01:36 +0000
@@ -28,7 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import build_icon
-from openlp.core.lib.ui import UiStrings
+from openlp.core.lib.ui import UiStrings, create_button_box
 from openlp.plugins.songs.lib.ui import SongStrings
 
 class Ui_SongMaintenanceDialog(object):
@@ -132,18 +132,14 @@
         self.stackedLayout.addWidget(self.booksPage)
         #
         self.dialogLayout.addLayout(self.stackedLayout, 0, 1)
-        self.buttonBox = QtGui.QDialogButtonBox(songMaintenanceDialog)
-        self.buttonBox.addButton(QtGui.QDialogButtonBox.Close)
-        self.buttonBox.setObjectName(u'buttonBox')
+        self.buttonBox = create_button_box(songMaintenanceDialog, u'buttonBox',
+            [u'close'])
         self.dialogLayout.addWidget(self.buttonBox, 1, 0, 1, 2)
         self.retranslateUi(songMaintenanceDialog)
         self.stackedLayout.setCurrentIndex(0)
-        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'),
-            songMaintenanceDialog.accept)
         QtCore.QObject.connect(self.typeListWidget,
             QtCore.SIGNAL(u'currentRowChanged(int)'),
             self.stackedLayout.setCurrentIndex)
-        QtCore.QMetaObject.connectSlotsByName(songMaintenanceDialog)
 
     def retranslateUi(self, songMaintenanceDialog):
         songMaintenanceDialog.setWindowTitle(SongStrings.SongMaintenance)

=== modified file 'openlp/plugins/songs/forms/songmaintenanceform.py'
--- openlp/plugins/songs/forms/songmaintenanceform.py	2011-12-27 10:33:55 +0000
+++ openlp/plugins/songs/forms/songmaintenanceform.py	2012-04-03 18:01:36 +0000
@@ -60,23 +60,23 @@
         self.booksEditButton.setEnabled(False)
         # Signals
         QtCore.QObject.connect(self.authorsAddButton,
-            QtCore.SIGNAL(u'pressed()'), self.onAuthorAddButtonClick)
+            QtCore.SIGNAL(u'clicked()'), self.onAuthorAddButtonClicked)
         QtCore.QObject.connect(self.topicsAddButton,
-            QtCore.SIGNAL(u'pressed()'), self.onTopicAddButtonClick)
+            QtCore.SIGNAL(u'clicked()'), self.onTopicAddButtonClicked)
         QtCore.QObject.connect(self.booksAddButton,
-            QtCore.SIGNAL(u'pressed()'), self.onBookAddButtonClick)
+            QtCore.SIGNAL(u'clicked()'), self.onBookAddButtonClicked)
         QtCore.QObject.connect(self.authorsEditButton,
-            QtCore.SIGNAL(u'pressed()'), self.onAuthorEditButtonClick)
+            QtCore.SIGNAL(u'clicked()'), self.onAuthorEditButtonClicked)
         QtCore.QObject.connect(self.topicsEditButton,
-            QtCore.SIGNAL(u'pressed()'), self.onTopicEditButtonClick)
+            QtCore.SIGNAL(u'clicked()'), self.onTopicEditButtonClicked)
         QtCore.QObject.connect(self.booksEditButton,
-            QtCore.SIGNAL(u'pressed()'), self.onBookEditButtonClick)
+            QtCore.SIGNAL(u'clicked()'), self.onBookEditButtonClicked)
         QtCore.QObject.connect(self.authorsDeleteButton,
-            QtCore.SIGNAL(u'pressed()'), self.onAuthorDeleteButtonClick)
+            QtCore.SIGNAL(u'clicked()'), self.onAuthorDeleteButtonClicked)
         QtCore.QObject.connect(self.topicsDeleteButton,
-            QtCore.SIGNAL(u'pressed()'), self.onTopicDeleteButtonClick)
+            QtCore.SIGNAL(u'clicked()'), self.onTopicDeleteButtonClicked)
         QtCore.QObject.connect(self.booksDeleteButton,
-            QtCore.SIGNAL(u'pressed()'), self.onBookDeleteButtonClick)
+            QtCore.SIGNAL(u'clicked()'), self.onBookDeleteButtonClicked)
         QtCore.QObject.connect(self.authorsListWidget,
             QtCore.SIGNAL(u'currentRowChanged(int)'),
             self.onAuthorsListRowChanged)
@@ -204,7 +204,7 @@
         else:
             return True
 
-    def onAuthorAddButtonClick(self):
+    def onAuthorAddButtonClicked(self):
         self.authorform.setAutoDisplayName(True)
         if self.authorform.exec_():
             author = Author.populate(
@@ -223,7 +223,7 @@
                     message=translate('SongsPlugin.SongMaintenanceForm',
                     'This author already exists.'))
 
-    def onTopicAddButtonClick(self):
+    def onTopicAddButtonClicked(self):
         if self.topicform.exec_():
             topic = Topic.populate(name=unicode(self.topicform.nameEdit.text()))
             if self.checkTopic(topic):
@@ -238,7 +238,7 @@
                     message=translate('SongsPlugin.SongMaintenanceForm',
                     'This topic already exists.'))
 
-    def onBookAddButtonClick(self):
+    def onBookAddButtonClicked(self):
         if self.bookform.exec_():
             book = Book.populate(name=unicode(self.bookform.nameEdit.text()),
                 publisher=unicode(self.bookform.publisherEdit.text()))
@@ -254,7 +254,7 @@
                     message=translate('SongsPlugin.SongMaintenanceForm',
                     'This book already exists.'))
 
-    def onAuthorEditButtonClick(self):
+    def onAuthorEditButtonClicked(self):
         author_id = self._getCurrentItemId(self.authorsListWidget)
         if author_id == -1:
             return
@@ -299,7 +299,7 @@
                     'Could not save your modified author, because the '
                     'author already exists.'))
 
-    def onTopicEditButtonClick(self):
+    def onTopicEditButtonClicked(self):
         topic_id = self._getCurrentItemId(self.topicsListWidget)
         if topic_id == -1:
             return
@@ -331,7 +331,7 @@
                     'Could not save your modified topic, because it '
                     'already exists.'))
 
-    def onBookEditButtonClick(self):
+    def onBookEditButtonClicked(self):
         book_id = self._getCurrentItemId(self.booksListWidget)
         if book_id == -1:
             return
@@ -443,7 +443,7 @@
             self.manager.save_object(song)
         self.manager.delete_object(Book, old_book.id)
 
-    def onAuthorDeleteButtonClick(self):
+    def onAuthorDeleteButtonClicked(self):
         """
         Delete the author if the author is not attached to any songs.
         """
@@ -454,7 +454,7 @@
             translate('SongsPlugin.SongMaintenanceForm', 'This author cannot '
             'be deleted, they are currently assigned to at least one song.'))
 
-    def onTopicDeleteButtonClick(self):
+    def onTopicDeleteButtonClicked(self):
         """
         Delete the Book if the Book is not attached to any songs.
         """
@@ -465,7 +465,7 @@
             translate('SongsPlugin.SongMaintenanceForm', 'This topic cannot '
             'be deleted, it is currently assigned to at least one song.'))
 
-    def onBookDeleteButtonClick(self):
+    def onBookDeleteButtonClicked(self):
         """
         Delete the Book if the Book is not attached to any songs.
         """

=== modified file 'openlp/plugins/songs/forms/topicsdialog.py'
--- openlp/plugins/songs/forms/topicsdialog.py	2011-12-27 10:33:55 +0000
+++ openlp/plugins/songs/forms/topicsdialog.py	2012-04-03 18:01:36 +0000
@@ -28,7 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import translate
-from openlp.core.lib.ui import create_accept_reject_button_box
+from openlp.core.lib.ui import create_button_box
 
 class Ui_TopicsDialog(object):
     def setupUi(self, topicsDialog):
@@ -45,11 +45,11 @@
         self.nameLabel.setBuddy(self.nameEdit)
         self.nameLayout.addRow(self.nameLabel, self.nameEdit)
         self.dialogLayout.addLayout(self.nameLayout)
-        self.dialogLayout.addWidget(
-            create_accept_reject_button_box(topicsDialog))
+        self.buttonBox = create_button_box(topicsDialog, u'buttonBox',
+            [u'cancel', u'save'])
+        self.dialogLayout.addWidget(self.buttonBox)
         self.retranslateUi(topicsDialog)
         topicsDialog.setMaximumHeight(topicsDialog.sizeHint().height())
-        QtCore.QMetaObject.connectSlotsByName(topicsDialog)
 
     def retranslateUi(self, topicsDialog):
         topicsDialog.setWindowTitle(

=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py	2012-03-26 09:41:59 +0000
+++ openlp/plugins/songs/lib/mediaitem.py	2012-04-03 18:01:36 +0000
@@ -119,7 +119,7 @@
             QtCore.SIGNAL(u'cleared()'), self.onClearTextButtonClick)
         QtCore.QObject.connect(self.searchTextEdit,
             QtCore.SIGNAL(u'searchTypeChanged(int)'),
-            self.onSearchTextButtonClick)
+            self.onSearchTextButtonClicked)
 
     def addCustomContextActions(self):
         create_widget_action(self.listView, separator=True)
@@ -173,7 +173,7 @@
             QtCore.QVariant(SongSearch.Entire)).toInt()[0])
         self.configUpdated()
 
-    def onSearchTextButtonClick(self):
+    def onSearchTextButtonClicked(self):
         # Save the current search type to the configuration.
         QtCore.QSettings().setValue(u'%s/last search type' %
             self.settingsSection,
@@ -251,7 +251,7 @@
             item = self.buildServiceItem(self.editItem)
             self.plugin.serviceManager.replaceServiceItem(item)
         self.onRemoteEditClear()
-        self.onSearchTextButtonClick()
+        self.onSearchTextButtonClicked()
         log.debug(u'onSongListLoad - finished')
 
     def displayResultsSong(self, searchresults):
@@ -315,7 +315,7 @@
         Clear the search text.
         """
         self.searchTextEdit.clear()
-        self.onSearchTextButtonClick()
+        self.onSearchTextButtonClicked()
 
     def onSearchTextEditChanged(self, text):
         """
@@ -330,7 +330,7 @@
             elif self.searchTextEdit.currentSearchType() == SongSearch.Lyrics:
                 search_length = 3
             if len(text) > search_length:
-                self.onSearchTextButtonClick()
+                self.onSearchTextButtonClicked()
             elif len(text) == 0:
                 self.onClearTextButtonClick()
 
@@ -426,7 +426,7 @@
                 except OSError:
                     log.exception(u'Could not remove directory: %s', save_path)
                 self.plugin.manager.delete_object(Song, item_id)
-            self.onSearchTextButtonClick()
+            self.onSearchTextButtonClicked()
 
     def onCloneClick(self):
         """
@@ -578,7 +578,7 @@
             if len(item.background_audio) > 0:
                 self._updateBackgroundAudio(song, item)
             editId = song.id
-            self.onSearchTextButtonClick()
+            self.onSearchTextButtonClicked()
         elif add_song and not self.addSongFromService:
             # Make sure we temporary import formatting tags.
             song = self.openLyrics.xml_to_song(item.xml_version, True)

=== modified file 'openlp/plugins/songs/lib/songimport.py'
--- openlp/plugins/songs/lib/songimport.py	2011-12-27 10:33:55 +0000
+++ openlp/plugins/songs/lib/songimport.py	2012-04-03 18:01:36 +0000
@@ -24,6 +24,7 @@
 # with this program; if not, write to the Free Software Foundation, Inc., 59  #
 # Temple Place, Suite 330, Boston, MA 02111-1307 USA                          #
 ###############################################################################
+
 import logging
 import re
 import shutil
@@ -308,7 +309,7 @@
                 verses_changed_to_other[verse_def] = new_verse_def
                 other_count += 1
                 verse_tag = VerseType.Tags[VerseType.Other]
-                log.info(u'Versetype %s changing to %s' , verse_def,
+                log.info(u'Versetype %s changing to %s', verse_def,
                     new_verse_def)
                 verse_def = new_verse_def
             sxml.add_verse_to_lyrics(verse_tag, verse_def[1:], verse_text, lang)

=== modified file 'openlp/plugins/songs/songsplugin.py'
--- openlp/plugins/songs/songsplugin.py	2012-02-27 23:44:35 +0000
+++ openlp/plugins/songs/songsplugin.py	2012-04-03 18:01:36 +0000
@@ -151,7 +151,7 @@
             clean_song(self.manager, song)
             progressDialog.setValue(number + 1)
         self.manager.save_objects(songs)
-        self.mediaItem.onSearchTextButtonClick()
+        self.mediaItem.onSearchTextButtonClicked()
 
     def onSongImportItemClicked(self):
         if self.mediaItem:
@@ -254,7 +254,7 @@
             importer = OpenLPSongImport(self.manager, filename=db)
             importer.doImport()
         progress.setValue(len(song_dbs))
-        self.mediaItem.onSearchTextButtonClick()
+        self.mediaItem.onSearchTextButtonClicked()
 
     def finalise(self):
         """

=== modified file 'openlp/plugins/songusage/forms/songusagedeletedialog.py'
--- openlp/plugins/songusage/forms/songusagedeletedialog.py	2011-12-27 10:33:55 +0000
+++ openlp/plugins/songusage/forms/songusagedeletedialog.py	2012-04-03 18:01:36 +0000
@@ -28,6 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import translate
+from openlp.core.lib.ui import create_button_box
 
 class Ui_SongUsageDeleteDialog(object):
     def setupUi(self, songUsageDeleteDialog):
@@ -47,10 +48,8 @@
             QtGui.QCalendarWidget.NoVerticalHeader)
         self.deleteCalendar.setObjectName(u'deleteCalendar')
         self.verticalLayout.addWidget(self.deleteCalendar)
-        self.buttonBox = QtGui.QDialogButtonBox(songUsageDeleteDialog)
-        self.buttonBox.setStandardButtons(
-            QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel)
-        self.buttonBox.setObjectName(u'buttonBox')
+        self.buttonBox = create_button_box(songUsageDeleteDialog, u'buttonBox',
+            [u'cancel', u'ok'])
         self.verticalLayout.addWidget(self.buttonBox)
         self.retranslateUi(songUsageDeleteDialog)
 

=== modified file 'openlp/plugins/songusage/forms/songusagedetaildialog.py'
--- openlp/plugins/songusage/forms/songusagedetaildialog.py	2011-12-27 10:33:55 +0000
+++ openlp/plugins/songusage/forms/songusagedetaildialog.py	2012-04-03 18:01:36 +0000
@@ -28,7 +28,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
+from openlp.core.lib.ui import create_button_box
 
 class Ui_SongUsageDetailDialog(object):
     def setupUi(self, songUsageDetailDialog):
@@ -74,14 +74,13 @@
         self.saveFilePushButton.setObjectName(u'saveFilePushButton')
         self.fileHorizontalLayout.addWidget(self.saveFilePushButton)
         self.verticalLayout.addWidget(self.fileGroupBox)
-        self.buttonBox = create_accept_reject_button_box(
-            songUsageDetailDialog, True)
+        self.buttonBox = create_button_box(songUsageDetailDialog, u'buttonBox',
+            [u'cancel', u'ok'])
         self.verticalLayout.addWidget(self.buttonBox)
         self.retranslateUi(songUsageDetailDialog)
         QtCore.QObject.connect(self.saveFilePushButton,
-            QtCore.SIGNAL(u'pressed()'),
+            QtCore.SIGNAL(u'clicked()'),
             songUsageDetailDialog.defineOutputLocation)
-        QtCore.QMetaObject.connectSlotsByName(songUsageDetailDialog)
 
     def retranslateUi(self, songUsageDetailDialog):
         songUsageDetailDialog.setWindowTitle(

=== modified file 'openlp/plugins/songusage/forms/songusagedetailform.py'
--- openlp/plugins/songusage/forms/songusagedetailform.py	2011-12-27 10:33:55 +0000
+++ openlp/plugins/songusage/forms/songusagedetailform.py	2012-04-03 18:01:36 +0000
@@ -72,7 +72,7 @@
 
     def defineOutputLocation(self):
         """
-        Triggered when the Directory selection button is pressed
+        Triggered when the Directory selection button is clicked
         """
         path = QtGui.QFileDialog.getExistingDirectory(self,
             translate('SongUsagePlugin.SongUsageDetailForm',
@@ -85,7 +85,7 @@
 
     def accept(self):
         """
-        Ok was pressed so lets save the data and run the report
+        Ok was triggered so lets save the data and run the report
         """
         log.debug(u'accept')
         path = unicode(self.fileLineEdit.text())
@@ -118,7 +118,7 @@
             fileHandle = open(outname, u'w')
             for instance in usage:
                 record = u'\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",' \
-                    u'\"%s\",\"%s\"\n' % ( instance.usagedate,
+                    u'\"%s\",\"%s\"\n' % (instance.usagedate,
                     instance.usagetime, instance.title, instance.copyright,
                     instance.ccl_number, instance.authors,
                     instance.plugin_name, instance.source)


Follow ups