Mercurial > traipse_dev
comparison upmana/updatemana.py @ 44:15a76be834dc traipse_dev
Delete button is working ok. Moving on to ignore feature then implementation.
author | sirebral |
---|---|
date | Wed, 05 Aug 2009 15:15:09 -0500 |
parents | f00b02fbf511 |
children | 50e82d8090cf |
comparison
equal
deleted
inserted
replaced
43:f00b02fbf511 | 44:15a76be834dc |
---|---|
252 self.sizers["repolist"] = wx.StaticBoxSizer(self.box_sizers["repolist"], wx.VERTICAL) | 252 self.sizers["repolist"] = wx.StaticBoxSizer(self.box_sizers["repolist"], wx.VERTICAL) |
253 self.sizers["repo"] = wx.GridBagSizer(hgap=2, vgap=2) | 253 self.sizers["repo"] = wx.GridBagSizer(hgap=2, vgap=2) |
254 self.sizers["repolist_layout"] = wx.FlexGridSizer(rows=1, cols=1, hgap=2, vgap=5) | 254 self.sizers["repolist_layout"] = wx.FlexGridSizer(rows=1, cols=1, hgap=2, vgap=5) |
255 self.manifest = manifest | 255 self.manifest = manifest |
256 | 256 |
257 self.id = -1; self.box = {}; self.box_name= {}; self.main = {}; self.container = {}; self.layout = {} | 257 self.NewRepoList(None) |
258 self.name = {}; self.url = {}; self.url_list = {}; self.pull = {}; self.uri = {}; self.delete = {} | |
259 self.defaultcheck = {}; self.default = {}; self.repotrac = {} | |
260 self.pull_list = {}; self.delete_list = {}; self.defchecklist = {} | |
261 | |
262 self.BuildRepoList(None) | 258 self.BuildRepoList(None) |
263 | 259 |
264 self.sizers["repolist_layout"].AddGrowableCol(0) | 260 self.sizers["repolist_layout"].AddGrowableCol(0) |
265 self.sizers["repolist"].Add(self.sizers["repolist_layout"], -1, wx.EXPAND) | 261 self.sizers["repolist"].Add(self.sizers["repolist_layout"], -1, wx.EXPAND) |
266 self.sizers["repo"].Add(self.sizers["repolist"], (0,0), flag=wx.EXPAND) | 262 self.sizers["repo"].Add(self.sizers["repolist"], (0,0), flag=wx.EXPAND) |
278 self.sizers["main"].AddGrowableRow(1) | 274 self.sizers["main"].AddGrowableRow(1) |
279 self.SetSizer(self.sizers["main"]) | 275 self.SetSizer(self.sizers["main"]) |
280 self.SetAutoLayout(True) | 276 self.SetAutoLayout(True) |
281 self.Fit() | 277 self.Fit() |
282 self.Bind(wx.EVT_BUTTON, self.AddRepo, self.buttons['addrepo']) | 278 self.Bind(wx.EVT_BUTTON, self.AddRepo, self.buttons['addrepo']) |
279 | |
280 def NewRepoList(self, event): | |
281 self.id = -1; self.box = {}; self.box_name= {}; self.main = {}; self.container = {}; self.layout = {} | |
282 self.name = {}; self.url = {}; self.url_list = {}; self.pull = {}; self.uri = {}; self.delete = {} | |
283 self.defaultcheck = {}; self.default = {}; self.repotrac = {} | |
284 self.pull_list = {}; self.delete_list = {}; self.defchecklist = {} | |
283 | 285 |
284 def BuildRepoList(self, event): | 286 def BuildRepoList(self, event): |
285 self.repolist = self.manifest.GetList('UpdateManifest', 'repolist', '') | 287 self.repolist = self.manifest.GetList('UpdateManifest', 'repolist', '') |
286 try: self.repolist = self.repo | 288 try: self.repolist = self.repo |
287 except: pass | 289 except: pass |
333 self.manifest.SetList('UpdateManifest', 'repolist', repolist) | 335 self.manifest.SetList('UpdateManifest', 'repolist', repolist) |
334 self.BuildRepoList(None) | 336 self.BuildRepoList(None) |
335 | 337 |
336 def DelRepo(self, event): | 338 def DelRepo(self, event): |
337 self.id = self.delete_list[event.GetEventObject()] | 339 self.id = self.delete_list[event.GetEventObject()] |
338 repolist = self.manifest.GetList('UpdateManifest', 'repolist', '') | 340 self.sizers["repolist_layout"].Hide(self.container[self.id]) |
339 repolist.pop(self.id); self.manifest.SetList('UpdateManifest', 'repolist', repolist) | 341 try: del self.box_name[self.id] |
340 self.sizers["repolist_layout"].Remove(self.container[self.id]) | 342 except: pass |
343 self.manifest.SetList('UpdateManifest', 'repolist', list(self.box_name.values())) | |
341 self.sizers['repolist_layout'].Layout() | 344 self.sizers['repolist_layout'].Layout() |
342 | 345 |
343 def RefreshRepo(self, event): | 346 def RefreshRepo(self, event): |
344 self.id = self.pull_list[event.GetEventObject()] | 347 self.id = self.pull_list[event.GetEventObject()] |
345 self.manifest.SetString('updaterepo', str(self.box_name[self.id]), self.url[self.id].GetValue()) | 348 self.manifest.SetString('updaterepo', str(self.box_name[self.id]), self.url[self.id].GetValue()) |