]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/DictionaryManagerActivity.java
Add error messages when dictionary path is not writable.
[Dictionary.git] / src / com / hughes / android / dictionary / DictionaryManagerActivity.java
index d9b1eed447eb87f95940f4e51a97ad7c0a5fb598..127de4358792396ba289327b3673ae7d793d1611 100644 (file)
@@ -173,7 +173,11 @@ public class DictionaryManagerActivity extends ActionBarActivity {
                     Toast.makeText(context, getString(R.string.installationFinished, dest),
                             Toast.LENGTH_LONG).show();
                 } catch (Exception e) {
-                    new AlertDialog.Builder(context).setTitle(getString(R.string.error)).setMessage(getString(R.string.unzippingFailed, dest)).setNeutralButton("Close", null).show();
+                    String msg = getString(R.string.unzippingFailed, dest);
+                    if (!application.getDictDir().canWrite()) {
+                        msg = getString(R.string.notWritable, application.getDictDir().getAbsolutePath());
+                    }
+                    new AlertDialog.Builder(context).setTitle(getString(R.string.error)).setMessage(msg).setNeutralButton("Close", null).show();
                     Log.e(LOG, "Failed to unzip.", e);
                 } finally {
                     localZipFile.delete();