← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2075: dhis-live: Improved icons and added multi-language support

 

------------------------------------------------------------
revno: 2075
committer: Saptarshi <sunbiz@xxxxxxxxxxxxx>
branch nick: trunk
timestamp: Mon 2010-09-06 19:50:24 +0200
message:
  dhis-live: Improved icons and added multi-language support
added:
  dhis-live/src/main/resources/messages_de.properties
  dhis-live/src/main/resources/messages_en.properties
  dhis-live/src/main/resources/messages_fr.properties
modified:
  dhis-live/src/main/java/org/hisp/dhis/SimpleConfigReader.java
  dhis-live/src/main/java/org/hisp/dhis/TrayApp.java
  dhis-live/src/main/java/org/hisp/dhis/WebAppServer.java
  dhis-live/src/main/resources/icons/running.png
  dhis-live/src/main/resources/icons/starting.gif
  dhis-live/src/main/resources/icons/starting.png


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-live/src/main/java/org/hisp/dhis/SimpleConfigReader.java'
--- dhis-live/src/main/java/org/hisp/dhis/SimpleConfigReader.java	2010-07-13 17:48:37 +0000
+++ dhis-live/src/main/java/org/hisp/dhis/SimpleConfigReader.java	2010-09-06 17:50:24 +0000
@@ -1,9 +1,32 @@
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+ * Copyright (c) 2004-2010, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-
 package org.hisp.dhis;
+
+
 import java.util.Properties;
 import java.io.*;
 import org.apache.commons.logging.Log;
@@ -13,45 +36,52 @@
  *
  * @author Jason P. Pickering
  */
- class SimpleConfigReader
- {
+class SimpleConfigReader
+{
 
     private static final String CONFIG_FILE = "conf/dhis2live.cfg";
+
     private static final int DEFAULT_JETTY_PORT = 8080;
+
     private static final String PREFERRED_BROWSER_PROPERTY = "preferredBrowser";
+
     private static final String JETTY_PORT_PROPERTY = "jettyPort";
+
     private static final Log log = LogFactory.getLog( SimpleConfigReader.class );
-    
+
     protected Properties getDefaultProperties()
     {
         FileInputStream configInputStream;
         Properties defaultProps = new Properties();
-        try {
+        try
+        {
             configInputStream = new FileInputStream( CONFIG_FILE );
             defaultProps.load( configInputStream );
             configInputStream.close();
-        } catch (FileNotFoundException e)
-        {
-            log.info ("No properties file found.");
-        } catch ( IOException ex)
-        {
-            log.error("There was an input/output error while loading the properties file.");
+        } catch ( FileNotFoundException e )
+        {
+            log.info( "No properties file found." );
+        } catch ( IOException ex )
+        {
+            log.error( "There was an input/output error while loading the properties file." );
         }
         return defaultProps;
     }
-protected String preferredBrowserPath ()
+
+    protected String preferredBrowserPath()
     {
         String thisBrowserPath = null;
-   if (getDefaultProperties().containsKey( PREFERRED_BROWSER_PROPERTY ) )
-    try
-    {
-        thisBrowserPath = getDefaultProperties().getProperty( PREFERRED_BROWSER_PROPERTY );
-         log.info("Browser path reported as" + thisBrowserPath);
-    }
-    catch (Exception e)
+        if ( getDefaultProperties().containsKey( PREFERRED_BROWSER_PROPERTY ) )
         {
-        log.error ("Could not load preferred browser property");
-        thisBrowserPath = null;
+            try
+            {
+                thisBrowserPath = getDefaultProperties().getProperty( PREFERRED_BROWSER_PROPERTY );
+                log.info( "Browser path reported as" + thisBrowserPath );
+            } catch ( Exception e )
+            {
+                log.error( "Could not load preferred browser property" );
+                thisBrowserPath = null;
+            }
         }
         return thisBrowserPath;
     }
@@ -69,10 +99,9 @@
                 log.error( "Port is not in the specified format.Using default." );
                 preferredJettyPort = WebAppServer.DEFAULT_JETTY_PORT;
             }
-         }
-    log.info ("Preferred jetty port will be configured to be " + preferredJettyPort);
-
-return preferredJettyPort;
-     }
-
+        }
+        log.info( "Preferred jetty port will be configured to be " + preferredJettyPort );
+
+        return preferredJettyPort;
+    }
 }

=== modified file 'dhis-live/src/main/java/org/hisp/dhis/TrayApp.java'
--- dhis-live/src/main/java/org/hisp/dhis/TrayApp.java	2010-07-13 17:48:37 +0000
+++ dhis-live/src/main/java/org/hisp/dhis/TrayApp.java	2010-09-06 17:50:24 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004-2009, University of Oslo
+ * Copyright (c) 2004-2010, University of Oslo
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,13 +26,15 @@
  */
 package org.hisp.dhis;
 
+
 import java.awt.*;
 import java.awt.event.*;
 import java.net.URI;
 import java.net.URL;
 import javax.swing.*;
 import java.io.*;
-
+import java.util.Locale;
+import java.util.ResourceBundle;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -42,24 +44,21 @@
  * @author Bob Jolliffe
  */
 public class TrayApp
-        implements LifeCycle.Listener {
+    implements LifeCycle.Listener
+{
 
-    private static final Log log = LogFactory.getLog(TrayApp.class);
+    private static final Log log = LogFactory.getLog( TrayApp.class );
 
     private static final String CONFIG_DIR = "/conf";
 
     private static final String STOPPED_ICON = "/icons/stopped.png";
 
-    private static final String STARTING_ICON = "/icons/starting.png";
+    private static final String STARTING_ICON = "/icons/starting.gif";
 
     private static final String FAILED_ICON = "/icons/failed.png";
 
     private static final String RUNNING_ICON = "/icons/running.png";
 
-    private static final String CMD_OPEN = "Open DHIS 2 Live";
-
-    private static final String CMD_EXIT = "Exit";
-
     private static final String CONFIG_FILE = "conf/dhis2live.cfg";
 
     private WebAppServer appServer;
@@ -70,29 +69,38 @@
 
     private SimpleConfigReader configReader;
 
+    private static ResourceBundle messages = ResourceBundle.getBundle( "messages", Locale.getDefault() );
+
     // -------------------------------------------------------------------------
     // Main method
     // -------------------------------------------------------------------------
     public static void main( String[] args )
-             {
+    {
+        Locale[] supportedLocales =
+        {
+            Locale.FRENCH,
+            Locale.GERMAN,
+            Locale.ENGLISH
+        };
+
+
         log.info( "Environment variable DHIS2_HOME: " + System.getenv( "DHIS2_HOME" ) );
         if ( !SystemTray.isSupported() )
         {
-            JOptionPane.showMessageDialog((JFrame) null, "SystemTray not supported on this platform");
-            System.exit(0);
-        }
-        else
-        {
-                try
-        {
-            new TrayApp();
-        } catch ( Exception ex )
-        {
-            log.fatal( "TrayApp Initialization failure", ex );
-            JOptionPane.showMessageDialog( (JFrame) null, "DHIS2-live failed to initialize\nSee log for details" );
+            JOptionPane.showMessageDialog( (JFrame) null, messages.getString( "dialogbox.unsupportedPlatform" ) );
             System.exit( 0 );
+        } else
+        {
+            try
+            {
+                new TrayApp();
+            } catch ( Exception ex )
+            {
+                log.fatal( "TrayApp Initialization failure", ex );
+                JOptionPane.showMessageDialog( (JFrame) null, messages.getString( "dialogbox.initFailure" ) );
+                System.exit( 0 );
+            }
         }
-     }
     }
 
     // -------------------------------------------------------------------------
@@ -100,57 +108,67 @@
     // -------------------------------------------------------------------------
     public TrayApp() throws AWTException, InterruptedException
     {
-        log.info("Initialising DHIS 2 Live...");
+        log.info( "Initialising DHIS 2 Live..." );
 
         installDir = getInstallDir();
 
-        if (installDir == null )
+        if ( installDir == null )
         {
             installDir = System.getenv( "DHIS2_HOME" );
             if ( installDir == null )
-                {
-                   log.fatal( "Neither DHIS Live Jar nor DHIS2_HOME could be found." );
-                   JOptionPane.showMessageDialog( (JFrame) null, "DHIS2-live failed to initialize\nSee log for details" );
-                   System.exit( 0 );
-                }
-            else
-                {
+            {
+                log.fatal( "Neither DHIS Live Jar nor DHIS2_HOME could be found." );
+                JOptionPane.showMessageDialog( (JFrame) null, messages.getString( "dialogbox.initFailure" ) );
+                System.exit( 0 );
+            } else
+            {
 
-            log.info("jar not installed, setting installdir to DHIS2_HOME: " + System.getenv( "DHIS2_HOME" ) );
-            installDir = System.getenv( "DHIS2_HOME" );
-                }
+                log.info( "jar not installed, setting installdir to DHIS2_HOME: " + System.getenv( "DHIS2_HOME" ) );
+                installDir = System.getenv( "DHIS2_HOME" );
+            }
         }
 
-        System.setProperty( "dhis2.home", installDir + CONFIG_DIR);
-        System.setProperty( "jetty.home", installDir);
-
-        System.setProperty( "birt.home", installDir + WebAppServer.BIRT_DIR);
-        System.setProperty( "birt.context.path", WebAppServer.BIRT_CONTEXT_PATH);
-
+        System.setProperty( "dhis2.home", installDir + CONFIG_DIR );
+        System.setProperty( "jetty.home", installDir );
+
+        System.setProperty( "birt.home", installDir + WebAppServer.BIRT_DIR );
+        System.setProperty( "birt.context.path", WebAppServer.BIRT_CONTEXT_PATH );
 
         SystemTray tray = SystemTray.getSystemTray();
 
-        Image image = createImage( STOPPED_ICON, "tray icon");
+        Image image = createImage( STOPPED_ICON, "tray icon" );
 
         PopupMenu popup = new PopupMenu();
-        MenuItem openItem = new MenuItem( CMD_OPEN );
-        MenuItem exitItem = new MenuItem( CMD_EXIT );
+        MenuItem openItem = new MenuItem( messages.getString( "CMD_OPEN" ) );
+        MenuItem databaseItem = new MenuItem( messages.getString( "CMD_DATABASE" ) );
+        MenuItem settingsItem = new MenuItem( messages.getString( "CMD_SETTINGS" ) );
+        MenuItem exitItem = new MenuItem( messages.getString( "CMD_EXIT" ) );
+
         popup.add( openItem );
+        popup.add( databaseItem );
+        popup.add( settingsItem );
         popup.add( exitItem );
 
         trayIcon = new TrayIcon( image, "DHIS 2 Live", popup );
         trayIcon.setImageAutoSize( true );
 
-        ActionListener listener = new ActionListener() {
+        ActionListener listener = new ActionListener()
+        {
 
-            public void actionPerformed(ActionEvent e) {
+            public void actionPerformed( ActionEvent e )
+            {
                 String cmd = e.getActionCommand();
 
-                if (cmd.equals( CMD_OPEN )) {
+                if ( cmd.equals( messages.getString( "CMD_OPEN" ) ) )
+                {
                     launchBrowser();
 
-                } else if (cmd.equals( CMD_EXIT )) {
-                    shutdown();
+                } else
+                {
+                    if ( cmd.equals( messages.getString( "CMD_EXIT" ) ) )
+                    {
+                        shutdown();
+                    }
                 }
             }
 
@@ -164,19 +182,17 @@
         appServer = new WebAppServer();
         try
         {
-        appServer.init( installDir, this );
-        }
-        catch (Exception e)
-            {
+            appServer.init( installDir, this );
+        } catch ( Exception e )
+        {
             log.fatal( "Application server could not be initialized" );
-        }     
+        }
         try
         {
-        appServer.start();
-        }
-        catch (Exception e)
+            appServer.start();
+        } catch ( Exception e )
         {
-            log.fatal ( "Application server could not be started" );
+            log.fatal( "Application server could not be started" );
         }
     }
 
@@ -186,40 +202,43 @@
     public void lifeCycleFailure( LifeCycle arg0, Throwable arg1 )
     {
         log.warn( "Lifecycle: server failed" );
-        trayIcon.setImage(createImage( FAILED_ICON, "Running icon" ) );
-        String message = "Web server failed to start - see logs for details";
-        JOptionPane.showMessageDialog( (JFrame) null, message );
+        trayIcon.setImage( createImage( FAILED_ICON, "Running icon" ) );
+        JOptionPane.showMessageDialog( (JFrame) null, messages.getString( "dialogbox.webserverFailure" ) );
         shutdown();
     }
 
-    public void lifeCycleStarted(LifeCycle arg0)
+    public void lifeCycleStarted( LifeCycle arg0 )
     {
-        log.info("Lifecycle: server started");
-        trayIcon.displayMessage( "Started", "DHIS 2 is running. Your browser will\n be pointed to " + getUrl() + ".",
-                TrayIcon.MessageType.INFO );
-        trayIcon.setToolTip( "DHIS 2 Server running" );
-        trayIcon.setImage(createImage( RUNNING_ICON, "Running icon" ) );
+        log.info( "Lifecycle: server started" );
+        trayIcon.displayMessage( messages.getString( "notification.started" ), messages.getString( "notification.startedDetails" ) + " " + getUrl() + ".",
+            TrayIcon.MessageType.INFO );
+        trayIcon.setToolTip( messages.getString( "tooltip.running" ) );
+        trayIcon.setImage( createImage( RUNNING_ICON, "Running icon" ) );
         launchBrowser();
 
     }
 
-    public void lifeCycleStarting(LifeCycle arg0) {
-        log.info("Lifecycle: server starting");
-        trayIcon.displayMessage("Starting", "DHIS 2 is starting.\nPlease be patient.", TrayIcon.MessageType.INFO);
-        trayIcon.setImage(createImage(STARTING_ICON, "Starting icon"));
-    }
-
-    public void lifeCycleStopped(LifeCycle arg0) {
-        log.info("Lifecycle: server stopped");
-        trayIcon.displayMessage("Stopped", "DHIS 2 has stopped.", TrayIcon.MessageType.INFO);
-        trayIcon.setImage(createImage(STOPPED_ICON, "Running icon"));
-    }
-
-    public void lifeCycleStopping(LifeCycle arg0) {
-        log.info("Lifecycle: server stopping");
-    }
-
-    private String defaultPreferredBrowserPath() {
+    public void lifeCycleStarting( LifeCycle arg0 )
+    {
+        log.info( "Lifecycle: server starting" );
+        trayIcon.displayMessage( messages.getString( "notification.starting" ), messages.getString( "notification.startingDetails" ), TrayIcon.MessageType.INFO );
+        trayIcon.setImage( createImage( STARTING_ICON, "Starting icon" ) );
+    }
+
+    public void lifeCycleStopped( LifeCycle arg0 )
+    {
+        log.info( "Lifecycle: server stopped" );
+        trayIcon.displayMessage( messages.getString( "notification.stopped" ), messages.getString( "notification.stoppedDetails" ), TrayIcon.MessageType.INFO );
+        trayIcon.setImage( createImage( STOPPED_ICON, "Running icon" ) );
+    }
+
+    public void lifeCycleStopping( LifeCycle arg0 )
+    {
+        log.info( "Lifecycle: server stopping" );
+    }
+
+    private String defaultPreferredBrowserPath()
+    {
         //initialize a return variable.false denotes failure.  true success
         configReader = new SimpleConfigReader();
         String preferredBrowserPath = null;
@@ -234,15 +253,14 @@
                 log.warn( "Browser does not appear to be valid.Please check that the browser exists." );
             }
 
-        } catch (Exception e) {
-            log.warn("There was a problem reading the preferred browser from the config file.");
+        } catch ( Exception e )
+        {
+            log.warn( "There was a problem reading the preferred browser from the config file." );
         }
-        log.info( "Preferred browser path reported to be " + preferredBrowserPath);
+        log.info( "Preferred browser path reported to be " + preferredBrowserPath );
         return preferredBrowserPath;
     }
 
-
-
     // -------------------------------------------------------------------------
     // Supportive methods
     // -------------------------------------------------------------------------
@@ -259,26 +277,29 @@
     /**
      * Launches the application in the default browser.
      */
-    private void launchBrowser() {
-
-
-            String preferredBrowserPath = defaultPreferredBrowserPath();
-            
-            if (preferredBrowserPath != null)
+    private void launchBrowser()
+    {
+
+
+        String preferredBrowserPath = defaultPreferredBrowserPath();
+
+        if ( preferredBrowserPath != null )
+        {
+            try
+            {   //if the preferred browser has not been defined and appears to be valid
+                launchPreferredBrowser();
+            } catch ( Exception ex )
             {
-                try {   //if the preferred browser has not been defined and appears to be valid
-                    launchPreferredBrowser();
-                } 
-                catch (Exception ex)
-                {
-                    log.warn ("Couldn't open preferred browser.Will attempt to revert to default. " + ex);
-                }
+                log.warn( "Couldn't open preferred browser.Will attempt to revert to default. " + ex );
             }
-            else {
-            try {
+        } else
+        {
+            try
+            {
                 launchDefaultBrowser();
-            } catch (Exception e) {
-                log.error("Could not open any browser" + e);
+            } catch ( Exception e )
+            {
+                log.error( "Could not open any browser" + e );
             }
         }
 
@@ -287,37 +308,45 @@
     /**
      * Launches the application in the custom embedded browser.
      */
-    private void launchPreferredBrowser()  {   //initialize a return variable.false denotes failure.  true success
-        try {
+    private void launchPreferredBrowser()
+    {   //initialize a return variable.false denotes failure.  true success
+        try
+        {
             String preferredBrowserPath = defaultPreferredBrowserPath();
             String thisurl = getUrl();
-            log.info("About to open " + thisurl + " with " + preferredBrowserPath);
-            String openPrefBrowser = (preferredBrowserPath + " " + thisurl);
+            log.info( "About to open " + thisurl + " with " + preferredBrowserPath );
+            String openPrefBrowser = ( preferredBrowserPath + " " + thisurl );
 
-            if (preferredBrowserPath != null && thisurl != null ) {
+            if ( preferredBrowserPath != null && thisurl != null )
+            {
 
                 //try and launch the prefered browser
                 try
                 {
                     Runtime rt = Runtime.getRuntime();
-                    rt.exec(openPrefBrowser);
-                } catch (IOException e) {
-                    log.error("There was a problem opening the preferred browser. " + e);
+                    rt.exec( openPrefBrowser );
+                } catch ( IOException e )
+                {
+                    log.error( "There was a problem opening the preferred browser. " + e );
                     //Try and fall back to the default browser
                     launchDefaultBrowser();
                 }
             }
-        } catch (Exception ex) {
-            log.error("An error occurred while attempting to open the preferred browser " + ex);
+        } catch ( Exception ex )
+        {
+            log.error( "An error occurred while attempting to open the preferred browser " + ex );
             //Try and fall back to the default browser
             launchDefaultBrowser();
         }
     }
 
-    private void launchDefaultBrowser() {
-        try {
+    private void launchDefaultBrowser()
+    {
+        try
+        {
             Desktop.getDesktop().browse( URI.create( getUrl() ) );
-        } catch (IOException e) {
+        } catch ( IOException e )
+        {
             log.error( "The default browser could not be launched" );
         }
     }
@@ -327,16 +356,16 @@
      */
     private void shutdown()
     {
-        log.info("Graceful shutdown...");
+        log.info( "Graceful shutdown..." );
         try
         {
             appServer.stop();
-        }
-        catch (Exception ex) {
-            log.warn ("Oops: " + ex.toString() );
-        }
-        log.info("Exiting...");
-        System.exit(0);
+        } catch ( Exception ex )
+        {
+            log.warn( "Oops: " + ex.toString() );
+        }
+        log.info( "Exiting..." );
+        System.exit( 0 );
     }
 
     /**
@@ -346,16 +375,16 @@
      * @param description the image description.
      * @return an Image.
      */
-    private static Image createImage(String path, String description)
+    private static Image createImage( String path, String description )
     {
-        URL imageURL = TrayApp.class.getResource(path);
-        if (imageURL == null) {
+        URL imageURL = TrayApp.class.getResource( path );
+        if ( imageURL == null )
+        {
             log.warn( "Resource not found: " + path );
             return null;
-        } 
-        else
+        } else
         {
-            return ( new ImageIcon(imageURL, description) ).getImage();
+            return ( new ImageIcon( imageURL, description ) ).getImage();
         }
     }
 
@@ -370,17 +399,17 @@
     private static String getInstallDir()
     {
         // find a resource
-        String resourceString = TrayApp.class.getResource("/icons/").toString();
+        String resourceString = TrayApp.class.getResource( "/icons/" ).toString();
         // we expect to see something of the form:
         // "jar:file:<install_dir>/dhis_xxx.jar!/icons"
-        if (!resourceString.startsWith("jar:file:"))
+        if ( !resourceString.startsWith( "jar:file:" ) )
         {
             // we're in trouble - its not in a jar file
             return null;
         }
         // find the last "/" just before the "!"
-        int endIndex = resourceString.lastIndexOf("/", resourceString.lastIndexOf("!"));
-        String result = resourceString.substring(9, endIndex);
+        int endIndex = resourceString.lastIndexOf( "/", resourceString.lastIndexOf( "!" ) );
+        String result = resourceString.substring( 9, endIndex );
         // replace encoded spaces
         result = result.replaceAll( "%20", " " );
         return result;

=== modified file 'dhis-live/src/main/java/org/hisp/dhis/WebAppServer.java'
--- dhis-live/src/main/java/org/hisp/dhis/WebAppServer.java	2010-07-13 17:48:37 +0000
+++ dhis-live/src/main/java/org/hisp/dhis/WebAppServer.java	2010-09-06 17:50:24 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004-2009, University of Oslo
+ * Copyright (c) 2004-2010, University of Oslo
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -24,13 +24,11 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-
 /**
  *
  * @author Bob Jolliffe
  * @version $$Id$$
  */
-
 package org.hisp.dhis;
 
 
@@ -49,6 +47,7 @@
  */
 public class WebAppServer
 {
+
     public static final String DHIS_DIR = "/webapps/dhis";
 
     public static final String BIRT_DIR = "/webapps/birt";
@@ -64,6 +63,7 @@
     protected Server server;
 
     protected Connector connector;
+
     private SimpleConfigReader configReader;
 
     public WebAppServer()
@@ -80,15 +80,17 @@
             int portFromConfig = this.getPortFromConfig();
             connector.setPort( portFromConfig );
             log.info( "Loading DHIS 2 on port: " + portFromConfig );
-        }
-        catch ( Exception ex )
+        } catch ( Exception ex )
         {
             log.info( "Couldn't load port number from " + installDir + JETTY_PORT_CONF );
             connector.setPort( DEFAULT_JETTY_PORT );
             log.info( "Loading DHIS 2 on port: " + DEFAULT_JETTY_PORT );
         }
 
-        server.setConnectors( new Connector[] { connector } );
+        server.setConnectors( new Connector[]
+            {
+                connector
+            } );
 
         ContextHandlerCollection handlers = new ContextHandlerCollection();
 
@@ -134,14 +136,13 @@
         int preferredJettyPort = DEFAULT_JETTY_PORT;
         try
         {
-        int portFromConfig = configReader.preferredJettyPort();
-        preferredJettyPort = portFromConfig;
-        }
-        catch (Exception e)
-            {
-            log.error ("There was a problem reading the preferred jetty port. Using default.");
+            int portFromConfig = configReader.preferredJettyPort();
+            preferredJettyPort = portFromConfig;
+        } catch ( Exception e )
+        {
+            log.error( "There was a problem reading the preferred jetty port. Using default." );
             preferredJettyPort = DEFAULT_JETTY_PORT;
-            }
+        }
         return preferredJettyPort;
     }
 }

=== modified file 'dhis-live/src/main/resources/icons/running.png'
Binary files dhis-live/src/main/resources/icons/running.png	2009-04-22 21:34:35 +0000 and dhis-live/src/main/resources/icons/running.png	2010-09-06 17:50:24 +0000 differ
=== modified file 'dhis-live/src/main/resources/icons/starting.gif'
Binary files dhis-live/src/main/resources/icons/starting.gif	2009-04-22 21:34:35 +0000 and dhis-live/src/main/resources/icons/starting.gif	2010-09-06 17:50:24 +0000 differ
=== modified file 'dhis-live/src/main/resources/icons/starting.png'
Binary files dhis-live/src/main/resources/icons/starting.png	2009-09-11 16:36:42 +0000 and dhis-live/src/main/resources/icons/starting.png	2010-09-06 17:50:24 +0000 differ
=== added file 'dhis-live/src/main/resources/messages_de.properties'
--- dhis-live/src/main/resources/messages_de.properties	1970-01-01 00:00:00 +0000
+++ dhis-live/src/main/resources/messages_de.properties	2010-09-06 17:50:24 +0000
@@ -0,0 +1,6 @@
+CMD_OPEN=Open DHIS 2 Live
+CMD_EXIT=Ausgang
+CMD_SETTINGS=Einstellungen
+CMD_DATABASE=Datenbanken
+dialogbox.unsupportedPlatform=System Tray nicht unterst\u00fctzt auf dieser Plattform
+dialogbox.initFailure=DHIS2-live konnte nicht initialisiert werden\nSiehe Protokoll f\u00fcr Details

=== added file 'dhis-live/src/main/resources/messages_en.properties'
--- dhis-live/src/main/resources/messages_en.properties	1970-01-01 00:00:00 +0000
+++ dhis-live/src/main/resources/messages_en.properties	2010-09-06 17:50:24 +0000
@@ -0,0 +1,17 @@
+CMD_OPEN = Open DHIS 2 Live
+CMD_EXIT = Exit
+CMD_SETTINGS = Settings
+CMD_DATABASE = Databases
+
+dialogbox.unsupportedPlatform = System Tray not supported on this platform
+dialogbox.initFailure = DHIS2-live failed to initialize\nSee log for details
+dialogbox.webserverFailure = Web server failed to start - see logs for details
+
+notification.started = Started
+notification.startedDetails = DHIS 2 is running. Your browser will\n be pointed to
+notification.starting = Starting
+notification.startingDetails = DHIS 2 is starting.\nPlease be patient.
+notification.stopped = Stopped
+notification.stoppedDetails = DHIS 2 has stopped.
+
+tooltip.running = DHIS 2 Server running
\ No newline at end of file

=== added file 'dhis-live/src/main/resources/messages_fr.properties'
--- dhis-live/src/main/resources/messages_fr.properties	1970-01-01 00:00:00 +0000
+++ dhis-live/src/main/resources/messages_fr.properties	2010-09-06 17:50:24 +0000
@@ -0,0 +1,6 @@
+CMD_OPEN=Open DHIS 2 Live
+CMD_EXIT=Sortie
+CMD_SETTINGS=Param\u00e8tres
+CMD_DATABASE=Bases de donn\u00e9es
+dialogbox.unsupportedPlatform=Barre d'\u00e9tat syst\u00e8me n'est pas support\u00e9 sur cette plate-forme
+dialogbox.initFailure=DHIS2-live n'a pas pu s'initialiser\nVoir le journal pour plus de d\u00e9tails