← Back to team overview

dhis-mobile-devs team mailing list archive

[Branch ~dhis-mobile-devs/dhis-mobile/lwuit-tracking] Rev 198: implement logger screen

 

------------------------------------------------------------
revno: 198
committer: sherylyn.marie
branch nick: lwuit-tracking
timestamp: Wed 2014-03-26 18:24:58 +0800
message:
  implement logger screen
modified:
  src/org/hisp/dhis/mobile/ui/Text.java
  src/org/hisp/dhis/mobile/view/LoginView.java
  src/org/hisp/dhis/mobile/view/TrackingMainMenuView.java


--
lp:~dhis-mobile-devs/dhis-mobile/lwuit-tracking
https://code.launchpad.net/~dhis-mobile-devs/dhis-mobile/lwuit-tracking

Your team DHIS mobile developers is subscribed to branch lp:~dhis-mobile-devs/dhis-mobile/lwuit-tracking.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis-mobile-devs/dhis-mobile/lwuit-tracking/+edit-subscription
=== modified file 'src/org/hisp/dhis/mobile/ui/Text.java'
--- src/org/hisp/dhis/mobile/ui/Text.java	2014-01-08 09:59:33 +0000
+++ src/org/hisp/dhis/mobile/ui/Text.java	2014-03-26 10:24:58 +0000
@@ -761,20 +761,29 @@
     {
         return get( (short) 140, "Send All" );
     }
-    
-    public static String PROGRAM(){
-        return get((short) 141, "Program: ");
-    }
-    
-    public static String ADD_PERSON(){
-        return get((short) 142, "Add Person");
-    }
-    
-    public static String HTTP_ERROR(){
-        return get((short) 143, "Error in HTTP operation");
-    }
-    
-    public static String ENROLL_SUCCESS(){
-        return get((short) 144, "Enroll Program Successfully");
+
+    public static String PROGRAM()
+    {
+        return get( (short) 141, "Program: " );
+    }
+
+    public static String ADD_PERSON()
+    {
+        return get( (short) 142, "Add Person" );
+    }
+
+    public static String HTTP_ERROR()
+    {
+        return get( (short) 143, "Error in HTTP operation" );
+    }
+
+    public static String ENROLL_SUCCESS()
+    {
+        return get( (short) 144, "Enroll Program Successfully" );
+    }
+
+    public static String LOG()
+    {
+        return "Log";
     }
 }

=== modified file 'src/org/hisp/dhis/mobile/view/LoginView.java'
--- src/org/hisp/dhis/mobile/view/LoginView.java	2013-11-19 03:19:28 +0000
+++ src/org/hisp/dhis/mobile/view/LoginView.java	2014-03-26 10:24:58 +0000
@@ -21,10 +21,12 @@
 
 import java.io.IOException;
 import java.util.Hashtable;
+
 import javax.microedition.rms.RecordStoreException;
 import javax.microedition.rms.RecordStoreNotFoundException;
 
 import org.hisp.dhis.mobile.connection.ConnectionManager;
+import org.hisp.dhis.mobile.log.LogMan;
 import org.hisp.dhis.mobile.midlet.DHISMIDlet;
 import org.hisp.dhis.mobile.recordstore.OrgUnitRecordStore;
 import org.hisp.dhis.mobile.ui.Text;
@@ -118,6 +120,10 @@
             loginForm.addComponent( new Label( Text.URL() ) );
             loginForm.addComponent( getLoginServerUrlTextField() );
 
+            if ( LogMan.isEnabled() )
+            {
+                loginForm.addCommand( new Command( Text.LOG() ) );
+            }
             loginForm.addCommand( new Command( Text.EXIT() ) );
             loginForm.addCommand( new Command( Text.LOGIN() ) );
             loginForm.addCommandListener( this );
@@ -136,6 +142,10 @@
         {
             login();
         }
+        else if ( ae.getCommand().getCommandName().equals( Text.LOG() ) )
+        {
+            LogMan.showLogMonitorScreen();
+        }
         else if ( ae.getCommand().getCommandName().equals( Text.EXIT() ) )
         {
             Dialog dialog = new Dialog( Text.WARNING() );

=== modified file 'src/org/hisp/dhis/mobile/view/TrackingMainMenuView.java'
--- src/org/hisp/dhis/mobile/view/TrackingMainMenuView.java	2014-02-07 11:02:56 +0000
+++ src/org/hisp/dhis/mobile/view/TrackingMainMenuView.java	2014-03-26 10:24:58 +0000
@@ -20,6 +20,7 @@
  */
 
 import org.hisp.dhis.mobile.connection.ConnectionManager;
+import org.hisp.dhis.mobile.log.LogMan;
 import org.hisp.dhis.mobile.midlet.DHISMIDlet;
 import org.hisp.dhis.mobile.midlet.NameBasedMIDlet;
 import org.hisp.dhis.mobile.model.ModelList;
@@ -79,7 +80,10 @@
         {
             this.navigate( (String) menuList.getSelectedItem() );
         }
-
+        else if ( ae.getCommand().getCommandName().equals( Text.LOG() ) )
+        {
+            LogMan.showLogMonitorScreen();
+        }
         else if ( ae.getCommand().getCommandName().equals( "Exit" ) )
         {
             getWarningDialog().show();
@@ -187,6 +191,10 @@
             menuForm.setSmoothScrolling( true );
             menuForm.addComponent( this.getMenuList() );
             menuForm.addCommand( getExitCommand() );
+            if ( LogMan.isEnabled() )
+            {
+                menuForm.addCommand( new Command( Text.LOG() ) );
+            }
             menuForm.setTransitionOutAnimator( CommonTransitions.createSlide( CommonTransitions.SLIDE_HORIZONTAL, true,
                 200 ) );
             menuForm.addCommandListener( this );