[kepler-code] r28751 - trunk/modules/apple-extensions/src/org/kepler/osx

crawl at ecoinformatics.org crawl at ecoinformatics.org
Tue Oct 4 10:21:31 PDT 2011


Author: crawl
Date: 2011-10-04 10:21:31 -0700 (Tue, 04 Oct 2011)
New Revision: 28751

Modified:
   trunk/modules/apple-extensions/src/org/kepler/osx/KeplerOSXExtension.java
Log:
report but don't throw error when can't connect to window server
(this can happen when user is not logged in on console)


Modified: trunk/modules/apple-extensions/src/org/kepler/osx/KeplerOSXExtension.java
===================================================================
--- trunk/modules/apple-extensions/src/org/kepler/osx/KeplerOSXExtension.java	2011-10-04 16:55:25 UTC (rev 28750)
+++ trunk/modules/apple-extensions/src/org/kepler/osx/KeplerOSXExtension.java	2011-10-04 17:21:31 UTC (rev 28751)
@@ -31,6 +31,8 @@
 
 import com.apple.eawt.Application;
 
+import ptolemy.util.MessageHandler;
+
 /**
  * Implement the OSExtension for Mac OSX
  */
@@ -43,7 +45,16 @@
   {
     System.setProperty("apple.laf.useScreenMenuBar", "true");
     System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Kepler");
-    Application osxApplication = Application.getApplication();
-    osxApplication.addApplicationListener(new KeplerApplicationListener());
+    try
+    {
+    	Application osxApplication = Application.getApplication();
+    	osxApplication.addApplicationListener(new KeplerApplicationListener());
+    }
+    catch(Throwable t)
+    {
+        // report the error, but do not throw since we may not be logged in
+        // on the console.
+        MessageHandler.error("Error adding OS X application listener: ", t);
+    }
   }
 }



More information about the Kepler-cvs mailing list