diff --git a/SWADroid/res/values-es/strings.xml b/SWADroid/res/values-es/strings.xml index 74178059..7523acd9 100644 --- a/SWADroid/res/values-es/strings.xml +++ b/SWADroid/res/values-es/strings.xml @@ -28,6 +28,8 @@ Obteniendo asignaturas... Notificaciones Obteniendo nuevas notificaciones + Tests + Obteniendo preguntas de test... Mierda. Ese bug del emulador de Android ha vuelto a aparecer. Reintentando... Ha ocurrido un error durante la ejecución de la @@ -50,6 +52,11 @@ Sin contenido No + Aceptar + Cancelar + Seleccione asignatura + Debe seleccionar una asignatura para descargar los tests + El profesor de esta asignatura no permite la descarga de tests Antes de usar la aplicación por primera vez debe introducir el nombre de usuario y la contraseña de acceso a SWAD en la pantalla de configuración.\n\nPuede acceder a la pantalla de @@ -59,11 +66,9 @@ Debido a cambios en la base de datos todos los datos de las notificaciones han sido borrados.\n\nDisculpe las molestias. + Usuario o contraseña incorrectos Error en respuesta del servidor Error durante la conexión con el servidor Tiempo de espera agotado intentando conectar con el servidor - - - \ No newline at end of file diff --git a/SWADroid/res/values/strings.xml b/SWADroid/res/values/strings.xml index 3619c2d0..2799cef6 100644 --- a/SWADroid/res/values/strings.xml +++ b/SWADroid/res/values/strings.xml @@ -26,6 +26,8 @@ Connecting... Notifications Retrieving new notifications + Tests + Obtaining test questions... Courses Retrieving courses... An error occurred during the execution of the @@ -51,6 +53,11 @@ No content Yes No + Ok + Cancel + Select course + You must select a course to download tests + The teacher of this course does not allows the tests download IMPORTANT Before using the application for the first time you must enter the user name and password for SWAD at the setup @@ -59,18 +66,8 @@ Due to changes in the database all notifications data have been deleted.\n\nSorry. + Incorrect user or password Error in server response Error while connecting to server Timeout trying to connect to the server - - - - - - - - - - - \ No newline at end of file diff --git a/SWADroid/src/es/ugr/swad/swadroid/modules/Login.java b/SWADroid/src/es/ugr/swad/swadroid/modules/Login.java index 798f983a..7e502f49 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/modules/Login.java +++ b/SWADroid/src/es/ugr/swad/swadroid/modules/Login.java @@ -72,7 +72,7 @@ public class Login extends Module { protected void connect() { String progressDescription = getString(R.string.loginProgressDescription); int progressTitle = R.string.loginProgressTitle; - Connect con = new Connect(false, progressDescription, progressTitle); + Connect con = new Connect(false, progressDescription, progressTitle, true); Toast.makeText(this, progressDescription, Toast.LENGTH_LONG).show(); con.execute(); diff --git a/SWADroid/src/es/ugr/swad/swadroid/modules/Module.java b/SWADroid/src/es/ugr/swad/swadroid/modules/Module.java index fef8aa1d..14b82192 100644 --- a/SWADroid/src/es/ugr/swad/swadroid/modules/Module.java +++ b/SWADroid/src/es/ugr/swad/swadroid/modules/Module.java @@ -457,7 +457,7 @@ public abstract class Module extends Activity { .setNeutralButton(R.string.close_dialog, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { - Module.this.finish(); + finish(); } }) .setIcon(R.drawable.erroricon).show(); @@ -501,27 +501,29 @@ public abstract class Module extends Activity { */ protected class Connect extends AsyncTask { /** - * Progress dialog. + * Progress dialog */ ProgressDialog dialog = new ProgressDialog(Module.this); /** - * Exception pointer. + * Exception pointer */ Exception e = null; String progressDescription; int progressTitle; - boolean showDialog; + boolean showDialog, isLoginModule; /** * Shows progress dialog and connects to SWAD in background * @param progressDescription Description to be showed in dialog * @param progressTitle Title to be showed in dialog */ - public Connect(boolean showDialog, String progressDescription, int progressTitle) { + public Connect(boolean showDialog, String progressDescription, int progressTitle, Boolean... isLogin) { super(); this.progressDescription = progressDescription; this.progressTitle = progressTitle; this.showDialog = showDialog; + assert isLogin.length <= 1; + this.isLoginModule = isLogin.length > 0 ? isLogin[0].booleanValue() : false; } /* (non-Javadoc) @@ -584,11 +586,16 @@ public abstract class Module extends Activity { */ if(e instanceof SoapFault) { SoapFault es = (SoapFault) e; + + if(isLoginModule) + errorMsg = getString(R.string.errorBadLoginMsg); + else + errorMsg = es.getMessage(); if(isDebuggable) - Log.e(es.getClass().getSimpleName(), es.getMessage()); + Log.e(e.getClass().getSimpleName(), errorMsg); - error(es.getMessage()); + error(errorMsg); } else if (e instanceof XmlPullParserException) { errorMsg = getString(R.string.errorServerResponseMsg);