]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/DictionaryActivity.java
Flag of Scotland, error message when directory is not available.
[Dictionary.git] / src / com / hughes / android / dictionary / DictionaryActivity.java
index bf93cecdd82eec2c4bd271b1ee55aed3462fee2b..4425a0b0f3d7cc2276ba5679d7df7e956b68ef20 100644 (file)
@@ -196,11 +196,11 @@ public class DictionaryActivity extends SherlockListActivity {
     public void onCreate(Bundle savedInstanceState) {
         Log.d(LOG, "onCreate:" + this);
         super.onCreate(savedInstanceState);
-
+        
         final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
         
         // Don't auto-launch if this fails.
-        prefs.edit().remove(C.INDEX_SHORT_NAME).commit(); 
+        prefs.edit().remove(C.DICT_FILE).commit(); 
 
         setTheme(((DictionaryApplication) getApplication()).getSelectedTheme().themeId);
 
@@ -233,7 +233,7 @@ public class DictionaryActivity extends SherlockListActivity {
                if(intent.getStringExtra(C.DICT_FILE) == null && (from != null || to != null))
                {
                        Log.d(LOG, "DictSearch: from: " + from + " to " + to);
-                       List<DictionaryInfo> dicts = application.getDictionariesOnDevice();
+                       List<DictionaryInfo> dicts = application.getDictionariesOnDevice(null);
                        for(DictionaryInfo info : dicts)
                        {
                                boolean hasFrom = from == null;
@@ -336,7 +336,6 @@ public class DictionaryActivity extends SherlockListActivity {
                 break;
             }
         }
-        indexIndex %= dictionary.indices.size();
         Log.d(LOG, "Loading index " + indexIndex);
         index = dictionary.indices.get(indexIndex);
         setListAdapter(new IndexAdapter(index));
@@ -404,7 +403,7 @@ public class DictionaryActivity extends SherlockListActivity {
 
         // Cache some prefs.
         wordList = new File(prefs.getString(getString(R.string.wordListFileKey),
-                getString(R.string.wordListFileDefault)));
+                new File(application.getDictDir(), "wordList.txt").getAbsolutePath()));
         saveOnlyFirstSubentry = prefs.getBoolean(getString(R.string.saveOnlyFirstSubentryKey),
                 false);
         clickOpensContextMenu = prefs.getBoolean(getString(R.string.clickOpensContextMenuKey),
@@ -435,7 +434,7 @@ public class DictionaryActivity extends SherlockListActivity {
         
         searchView = new SearchView(getSupportActionBar().getThemedContext());
         searchView.setIconifiedByDefault(false);
-        // searchView.setIconified(false); // puts the magifying glass in the
+        // searchView.setIconified(false); // puts the magnifying glass in the
         // wrong place.
         searchView.setQueryHint(getString(R.string.searchText));
         searchView.setSubmitButtonEnabled(false);
@@ -613,7 +612,7 @@ public class DictionaryActivity extends SherlockListActivity {
         dialog.setContentView(R.layout.select_dictionary_dialog);
         dialog.setTitle(R.string.selectDictionary);
 
-        final List<DictionaryInfo> installedDicts = application.getDictionariesOnDevice();
+        final List<DictionaryInfo> installedDicts = application.getDictionariesOnDevice(null);
 
         ListView listView = (ListView) dialog.findViewById(android.R.id.list);
         final Button button = new Button(listView.getContext());