# HG changeset patch
# User greg
# Date 1247831259 -7200
# Node ID ecaac955c16a0f1958621d4bd0651a87dd93f97d
# Parent  84fb13d1b3d2914b58542a7902f46e5fb95a1b05
fix message dialog when objdictedit can't find the pdf reader

diff -r 84fb13d1b3d2 -r ecaac955c16a objdictgen/doc_index/DS301_index.py
--- a/objdictgen/doc_index/DS301_index.py	Fri Jul 17 11:56:24 2009 +0200
+++ b/objdictgen/doc_index/DS301_index.py	Fri Jul 17 13:47:39 2009 +0200
@@ -45,5 +45,8 @@
                 os.system("xpdf -remote DS301 %s &"%os.path.join(cwd, "doc","301_v04000201.pdf"))
         return True
     except:
-        return """Check if xpdf is correctly installed on your computer"""
-	
\ No newline at end of file
+        if wx.Platform == '__WXMSW__':
+            return """Check if Acrobat Reader is correctly installed on your computer"""
+        else:
+            return """Check if xpdf is correctly installed on your computer"""
+        
\ No newline at end of file
diff -r 84fb13d1b3d2 -r ecaac955c16a objdictgen/objdictedit.py
--- a/objdictgen/objdictedit.py	Fri Jul 17 11:56:24 2009 +0200
+++ b/objdictgen/objdictedit.py	Fri Jul 17 13:47:39 2009 +0200
@@ -408,8 +408,18 @@
             readerexepath = os.path.join(readerpath,"AcroRd32.exe")
             if(os.path.isfile(readerexepath)):
                 os.spawnl(os.P_DETACH, readerexepath, "AcroRd32.exe", '"%s"'%os.path.join(ScriptDirectory, "doc","manual_en.pdf"))
-        else:
-            os.system("xpdf -remote CANFESTIVAL %s %d &"%(os.path.join(ScriptDirectory, "doc/manual_en.pdf"),16))
+            else:
+                message = wx.MessageDialog(self, """Check if Acrobat Reader is correctly installed on your computer""", "ERROR", wx.OK|wx.ICON_ERROR)
+                message.ShowModal()
+                message.Destroy()
+                
+        else:
+            try:
+                os.system("xpdf -remote CANFESTIVAL %s %d &"%(os.path.join(ScriptDirectory, "doc/manual_en.pdf"),16))
+            except:
+                message = wx.MessageDialog(self, """Check if xpdf is correctly installed on your computer""", "ERROR", wx.OK|wx.ICON_ERROR)
+                message.ShowModal()
+                message.Destroy()
         event.Skip()
 
     def OnAboutMenu(self, event):