def open(self): if not self.saveQuestion(): return() try: self.pasoinfo.hide() self.pasopackages.hide() self.horizontalLayout.removeWidget(self.pasoinfo) self.horizontalLayout.removeWidget(self.pasopackages) except: pass fileName = QtGui.QFileDialog.getOpenFileName(self, "",self.preferences.config.workspace, "Paso (*%s)" %const.PASO_EXT) if fileName: data = loadPaso(unicode(fileName)) if data: self.pasoFName = os.path.basename(unicode(fileName)) self.pasoinfo = pasoInfo() self.pasopackages = pasoPackages() self.pasoinfo.setHeader(data.header) self.pasoinfo.setTitle(self.pasoFName) self.pasopackages.setFromList(data.packages.files.keys()) self.horizontalLayout.addWidget(self.pasoinfo) self.horizontalLayout.addWidget(self.pasopackages) self.actionBuild_from_Installation.setEnabled(True) self.actionSave.setEnabled(True) self.actionSave_as.setEnabled(True) self.actionExport.setEnabled(False) self.actionBuild_installation_image.setEnabled(True) self.setWindowTitle("%s - %s" %(const.NAME, self.pasoFName)) else: self.message(self.msg[23])
def new(self): if not self.saveQuestion(): return() try: self.pasoinfo.hide() self.pasopackages.hide() self.horizontalLayout.removeWidget(self.pasoinfo) self.horizontalLayout.removeWidget(self.pasopackages) except: pass self.pasoinfo = pasoInfo() header = self.pasoinfo.getHeader() header.pn = self.preferences.config.name header.pm = self.preferences.config.email self.pasoinfo.setHeader(header) self.horizontalLayout.addWidget(self.pasoinfo) self.actionBuild_from_Installation.setEnabled(True) self.pasoFName = "" self.actionSave.setEnabled(False) self.actionBuild_installation_image.setEnabled(False) self.actionSave_as.setEnabled(False) self.actionExport.setEnabled(False) self.setWindowTitle(const.NAME)