forked from openlp/openlp
Changed filerenamefor to registry.
Started on test for filerenameform
This commit is contained in:
parent
6e17ff9d9e
commit
589d335d39
@ -34,18 +34,18 @@ from PyQt4 import QtGui
|
||||
|
||||
from filerenamedialog import Ui_FileRenameDialog
|
||||
|
||||
from openlp.core.lib import translate
|
||||
from openlp.core.lib import translate, Registry
|
||||
|
||||
|
||||
class FileRenameForm(QtGui.QDialog, Ui_FileRenameDialog):
|
||||
"""
|
||||
The file rename dialog
|
||||
"""
|
||||
def __init__(self, parent):
|
||||
def __init__(self):
|
||||
"""
|
||||
Constructor
|
||||
"""
|
||||
QtGui.QDialog.__init__(self, parent)
|
||||
QtGui.QDialog.__init__(self, self.main_window)
|
||||
self.setupUi(self)
|
||||
|
||||
def exec_(self, copy=False):
|
||||
@ -58,3 +58,13 @@ class FileRenameForm(QtGui.QDialog, Ui_FileRenameDialog):
|
||||
self.setWindowTitle(translate('OpenLP.FileRenameForm', 'File Rename'))
|
||||
self.fileNameEdit.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)
|
||||
|
@ -62,7 +62,7 @@ class ThemeManager(QtGui.QWidget):
|
||||
Registry().register(u'theme_manager', self)
|
||||
self.settingsSection = u'themes'
|
||||
self.themeForm = ThemeForm(self)
|
||||
self.fileRenameForm = FileRenameForm(self)
|
||||
self.fileRenameForm = FileRenameForm()
|
||||
# start with the layout
|
||||
self.layout = QtGui.QVBoxLayout(self)
|
||||
self.layout.setSpacing(0)
|
||||
|
Loading…
Reference in New Issue
Block a user