def on_saveas_selected(self, evt, set_name=False): path = wx.FileSelector(_("Select file"), wildcard=wildcard, flags=wx.FD_SAVE, parent=self) if path: self.update_current_node_text() if self.file.track_tree_state: # Update the selected item before saving if needed node = self.tree.GetItemData(self.tree.Selection) self.file.selected_item = orgutils.get_node_path(node) orgutils.save_file(self.file, path) if set_name: self.file_name = path
def on_save_selected(self, evt): self.update_current_node_text() if self.file.modified: if self.file_name: if self.file.track_tree_state: # Update the selected item before saving if needed node = self.tree.GetItemPyData(self.tree.Selection) self.file.selected_item = orgutils.get_node_path(node) orgutils.save_file(self.file, self.file_name) self.file.modified = False else: self.on_saveas_selected(evt, True)
def on_save_selected(self, evt): self.update_current_node_text() if self.file.modified: if self.file_name: if self.file.track_tree_state: # Update the selected item before saving if needed node = self.tree.GetItemData(self.tree.Selection) self.file.selected_item = orgutils.get_node_path(node) orgutils.save_file(self.file, self.file_name) self.file.modified = False else: self.on_saveas_selected(evt, True)
def on_saveas_selected(self, evt, set_name=False): path = wx.FileSelector(_("Select file"), wildcard=wildcard, flags=wx.SAVE, parent=self) if path: self.update_current_node_text() if self.file.track_tree_state: # Update the selected item before saving if needed node = self.tree.GetItemPyData(self.tree.Selection) self.file.selected_item = orgutils.get_node_path(node) orgutils.save_file(self.file, path) if set_name: self.file_name = path