From 3409c491fe1ac41c240b65e161fa7936b36f4501 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 18 Jul 2013 16:11:39 +0200 Subject: [PATCH 1/3] changed constructors --- openlp/core/lib/treewidgetwithdnd.py | 2 +- openlp/core/ui/aboutform.py | 2 +- openlp/core/ui/advancedtab.py | 2 +- openlp/core/ui/generaltab.py | 2 +- openlp/core/ui/mainwindow.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openlp/core/lib/treewidgetwithdnd.py b/openlp/core/lib/treewidgetwithdnd.py index 13e1a9abd..6411333c7 100644 --- a/openlp/core/lib/treewidgetwithdnd.py +++ b/openlp/core/lib/treewidgetwithdnd.py @@ -44,7 +44,7 @@ class TreeWidgetWithDnD(QtGui.QTreeWidget): """ Initialise the tree widget """ - QtGui.QTreeWidget.__init__(self, parent) + super(TreeWidgetWithDnD, self).__init__(parent) self.mimeDataText = name self.allow_internal_dnd = False self.header().close() diff --git a/openlp/core/ui/aboutform.py b/openlp/core/ui/aboutform.py index c847f1f04..c1890dfcd 100644 --- a/openlp/core/ui/aboutform.py +++ b/openlp/core/ui/aboutform.py @@ -46,7 +46,7 @@ class AboutForm(QtGui.QDialog, Ui_AboutDialog): """ Do some initialisation stuff """ - QtGui.QDialog.__init__(self, parent) + super(AboutForm, self).__init__(parent) application_version = get_application_version() self.setupUi(self) about_text = self.about_text_edit.toPlainText() diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index b2d06fe88..7d9d72f4e 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -57,7 +57,7 @@ class AdvancedTab(SettingsTab): self.data_exists = False self.icon_path = u':/system/system_settings.png' advanced_translated = translate('OpenLP.AdvancedTab', 'Advanced') - SettingsTab.__init__(self, parent, u'Advanced', advanced_translated) + super(AdvancedTab, self).__init__(parent, u'Advanced', advanced_translated) def setupUi(self): """ diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index 7fe7beaca..111d3fb28 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -49,7 +49,7 @@ class GeneralTab(SettingsTab): self.screens = ScreenList() self.icon_path = u':/icon/openlp-logo-16x16.png' general_translated = translate('OpenLP.GeneralTab', 'General') - SettingsTab.__init__(self, parent, u'Core', general_translated) + super(GeneralTab, self).__init__(parent, u'Core', general_translated) def setupUi(self): """ diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index b143d6e01..d907a90c0 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -475,7 +475,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): """ This constructor sets up the interface, the various managers, and the plugins. """ - QtGui.QMainWindow.__init__(self) + super(MainWindow, self).__init__() Registry().register(u'main_window', self) self.clipboard = self.application.clipboard() self.arguments = self.application.args From 13c9a69de1061d4bdaab2fb43c11c6fcd6954246 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 18 Jul 2013 16:14:29 +0200 Subject: [PATCH 2/3] changed constructors --- openlp/core/ui/media/mediacontroller.py | 2 +- openlp/core/ui/media/phononplayer.py | 2 +- openlp/core/ui/splashscreen.py | 2 +- openlp/core/ui/themeform.py | 2 +- openlp/core/ui/themelayoutform.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openlp/core/ui/media/mediacontroller.py b/openlp/core/ui/media/mediacontroller.py index 71f2b4b10..b6c27e9d2 100644 --- a/openlp/core/ui/media/mediacontroller.py +++ b/openlp/core/ui/media/mediacontroller.py @@ -53,7 +53,7 @@ class MediaSlider(QtGui.QSlider): """ Constructor """ - QtGui.QSlider.__init__(self, direction) + super(MediaSlider, self).__init__(direction) self.manager = manager self.controller = controller diff --git a/openlp/core/ui/media/phononplayer.py b/openlp/core/ui/media/phononplayer.py index 2a6eb77ba..8f91abb28 100644 --- a/openlp/core/ui/media/phononplayer.py +++ b/openlp/core/ui/media/phononplayer.py @@ -87,7 +87,7 @@ class PhononPlayer(MediaPlayer): """ Constructor """ - MediaPlayer.__init__(self, parent, u'phonon') + super(PhononPlayer, self).__init__(parent, u'phonon') self.original_name = u'Phonon' self.display_name = u'&Phonon' self.parent = parent diff --git a/openlp/core/ui/splashscreen.py b/openlp/core/ui/splashscreen.py index c6f259499..be7751769 100644 --- a/openlp/core/ui/splashscreen.py +++ b/openlp/core/ui/splashscreen.py @@ -41,7 +41,7 @@ class SplashScreen(QtGui.QSplashScreen): """ Constructor """ - QtGui.QSplashScreen.__init__(self) + super(SplashScreen, self).__init__() self.setupUi() def setupUi(self): diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 007932f6e..b4dbabd54 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -58,7 +58,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): ``parent`` The QWidget-derived parent of the wizard. """ - QtGui.QWizard.__init__(self, parent) + super(ThemeForm, self).__init__(parent) self.setupUi(self) self.registerFields() self.updateThemeAllowed = True diff --git a/openlp/core/ui/themelayoutform.py b/openlp/core/ui/themelayoutform.py index a8cb7cb84..fb982ecd3 100644 --- a/openlp/core/ui/themelayoutform.py +++ b/openlp/core/ui/themelayoutform.py @@ -42,7 +42,7 @@ class ThemeLayoutForm(QtGui.QDialog, Ui_ThemeLayoutDialog): """ Constructor """ - QtGui.QDialog.__init__(self, parent) + super(ThemeLayoutForm, self).__init__(parent) self.setupUi(self) def exec_(self, image): From 1571cab0cfea8eae33dfc06ba6404b4105149727 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 18 Jul 2013 16:19:01 +0200 Subject: [PATCH 3/3] changed constructors --- openlp/core/lib/spelltextedit.py | 2 +- openlp/core/ui/exceptionform.py | 2 +- openlp/core/ui/firsttimelanguageform.py | 2 +- openlp/core/ui/formattingtagform.py | 2 +- openlp/core/ui/media/playertab.py | 2 +- openlp/core/ui/media/vlcplayer.py | 5 ++--- openlp/core/ui/media/webkitplayer.py | 2 +- openlp/core/ui/pluginform.py | 2 +- openlp/core/ui/printserviceform.py | 2 +- openlp/core/ui/servicemanager.py | 2 +- openlp/core/ui/settingsform.py | 2 +- 11 files changed, 12 insertions(+), 13 deletions(-) diff --git a/openlp/core/lib/spelltextedit.py b/openlp/core/lib/spelltextedit.py index 168ce528f..e4fa5fa4e 100644 --- a/openlp/core/lib/spelltextedit.py +++ b/openlp/core/lib/spelltextedit.py @@ -60,7 +60,7 @@ class SpellTextEdit(QtGui.QPlainTextEdit): Constructor. """ global ENCHANT_AVAILABLE - QtGui.QPlainTextEdit.__init__(self, parent) + super(SpellTextEdit, self).__init__(parent) self.formatting_tags_allowed = formatting_tags_allowed # Default dictionary based on the current locale. if ENCHANT_AVAILABLE: diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 49d6b0bef..1de11b1af 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -117,7 +117,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog): """ Constructor. """ - QtGui.QDialog.__init__(self, parent) + super(ExceptionForm, self).__init__(parent) self.setupUi(self) self.settings_section = u'crashreport' diff --git a/openlp/core/ui/firsttimelanguageform.py b/openlp/core/ui/firsttimelanguageform.py index 14b9dadc3..2d024b6c1 100644 --- a/openlp/core/ui/firsttimelanguageform.py +++ b/openlp/core/ui/firsttimelanguageform.py @@ -44,7 +44,7 @@ class FirstTimeLanguageForm(QtGui.QDialog, Ui_FirstTimeLanguageDialog): """ Constructor """ - QtGui.QDialog.__init__(self, parent) + super(FirstTimeLanguageForm, self).__init__(parent) self.setupUi(self) self.qmList = LanguageManager.get_qm_list() self.language_combo_box.addItem(u'Autodetect') diff --git a/openlp/core/ui/formattingtagform.py b/openlp/core/ui/formattingtagform.py index d2390c2f9..f69ca7fc7 100644 --- a/openlp/core/ui/formattingtagform.py +++ b/openlp/core/ui/formattingtagform.py @@ -46,7 +46,7 @@ class FormattingTagForm(QtGui.QDialog, Ui_FormattingTagDialog): """ Constructor """ - QtGui.QDialog.__init__(self, parent) + super(FormattingTagForm, self).__init__(parent) self.setupUi(self) self.tag_table_widget.itemSelectionChanged.connect(self.on_row_selected) self.new_push_button.clicked.connect(self.on_new_clicked) diff --git a/openlp/core/ui/media/playertab.py b/openlp/core/ui/media/playertab.py index 3331c70ca..3fc4f682c 100644 --- a/openlp/core/ui/media/playertab.py +++ b/openlp/core/ui/media/playertab.py @@ -59,7 +59,7 @@ class PlayerTab(SettingsTab): self.saved_used_players = None self.icon_path = u':/media/multimedia-player.png' player_translated = translate('OpenLP.PlayerTab', 'Players') - SettingsTab.__init__(self, parent, u'Players', player_translated) + super(PlayerTab, self).__init__(parent, u'Players', player_translated) def setupUi(self): """ diff --git a/openlp/core/ui/media/vlcplayer.py b/openlp/core/ui/media/vlcplayer.py index 8c943dc82..40be8290d 100644 --- a/openlp/core/ui/media/vlcplayer.py +++ b/openlp/core/ui/media/vlcplayer.py @@ -98,15 +98,14 @@ VIDEO_EXT = [ class VlcPlayer(MediaPlayer): """ - A specialised version of the MediaPlayer class, which provides a VLC - display. + A specialised version of the MediaPlayer class, which provides a VLC display. """ def __init__(self, parent): """ Constructor """ - MediaPlayer.__init__(self, parent, u'vlc') + super(VlcPlayer, self).__init__(parent, u'vlc') self.original_name = u'VLC' self.display_name = u'&VLC' self.parent = parent diff --git a/openlp/core/ui/media/webkitplayer.py b/openlp/core/ui/media/webkitplayer.py index e534a974b..5c348d556 100644 --- a/openlp/core/ui/media/webkitplayer.py +++ b/openlp/core/ui/media/webkitplayer.py @@ -213,7 +213,7 @@ class WebkitPlayer(MediaPlayer): """ Constructor """ - MediaPlayer.__init__(self, parent, u'webkit') + super(WebkitPlayer, self).__init__(parent, u'webkit') self.original_name = u'WebKit' self.display_name = u'&WebKit' self.parent = parent diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index 4f4824fb7..038cca159 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.py @@ -48,7 +48,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): """ Constructor """ - QtGui.QDialog.__init__(self, parent) + super(PluginForm, self).__init__(parent) self.activePlugin = None self.programaticChange = False self.setupUi(self) diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 169478106..00a68a847 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -118,7 +118,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): """ Constructor """ - QtGui.QDialog.__init__(self, Registry().get('main_window')) + super(PrintServiceForm, self).__init__(Registry().get('main_window')) self.printer = QtGui.QPrinter() self.print_dialog = QtGui.QPrintDialog(self.printer, self) self.document = QtGui.QTextDocument() diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index e02036bf2..839d2b571 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -295,7 +295,7 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog): """ Sets up the service manager, toolbars, list view, et al. """ - QtGui.QWidget.__init__(self, parent) + super(ServiceManager, self).__init__(parent) self.active = build_icon(u':/media/auto-start_active.png') self.inactive = build_icon(u':/media/auto-start_inactive.png') Registry().register(u'service_manager', self) diff --git a/openlp/core/ui/settingsform.py b/openlp/core/ui/settingsform.py index bc40539cf..174b5da3e 100644 --- a/openlp/core/ui/settingsform.py +++ b/openlp/core/ui/settingsform.py @@ -51,7 +51,7 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog): """ Registry().register(u'settings_form', self) Registry().register_function(u'bootstrap_post_set_up', self.post_set_up) - QtGui.QDialog.__init__(self, parent) + super(SettingsForm, self).__init__(parent) self.processes = [] self.setupUi(self)