1
0
mirror of https://github.com/rzzzwilson/pymlac.git synced 2025-06-10 09:32:41 +00:00

Added warning if PTP file can't load

This commit is contained in:
Ross Wilson
2016-03-08 12:23:38 +07:00
parent 8794fc7682
commit ed0488f819

View File

@@ -514,6 +514,9 @@ class MyFrame(wx.Frame):
if start:
# mark start address as MAIN instructions
self.do_main_start(start)
else:
self.warn("File '%s' was not recognized as any form of PTP file"
% filename)
dlg.Destroy()
@@ -624,10 +627,6 @@ class MyFrame(wx.Frame):
global Mem, NewCycle
# thiscycle = NewCycle.next()
# processmain.process(Mem, [start], thiscycle)
thiscycle = NewCycle.next()
Mem.setUndo()
processmain.process(Mem, [start], thiscycle)
@@ -635,6 +634,11 @@ class MyFrame(wx.Frame):
grid.ClearSelection()
frame.enableUndo(True)
def warn(self, msg):
"""Display a warning message, log and graphically."""
wx.MessageBox(msg, 'Warning', wx.OK | wx.ICON_ERROR)
class MyApp(wx.App):
def OnInit(self):