Trigger push button actions with click signal instead of push signal

This commit is contained in:
M2j 2012-04-02 02:19:16 +02:00
parent 6657e27694
commit c747baa2ea
27 changed files with 136 additions and 151 deletions

View File

@ -260,7 +260,7 @@ class MediaManagerItem(QtGui.QWidget):
self.menu.addActions(self.listView.actions()) self.menu.addActions(self.listView.actions())
QtCore.QObject.connect(self.listView, QtCore.QObject.connect(self.listView,
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
self.onClickPressed) self.onDoubleClicked)
QtCore.QObject.connect(self.listView, QtCore.QObject.connect(self.listView,
QtCore.SIGNAL(u'itemSelectionChanged()'), QtCore.SIGNAL(u'itemSelectionChanged()'),
self.onSelectionChange) self.onSelectionChange)
@ -295,9 +295,9 @@ class MediaManagerItem(QtGui.QWidget):
self.pageLayout.addWidget(self.searchWidget) self.pageLayout.addWidget(self.searchWidget)
# Signals and slots # Signals and slots
QtCore.QObject.connect(self.searchTextEdit, QtCore.QObject.connect(self.searchTextEdit,
QtCore.SIGNAL(u'returnPressed()'), self.onSearchTextButtonClick) QtCore.SIGNAL(u'returnPressed()'), self.onSearchTextButtonClicked)
QtCore.QObject.connect(self.searchTextButton, QtCore.QObject.connect(self.searchTextButton,
QtCore.SIGNAL(u'pressed()'), self.onSearchTextButtonClick) QtCore.SIGNAL(u'clicked()'), self.onSearchTextButtonClicked)
QtCore.QObject.connect(self.searchTextEdit, QtCore.QObject.connect(self.searchTextEdit,
QtCore.SIGNAL(u'textChanged(const QString&)'), QtCore.SIGNAL(u'textChanged(const QString&)'),
self.onSearchTextEditChanged) self.onSearchTextEditChanged)
@ -458,7 +458,7 @@ class MediaManagerItem(QtGui.QWidget):
raise NotImplementedError(u'MediaManagerItem.generateSlideData needs ' raise NotImplementedError(u'MediaManagerItem.generateSlideData needs '
u'to be defined by the plugin') u'to be defined by the plugin')
def onClickPressed(self): def onDoubleClicked(self):
""" """
Allows the list click action to be determined dynamically Allows the list click action to be determined dynamically
""" """

View File

@ -189,7 +189,7 @@ class SearchEdit(QtGui.QLineEdit):
def _onClearButtonClicked(self): 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 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 ``cleared()`` signal so that an application can react to the clearing
of the line edit. of the line edit.

View File

@ -112,7 +112,7 @@ class SettingsTab(QtGui.QWidget):
def cancel(self): def cancel(self):
""" """
Reset any settings if cancel pressed Reset any settings if cancel triggered
""" """
self.load() self.load()

View File

@ -28,7 +28,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import build_icon, translate from openlp.core.lib import build_icon, translate
from openlp.core.lib.ui import UiStrings, create_button_box from openlp.core.lib.ui import UiStrings, create_button, create_button_box
class Ui_AboutDialog(object): class Ui_AboutDialog(object):
def setupUi(self, aboutDialog): def setupUi(self, aboutDialog):
@ -71,10 +71,8 @@ class Ui_AboutDialog(object):
self.licenseTabLayout.addWidget(self.licenseTextEdit) self.licenseTabLayout.addWidget(self.licenseTextEdit)
self.aboutNotebook.addTab(self.licenseTab, u'') self.aboutNotebook.addTab(self.licenseTab, u'')
self.aboutDialogLayout.addWidget(self.aboutNotebook) self.aboutDialogLayout.addWidget(self.aboutNotebook)
self.contributeButton = QtGui.QPushButton() self.contributeButton = create_button(None, u'contributeButton',
self.contributeButton.setIcon( icon=u':/system/system_contribute.png')
build_icon(u':/system/system_contribute.png'))
self.contributeButton.setObjectName(u'contributeButton')
self.buttonBox = create_button_box(aboutDialog, u'buttonBox', self.buttonBox = create_button_box(aboutDialog, u'buttonBox',
[u'close'], [self.contributeButton]) [u'close'], [self.contributeButton])
self.aboutDialogLayout.addWidget(self.buttonBox) self.aboutDialogLayout.addWidget(self.buttonBox)

View File

@ -246,22 +246,22 @@ class AdvancedTab(SettingsTab):
QtCore.SIGNAL(u'textChanged(QString)'), QtCore.SIGNAL(u'textChanged(QString)'),
self.updateServiceNameExample) self.updateServiceNameExample)
QtCore.QObject.connect(self.serviceNameRevertButton, QtCore.QObject.connect(self.serviceNameRevertButton,
QtCore.SIGNAL(u'pressed()'), QtCore.SIGNAL(u'clicked()'),
self.onServiceNameRevertButtonPressed) self.onServiceNameRevertButtonClicked)
QtCore.QObject.connect(self.defaultColorButton, QtCore.QObject.connect(self.defaultColorButton,
QtCore.SIGNAL(u'pressed()'), self.onDefaultColorButtonPressed) QtCore.SIGNAL(u'clicked()'), self.onDefaultColorButtonClicked)
QtCore.QObject.connect(self.defaultBrowseButton, QtCore.QObject.connect(self.defaultBrowseButton,
QtCore.SIGNAL(u'pressed()'), self.onDefaultBrowseButtonPressed) QtCore.SIGNAL(u'clicked()'), self.onDefaultBrowseButtonClicked)
QtCore.QObject.connect(self.defaultRevertButton, QtCore.QObject.connect(self.defaultRevertButton,
QtCore.SIGNAL(u'pressed()'), self.onDefaultRevertButtonPressed) QtCore.SIGNAL(u'clicked()'), self.onDefaultRevertButtonClicked)
QtCore.QObject.connect(self.x11BypassCheckBox, QtCore.QObject.connect(self.x11BypassCheckBox,
QtCore.SIGNAL(u'toggled(bool)'), self.onX11BypassCheckBoxToggled) QtCore.SIGNAL(u'toggled(bool)'), self.onX11BypassCheckBoxToggled)
QtCore.QObject.connect(self.endSlideRadioButton, QtCore.QObject.connect(self.endSlideRadioButton,
QtCore.SIGNAL(u'pressed()'), self.onEndSlideButtonPressed) QtCore.SIGNAL(u'clicked()'), self.onEndSlideButtonClicked)
QtCore.QObject.connect(self.wrapSlideRadioButton, QtCore.QObject.connect(self.wrapSlideRadioButton,
QtCore.SIGNAL(u'pressed()'), self.onWrapSlideButtonPressed) QtCore.SIGNAL(u'clicked()'), self.onWrapSlideButtonClicked)
QtCore.QObject.connect(self.nextItemRadioButton, QtCore.QObject.connect(self.nextItemRadioButton,
QtCore.SIGNAL(u'pressed()'), self.onnextItemButtonPressed) QtCore.SIGNAL(u'clicked()'), self.onnextItemButtonClicked)
def retranslateUi(self): def retranslateUi(self):
""" """
@ -506,11 +506,11 @@ class AdvancedTab(SettingsTab):
self.serviceNameTime.setEnabled(service_day is not 7) self.serviceNameTime.setEnabled(service_day is not 7)
self.updateServiceNameExample(None) self.updateServiceNameExample(None)
def onServiceNameRevertButtonPressed(self): def onServiceNameRevertButtonClicked(self):
self.serviceNameEdit.setText(self.defaultServiceName) self.serviceNameEdit.setText(self.defaultServiceName)
self.serviceNameEdit.setFocus() self.serviceNameEdit.setFocus()
def onDefaultColorButtonPressed(self): def onDefaultColorButtonClicked(self):
new_color = QtGui.QColorDialog.getColor( new_color = QtGui.QColorDialog.getColor(
QtGui.QColor(self.defaultColor), self) QtGui.QColor(self.defaultColor), self)
if new_color.isValid(): if new_color.isValid():
@ -518,7 +518,7 @@ class AdvancedTab(SettingsTab):
self.defaultColorButton.setStyleSheet( self.defaultColorButton.setStyleSheet(
u'background-color: %s' % self.defaultColor) u'background-color: %s' % self.defaultColor)
def onDefaultBrowseButtonPressed(self): def onDefaultBrowseButtonClicked(self):
file_filters = u'%s;;%s (*.*) (*)' % (get_images_filter(), file_filters = u'%s;;%s (*.*) (*)' % (get_images_filter(),
UiStrings().AllFiles) UiStrings().AllFiles)
filename = QtGui.QFileDialog.getOpenFileName(self, filename = QtGui.QFileDialog.getOpenFileName(self,
@ -528,7 +528,7 @@ class AdvancedTab(SettingsTab):
self.defaultFileEdit.setText(filename) self.defaultFileEdit.setText(filename)
self.defaultFileEdit.setFocus() self.defaultFileEdit.setFocus()
def onDefaultRevertButtonPressed(self): def onDefaultRevertButtonClicked(self):
self.defaultFileEdit.setText(u':/graphics/openlp-splash-screen.png') self.defaultFileEdit.setText(u':/graphics/openlp-splash-screen.png')
self.defaultFileEdit.setFocus() self.defaultFileEdit.setFocus()
@ -541,11 +541,11 @@ class AdvancedTab(SettingsTab):
""" """
self.displayChanged = True self.displayChanged = True
def onEndSlideButtonPressed(self): def onEndSlideButtonClicked(self):
self.slide_limits = SlideLimits.End self.slide_limits = SlideLimits.End
def onWrapSlideButtonPressed(self): def onWrapSlideButtonClicked(self):
self.slide_limits = SlideLimits.Wrap self.slide_limits = SlideLimits.Wrap
def onnextItemButtonPressed(self): def onnextItemButtonClicked(self):
self.slide_limits = SlideLimits.Next self.slide_limits = SlideLimits.Next

View File

@ -28,7 +28,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate, build_icon from openlp.core.lib import translate, build_icon
from openlp.core.lib.ui import create_button_box from openlp.core.lib.ui import create_button, create_button_box
class Ui_ExceptionDialog(object): class Ui_ExceptionDialog(object):
def setupUi(self, exceptionDialog): def setupUi(self, exceptionDialog):
@ -63,16 +63,15 @@ class Ui_ExceptionDialog(object):
self.exceptionTextEdit.setReadOnly(True) self.exceptionTextEdit.setReadOnly(True)
self.exceptionTextEdit.setObjectName(u'exceptionTextEdit') self.exceptionTextEdit.setObjectName(u'exceptionTextEdit')
self.exceptionLayout.addWidget(self.exceptionTextEdit) self.exceptionLayout.addWidget(self.exceptionTextEdit)
self.sendReportButton = QtGui.QPushButton(exceptionDialog) self.sendReportButton = create_button(exceptionDialog,
self.sendReportButton.setIcon(build_icon( u'sendReportButton', icon=u':/general/general_email.png',
u':/general/general_email.png')) click=self.onSendReportButtonClicked)
self.sendReportButton.setObjectName(u'sendReportButton') self.saveReportButton = create_button(exceptionDialog,
self.saveReportButton = QtGui.QPushButton(exceptionDialog) u'saveReportButton', icon=u':/general/general_save.png',
self.saveReportButton.setIcon(build_icon(u':/general/general_save.png')) click=self.onSaveReportButtonClicked)
self.saveReportButton.setObjectName(u'saveReportButton') self.attachFileButton = create_icon(exceptionDialog,
self.attachFileButton = QtGui.QPushButton(exceptionDialog) u'attachFileButton', icon=u':/general/general_open.png',
self.attachFileButton.setIcon(build_icon(u':/general/general_open.png')) click=self.onAttachFileButtonClicked)
self.attachFileButton.setObjectName(u'attachFileButton')
self.buttonBox = create_button_box(exceptionDialog, u'buttonBox', self.buttonBox = create_button_box(exceptionDialog, u'buttonBox',
[u'close'], [self.sendReportButton, self.saveReportButton, [u'close'], [self.sendReportButton, self.saveReportButton,
self.attachFileButton]) self.attachFileButton])
@ -81,12 +80,6 @@ class Ui_ExceptionDialog(object):
self.retranslateUi(exceptionDialog) self.retranslateUi(exceptionDialog)
QtCore.QObject.connect(self.descriptionTextEdit, QtCore.QObject.connect(self.descriptionTextEdit,
QtCore.SIGNAL(u'textChanged()'), self.onDescriptionUpdated) QtCore.SIGNAL(u'textChanged()'), self.onDescriptionUpdated)
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)
def retranslateUi(self, exceptionDialog): def retranslateUi(self, exceptionDialog):
exceptionDialog.setWindowTitle( exceptionDialog.setWindowTitle(

View File

@ -133,7 +133,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
system = system + u'Desktop: GNOME\n' system = system + u'Desktop: GNOME\n'
return (openlp_version, description, traceback, system, libraries) return (openlp_version, description, traceback, system, libraries)
def onSaveReportButtonPressed(self): def onSaveReportButtonClicked(self):
""" """
Saving exception log and system informations to a file. Saving exception log and system informations to a file.
""" """
@ -169,7 +169,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
finally: finally:
report_file.close() report_file.close()
def onSendReportButtonPressed(self): def onSendReportButtonClicked(self):
""" """
Opening systems default email client and inserting exception log and Opening systems default email client and inserting exception log and
system informations. system informations.
@ -210,7 +210,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
unicode(translate('OpenLP.ExceptionDialog', unicode(translate('OpenLP.ExceptionDialog',
'Description characters to enter : %s')) % count) 'Description characters to enter : %s')) % count)
def onAttachFileButtonPressed(self): def onAttachFileButtonClicked(self):
files = QtGui.QFileDialog.getOpenFileName( files = QtGui.QFileDialog.getOpenFileName(
self,translate('ImagePlugin.ExceptionDialog', self,translate('ImagePlugin.ExceptionDialog',
'Select Attachment'), 'Select Attachment'),

View File

@ -183,7 +183,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
""" """
Detects Page changes and updates as approprate. 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. # to be a -1.
if pageId != -1: if pageId != -1:
self.lastId = pageId self.lastId = pageId
@ -239,7 +239,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
def onCancelButtonClicked(self): def onCancelButtonClicked(self):
""" """
Process the pressing of the cancel button. Process the triggering of the cancel button.
""" """
if self.lastId == FirstTimePage.NoInternet or \ if self.lastId == FirstTimePage.NoInternet or \
(self.lastId <= FirstTimePage.Plugins and \ (self.lastId <= FirstTimePage.Plugins and \
@ -251,7 +251,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
def onNoInternetFinishButtonClicked(self): 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') Receiver.send_message(u'cursor_busy')
self._performWizard() self._performWizard()

View File

@ -233,14 +233,14 @@ class Ui_FirstTimeWizard(object):
self.noInternetText = translate('OpenLP.FirstTimeWizard', self.noInternetText = translate('OpenLP.FirstTimeWizard',
'No Internet connection was found. The First Time Wizard needs an ' 'No Internet connection was found. The First Time Wizard needs an '
'Internet connection in order to be able to download sample ' '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 ' '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, ' 'First Time Wizard and import this sample data at a later time, '
'check your Internet connection and re-run this wizard by ' 'check your Internet connection and re-run this wizard by '
'selecting "Tools/Re-run First Time Wizard" from OpenLP.') 'selecting "Tools/Re-run First Time Wizard" from OpenLP.')
self.cancelWizardText = translate('OpenLP.FirstTimeWizard', self.cancelWizardText = translate('OpenLP.FirstTimeWizard',
'\n\nTo cancel the First Time Wizard completely (and not start ' '\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', self.songsPage.setTitle(translate('OpenLP.FirstTimeWizard',
'Sample Songs')) 'Sample Songs'))
self.songsPage.setSubTitle(translate('OpenLP.FirstTimeWizard', self.songsPage.setSubTitle(translate('OpenLP.FirstTimeWizard',

View File

@ -50,11 +50,11 @@ class FormattingTagForm(QtGui.QDialog, Ui_FormattingTagDialog):
QtCore.QObject.connect(self.tagTableWidget, QtCore.QObject.connect(self.tagTableWidget,
QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onRowSelected) QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onRowSelected)
QtCore.QObject.connect(self.newPushButton, QtCore.QObject.connect(self.newPushButton,
QtCore.SIGNAL(u'pressed()'), self.onNewPushed) QtCore.SIGNAL(u'clicked()'), self.onNewClicked)
QtCore.QObject.connect(self.savePushButton, QtCore.QObject.connect(self.savePushButton,
QtCore.SIGNAL(u'pressed()'), self.onSavedPushed) QtCore.SIGNAL(u'clicked()'), self.onSavedClicked)
QtCore.QObject.connect(self.deletePushButton, 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()'), QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'),
self.close) self.close)
# Forces reloading of tags from openlp configuration. # Forces reloading of tags from openlp configuration.
@ -95,7 +95,7 @@ class FormattingTagForm(QtGui.QDialog, Ui_FormattingTagDialog):
self.savePushButton.setEnabled(True) self.savePushButton.setEnabled(True)
self.deletePushButton.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. Add a new tag to list only if it is not a duplicate.
""" """
@ -123,7 +123,7 @@ class FormattingTagForm(QtGui.QDialog, Ui_FormattingTagDialog):
self.onRowSelected() self.onRowSelected()
self.tagTableWidget.scrollToBottom() self.tagTableWidget.scrollToBottom()
def onDeletePushed(self): def onDeleteClicked(self):
""" """
Delete selected custom tag. Delete selected custom tag.
""" """
@ -133,7 +133,7 @@ class FormattingTagForm(QtGui.QDialog, Ui_FormattingTagDialog):
self._resetTable() self._resetTable()
FormattingTags.save_html_tags() FormattingTags.save_html_tags()
def onSavedPushed(self): def onSavedClicked(self):
""" """
Update Custom Tag details if not duplicate and save the data. Update Custom Tag details if not duplicate and save the data.
""" """

View File

@ -608,7 +608,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
def accept(self): 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 # Save the theme name
self.theme.theme_name = unicode(self.field(u'name').toString()) self.theme.theme_name = unicode(self.field(u'name').toString())

View File

@ -92,11 +92,11 @@ class ThemesTab(SettingsTab):
self.rightLayout.addWidget(self.LevelGroupBox) self.rightLayout.addWidget(self.LevelGroupBox)
self.rightLayout.addStretch() self.rightLayout.addStretch()
QtCore.QObject.connect(self.SongLevelRadioButton, QtCore.QObject.connect(self.SongLevelRadioButton,
QtCore.SIGNAL(u'pressed()'), self.onSongLevelButtonPressed) QtCore.SIGNAL(u'clicked()'), self.onSongLevelButtonClicked)
QtCore.QObject.connect(self.ServiceLevelRadioButton, QtCore.QObject.connect(self.ServiceLevelRadioButton,
QtCore.SIGNAL(u'pressed()'), self.onServiceLevelButtonPressed) QtCore.SIGNAL(u'clicked()'), self.onServiceLevelButtonClicked)
QtCore.QObject.connect(self.GlobalLevelRadioButton, QtCore.QObject.connect(self.GlobalLevelRadioButton,
QtCore.SIGNAL(u'pressed()'), self.onGlobalLevelButtonPressed) QtCore.SIGNAL(u'clicked()'), self.onGlobalLevelButtonClicked)
QtCore.QObject.connect(self.DefaultComboBox, QtCore.QObject.connect(self.DefaultComboBox,
QtCore.SIGNAL(u'activated(int)'), self.onDefaultComboBoxChanged) QtCore.SIGNAL(u'activated(int)'), self.onDefaultComboBoxChanged)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
@ -155,13 +155,13 @@ class ThemesTab(SettingsTab):
def postSetUp(self): def postSetUp(self):
Receiver.send_message(u'theme_update_global', self.global_theme) Receiver.send_message(u'theme_update_global', self.global_theme)
def onSongLevelButtonPressed(self): def onSongLevelButtonClicked(self):
self.theme_level = ThemeLevel.Song self.theme_level = ThemeLevel.Song
def onServiceLevelButtonPressed(self): def onServiceLevelButtonClicked(self):
self.theme_level = ThemeLevel.Service self.theme_level = ThemeLevel.Service
def onGlobalLevelButtonPressed(self): def onGlobalLevelButtonClicked(self):
self.theme_level = ThemeLevel.Global self.theme_level = ThemeLevel.Global
def onDefaultComboBoxChanged(self, value): def onDefaultComboBoxChanged(self, value):

View File

@ -68,20 +68,16 @@ class Ui_AlertDialog(object):
self.saveButton.setObjectName(u'saveButton') self.saveButton.setObjectName(u'saveButton')
self.manageButtonLayout.addWidget(self.saveButton) self.manageButtonLayout.addWidget(self.saveButton)
self.deleteButton = create_button(alertDialog, u'deleteButton', self.deleteButton = create_button(alertDialog, u'deleteButton',
role=u'delete', click=alertDialog.onDeleteButtonClicked) role=u'delete', enabled=False,
self.deleteButton.setEnabled(False) click=alertDialog.onDeleteButtonClicked)
self.manageButtonLayout.addWidget(self.deleteButton) self.manageButtonLayout.addWidget(self.deleteButton)
self.manageButtonLayout.addStretch() self.manageButtonLayout.addStretch()
self.alertDialogLayout.addLayout(self.manageButtonLayout, 1, 1) self.alertDialogLayout.addLayout(self.manageButtonLayout, 1, 1)
displayIcon = build_icon(u':/general/general_live.png') displayIcon = build_icon(u':/general/general_live.png')
self.displayButton = QtGui.QPushButton(alertDialog) self.displayButton = create_button(alertDialog, u'displayButton',
self.displayButton.setEnabled(False) icon=displayIcon, enabled=False)
self.displayButton.setIcon(displayIcon) self.displayCloseButton = create_button(alertDialog,
self.displayButton.setObjectName(u'displayButton') u'displayCloseButton', icon=displayIcon, enabled=False)
self.displayCloseButton = QtGui.QPushButton(alertDialog)
self.displayCloseButton.setEnabled(False)
self.displayCloseButton.setIcon(displayIcon)
self.displayCloseButton.setObjectName(u'displayCloseButton')
self.buttonBox = create_button_box(alertDialog, u'buttonBox', self.buttonBox = create_button_box(alertDialog, u'buttonBox',
[u'close'], [self.displayButton, self.displayCloseButton]) [u'close'], [self.displayButton, self.displayCloseButton])
self.alertDialogLayout.addWidget(self.buttonBox, 2, 0, 1, 2) self.alertDialogLayout.addWidget(self.buttonBox, 2, 0, 1, 2)

View File

@ -94,9 +94,9 @@ class AlertsTab(SettingsTab):
self.rightLayout.addStretch() self.rightLayout.addStretch()
# Signals and slots # Signals and slots
QtCore.QObject.connect(self.backgroundColorButton, QtCore.QObject.connect(self.backgroundColorButton,
QtCore.SIGNAL(u'pressed()'), self.onBackgroundColorButtonClicked) QtCore.SIGNAL(u'clicked()'), self.onBackgroundColorButtonClicked)
QtCore.QObject.connect(self.fontColorButton, QtCore.QObject.connect(self.fontColorButton,
QtCore.SIGNAL(u'pressed()'), self.onFontColorButtonClicked) QtCore.SIGNAL(u'clicked()'), self.onFontColorButtonClicked)
QtCore.QObject.connect(self.fontComboBox, QtCore.QObject.connect(self.fontComboBox,
QtCore.SIGNAL(u'activated(int)'), self.onFontComboBoxClicked) QtCore.SIGNAL(u'activated(int)'), self.onFontComboBoxClicked)
QtCore.QObject.connect(self.timeoutSpinBox, QtCore.QObject.connect(self.timeoutSpinBox,

View File

@ -271,9 +271,9 @@ class BibleMediaItem(MediaManagerItem):
self.onAdvancedStyleComboBoxChanged) self.onAdvancedStyleComboBoxChanged)
# Buttons # Buttons
QtCore.QObject.connect(self.advancedSearchButton, QtCore.QObject.connect(self.advancedSearchButton,
QtCore.SIGNAL(u'pressed()'), self.onAdvancedSearchButton) QtCore.SIGNAL(u'clicked()'), self.onAdvancedSearchButton)
QtCore.QObject.connect(self.quickSearchButton, QtCore.QObject.connect(self.quickSearchButton,
QtCore.SIGNAL(u'pressed()'), self.onQuickSearchButton) QtCore.SIGNAL(u'clicked()'), self.onQuickSearchButton)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'config_updated'), self.configUpdated) QtCore.SIGNAL(u'config_updated'), self.configUpdated)
# Other stuff # Other stuff
@ -667,7 +667,7 @@ class BibleMediaItem(MediaManagerItem):
""" """
Does an advanced search and saves the search results. 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) self.advancedSearchButton.setEnabled(False)
Receiver.send_message(u'openlp_process_events') Receiver.send_message(u'openlp_process_events')
bible = unicode(self.advancedVersionComboBox.currentText()) bible = unicode(self.advancedVersionComboBox.currentText())
@ -706,7 +706,7 @@ class BibleMediaItem(MediaManagerItem):
Does a quick search and saves the search results. Quick search can Does a quick search and saves the search results. Quick search can
either be "Reference Search" or "Text Search". 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) self.quickSearchButton.setEnabled(False)
Receiver.send_message(u'openlp_process_events') Receiver.send_message(u'openlp_process_events')
bible = unicode(self.quickVersionComboBox.currentText()) bible = unicode(self.quickVersionComboBox.currentText())

View File

@ -56,20 +56,20 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
self.editSlideForm = EditCustomSlideForm(self) self.editSlideForm = EditCustomSlideForm(self)
# Connecting signals and slots # Connecting signals and slots
QtCore.QObject.connect(self.previewButton, QtCore.QObject.connect(self.previewButton,
QtCore.SIGNAL(u'pressed()'), self.onPreviewButtonPressed) QtCore.SIGNAL(u'clicked()'), self.onPreviewButtonClicked)
QtCore.QObject.connect(self.addButton, QtCore.QObject.connect(self.addButton,
QtCore.SIGNAL(u'pressed()'), self.onAddButtonPressed) QtCore.SIGNAL(u'clicked()'), self.onAddButtonClicked)
QtCore.QObject.connect(self.editButton, QtCore.QObject.connect(self.editButton,
QtCore.SIGNAL(u'pressed()'), self.onEditButtonPressed) QtCore.SIGNAL(u'clicked()'), self.onEditButtonClicked)
QtCore.QObject.connect(self.editAllButton, QtCore.QObject.connect(self.editAllButton,
QtCore.SIGNAL(u'pressed()'), self.onEditAllButtonPressed) QtCore.SIGNAL(u'clicked()'), self.onEditAllButtonClicked)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'theme_update_list'), self.loadThemes) QtCore.SIGNAL(u'theme_update_list'), self.loadThemes)
QtCore.QObject.connect(self.slideListView, QtCore.QObject.connect(self.slideListView,
QtCore.SIGNAL(u'currentRowChanged(int)'), self.onCurrentRowChanged) QtCore.SIGNAL(u'currentRowChanged(int)'), self.onCurrentRowChanged)
QtCore.QObject.connect(self.slideListView, QtCore.QObject.connect(self.slideListView,
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
self.onEditButtonPressed) self.onEditButtonClicked)
def loadThemes(self, themelist): def loadThemes(self, themelist):
self.themeComboBox.clear() self.themeComboBox.clear()
@ -154,18 +154,18 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
self.slideListView.insertItem(selectedRow + 1, qw) self.slideListView.insertItem(selectedRow + 1, qw)
self.slideListView.setCurrentRow(selectedRow + 1) self.slideListView.setCurrentRow(selectedRow + 1)
def onAddButtonPressed(self): def onAddButtonClicked(self):
self.editSlideForm.setText(u'') self.editSlideForm.setText(u'')
if self.editSlideForm.exec_(): if self.editSlideForm.exec_():
for slide in self.editSlideForm.getText(): for slide in self.editSlideForm.getText():
self.slideListView.addItem(slide) self.slideListView.addItem(slide)
def onEditButtonPressed(self): def onEditButtonClicked(self):
self.editSlideForm.setText(self.slideListView.currentItem().text()) self.editSlideForm.setText(self.slideListView.currentItem().text())
if self.editSlideForm.exec_(): if self.editSlideForm.exec_():
self.updateSlideList(self.editSlideForm.getText()) self.updateSlideList(self.editSlideForm.getText())
def onEditAllButtonPressed(self): def onEditAllButtonClicked(self):
""" """
Edits all slides. Edits all slides.
""" """
@ -179,7 +179,7 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
if self.editSlideForm.exec_(): if self.editSlideForm.exec_():
self.updateSlideList(self.editSlideForm.getText(), True) self.updateSlideList(self.editSlideForm.getText(), True)
def onPreviewButtonPressed(self): def onPreviewButtonClicked(self):
""" """
Save the custom item and preview it. Save the custom item and preview it.
""" """

View File

@ -28,7 +28,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate, SpellTextEdit, build_icon from openlp.core.lib import translate, SpellTextEdit, build_icon
from openlp.core.lib.ui import create_button_box, UiStrings from openlp.core.lib.ui import UiStrings, create_button, create_button_box
class Ui_CustomSlideEditDialog(object): class Ui_CustomSlideEditDialog(object):
def setupUi(self, customSlideEditDialog): def setupUi(self, customSlideEditDialog):
@ -38,12 +38,10 @@ class Ui_CustomSlideEditDialog(object):
self.slideTextEdit = SpellTextEdit(self) self.slideTextEdit = SpellTextEdit(self)
self.slideTextEdit.setObjectName(u'slideTextEdit') self.slideTextEdit.setObjectName(u'slideTextEdit')
self.dialogLayout.addWidget(self.slideTextEdit) self.dialogLayout.addWidget(self.slideTextEdit)
self.splitButton = QtGui.QPushButton(customSlideEditDialog) self.splitButton = create_button(customSlideEditDialog, u'splitButton',
self.splitButton.setIcon(build_icon(u':/general/general_add.png')) icon=u':/general/general_add.png')
self.splitButton.setObjectName(u'splitButton') self.insertButton = create_button(customSlideEditDialog,
self.insertButton = QtGui.QPushButton(customSlideEditDialog) u'insertButton', icon=u':/general/general_add.png')
self.insertButton.setIcon(build_icon(u':/general/general_add.png'))
self.insertButton.setObjectName(u'insertButton')
self.buttonBox = create_button_box(customSlideEditDialog, u'buttonBox', self.buttonBox = create_button_box(customSlideEditDialog, u'buttonBox',
[u'cancel', u'save'], [self.splitButton, self.insertButton]) [u'cancel', u'save'], [self.splitButton, self.insertButton])
self.dialogLayout.addWidget(self.buttonBox) self.dialogLayout.addWidget(self.buttonBox)

View File

@ -46,9 +46,9 @@ class EditCustomSlideForm(QtGui.QDialog, Ui_CustomSlideEditDialog):
self.setupUi(self) self.setupUi(self)
# Connecting signals and slots # Connecting signals and slots
QtCore.QObject.connect(self.insertButton, QtCore.QObject.connect(self.insertButton,
QtCore.SIGNAL(u'clicked()'), self.onInsertButtonPressed) QtCore.SIGNAL(u'clicked()'), self.onInsertButtonClicked)
QtCore.QObject.connect(self.splitButton, QtCore.QObject.connect(self.splitButton,
QtCore.SIGNAL(u'clicked()'), self.onSplitButtonPressed) QtCore.SIGNAL(u'clicked()'), self.onSplitButtonClicked)
def setText(self, text): def setText(self, text):
""" """
@ -68,7 +68,7 @@ class EditCustomSlideForm(QtGui.QDialog, Ui_CustomSlideEditDialog):
""" """
return self.slideTextEdit.toPlainText().split(u'\n[===]\n') return self.slideTextEdit.toPlainText().split(u'\n[===]\n')
def onInsertButtonPressed(self): def onInsertButtonClicked(self):
""" """
Adds a slide split at the cursor. Adds a slide split at the cursor.
""" """
@ -77,7 +77,7 @@ class EditCustomSlideForm(QtGui.QDialog, Ui_CustomSlideEditDialog):
self.slideTextEdit.insertPlainText(u'[===]\n') self.slideTextEdit.insertPlainText(u'[===]\n')
self.slideTextEdit.setFocus() self.slideTextEdit.setFocus()
def onSplitButtonPressed(self): def onSplitButtonClicked(self):
""" """
Adds a virtual split at cursor. Adds a virtual split at cursor.
""" """

View File

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

View File

@ -61,7 +61,7 @@ class ImageTab(SettingsTab):
self.rightLayout.addStretch() self.rightLayout.addStretch()
# Signals and slots # Signals and slots
QtCore.QObject.connect(self.backgroundColorButton, QtCore.QObject.connect(self.backgroundColorButton,
QtCore.SIGNAL(u'pressed()'), self.onbackgroundColorButtonClicked) QtCore.SIGNAL(u'clicked()'), self.onbackgroundColorButtonClicked)
def retranslateUi(self): def retranslateUi(self):
self.bgColorGroupBox.setTitle( self.bgColorGroupBox.setTitle(

View File

@ -68,14 +68,14 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
QtCore.SIGNAL(u'clicked()'), self.onAuthorRemoveButtonClicked) QtCore.SIGNAL(u'clicked()'), self.onAuthorRemoveButtonClicked)
QtCore.QObject.connect(self.authorsListView, QtCore.QObject.connect(self.authorsListView,
QtCore.SIGNAL(u'itemClicked(QListWidgetItem*)'), QtCore.SIGNAL(u'itemClicked(QListWidgetItem*)'),
self.onAuthorsListViewPressed) self.onAuthorsListViewClicked)
QtCore.QObject.connect(self.topicAddButton, QtCore.QObject.connect(self.topicAddButton,
QtCore.SIGNAL(u'clicked()'), self.onTopicAddButtonClicked) QtCore.SIGNAL(u'clicked()'), self.onTopicAddButtonClicked)
QtCore.QObject.connect(self.topicRemoveButton, QtCore.QObject.connect(self.topicRemoveButton,
QtCore.SIGNAL(u'clicked()'), self.onTopicRemoveButtonClicked) QtCore.SIGNAL(u'clicked()'), self.onTopicRemoveButtonClicked)
QtCore.QObject.connect(self.topicsListView, QtCore.QObject.connect(self.topicsListView,
QtCore.SIGNAL(u'itemClicked(QListWidgetItem*)'), QtCore.SIGNAL(u'itemClicked(QListWidgetItem*)'),
self.onTopicListViewPressed) self.onTopicListViewClicked)
QtCore.QObject.connect(self.copyrightInsertButton, QtCore.QObject.connect(self.copyrightInsertButton,
QtCore.SIGNAL(u'clicked()'), self.onCopyrightInsertButtonTriggered) QtCore.SIGNAL(u'clicked()'), self.onCopyrightInsertButtonTriggered)
QtCore.QObject.connect(self.verseAddButton, QtCore.QObject.connect(self.verseAddButton,
@ -91,7 +91,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
QtCore.SIGNAL(u'clicked()'), self.onVerseDeleteButtonClicked) QtCore.SIGNAL(u'clicked()'), self.onVerseDeleteButtonClicked)
QtCore.QObject.connect(self.verseListWidget, QtCore.QObject.connect(self.verseListWidget,
QtCore.SIGNAL(u'itemClicked(QTableWidgetItem*)'), QtCore.SIGNAL(u'itemClicked(QTableWidgetItem*)'),
self.onVerseListViewPressed) self.onVerseListViewClicked)
QtCore.QObject.connect(self.verseOrderEdit, QtCore.QObject.connect(self.verseOrderEdit,
QtCore.SIGNAL(u'textChanged(QString)'), QtCore.SIGNAL(u'textChanged(QString)'),
self.onVerseOrderTextChanged) self.onVerseOrderTextChanged)
@ -412,7 +412,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
author_item.setData(QtCore.Qt.UserRole, QtCore.QVariant(author.id)) author_item.setData(QtCore.Qt.UserRole, QtCore.QVariant(author.id))
self.authorsListView.addItem(author_item) self.authorsListView.addItem(author_item)
def onAuthorsListViewPressed(self): def onAuthorsListViewClicked(self):
if self.authorsListView.count() > 1: if self.authorsListView.count() > 1:
self.authorRemoveButton.setEnabled(True) self.authorRemoveButton.setEnabled(True)
@ -463,7 +463,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
'type in a new topic and click the "Add Topic to Song" ' 'type in a new topic and click the "Add Topic to Song" '
'button to add the new topic.')) 'button to add the new topic.'))
def onTopicListViewPressed(self): def onTopicListViewClicked(self):
self.topicRemoveButton.setEnabled(True) self.topicRemoveButton.setEnabled(True)
def onTopicRemoveButtonClicked(self): def onTopicRemoveButtonClicked(self):
@ -472,7 +472,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
row = self.topicsListView.row(item) row = self.topicsListView.row(item)
self.topicsListView.takeItem(row) self.topicsListView.takeItem(row)
def onVerseListViewPressed(self): def onVerseListViewClicked(self):
self.verseEditButton.setEnabled(True) self.verseEditButton.setEnabled(True)
self.verseDeleteButton.setEnabled(True) self.verseDeleteButton.setEnabled(True)
@ -729,7 +729,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
def onPreview(self, button): 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. The Song is valid so as the plugin to add it to preview to see.
``button`` ``button``

View File

@ -90,7 +90,7 @@ class SongExportForm(OpenLPWizard):
""" """
QtCore.QObject.connect(self.availableListWidget, QtCore.QObject.connect(self.availableListWidget,
QtCore.SIGNAL(u'itemActivated(QListWidgetItem*)'), QtCore.SIGNAL(u'itemActivated(QListWidgetItem*)'),
self.onItemPressed) self.onItemTriggered)
QtCore.QObject.connect(self.searchLineEdit, QtCore.QObject.connect(self.searchLineEdit,
QtCore.SIGNAL(u'textEdited(const QString&)'), QtCore.SIGNAL(u'textEdited(const QString&)'),
self.onSearchLineEditChanged) self.onSearchLineEditChanged)
@ -312,14 +312,14 @@ class SongExportForm(OpenLPWizard):
QtCore.QString(unicode(text)), QtCore.Qt.MatchContains) QtCore.QString(unicode(text)), QtCore.Qt.MatchContains)
] ]
def onItemPressed(self, item): def onItemTriggered(self, item):
""" """
Called, when an item in the *availableListWidget* has been pressed. Thes Called, when an item in the *availableListWidget* has been triggered.
item is check if it was not checked, whereas it is unchecked when it was The item is check if it was not checked, whereas it is unchecked when it
checked. was checked.
``item`` ``item``
The *QListWidgetItem* which was pressed. The *QListWidgetItem* which was triggered.
""" """
item.setCheckState( item.setCheckState(
QtCore.Qt.Unchecked if item.checkState() else QtCore.Qt.Checked) QtCore.Qt.Unchecked if item.checkState() else QtCore.Qt.Checked)

View File

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

View File

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

View File

@ -151,7 +151,7 @@ class SongsPlugin(Plugin):
clean_song(self.manager, song) clean_song(self.manager, song)
progressDialog.setValue(number + 1) progressDialog.setValue(number + 1)
self.manager.save_objects(songs) self.manager.save_objects(songs)
self.mediaItem.onSearchTextButtonClick() self.mediaItem.onSearchTextButtonClicked()
def onSongImportItemClicked(self): def onSongImportItemClicked(self):
if self.mediaItem: if self.mediaItem:
@ -254,7 +254,7 @@ class SongsPlugin(Plugin):
importer = OpenLPSongImport(self.manager, filename=db) importer = OpenLPSongImport(self.manager, filename=db)
importer.doImport() importer.doImport()
progress.setValue(len(song_dbs)) progress.setValue(len(song_dbs))
self.mediaItem.onSearchTextButtonClick() self.mediaItem.onSearchTextButtonClicked()
def finalise(self): def finalise(self):
""" """

View File

@ -79,7 +79,7 @@ class Ui_SongUsageDetailDialog(object):
self.verticalLayout.addWidget(self.buttonBox) self.verticalLayout.addWidget(self.buttonBox)
self.retranslateUi(songUsageDetailDialog) self.retranslateUi(songUsageDetailDialog)
QtCore.QObject.connect(self.saveFilePushButton, QtCore.QObject.connect(self.saveFilePushButton,
QtCore.SIGNAL(u'pressed()'), QtCore.SIGNAL(u'clicked()'),
songUsageDetailDialog.defineOutputLocation) songUsageDetailDialog.defineOutputLocation)
def retranslateUi(self, songUsageDetailDialog): def retranslateUi(self, songUsageDetailDialog):

View File

@ -72,7 +72,7 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog):
def defineOutputLocation(self): def defineOutputLocation(self):
""" """
Triggered when the Directory selection button is pressed Triggered when the Directory selection button is clicked
""" """
path = QtGui.QFileDialog.getExistingDirectory(self, path = QtGui.QFileDialog.getExistingDirectory(self,
translate('SongUsagePlugin.SongUsageDetailForm', translate('SongUsagePlugin.SongUsageDetailForm',
@ -85,7 +85,7 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog):
def accept(self): 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') log.debug(u'accept')
path = unicode(self.fileLineEdit.text()) path = unicode(self.fileLineEdit.text())