]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/DictionaryManagerActivity.java
Display uncompressed size of dictionaries.
[Dictionary.git] / src / com / hughes / android / dictionary / DictionaryManagerActivity.java
index 127de4358792396ba289327b3673ae7d793d1611..bd9f364a1739bd039e2f9e3b65a1bb45c0820ab2 100644 (file)
@@ -174,8 +174,9 @@ public class DictionaryManagerActivity extends ActionBarActivity {
                             Toast.LENGTH_LONG).show();
                 } catch (Exception e) {
                     String msg = getString(R.string.unzippingFailed, dest);
-                    if (!application.getDictDir().canWrite()) {
-                        msg = getString(R.string.notWritable, application.getDictDir().getAbsolutePath());
+                    File dir = application.getDictDir();
+                    if (!dir.canWrite() || !application.checkFileCreate(dir)) {
+                        msg = getString(R.string.notWritable, dir.getAbsolutePath());
                     }
                     new AlertDialog.Builder(context).setTitle(getString(R.string.error)).setMessage(msg).setNeutralButton("Close", null).show();
                     Log.e(LOG, "Failed to unzip.", e);
@@ -528,8 +529,8 @@ public class DictionaryManagerActivity extends ActionBarActivity {
 
         final boolean updateAvailable = application.updateAvailable(dictionaryInfo);
         final Button downloadButton = (Button) row.findViewById(R.id.downloadButton);
+        final DictionaryInfo downloadable = application.getDownloadable(dictionaryInfo.uncompressedFilename);
         if (!canLaunch || updateAvailable) {
-            final DictionaryInfo downloadable = application.getDownloadable(dictionaryInfo.uncompressedFilename);
             downloadButton
                     .setText(getString(
                             R.string.downloadButton,
@@ -573,6 +574,8 @@ public class DictionaryManagerActivity extends ActionBarActivity {
             builder.append(getString(R.string.indexInfo, indexInfo.shortName,
                     indexInfo.mainTokenCount));
         }
+        builder.append("; ");
+        builder.append(getString(R.string.downloadButton, downloadable.uncompressedBytes / 1024.0 / 1024.0));
         details.setText(builder.toString());
 
         if (canLaunch) {