OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the Adblock Plus, | 2 * This file is part of the Adblock Plus, |
3 * Copyright (C) 2006-2012 Eyeo GmbH | 3 * Copyright (C) 2006-2012 Eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
16 */ | 16 */ |
17 | 17 |
18 package org.adblockplus.android; | 18 package org.adblockplus.android; |
19 | 19 |
20 import android.app.Activity; | 20 import android.app.Activity; |
21 import android.content.Intent; | 21 import android.content.Intent; |
22 import android.net.Uri; | 22 import android.net.Uri; |
23 import android.os.Bundle; | 23 import android.os.Bundle; |
| 24 import android.text.Html; |
24 import android.view.View; | 25 import android.view.View; |
25 import android.widget.TextView; | 26 import android.widget.TextView; |
26 | 27 |
27 /** | 28 /** |
28 * Displays configuration warning message. | 29 * Displays configuration warning message. |
29 */ | 30 */ |
30 public class ConfigurationActivity extends Activity | 31 public class ConfigurationActivity extends Activity |
31 { | 32 { |
| 33 private int port; |
| 34 |
32 @Override | 35 @Override |
33 public void onCreate(Bundle savedInstanceState) | 36 public void onCreate(Bundle savedInstanceState) |
34 { | 37 { |
35 super.onCreate(savedInstanceState); | 38 super.onCreate(savedInstanceState); |
36 setContentView(R.layout.configuration); | 39 setContentView(R.layout.configuration); |
37 int port = getIntent().getIntExtra("port", 0); | 40 port = getIntent().getIntExtra("port", 0); |
38 String msg1 = getString(R.string.msg_notraffic); | 41 String msg1 = getString(R.string.msg_notraffic); |
39 String msg2 = getString(R.string.msg_configuration, port); | 42 String msg2 = getString(R.string.msg_configuration, port); |
40 ((TextView) findViewById(R.id.message_text)).setText(msg1 + " " + msg2); | 43 ((TextView) findViewById(R.id.message_text)).setText(Html.fromHtml(msg1 + "
" + msg2)); |
41 } | 44 } |
42 | 45 |
43 public void onOk(View view) | 46 public void onOk(View view) |
44 { | 47 { |
45 finish(); | 48 finish(); |
46 } | 49 } |
47 | 50 |
48 public void onHelp(View view) | 51 public void onHelp(View view) |
49 { | 52 { |
50 Uri uri = Uri.parse(getString(R.string.configuring_proxy_url)); | 53 Intent intent; |
51 final Intent intent = new Intent(Intent.ACTION_VIEW, uri); | 54 if (ProxyService.hasNativeProxy) |
| 55 { |
| 56 intent = new Intent(this, ProxyConfigurationActivity.class).putExtra("port
", port); |
| 57 } |
| 58 else |
| 59 { |
| 60 Uri uri = Uri.parse(getString(R.string.configuring_proxy_url)); |
| 61 intent = new Intent(Intent.ACTION_VIEW, uri); |
| 62 } |
52 startActivity(intent); | 63 startActivity(intent); |
53 finish(); | 64 finish(); |
54 } | 65 } |
55 } | 66 } |
OLD | NEW |