[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r21776: {projects} removed home, browse menu options; added beter non-root oper (in projects/android/trunk/Orbot/src/org/torproject/android: . service)



Author: n8fr8
Date: 2010-03-01 05:52:44 +0000 (Mon, 01 Mar 2010)
New Revision: 21776

Modified:
   projects/android/trunk/Orbot/src/org/torproject/android/Orbot.java
   projects/android/trunk/Orbot/src/org/torproject/android/SettingsPreferences.java
   projects/android/trunk/Orbot/src/org/torproject/android/service/TorServiceUtils.java
Log:
removed home, browse menu options; added beter non-root operation

Modified: projects/android/trunk/Orbot/src/org/torproject/android/Orbot.java
===================================================================
--- projects/android/trunk/Orbot/src/org/torproject/android/Orbot.java	2010-03-01 02:59:03 UTC (rev 21775)
+++ projects/android/trunk/Orbot/src/org/torproject/android/Orbot.java	2010-03-01 05:52:44 UTC (rev 21776)
@@ -87,26 +87,35 @@
         
         MenuItem mItem = null;
         
+        /*
+        
         mItem = menu.add(0, 1, Menu.NONE, getString(R.string.menu_home));
         mItem.setIcon(R.drawable.ic_menu_home);
 
         mItem = menu.add(0, 2, Menu.NONE, getString(R.string.menu_browse));
         mItem.setIcon(R.drawable.ic_menu_goto);
+        */
 
-        mItem = menu.add(0, 3, Menu.NONE, getString(R.string.menu_info));
-        mItem.setIcon(R.drawable.ic_menu_about);
         
         mItem = menu.add(0, 4, Menu.NONE, getString(R.string.menu_settings));
         mItem.setIcon(R.drawable.ic_menu_register);
        
-        mItem = menu.add(0, 5, Menu.NONE, getString(R.string.menu_apps));
-        mItem.setIcon(R.drawable.ic_menu_register);
-
-        if (!TorServiceUtils.hasRoot())
-        	mItem.setEnabled(false);
-        
+       
+    	mItem = menu.add(0, 5, Menu.NONE, getString(R.string.menu_apps));
+    	mItem.setIcon(R.drawable.ic_menu_goto);
+    	
+    	 if (!TorServiceUtils.hasRoot())
+         {
+    		 mItem.setEnabled(false);
+    		 
+         }
+        	
         mItem =  menu.add(0,6, Menu.NONE, getString(R.string.menu_log));
         mItem.setIcon(R.drawable.ic_menu_reports);
+        
+        mItem = menu.add(0, 3, Menu.NONE, getString(R.string.menu_info));
+        mItem.setIcon(R.drawable.ic_menu_about);
+       
 
       
         return true;
@@ -628,8 +637,12 @@
 				}
 				else if (mService.getStatus() == STATUS_READY)
 				{
+					mService.setProfile(PROFILE_ON); //this means turn on
+					
+					updateStatus("");
+					
 					processSettings();
-					mService.setProfile(PROFILE_ON);
+					
 
 					if (hasRoot && enableTransparentProxy)
 					{
@@ -641,8 +654,9 @@
 				else
 				{
 					
-					mService.setProfile(PROFILE_ONDEMAND);	
-				
+					mService.setProfile(PROFILE_ONDEMAND);	//these means turn off
+					updateStatus("");
+					
 					if (hasRoot && enableTransparentProxy)
 					{
 						TorTransProxy.purgeNatIptables();

Modified: projects/android/trunk/Orbot/src/org/torproject/android/SettingsPreferences.java
===================================================================
--- projects/android/trunk/Orbot/src/org/torproject/android/SettingsPreferences.java	2010-03-01 02:59:03 UTC (rev 21775)
+++ projects/android/trunk/Orbot/src/org/torproject/android/SettingsPreferences.java	2010-03-01 05:52:44 UTC (rev 21776)
@@ -3,6 +3,8 @@
 
 package org.torproject.android;
 
+import org.torproject.android.service.TorServiceUtils;
+
 import android.os.Bundle;
 import android.preference.PreferenceActivity;
 import android.util.Log;
@@ -13,6 +15,9 @@
 	protected void onCreate(Bundle savedInstanceState) {
 		super.onCreate(savedInstanceState);
 		addPreferencesFromResource(R.xml.preferences);
+		
+		if (!TorServiceUtils.hasRoot())
+			getPreferenceScreen().getPreference(3).setEnabled(false);
 	}
 	
 	/* (non-Javadoc)

Modified: projects/android/trunk/Orbot/src/org/torproject/android/service/TorServiceUtils.java
===================================================================
--- projects/android/trunk/Orbot/src/org/torproject/android/service/TorServiceUtils.java	2010-03-01 02:59:03 UTC (rev 21775)
+++ projects/android/trunk/Orbot/src/org/torproject/android/service/TorServiceUtils.java	2010-03-01 05:52:44 UTC (rev 21776)
@@ -86,6 +86,7 @@
 		while (itAppInfo.hasNext())
 		{
 			aInfo = itAppInfo.next();
+			
 			apps[appIdx] = new TorifiedApp();
 			
 			apps[appIdx].setEnabled(aInfo.enabled);