]> gitweb.fperrin.net Git - Dictionary.git/commitdiff
More messaging about downloads.
authorThad Hughes <thadh@google.com>
Thu, 26 Dec 2013 20:08:18 +0000 (12:08 -0800)
committerThad Hughes <thadh@google.com>
Thu, 26 Dec 2013 20:08:18 +0000 (12:08 -0800)
res/values-de/strings.xml
res/values/strings.xml
src/com/hughes/android/dictionary/DictionaryManagerActivity.java
todo.txt

index dddd1915a85f37bb2b00c5c7291b29d6d4f75bd6..b3ca64e8af4ce82133cb1fa58c24cf747e2f9db1 100644 (file)
@@ -3,7 +3,7 @@
 
        <string name="app_name">QuickDic</string>
 
-       <string name="titleWithVersion">QuickDic 4.0.1</string>
+       <string name="titleWithVersion">QuickDic 5.0.0</string>
        
   <!-- Global. -->
   <string name="about">Über QuickDic…</string>
@@ -22,8 +22,8 @@
   <string name="deleteDictionary">Wörterbuch entfernen</string>
   <string name="indexInfo">%1$s: %2$,d Wörter</string>
   <string name="managerFilterText">Filter</string>
-  <string name="managerFilterCheckbox">Nur SD-Karte</string>
-  
+  <string name="managerFilterCheckbox">Nur SD-Karte</string>  
+
   <string name="thanksForUpdatingVersion">4.0.1_de_b</string>
 
   <!-- DictionaryActivity -->
index b14259d2418121443938cd99d862821c60418c3e..7eb70e667108ece49c872b8a9c82cfeda7c352bb 100644 (file)
@@ -3,14 +3,13 @@
 
   <string name="app_name">QuickDic</string>
 
-  <string name="titleWithVersion">QuickDic 4.0.1</string>
+  <string name="titleWithVersion">QuickDic 5.0.0</string>
   
   <!-- Global. -->
   <string name="about">About QuickDic…</string> 
   <string name="settings">Settings…</string>
   <string name="help">Help</string>
   <string name="reportIssue">Report issue…</string>
-  <string name="fontWorkaround">Detected font problem (common on Sony Ericsson devices), switching back to default font.</string>
   
   <string name="no_dict_file">Please specify a default directory in the settings.</string>
   
    <!-- DictionaryManagerActivity -->
   <string name="dictionaryManager">Dictionary manager</string>
   <string name="dictionariesOnDevice">Dictionaries on device</string>
-  <string name="noDictionariesOnDevice">No dictionaries on device</string>
   <string name="downloadableDictionaries">Downloadable dictionaries</string>
   <string name="downloadButton">%.1fMB</string>
   <string name="updateAvailable">UPDATE!</string>
   <string name="moveToTop">Move to top</string>
   <string name="deleteDictionary">Delete dictionary</string>
   <string name="indexInfo">%1$s: %2$,d words</string>
-  <string name="managerFilterText">List filter</string>
   <string name="managerShow">Show</string>
   <string name="managerHide">Hide</string>
   
   <string name="unableToReadDictionaryDir">Unable to read dictionary directory: \n%1$s\n\nAndroid external storage directory: \n%2$s</string>
   
   <!-- Download. -->
-  <string name="downloadFinished">Download finished: \n%s.</string>
   <string name="downloadFailed">Download failed: \n%s.</string>  
+  <string name="unzippingDictionary">Unzipping dictionary: \n%s</string>
+  <string name="unzippingFailed">Unzipping failed: \n%s</string>
+  <string name="installationFinished">Installation finished: \n%s.</string>
   
   
 
   <!-- DictionaryActivity -->
   <string name="searchText">Search Text</string>
   <string name="selectDictionary">Select dictionary…</string>
-  <string name="switchToLanguage">Switch to %s</string>
   <string name="addToWordList">Add to word list: %s</string>
   <string name="searchForSelection">Search: %s</string>
   <string name="failedAddingToWordList">Failure adding to word list: %s</string>
-  <string name="unzippingDictionary">Unzipping dictionary…</string>
-  <string name="failedToUnzipDictionary">Failed to unzip dictionary…</string>
   <string name="invalidDictionary">Invalid dictionary: file=%1$s, error=%2$s</string>
   <string name="noSearchResults">No search results.</string>
   <string name="aboutDictionary">About dictionary…</string> 
-  <string name="randomWord">Random word</string> 
   <string name="fontFailure">Font failure: %s</string> 
   <string name="seeAlso">See also: %1$s (%2$s)</string> 
   <string name="speak">Speak</string> 
@@ -71,7 +66,6 @@
   
   
        <!-- About. -->
-  <string name="thadHughes">Thad Hughes</string>
   <string name="contactMe">If you\'re using QuickDic, I\'d love to hear from you.
   Unfortunately, I cannot take responsibility for dictionary content (other than formatting), as it is generated from other sources.
   Please send comments, suggestions, bug reports, or just a quick hello to:</string>
@@ -90,7 +84,6 @@
   <string name="defaultDicTitle">Default Dic</string>
   <string name="defaultDicSummary">The directory to fired up when nothing else mentioned.</string>
 
-
   <string name="quickdicDirectoryKey">quickdicDirectory</string>
   <string name="quickdicDirectoryTitle">QuickDic directory</string>
   <string name="quickdicDirectorySummary">The directory where QuickDic stores dictionaries (empty for default quickDic folder on external storage).</string>
index fa0bf8a5415438076eb36fde61baf87ca656f34d..30a4e3b9fec4d9bc211c4bcc1441adc824003138 100644 (file)
@@ -15,7 +15,6 @@
 package com.hughes.android.dictionary;
 
 import android.app.AlertDialog;
-import android.app.Dialog;
 import android.app.DownloadManager;
 import android.app.DownloadManager.Request;
 import android.content.BroadcastReceiver;
@@ -37,26 +36,22 @@ import android.view.ContextMenu.ContextMenuInfo;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.View.OnClickListener;
-import android.view.View.OnLongClickListener;
-import android.view.inputmethod.EditorInfo;
 import android.view.ViewGroup;
+import android.view.inputmethod.EditorInfo;
 import android.widget.AdapterView.AdapterContextMenuInfo;
 import android.widget.BaseAdapter;
 import android.widget.Button;
 import android.widget.CompoundButton;
-import android.widget.FrameLayout;
-import android.widget.ImageView;
-import android.widget.ListView;
-import android.widget.Toast;
 import android.widget.CompoundButton.OnCheckedChangeListener;
+import android.widget.FrameLayout;
 import android.widget.LinearLayout;
 import android.widget.TextView;
+import android.widget.Toast;
 import android.widget.ToggleButton;
 
 import com.actionbarsherlock.app.ActionBar;
 import com.actionbarsherlock.app.SherlockListActivity;
 import com.actionbarsherlock.view.Menu;
-import com.actionbarsherlock.view.MenuInflater;
 import com.actionbarsherlock.widget.SearchView;
 import com.actionbarsherlock.widget.SearchView.OnQueryTextListener;
 import com.hughes.android.dictionary.DictionaryInfo.IndexInfo;
@@ -141,22 +136,29 @@ public class DictionaryManagerActivity extends SherlockListActivity {
                 }
 
                 Log.w(LOG, "Download finished: " + dest);
+                Toast.makeText(context, getString(R.string.unzippingDictionary, dest),
+                        Toast.LENGTH_LONG).show();
+                
+                
                 final File localZipFile = new File(Uri.parse(dest).getPath());
-
                 try {
                     ZipFile zipFile = new ZipFile(localZipFile);
                     final ZipEntry zipEntry = zipFile.entries().nextElement();
                     Log.d(LOG, "Unzipping entry: " + zipEntry.getName());
                     final InputStream zipIn = zipFile.getInputStream(zipEntry);
-                    final OutputStream zipOut = new FileOutputStream(
-                            new File(application.getDictDir(), zipEntry.getName()));
+                    File targetFile = new File(application.getDictDir(), zipEntry.getName());
+                    if (targetFile.exists()) {
+                        targetFile.renameTo(new File(targetFile.getAbsolutePath().replace(".quickdic", "bak.quickdic")));
+                        targetFile = new File(application.getDictDir(), zipEntry.getName());
+                    }
+                    final OutputStream zipOut = new FileOutputStream(targetFile);
                     copyStream(zipIn, zipOut);
                     zipFile.close();
                     application.backgroundUpdateDictionaries(dictionaryUpdater);
-                    Toast.makeText(context, getString(R.string.downloadFinished, dest),
+                    Toast.makeText(context, getString(R.string.installationFinished, dest),
                             Toast.LENGTH_LONG).show();
                 } catch (Exception e) {
-                    Toast.makeText(context, getString(R.string.downloadFailed, dest),
+                    Toast.makeText(context, getString(R.string.unzippingFailed, dest),
                             Toast.LENGTH_LONG).show();
                     Log.e(LOG, "Failed to unzip.", e);
                 } finally {
index cd2fc80c7544a5bc6c5c94fba5864cba14a590ce..335af62373be105a6eb2e038a7dc555979fd0514 100644 (file)
--- a/todo.txt
+++ b/todo.txt
@@ -1,3 +1,3 @@
 * Internationalize strings.
-* Back button in top left
+* Back button and actionbar button.
 * HtmlEntries inline, expandable.
\ No newline at end of file