Merge branch 'master' into wx3

This commit is contained in:
blitzmann
2015-09-29 21:35:44 -04:00
29 changed files with 124 additions and 51 deletions

View File

@@ -32,15 +32,16 @@ class Ammo(ViewColumn):
def getText(self, stuff):
if getattr(stuff, "charge", None) is not None:
shots = stuff.numShots
if shots > 0:
text = "%s (%s)" % (stuff.charge.name, stuff.numShots)
charges = stuff.numCharges
if charges > 0:
cycles = stuff.numShots
if charges != cycles:
return "%s (%d, %d cycles)" % (stuff.charge.name, charges, cycles)
else:
return "%s (%d)" % (stuff.charge.name, charges)
else:
text = stuff.charge.name
else:
text = ""
return text
return stuff.charge.name
return ""
def getImageId(self, mod):
return -1

View File

@@ -1642,7 +1642,17 @@ class FitItem(SFItem.SFBrowserItem):
self.RestoreEditButton()
return
self.deleteFit()
# to prevent accidental deletion, give dialog confirmation unless shift is depressed
if wx.GetMouseState().ShiftDown() or wx.GetMouseState().MiddleDown():
self.deleteFit()
else:
dlg = wx.MessageDialog(self,
"Do you really want to delete this fit?",
"Confirm Delete", wx.OK | wx.CANCEL | wx.ICON_QUESTION)
result = dlg.ShowModal()
dlg.Destroy()
if result == wx.ID_OK:
self.deleteFit()
def deleteFit(self, event=None):
if self.deleted: