Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | package org.mozilla.gecko.sync.setup.activities; |
michael@0 | 6 | |
michael@0 | 7 | import org.mozilla.gecko.R; |
michael@0 | 8 | import org.mozilla.gecko.sync.setup.Constants; |
michael@0 | 9 | |
michael@0 | 10 | import android.content.Context; |
michael@0 | 11 | import android.content.Intent; |
michael@0 | 12 | import android.os.Bundle; |
michael@0 | 13 | import android.view.View; |
michael@0 | 14 | import android.widget.TextView; |
michael@0 | 15 | |
michael@0 | 16 | public class SetupFailureActivity extends SyncActivity { |
michael@0 | 17 | private Context mContext; |
michael@0 | 18 | |
michael@0 | 19 | @Override |
michael@0 | 20 | public void onCreate(Bundle savedInstanceState) { |
michael@0 | 21 | super.onCreate(savedInstanceState); |
michael@0 | 22 | setContentView(R.layout.sync_setup_failure); |
michael@0 | 23 | mContext = this.getApplicationContext(); |
michael@0 | 24 | |
michael@0 | 25 | // Modify general error message if necessary. |
michael@0 | 26 | Bundle extras = this.getIntent().getExtras(); |
michael@0 | 27 | if (extras != null) { |
michael@0 | 28 | boolean isAccountError = extras.getBoolean(Constants.INTENT_EXTRA_IS_ACCOUNTERROR); |
michael@0 | 29 | if (isAccountError) { |
michael@0 | 30 | TextView subtitle1 = (TextView) findViewById(R.id.failure_subtitle1); |
michael@0 | 31 | // Display error for multiple accounts. |
michael@0 | 32 | // TODO: Remove when Bug 761206 is resolved (support for multiple versions). |
michael@0 | 33 | TextView subtitle2 = (TextView) findViewById(R.id.failure_subtitle2); |
michael@0 | 34 | subtitle1.setText(getString(R.string.sync_subtitle_failaccount)); |
michael@0 | 35 | subtitle2.setVisibility(View.VISIBLE); |
michael@0 | 36 | subtitle2.setText(getString(R.string.sync_subtitle_failmultiple)); |
michael@0 | 37 | } |
michael@0 | 38 | } |
michael@0 | 39 | } |
michael@0 | 40 | |
michael@0 | 41 | public void manualClickHandler(View target) { |
michael@0 | 42 | Intent intent = new Intent(mContext, AccountActivity.class); |
michael@0 | 43 | intent.setFlags(Constants.FLAG_ACTIVITY_REORDER_TO_FRONT_NO_ANIMATION); |
michael@0 | 44 | startActivity(intent); |
michael@0 | 45 | overridePendingTransition(0, 0); |
michael@0 | 46 | finish(); |
michael@0 | 47 | } |
michael@0 | 48 | |
michael@0 | 49 | public void tryAgainClickHandler(View target) { |
michael@0 | 50 | finish(); |
michael@0 | 51 | } |
michael@0 | 52 | |
michael@0 | 53 | public void cancelClickHandler(View target) { |
michael@0 | 54 | setResult(RESULT_CANCELED); |
michael@0 | 55 | moveTaskToBack(true); |
michael@0 | 56 | finish(); |
michael@0 | 57 | } |
michael@0 | 58 | } |