Changed to static metod

This commit is contained in:
Philip Ridout 2013-08-11 21:16:27 +01:00
parent 0e155daaf6
commit d42364671e
5 changed files with 6 additions and 5 deletions

View File

@ -41,7 +41,8 @@ from openlp.core.lib.ui import UiStrings
log = logging.getLogger(__name__)
class FileDialog(QtGui.QFileDialog):
def getOpenFileNames(self, parent, title, path, filters):
@staticmethod
def getOpenFileNames(parent, title, path, filters):
files = QtGui.QFileDialog.getOpenFileNames(parent, title, path, filters)
file_list = QtCore.QStringList()
for file in files:

View File

@ -337,7 +337,7 @@ class MediaManagerItem(QtGui.QWidget):
"""
Add a file to the list widget to make it available for showing
"""
files = FileDialog().getOpenFileNames(
files = FileDialog.getOpenFileNames(
self, self.onNewPrompt,
SettingsManager.get_last_dir(self.settingsSection),
self.onNewFileMasks)

View File

@ -420,7 +420,7 @@ class ThemeManager(QtGui.QWidget):
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'),
SettingsManager.get_last_dir(self.settingsSection),
unicode(translate('OpenLP.ThemeManager',

View File

@ -757,7 +757,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)'),
QtCore.QString(), filters)
for filename in filenames:

View File

@ -281,7 +281,7 @@ class SongImportForm(OpenLPWizard):
if filters:
filters += u';;'
filters += u'%s (*)' % UiStrings().AllFiles
filenames = FileDialog().getOpenFileNames(self, title,
filenames = FileDialog.getOpenFileNames(self, title,
SettingsManager.get_last_dir(self.plugin.settingsSection, 1),
filters)
if filenames: