From 49c9663dcfb0b49c744da3141916ca6568fbd4b0 Mon Sep 17 00:00:00 2001 From: Philip Ridout Date: Thu, 22 Aug 2013 20:20:02 +0000 Subject: [PATCH] renamed var, removed some uneeded ()'s --- openlp/core/lib/mediamanageritem.py | 2 +- openlp/core/ui/thememanager.py | 2 +- openlp/plugins/songs/forms/editsongform.py | 2 +- openlp/plugins/songs/forms/songimportform.py | 2 +- tests/functional/openlp_core_lib/test_file_dialog.py | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 1aa622b1e..018c6801f 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -305,7 +305,7 @@ class MediaManagerItem(QtGui.QWidget): """ Add a file to the list widget to make it available for showing """ - files = FileDialog().getOpenFileNames(self, self.on_new_prompt, + files = FileDialog.getOpenFileNames(self, self.on_new_prompt, Settings().value(self.settings_section + u'/last directory'), self.on_new_file_masks) log.info(u'New files(s) %s', files) if files: diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index a1f761d8f..1f64acbf7 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -374,7 +374,7 @@ class ThemeManager(QtGui.QWidget): Opens a file dialog to select the theme file(s) to import before attempting to extract OpenLP themes from those files. This process will load both OpenLP version 1 and version 2 themes. """ - files = FileDialog().getOpenFileNames(self, + files = FileDialog.getOpenFileNames(self, translate('OpenLP.ThemeManager', 'Select Theme Import File'), Settings().value(self.settings_section + u'/last directory import'), translate('OpenLP.ThemeManager', 'OpenLP Themes (*.theme *.otz)')) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index f73a4468c..153a96e14 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -753,7 +753,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): Loads file(s) from the filesystem. """ filters = u'%s (*)' % UiStrings().AllFiles - filenames = FileDialog().getOpenFileNames(self, + filenames = FileDialog.getOpenFileNames(self, translate('SongsPlugin.EditSongForm', 'Open File(s)'), u'', filters) for filename in filenames: item = QtGui.QListWidgetItem(os.path.split(unicode(filename))[1]) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index bd9acc943..d0378cd45 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -244,7 +244,7 @@ class SongImportForm(OpenLPWizard): if filters: filters += u';;' filters += u'%s (*)' % UiStrings().AllFiles - filenames = FileDialog().getOpenFileNames(self, title, + filenames = FileDialog.getOpenFileNames(self, title, Settings().value(self.plugin.settings_section + u'/last directory import'), filters) if filenames: listbox.addItems(filenames) diff --git a/tests/functional/openlp_core_lib/test_file_dialog.py b/tests/functional/openlp_core_lib/test_file_dialog.py index dc704eaef..b895cc67d 100644 --- a/tests/functional/openlp_core_lib/test_file_dialog.py +++ b/tests/functional/openlp_core_lib/test_file_dialog.py @@ -66,6 +66,6 @@ class TestFileDialog(TestCase): # called. The returned result should corrilate with the input. self.mocked_os.path.exists.assert_has_calls([call(u'/Valid File'), call(u'/url%20encoded%20file%20%231'), call(u'/url encoded file #1'), call(u'/non-existing'), call(u'/non-existing')]) - self.mocked_qt_gui.QmessageBox.information.called_with(self.mocked_parent, UiStrings().FNFT, - UiStrings().FNF % u'/non-existing') + self.mocked_qt_gui.QmessageBox.information.called_with(self.mocked_parent, UiStrings().FileNotFound, + UiStrings().FileNotFoundMessage % u'/non-existing') self.assertEqual(result, [u'/Valid File', u'/url encoded file #1'], u'The returned file list is incorrect') \ No newline at end of file