def __init__(self, *args, **kwargs): QtGui.QWizardPage.__init__(self, *args) self.ui = Ui_tombfile() self.ui.setupUi(self) if 'tombfile' in kwargs and kwargs['tombfile'] is not None: self.ui.tomb_line.setText(kwargs['tombfile']) self.ui.tomb_browse.clicked.connect(self.on_tomb_location_clicked)
class TombfilePage(QtGui.QWizardPage): def __init__(self, *args, **kwargs): QtGui.QWizardPage.__init__(self, *args) self.ui = Ui_tombfile() self.ui.setupUi(self) if 'tombfile' in kwargs and kwargs['tombfile'] is not None: self.ui.tomb_line.setText(kwargs['tombfile']) self.ui.tomb_browse.clicked.connect(self.on_tomb_location_clicked) def on_tomb_location_clicked(self, *args, **kwargs): filename = QtGui.QFileDialog.getOpenFileName(self, 'Select Tomb', filter="Tomb (*.tomb)") self.ui.tomb_line.setText(filename)