def OnAddRepository(self, e): dlg = AddRepositoryDialog(None, None) result = dlg.ShowModal() if wx.ID_OK == result: ri = RepoInfo() ri.url = dlg.url ri.username = dlg.username ri.password = dlg.password self.config.repositories.append(ri) self.config.save() self.refreshList() dlg.Destroy()
def OnEditRepository(self, e): url = self.chkListBox.GetStrings()[self.chkListBox.GetSelections()[0]] for repoInfo in self.config.repositories: if repoInfo.url == url: repo = repoInfo break dlg = AddRepositoryDialog(repo, None) result = dlg.ShowModal() if wx.ID_OK == result: ri = RepoInfo() ri.url = dlg.url ri.username = dlg.username ri.password = dlg.password self.config.repositories.append(ri) self.config.save() self.refreshList() dlg.Destroy()