# HG changeset patch
# User Xeli
# Date 1326657871 -3600
# Node ID bc1214f66ee4b13a04ca1fcbfa80c2863126865b
# Parent e24855695acab9769acf1760c91d05689a403df8
some bug fixed regarding the downloader
diff -r e24855695aca -r bc1214f66ee4 project_files/Android-build/SDL-android-project/AndroidManifest.xml
--- a/project_files/Android-build/SDL-android-project/AndroidManifest.xml Sun Jan 15 21:00:10 2012 +0100
+++ b/project_files/Android-build/SDL-android-project/AndroidManifest.xml Sun Jan 15 21:04:31 2012 +0100
@@ -30,8 +30,8 @@
-
+ android:screenOrientation='landscape'
+ android:launchMode="singleTop"/>
diff -r e24855695aca -r bc1214f66ee4 project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadDialogFragment.java
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadDialogFragment.java Sun Jan 15 21:00:10 2012 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadDialogFragment.java Sun Jan 15 21:04:31 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);
}
diff -r e24855695aca -r bc1214f66ee4 project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadFragment.java
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadFragment.java Sun Jan 15 21:00:10 2012 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadFragment.java Sun Jan 15 21:04:31 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;
diff -r e24855695aca -r bc1214f66ee4 project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadService.java
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadService.java Sun Jan 15 21:00:10 2012 +0100
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Downloader/DownloadService.java Sun Jan 15 21:04:31 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;
}