removed home, browse menu options; added beter non-root operation

svn:r21776
This commit is contained in:
Nathan Freitas 2010-03-01 05:52:44 +00:00
parent a8080d4011
commit ce65c91546
3 changed files with 31 additions and 11 deletions

View File

@ -87,26 +87,35 @@ public class Orbot extends Activity implements OnClickListener, TorConstants, On
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 @@ public class Orbot extends Activity implements OnClickListener, TorConstants, On
}
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 @@ public class Orbot extends Activity implements OnClickListener, TorConstants, On
else
{
mService.setProfile(PROFILE_ONDEMAND);
mService.setProfile(PROFILE_ONDEMAND); //these means turn off
updateStatus("");
if (hasRoot && enableTransparentProxy)
{
TorTransProxy.purgeNatIptables();

View File

@ -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 @@ public class SettingsPreferences
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preferences);
if (!TorServiceUtils.hasRoot())
getPreferenceScreen().getPreference(3).setEnabled(false);
}
/* (non-Javadoc)

View File

@ -86,6 +86,7 @@ public class TorServiceUtils implements TorServiceConstants {
while (itAppInfo.hasNext())
{
aInfo = itAppInfo.next();
apps[appIdx] = new TorifiedApp();
apps[appIdx].setEnabled(aInfo.enabled);