From 8761117d341e7ce41c3ecb364dbe82aa7c34c4dc Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 3 Apr 2013 12:19:15 +0200 Subject: [PATCH 1/2] fixed fixme: constructor --- openlp/core/lib/settingstab.py | 6 ++---- openlp/core/ui/media/playertab.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/openlp/core/lib/settingstab.py b/openlp/core/lib/settingstab.py index 8bdc60cbb..99b862958 100644 --- a/openlp/core/lib/settingstab.py +++ b/openlp/core/lib/settingstab.py @@ -184,10 +184,8 @@ class SettingsTab(QtGui.QWidget): """ Adds the media controller to the class dynamically """ -# if not hasattr(self, '_media_controller'): -# self._media_controller = Registry().get('media_controller') - # FIXME: python3 - self._media_controller = Registry().get('media_controller') + if not hasattr(self, '_media_controller'): + self._media_controller = Registry().get('media_controller') return self._media_controller media_controller = property(_get_media_controller) diff --git a/openlp/core/ui/media/playertab.py b/openlp/core/ui/media/playertab.py index 1c61a5545..3331c70ca 100644 --- a/openlp/core/ui/media/playertab.py +++ b/openlp/core/ui/media/playertab.py @@ -55,7 +55,7 @@ class PlayerTab(SettingsTab): """ Constructor """ - self.media_players = self.media_controller.media_players + self.media_players = Registry().get('media_controller').media_players self.saved_used_players = None self.icon_path = u':/media/multimedia-player.png' player_translated = translate('OpenLP.PlayerTab', 'Players') From 2c94f0df835552e47333c5e7861d58f62dcc2180 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 3 Apr 2013 12:23:52 +0200 Subject: [PATCH 2/2] fixed #FIXME: constructor --- openlp/core/ui/filerenameform.py | 22 ++++++++++------------ openlp/core/ui/serviceitemeditform.py | 4 +--- openlp/core/ui/servicenoteform.py | 4 +--- openlp/core/ui/starttimeform.py | 4 +--- 4 files changed, 13 insertions(+), 21 deletions(-) diff --git a/openlp/core/ui/filerenameform.py b/openlp/core/ui/filerenameform.py index 885824c38..a53695426 100644 --- a/openlp/core/ui/filerenameform.py +++ b/openlp/core/ui/filerenameform.py @@ -45,9 +45,7 @@ class FileRenameForm(QtGui.QDialog, Ui_FileRenameDialog): """ Constructor """ - super().__init__() - # TODO: python3 - parent correct? - #QtGui.QDialog.__init__(self, self.main_window) + super(FileRenameForm, self).__init__(Registry().get(u'main_window')) self.setupUi(self) def exec_(self, copy=False): @@ -61,12 +59,12 @@ class FileRenameForm(QtGui.QDialog, Ui_FileRenameDialog): self.file_name_edit.setFocus() return QtGui.QDialog.exec_(self) - def _get_main_window(self): - """ - Adds the main window to the class dynamically - """ - if not hasattr(self, u'_main_window'): - self._main_window = Registry().get(u'main_window') - return self._main_window - - main_window = property(_get_main_window) +# def _get_main_window(self): +# """ +# Adds the main window to the class dynamically +# """ +# if not hasattr(self, u'_main_window'): +# self._main_window = Registry().get(u'main_window') +# return self._main_window +# +# main_window = property(_get_main_window) diff --git a/openlp/core/ui/serviceitemeditform.py b/openlp/core/ui/serviceitemeditform.py index d88dd8c12..6ca1068cc 100644 --- a/openlp/core/ui/serviceitemeditform.py +++ b/openlp/core/ui/serviceitemeditform.py @@ -44,9 +44,7 @@ class ServiceItemEditForm(QtGui.QDialog, Ui_ServiceItemEditDialog): Constructor """ - super().__init__() - # TODO: python3 - parent correct? - #QtGui.QDialog.__init__(self, self.main_window) + super(ServiceItemEditForm, self).__init__(Registry().get(u'main_window')) self.setupUi(self) self.item_list = [] self.list_widget.currentRowChanged.connect(self.on_current_row_changed) diff --git a/openlp/core/ui/servicenoteform.py b/openlp/core/ui/servicenoteform.py index cd265cb3a..308d9edcf 100644 --- a/openlp/core/ui/servicenoteform.py +++ b/openlp/core/ui/servicenoteform.py @@ -43,9 +43,7 @@ class ServiceNoteForm(QtGui.QDialog): """ Constructor """ - super().__init__() - # TODO: python3 - parent correct? - #QtGui.QDialog.__init__(self, self.main_window) + super(ServiceNoteForm, self).__init__(Registry().get(u'main_window')) self.setupUi() self.retranslateUi() diff --git a/openlp/core/ui/starttimeform.py b/openlp/core/ui/starttimeform.py index f2ac090d0..bf952a2d1 100644 --- a/openlp/core/ui/starttimeform.py +++ b/openlp/core/ui/starttimeform.py @@ -45,9 +45,7 @@ class StartTimeForm(QtGui.QDialog, Ui_StartTimeDialog): """ Constructor """ - super().__init__() - # TODO: python3 - parent correct? - #QtGui.QDialog.__init__(self, self.main_window) + super(StartTimeForm, self).__init__(Registry().get(u'main_window')) self.setupUi(self) def exec_(self):