[kepler-code] r28752 - releases/release-branches/apple-extensions-2.1/src/org/kepler/osx

crawl at ecoinformatics.org crawl at ecoinformatics.org
Tue Oct 4 10:53:16 PDT 2011


Author: crawl
Date: 2011-10-04 10:53:16 -0700 (Tue, 04 Oct 2011)
New Revision: 28752

Modified:
   releases/release-branches/apple-extensions-2.1/src/org/kepler/osx/KeplerOSXExtension.java
Log:
merge from trunk r28751:

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: releases/release-branches/apple-extensions-2.1/src/org/kepler/osx/KeplerOSXExtension.java
===================================================================
--- releases/release-branches/apple-extensions-2.1/src/org/kepler/osx/KeplerOSXExtension.java	2011-10-04 17:21:31 UTC (rev 28751)
+++ releases/release-branches/apple-extensions-2.1/src/org/kepler/osx/KeplerOSXExtension.java	2011-10-04 17:53:16 UTC (rev 28752)
@@ -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