def on_menu_new(self, event): """ Called on file>new or ctrl+n """ if not self.safeToQuit(): return self.issue_l = IssueList() self.setTitle("Untitled") self.setDirty(False) #clear all selections #TODO still needs to reset choices for elem in self.important: if type(elem) == type(wx.Choice): elem.SetSelection(0) elif type(elem) == type(wx.TextCtrl): elem.SetValue('')
def __init__(self, *args, **kwds): import glob TestingFrame.__init__(self, *args, **kwds) uppath = lambda _path, n: os.sep.join(_path.split(os.sep)[:-n]) self.settings = {} self.dark = False self.settings_file = 'settings.txt' self.dbfile = '' self.db = None self.load_db() self.Issue = Query() #TODO remove this and the errors taht causes self.issue_l = IssueList() self.search_dict = \ {intake.USER_TYPE: self.choice_user, intake.CATEGORY: self.choice_component, intake.BEST_PRACTICE: self.choice_best_practice, intake.PLATFORM: self.choice_platform, intake.WCAG: self.choice_wcag} for label, choice in self.search_dict.items(): list_items = self.db.get_column_names(label) list_items.sort() choice.AppendItems(list_items) self.isDirty: bool = False #used to save the state of changes self.name = " - TTT" self.setTitle("Untitled") self.pathname: str = '' #Fields that are requiree/important self.important = {\ TFrame.USER_TYPE: self.choice_user, TFrame.PLATFORM: self.choice_platform, TFrame.ISSUE_SUMMARY: self.text_ctrl_issue_summary, TFrame.ISSUE_DESCRIPTION: self.text_ctrl_issue_description, TFrame.STEPS: self.text_ctrl_steps_to_reproduce, TFrame.REMEDIATTION: self.text_ctrl_remediation, TFrame.SEVERITY: self.choice_severity, TFrame.CATEGORY: self.choice_component, TFrame.BEST_PRACTICE: self.choice_best_practice, TFrame.WCAG: self.choice_wcag} #sample info added to the tree self.root = self.tree_ctrl_1.AddRoot("All Issues")