comparison upmana/updatemana.py @ 43:f00b02fbf511 traipse_dev

Delete works, GUI updates wrong. Refresh now Force pulls.
author sirebral
date Wed, 05 Aug 2009 10:46:05 -0500
parents 81254b3935fb
children 15a76be834dc
comparison
equal deleted inserted replaced
42:81254b3935fb 43:f00b02fbf511
133 dlg.Centre() 133 dlg.Centre()
134 dlg.Bind(wx.EVT_RADIOBUTTON, self.PackageSet) 134 dlg.Bind(wx.EVT_RADIOBUTTON, self.PackageSet)
135 135
136 if dlg.ShowModal(): 136 if dlg.ShowModal():
137 dlg.Destroy() 137 dlg.Destroy()
138 if self.Updated:
139 self.Updated = False
140 self.filelist.SetValue('')
141 wx.CallAfter(self.check)
142 138
143 def PackageSet(self, event): 139 def PackageSet(self, event):
144 for btn in self.btn: 140 for btn in self.btn:
145 if self.btn[btn].GetValue() == True: self.current = self.btnlist[btn] 141 if self.btn[btn].GetValue() == True: self.current = self.btnlist[btn]
146 142
256 self.sizers["repolist"] = wx.StaticBoxSizer(self.box_sizers["repolist"], wx.VERTICAL) 252 self.sizers["repolist"] = wx.StaticBoxSizer(self.box_sizers["repolist"], wx.VERTICAL)
257 self.sizers["repo"] = wx.GridBagSizer(hgap=2, vgap=2) 253 self.sizers["repo"] = wx.GridBagSizer(hgap=2, vgap=2)
258 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)
259 self.manifest = manifest 255 self.manifest = manifest
260 256
261 self.id = 0; self.box = {}; self.box_name= {}; self.main = {}; self.container = {}; self.layout = {} 257 self.id = -1; self.box = {}; self.box_name= {}; self.main = {}; self.container = {}; self.layout = {}
262 self.name = {}; self.url = {}; self.url_list = {}; self.pull = {}; self.uri = {}; self.delete = {} 258 self.name = {}; self.url = {}; self.url_list = {}; self.pull = {}; self.uri = {}; self.delete = {}
263 self.defaultcheck = {}; self.default = {}; self.repotrac = {} 259 self.defaultcheck = {}; self.default = {}; self.repotrac = {}
264 self.pull_list = {}; self.delete_list = {}; self.defchecklist = {} 260 self.pull_list = {}; self.delete_list = {}; self.defchecklist = {}
265 261
266 self.BuildRepoList(None) 262 self.BuildRepoList(None)
318 self.layout[self.id].Add(self.delete[self.id], -1, wx.EXPAND) 314 self.layout[self.id].Add(self.delete[self.id], -1, wx.EXPAND)
319 self.layout[self.id].Add(self.defaultcheck[self.id], -1, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL|wx.ALL) 315 self.layout[self.id].Add(self.defaultcheck[self.id], -1, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL|wx.ALL)
320 self.layout[self.id].Add(self.default[self.id], -1, wx.EXPAND) 316 self.layout[self.id].Add(self.default[self.id], -1, wx.EXPAND)
321 self.layout[self.id].AddGrowableCol(1) 317 self.layout[self.id].AddGrowableCol(1)
322 self.container[self.id].Add(self.layout[self.id], -1, wx.EXPAND) 318 self.container[self.id].Add(self.layout[self.id], -1, wx.EXPAND)
319 #Button Events
323 self.Bind(wx.EVT_BUTTON, self.RefreshRepo, self.pull[self.id]) 320 self.Bind(wx.EVT_BUTTON, self.RefreshRepo, self.pull[self.id])
321 self.Bind(wx.EVT_BUTTON, self.DelRepo, self.delete[self.id])
324 self.sizers["repolist_layout"].Insert(0, self.container[self.id], -1, wx.EXPAND) 322 self.sizers["repolist_layout"].Insert(0, self.container[self.id], -1, wx.EXPAND)
325 self.sizers['repolist_layout'].Layout() 323 self.sizers['repolist_layout'].Layout()
326 324
327 def AddRepo(self, event): 325 def AddRepo(self, event):
328 repo = self.texts['reponame'].GetValue(); repo = repo.replace(' ', '_'); repo = 'repo-' + repo 326 repo = self.texts['reponame'].GetValue(); repo = repo.replace(' ', '_'); repo = 'repo-' + repo
333 else: 331 else:
334 repolist = repolist + self.repo 332 repolist = repolist + self.repo
335 self.manifest.SetList('UpdateManifest', 'repolist', repolist) 333 self.manifest.SetList('UpdateManifest', 'repolist', repolist)
336 self.BuildRepoList(None) 334 self.BuildRepoList(None)
337 335
336 def DelRepo(self, event):
337 self.id = self.delete_list[event.GetEventObject()]
338 repolist = self.manifest.GetList('UpdateManifest', 'repolist', '')
339 repolist.pop(self.id); self.manifest.SetList('UpdateManifest', 'repolist', repolist)
340 self.sizers["repolist_layout"].Remove(self.container[self.id])
341 self.sizers['repolist_layout'].Layout()
342
338 def RefreshRepo(self, event): 343 def RefreshRepo(self, event):
339 self.id = self.pull_list[event.GetEventObject()] 344 self.id = self.pull_list[event.GetEventObject()]
340 self.manifest.SetString('updaterepo', str(self.box_name[self.id]), self.url[self.id].GetValue()) 345 self.manifest.SetString('updaterepo', str(self.box_name[self.id]), self.url[self.id].GetValue())
341 try: 346 try:
342 commands.pull(self.ui, self.r, self.url[self.id].GetValue()) 347 commands.pull(self.ui, self.r, self.url[self.id].GetValue(), force=True)
343 except: 348 except:
344 pass 349 pass
345 350
346 class Manifest(wx.Panel): 351 class Manifest(wx.Panel):
347 def __init__(self, parent): 352 def __init__(self, parent):