// Path: AndroBOINC/src/main/java/sk/boinc/androboinc/util/ScreenOrientationHandler.java
// public class ScreenOrientationHandler implements OnSharedPreferenceChangeListener {
// 	private static final String TAG = "ScreenOrientationHandle";
// 
// 	private final Activity mActivity;
// 	private int mChosenOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
// 
// 	public ScreenOrientationHandler(Activity activity) {
// 		mActivity = activity;
// 		SharedPreferences globalPrefs = PreferenceManager.getDefaultSharedPreferences(mActivity);
// 		globalPrefs.registerOnSharedPreferenceChangeListener(this);
// 		String orientation = globalPrefs.getString(PreferenceName.SCREEN_ORIENTATION, "-1");
// 		int savedOrientation = Integer.parseInt(orientation);
// 		if ( (savedOrientation < ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) ||
// 				(savedOrientation > ActivityInfo.SCREEN_ORIENTATION_SENSOR) ) {
// 			savedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
// 		}
// 		mChosenOrientation = savedOrientation;
// 	}
// 
// 	@Override
// 	public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
// 		if (key.equals(PreferenceName.SCREEN_ORIENTATION)) {
// 			String orientation = sharedPreferences.getString(PreferenceName.SCREEN_ORIENTATION, "-1");
// 			int newOrientation = Integer.parseInt(orientation);
// 			if ( (newOrientation < ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) ||
// 					(newOrientation > ActivityInfo.SCREEN_ORIENTATION_SENSOR) ) {
// 				return;
// 			}
// 			if (newOrientation == mChosenOrientation) return; // unchanged
// 			if (BuildConfig.DEBUG) Log.d(TAG, "Orientation setting changed from " + mChosenOrientation + " to " + newOrientation);
// 			mChosenOrientation = newOrientation;
// 		}
// 	}
// 
// 	public void setOrientation() {
// 		if (mChosenOrientation != mActivity.getRequestedOrientation()) {
// 			if (BuildConfig.DEBUG) Log.d(TAG, "Changing orientation for " + mActivity.toString());
// 			// mChosenOrientation can have only allowed values (see above)
// 			//noinspection AndroidLintWrongConstant
// 			mActivity.setRequestedOrientation(mChosenOrientation);
// 		}
// 	}
// }


import sk.boinc.androboinc.util.NetStatsStorage;
import sk.boinc.androboinc.util.PreferenceName;
import sk.boinc.androboinc.util.ScreenOrientationHandler;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.Preference.OnPreferenceClickListener;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.CheckBox;
import android.widget.TextView;
/* 
 * AndroBOINC - BOINC Manager for Android
 * Copyright (C) 2010, Pavol Michalec
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */

package sk.boinc.androboinc;


public class AppPreferencesActivity extends PreferenceActivity implements OnSharedPreferenceChangeListener {
	private static final String TAG = "AppPreferencesActivity";

	private static final int DIALOG_NETSTATS_DISCLAIMER = 1;
	private static final int DIALOG_ABOUT               = 2;
	private static final int DIALOG_LICENSE             = 3;
	private static final int DIALOG_LICENSE2            = 4;
	private static final int DIALOG_CHANGELOG           = 5;

	private BoincManagerApplication mApp;
// Path: AndroBOINC/src/main/java/sk/boinc/androboinc/util/ScreenOrientationHandler.java
// public class ScreenOrientationHandler implements OnSharedPreferenceChangeListener {
// 	private static final String TAG = "ScreenOrientationHandle";
// 
// 	private final Activity mActivity;
// 	private int mChosenOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
// 
// 	public ScreenOrientationHandler(Activity activity) {
// 		mActivity = activity;
// 		SharedPreferences globalPrefs = PreferenceManager.getDefaultSharedPreferences(mActivity);
// 		globalPrefs.registerOnSharedPreferenceChangeListener(this);
// 		String orientation = globalPrefs.getString(PreferenceName.SCREEN_ORIENTATION, "-1");
// 		int savedOrientation = Integer.parseInt(orientation);
// 		if ( (savedOrientation < ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) ||
// 				(savedOrientation > ActivityInfo.SCREEN_ORIENTATION_SENSOR) ) {
// 			savedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
// 		}
// 		mChosenOrientation = savedOrientation;
// 	}
// 
// 	@Override
// 	public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
// 		if (key.equals(PreferenceName.SCREEN_ORIENTATION)) {
// 			String orientation = sharedPreferences.getString(PreferenceName.SCREEN_ORIENTATION, "-1");
// 			int newOrientation = Integer.parseInt(orientation);
// 			if ( (newOrientation < ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) ||
// 					(newOrientation > ActivityInfo.SCREEN_ORIENTATION_SENSOR) ) {
// 				return;
// 			}
// 			if (newOrientation == mChosenOrientation) return; // unchanged
// 			if (BuildConfig.DEBUG) Log.d(TAG, "Orientation setting changed from " + mChosenOrientation + " to " + newOrientation);
// 			mChosenOrientation = newOrientation;
// 		}
// 	}
// 
// 	public void setOrientation() {
// 		if (mChosenOrientation != mActivity.getRequestedOrientation()) {
// 			if (BuildConfig.DEBUG) Log.d(TAG, "Changing orientation for " + mActivity.toString());
// 			// mChosenOrientation can have only allowed values (see above)
// 			//noinspection AndroidLintWrongConstant
// 			mActivity.setRequestedOrientation(mChosenOrientation);
// 		}
// 	}
// }


// Path: AndroBOINC/src/main/java/sk/boinc/androboinc/AppPreferencesActivity.java
import sk.boinc.androboinc.util.NetStatsStorage;
import sk.boinc.androboinc.util.PreferenceName;
import sk.boinc.androboinc.util.ScreenOrientationHandler;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.Preference.OnPreferenceClickListener;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.CheckBox;
import android.widget.TextView;

/* 
 * AndroBOINC - BOINC Manager for Android
 * Copyright (C) 2010, Pavol Michalec
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */

package sk.boinc.androboinc;


public class AppPreferencesActivity extends PreferenceActivity implements OnSharedPreferenceChangeListener {
	private static final String TAG = "AppPreferencesActivity";

	private static final int DIALOG_NETSTATS_DISCLAIMER = 1;
	private static final int DIALOG_ABOUT               = 2;
	private static final int DIALOG_LICENSE             = 3;
	private static final int DIALOG_LICENSE2            = 4;
	private static final int DIALOG_CHANGELOG           = 5;

	private BoincManagerApplication mApp;
	private ScreenOrientationHandler mScreenOrientation;