def endEditMode(self): title = self.label.get_text() if len(title) == 0: title = self.startEditTitle cs = self.control.currentStory() if title != self.startEditTitle: path = cs.path if path is None: cs.path = self.control.saveDir + title else: split = os.path.split(path) if not os.path.exists(split[0] + "/" + title): cs.path = split[0] + "/" + title else: _dialog.infoDialog(self.control, "That story name is already being used.") title = self.startEditTitle self.saving = True cs.makeHistoryDir() cs.save() self.saving = False self.vbox.remove(self.label) self.label = Gtk.Label() self.label.set_text(title) self.vbox.pack_start(self.label, 0, 0, 0) self.show_all() cs.title = title self.control.storyItemBox.reset() self.control.storyItemBox.load() self.control.storyItemBox.show_all() self.control.storyItemBox.loadStoryAtIndex() self.control.storyItemBox.editing = False self.editing = False self.doubleClick = False
def shutdownUnsavedFileCheck(self): if self.control.state.backupDir and not os.path.exists(self.control.state.backupDir): _dialog.infoDialog(self.control, "Your backup directory cannot be found:\n\n" + self.control.state.backupDir) self.control.currentStory().save() for i in range(len(self.control.stories)): story = self.control.stories[i] story.index.sequence = 0 #story.sequences.index(sq) story.index.scene = 0 story.index.page = 0 story.index.line = 0 story.index.offset = 0 if not story.saved: story.save() story.close() return