4 # Copyright 2009 Develer S.r.l. (http://www.develer.com/)
9 # Author: Lorenzo Berni <duplo@develer.com>
15 from PyQt4.QtGui import *
16 from PyQt4.QtCore import *
18 from BWizardPage import *
23 class BOpenPage(BWizardPage):
25 Initial page of the wizard. Permit to select the project name and the directory
26 where the project will be created.
30 BWizardPage.__init__(self, UI_LOCATION + "/project_select.ui")
31 self.setTitle(self.tr("Open an existing BeRTOS project"))
33 ## Overloaded BWizardPage methods ##
36 project = unicode(QFileDialog.getOpenFileName(self, self.tr("Open project file"), os.path.expanduser("~"), self.tr("Project file (project.bertos)")))
38 QApplication.instance().quit()
40 QApplication.instance().project = pickle.loads(open(project, "r").read())
41 self.pageContent.nameLabel.setText(os.path.basename(project.replace(os.sep + "project.bertos", "")))
42 self.pageContent.dirLabel.setText(project)