def closeProject(self): if not self.currentProject: return # Close open tabs in editor self.mainEditor.closeAllTabs() # Save datas self.saveDatas() self.currentProject = None QSettings().setValue("lastProject", "") # Clear datas self.loadEmptyDatas() self.saveTimer.stop() loadSave.clearSaveCache() # UI for i in [ self.actSave, self.actSaveAs, self.actCloseProject, self.menuEdit, self.menuView, self.menuTools, self.menuHelp ]: i.setEnabled(False) # Reload recent files self.welcome.updateValues() # Show welcome dialog self.stack.setCurrentIndex(0)
def closeProject(self): if not self.currentProject: return # Close open tabs in editor self.mainEditor.closeAllTabs() # Save datas self.saveDatas() self.currentProject = None QSettings().setValue("lastProject", "") # Clear datas self.loadEmptyDatas() self.saveTimer.stop() loadSave.clearSaveCache() # UI for i in [self.actSave, self.actSaveAs, self.actCloseProject, self.menuEdit, self.menuView, self.menuTools, self.menuHelp]: i.setEnabled(False) # Reload recent files self.welcome.updateValues() # Show welcome dialog self.stack.setCurrentIndex(0)
def saveAsFile(self): """File dialog that request a file, existing or not. Save datas to that file, which then becomes the current project.""" filename = QFileDialog.getSaveFileName( self, self.tr("Save project as..."), ".", self.tr("Manuskript project (*.msk)"))[0] if filename: self.appendToRecentFiles(filename) loadSave.clearSaveCache( ) # Ensure all file(s) are saved under new filename self.mw.saveDatas(filename) # Update Window's project name with new filename pName = os.path.split(filename)[1] if pName.endswith('.msk'): pName = pName[:-4] self.mw.setWindowTitle(pName + " - " + self.tr("Manuskript"))
def saveAsFile(self): lastDirectory = self.getLastAccessedDirectory() """File dialog that request a file, existing or not. Save data to that file, which then becomes the current project.""" filename = QFileDialog.getSaveFileName(self, self.tr("Save project as..."), lastDirectory, self.tr("Manuskript project (*.msk)"))[0] if filename: self.setLastAccessedDirectory(os.path.dirname(filename)) if filename[-4:] != ".msk": filename += ".msk" self.appendToRecentFiles(filename) loadSave.clearSaveCache() # Ensure all file(s) are saved under new filename self.mw.saveDatas(filename) # Update Window's project name with new filename pName = os.path.split(filename)[1] if pName.endswith('.msk'): pName=pName[:-4] self.mw.setWindowTitle(pName + " - " + self.tr("Manuskript"))
def closeProject(self): if not self.currentProject: return # Close open tabs in editor self.mainEditor.closeAllTabs() # Save datas self.saveDatas() self.currentProject = None QSettings().setValue("lastProject", "") # Clear datas self.loadEmptyDatas() self.saveTimer.stop() loadSave.clearSaveCache() self.breakConnections() # UI for i in [self.actOpen, self.menuRecents]: i.setEnabled(True) for i in [self.actSave, self.actSaveAs, self.actCloseProject, self.menuEdit, self.menuView, self.menuTools, self.menuHelp]: i.setEnabled(False) # Set Window's name - no project loaded self.setWindowTitle(self.tr("Manuskript")) # Reload recent files self.welcome.updateValues() # Show welcome dialog self.stack.setCurrentIndex(0)