From 0df1f3932af2d710c61495849da47e514ffbce57 Mon Sep 17 00:00:00 2001 From: Patrick Zimmermann Date: Mon, 18 Feb 2013 23:26:27 +0100 Subject: [PATCH] Replace QObject.connect calls with a smarter more pythonic syntax. Courtesy of TRB143++. --- openlp/core/ui/wizard.py | 6 +++--- openlp/plugins/songs/forms/duplicatesongremovalform.py | 4 ++-- openlp/plugins/songs/forms/songreviewwidget.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/openlp/core/ui/wizard.py b/openlp/core/ui/wizard.py index 3a2596a77..de73ec005 100644 --- a/openlp/core/ui/wizard.py +++ b/openlp/core/ui/wizard.py @@ -112,10 +112,10 @@ class OpenLPWizard(QtGui.QWizard): self.registerFields() self.customInit() self.customSignals() - QtCore.QObject.connect(self, QtCore.SIGNAL(u'currentIdChanged(int)'), self.onCurrentIdChanged) + self.currentIdChanged.connect(self.onCurrentIdChanged) if self.with_progress_page: - QtCore.QObject.connect(self.errorCopyToButton, QtCore.SIGNAL(u'clicked()'), self.onErrorCopyToButtonClicked) - QtCore.QObject.connect(self.errorSaveToButton, QtCore.SIGNAL(u'clicked()'), self.onErrorSaveToButtonClicked) + self.errorCopyToButton.clicked.connect(self.onErrorCopyToButtonClicked) + self.errorSaveToButton.clicked.connect(self.onErrorSaveToButtonClicked) def setupUi(self, image): """ diff --git a/openlp/plugins/songs/forms/duplicatesongremovalform.py b/openlp/plugins/songs/forms/duplicatesongremovalform.py index 3ec93f25f..29eb1b312 100644 --- a/openlp/plugins/songs/forms/duplicatesongremovalform.py +++ b/openlp/plugins/songs/forms/duplicatesongremovalform.py @@ -70,8 +70,8 @@ class DuplicateSongRemovalForm(OpenLPWizard): """ Song wizard specific signals. """ - QtCore.QObject.connect(self.finishButton, QtCore.SIGNAL(u'clicked()'), self.onWizardExit) - QtCore.QObject.connect(self.cancelButton, QtCore.SIGNAL(u'clicked()'), self.onWizardExit) + self.finishButton.clicked.connect(self.onWizardExit) + self.cancelButton.clicked.connect(self.onWizardExit) def addCustomPages(self): """ diff --git a/openlp/plugins/songs/forms/songreviewwidget.py b/openlp/plugins/songs/forms/songreviewwidget.py index 9799a9ee7..af861205e 100644 --- a/openlp/plugins/songs/forms/songreviewwidget.py +++ b/openlp/plugins/songs/forms/songreviewwidget.py @@ -54,7 +54,7 @@ class SongReviewWidget(QtGui.QWidget): self.song = song self.setupUi() self.retranslateUi() - QtCore.QObject.connect(self.song_remove_button, QtCore.SIGNAL(u'clicked()'), self.on_remove_button_clicked) + self.song_remove_button.clicked.connect(self.on_remove_button_clicked) def setupUi(self): self.song_vertical_layout = QtGui.QVBoxLayout(self)