fix message dialog when objdictedit can't find the pdf reader
authorgreg
Fri, 17 Jul 2009 13:47:39 +0200
changeset 569 ecaac955c16a
parent 568 84fb13d1b3d2
child 570 c18397a2b035
fix message dialog when objdictedit can't find the pdf reader
objdictgen/doc_index/DS301_index.py
objdictgen/objdictedit.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
--- 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):