From ed0488f819d17a6d35d8d30b4d15cb5508b68c65 Mon Sep 17 00:00:00 2001 From: Ross Wilson Date: Tue, 8 Mar 2016 12:23:38 +0700 Subject: [PATCH] Added warning if PTP file can't load --- idasm/idasm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/idasm/idasm b/idasm/idasm index a1d1cbc..9c052f4 100755 --- a/idasm/idasm +++ b/idasm/idasm @@ -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):