changed error message
authorXeli
Sun, 15 Jan 2012 21:08:15 +0100
changeset 6568 ad83229a7d98
parent 6563 30e042398411 (current diff)
parent 6567 54e19cefcdac (diff)
child 6569 64f9fbd48b9e
changed error message
project_files/Android-build/SDL-android-project/res/values/strings.xml
--- a/project_files/Android-build/SDL-android-project/AndroidManifest.xml	Sun Jan 15 12:40:48 2012 -0500
+++ b/project_files/Android-build/SDL-android-project/AndroidManifest.xml	Sun Jan 15 21:08:15 2012 +0100
@@ -30,8 +30,8 @@
         <activity android:name=".Downloader.DownloadListActivity"
                   android:label="@string/app_name"
 				  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
-				  android:screenOrientation='landscape'>
-        </activity>
+				  android:screenOrientation='landscape'
+				  android:launchMode="singleTop"/>
         
         <service android:name=".Downloader.DownloadService"/>
         
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/ant.properties	Sun Jan 15 21:08:15 2012 +0100
@@ -0,0 +1,17 @@
+# This file is used to override default values used by the Ant build system.
+#
+# This file must be checked in Version Control Systems, as it is
+# integral to the build system of your project.
+
+# This file is only used by the Ant script.
+
+# You can use this to override default values such as
+#  'source.dir' for the location of your java source folder and
+#  'out.dir' for the location of your output folder.
+
+# You can also use it define how the release builds are signed by declaring
+# the following properties:
+#  'key.store' for the location of your keystore and
+#  'key.alias' for the name of the key to use.
+# The password will be asked during the build when you use the 'release' target.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/project.properties	Sun Jan 15 21:08:15 2012 +0100
@@ -0,0 +1,2 @@
+# Project target.
+target=android-4
--- a/project_files/Android-build/SDL-android-project/res/values/strings.xml	Sun Jan 15 12:40:48 2012 -0500
+++ b/project_files/Android-build/SDL-android-project/res/values/strings.xml	Sun Jan 15 21:08:15 2012 +0100
@@ -21,7 +21,7 @@
     <string name="download_done">Done</string>
     <string name="download_back">Back to main menu</string>
     <string name="download_tryagain">Try again</string>
-    <string name="download_failed">The download has failed, check the internet connectivity and please try again</string>
+    <string name="download_failed">The download has failed because of: </string>
     <string name="download_userexplain">Before starting the game we must download some extra files...</string>
     
     <string name="download_areyousure">Are you sure you want to download this package?</string>
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadDialogFragment.java	Sun Jan 15 12:40:48 2012 -0500
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadDialogFragment.java	Sun Jan 15 21:08:15 2012 +0100
@@ -60,7 +60,7 @@
 
 		public void onClick(DialogInterface dialog, int which) {
 			if(which == Dialog.BUTTON_POSITIVE){
-				Intent i = new Intent(getActivity(), DownloadFragment.class);
+				Intent i = new Intent(getActivity(), DownloadListActivity.class);
 				i.putExtra(DownloadFragment.EXTRA_TASK, task);
 				getActivity().startActivity(i);
 			}
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadFragment.java	Sun Jan 15 12:40:48 2012 -0500
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadFragment.java	Sun Jan 15 21:08:15 2012 +0100
@@ -32,7 +32,6 @@
 import android.os.Messenger;
 import android.os.RemoteException;
 import android.support.v4.app.Fragment;
-import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.View.OnClickListener;
@@ -199,10 +198,14 @@
 				break;
 			case MSG_FAILED:
 				progress.setProgress(progress.getMax());
-				progress_sub.setText(R.string.download_failed);
-				//	positive.setText(R.string.download_back);
-				//	positive.setOnClickListener(doneClicker);
-
+				
+				String errorMsg = getString(R.string.download_failed);
+				switch(msg.arg1){
+				case DownloadAsyncTask.EXIT_CONNERROR: progress_sub.setText(errorMsg + " " + "Connection error"); break;
+				case DownloadAsyncTask.EXIT_FNF: progress_sub.setText(errorMsg + " " + "File not found"); break;
+				case DownloadAsyncTask.EXIT_MD5: progress_sub.setText(errorMsg + " " + "MD5 check failed"); break;
+				case DownloadAsyncTask.EXIT_URLFAIL: progress_sub.setText(errorMsg + " " + "Invalid url"); break;
+				}
 				negative.setText(R.string.download_tryagain);
 				negative.setOnClickListener(tryAgainClicker);
 				break;
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadService.java	Sun Jan 15 12:40:48 2012 -0500
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadService.java	Sun Jan 15 21:08:15 2012 +0100
@@ -175,7 +175,7 @@
 			contentView.setProgressBar(R.id.notification_progress, 100, 34, false);
 			progressNotification.contentView = contentView;
 
-			PendingIntent contentIntent = PendingIntent.getActivity(DownloadService.this, 0, new Intent(DownloadService.this, DownloadFragment.class), Intent.FLAG_ACTIVITY_NEW_TASK);
+			PendingIntent contentIntent = PendingIntent.getActivity(DownloadService.this, 0, new Intent(DownloadService.this, DownloadListActivity.class), Intent.FLAG_ACTIVITY_NEW_TASK);
 			progressNotification.contentIntent = contentIntent;
 
 			startForeground(NOTIFICATION_PROCESSING, progressNotification);
@@ -199,10 +199,10 @@
 		public void done(int result){
 			switch(result){
 			case DownloadAsyncTask.EXIT_SUCCESS: 	sendMessageToClients(Message.obtain(handler, DownloadFragment.MSG_DONE)); break;
-			case DownloadAsyncTask.EXIT_CONNERROR:  sendMessageToClients(Message.obtain(handler, DownloadFragment.MSG_FAILED)); break;
-			case DownloadAsyncTask.EXIT_FNF:		sendMessageToClients(Message.obtain(handler, DownloadFragment.MSG_FAILED)); break;
-			case DownloadAsyncTask.EXIT_MD5:		sendMessageToClients(Message.obtain(handler, DownloadFragment.MSG_FAILED)); break;
-			case DownloadAsyncTask.EXIT_URLFAIL:	sendMessageToClients(Message.obtain(handler, DownloadFragment.MSG_FAILED)); break;
+			case DownloadAsyncTask.EXIT_CONNERROR:  sendMessageToClients(Message.obtain(handler, DownloadFragment.MSG_FAILED, DownloadAsyncTask.EXIT_CONNERROR, 0)); break;
+			case DownloadAsyncTask.EXIT_FNF:		sendMessageToClients(Message.obtain(handler, DownloadFragment.MSG_FAILED, DownloadAsyncTask.EXIT_FNF, 0)); break;
+			case DownloadAsyncTask.EXIT_MD5:		sendMessageToClients(Message.obtain(handler, DownloadFragment.MSG_FAILED, DownloadAsyncTask.EXIT_MD5, 0)); break;
+			case DownloadAsyncTask.EXIT_URLFAIL:	sendMessageToClients(Message.obtain(handler, DownloadFragment.MSG_FAILED, DownloadAsyncTask.EXIT_URLFAIL, 0)); break;
 			case DownloadAsyncTask.EXIT_CANCELLED:	sendMessageToClients(Message.obtain(handler, DownloadFragment.MSG_DONE)); break;
 			}
 			
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/TeamCreatorActivity.java	Sun Jan 15 12:40:48 2012 -0500
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/TeamCreatorActivity.java	Sun Jan 15 21:08:15 2012 +0100
@@ -67,8 +67,12 @@
 	private boolean saved = false;
 	private String fileName = null;
 
-	private List<HashMap<String, ?>> flagsData, typesData, gravesData, hatsData;
-	private List<String> voicesData, fortsData;
+	private final List<HashMap<String, ?>> flagsData = new ArrayList<HashMap<String, ?>>();
+	private final List<HashMap<String, ?>> typesData = new ArrayList<HashMap<String, ?>>();
+	private final List<HashMap<String, ?>> gravesData = new ArrayList<HashMap<String, ?>>();
+	private final List<HashMap<String, ?>> hatsData = new ArrayList<HashMap<String, ?>>();
+	private final List<String> voicesData = new ArrayList<String>();
+	private final List<String> fortsData = new ArrayList<String>();
 
 	public void onCreate(Bundle savedInstanceState) {
 		super.onCreate(savedInstanceState);
@@ -104,7 +108,6 @@
 					.findViewById(R.id.txtTeam1));
 		}
 
-		gravesData = new ArrayList<HashMap<String, ?>>();
 		SimpleAdapter sa = new SimpleAdapter(this, gravesData,
 				R.layout.spinner_textimg_entry, new String[] { "txt", "img" },
 				new int[] { R.id.spinner_txt, R.id.spinner_img });
@@ -113,7 +116,6 @@
 		grave.setAdapter(sa);
 		grave.setOnFocusChangeListener(focusser);
 
-		flagsData = new ArrayList<HashMap<String, ?>>();
 		sa = new SimpleAdapter(this, flagsData, R.layout.spinner_textimg_entry,
 				new String[] { "txt", "img" }, new int[] { R.id.spinner_txt,
 				R.id.spinner_img });
@@ -122,7 +124,6 @@
 		flag.setAdapter(sa);
 		flag.setOnFocusChangeListener(focusser);
 
-		typesData = new ArrayList<HashMap<String, ?>>();
 		sa = new SimpleAdapter(this, typesData, R.layout.spinner_textimg_entry,
 				new String[] { "txt", "img" }, new int[] { R.id.spinner_txt,
 				R.id.spinner_img });
@@ -130,7 +131,6 @@
 		difficulty.setAdapter(sa);
 		difficulty.setOnFocusChangeListener(focusser);
 
-		hatsData = new ArrayList<HashMap<String, ?>>();
 		sa = new SimpleAdapter(this, hatsData, R.layout.spinner_textimg_entry,
 				new String[] { "txt", "img" }, new int[] { R.id.spinner_txt,
 				R.id.spinner_img });
@@ -140,14 +140,12 @@
 			spin.setAdapter(sa);
 		}
 
-		voicesData = new ArrayList<String>();
 		ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.listview_item, voicesData);
 		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
 		voice.setAdapter(adapter);
 		voice.setOnFocusChangeListener(focusser);
 		voiceButton.setOnClickListener(voiceClicker);
 
-		fortsData = new ArrayList<String>();
 		adapter = new ArrayAdapter<String>(this, R.layout.listview_item, fortsData);
 		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
 		fort.setAdapter(adapter);
@@ -158,28 +156,33 @@
 	}
 
 	public void run(){
-		ArrayList<HashMap<String, ?>> gravesData = FrontendDataUtils.getGraves(this);
-		ArrayList<HashMap<String, ?>> flagsData = FrontendDataUtils.getFlags(this);
-		ArrayList<HashMap<String, ?>> typesData = FrontendDataUtils.getTypes(this);
-		ArrayList<HashMap<String, ?>> hatsData = FrontendDataUtils.getHats(this);
-		ArrayList<String> voicesData = FrontendDataUtils.getVoices(this);
-		ArrayList<String> fortsData = FrontendDataUtils.getForts(this);
+		final ArrayList<HashMap<String, ?>> gravesDataNew = FrontendDataUtils.getGraves(this);
+		final ArrayList<HashMap<String, ?>> flagsDataNew = FrontendDataUtils.getFlags(this);
+		final ArrayList<HashMap<String, ?>> typesDataNew = FrontendDataUtils.getTypes(this);
+		final ArrayList<HashMap<String, ?>> hatsDataNew = FrontendDataUtils.getHats(this);
+		final ArrayList<String> voicesDataNew = FrontendDataUtils.getVoices(this);
+		final ArrayList<String> fortsDataNew = FrontendDataUtils.getForts(this);
 		
-		copy(this.gravesData, gravesData);
-		copy(this.flagsData, flagsData);
-		copy(this.typesData, typesData);
-		copy(this.hatsData, hatsData);
-		copy(this.voicesData, voicesData);
-		copy(this.fortsData, fortsData);
 		
 		this.runOnUiThread(new Runnable(){
 			public void run() {
+				copy(gravesData, gravesDataNew);
 				((SimpleAdapter)grave.getAdapter()).notifyDataSetChanged();
+				
+				copy(flagsData, flagsDataNew);
 				((SimpleAdapter)flag.getAdapter()).notifyDataSetChanged();
+				
+				copy(typesData, typesDataNew);
 				((SimpleAdapter)difficulty.getAdapter()).notifyDataSetChanged();
-				((SimpleAdapter)hogHat.get(0).getAdapter()).notifyDataSetChanged();				
+				
+				copy(hatsData, hatsDataNew);
+				((SimpleAdapter)hogHat.get(0).getAdapter()).notifyDataSetChanged();
+				
+				copy(voicesData, voicesDataNew);
 				((ArrayAdapter<String>)fort.getAdapter()).notifyDataSetChanged();
-				((ArrayAdapter<String>)voice.getAdapter()).notifyDataSetChanged();
+				
+				copy(fortsData, fortsDataNew);
+				((ArrayAdapter<String>)voice.getAdapter()).notifyDataSetChanged();			
 			}
 		});		
 
Binary file project_files/promotional_art/Icon.png has changed
Binary file project_files/promotional_art/Marketplace-header.png has changed
Binary file project_files/promotional_art/Promo-graphic.png has changed