1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-03 17:59:33 +02:00

dictionary preference has been added

This commit is contained in:
Nikolay Pultsin 2011-01-08 22:45:18 +00:00
parent 58c448f02e
commit 003bcf486b
14 changed files with 105 additions and 13 deletions

View file

@ -480,6 +480,7 @@
</node>
<node name="dictionary" value="Slovník">
<node name="summary" value="Nastavení slovníku"/>
<node name="dictionary" value="Slovník"/>
<node name="tappingAction" value="Dlouhé klepnutí">
<node name="doNothing" value="Dlouhé klepnutí nedělá nic"/>
<node name="selectWord" value="Dlouhé klepnutí vybere slovo"/>

View file

@ -481,6 +481,7 @@
</node>
<node name="dictionary" value="Dictionary" toBeTranslated="true">
<node name="summary" value="Dictionary settings" toBeTranslated="true"/>
<node name="dictionary" value="Dictionary" toBeTranslated="true"/>
<node name="tappingAction" value="Long tapping action" toBeTranslated="true">
<node name="doNothing" value="Long tapping does nothing" toBeTranslated="true"/>
<node name="selectWord" value="Long tapping selects the word" toBeTranslated="true"/>

View file

@ -479,6 +479,7 @@
</node>
<node name="dictionary" value="Dictionary">
<node name="summary" value="Dictionary settings"/>
<node name="dictionary" value="Dictionary"/>
<node name="tappingAction" value="Long tapping action">
<node name="doNothing" value="Long tapping does nothing"/>
<node name="selectWord" value="Long tapping selects the word"/>

View file

@ -483,6 +483,7 @@
</node>
<node name="dictionary" value="Dictionnaire">
<node name="summary" value="Paramètres du dictionnaire"/>
<node name="dictionary" value="Dictionnaire"/>
<node name="tappingAction" value="Configuration de l'appui long">
<node name="doNothing" value="Un appui long ne fait rien"/>
<node name="selectWord" value="Un appui long selectionne le mot"/>

View file

@ -480,6 +480,7 @@
</node>
<node name="dictionary" value="Szótár">
<node name="summary" value="Szótár beállításai"/>
<node name="dictionary" value="Szótár"/>
<node name="tappingAction" value="Hosszú érintés">
<node name="doNothing" value="Nem történik semmi hosszú érintésre"/>
<node name="selectWord" value="A hosszú érintés kijelöli a szót"/>

View file

@ -480,6 +480,7 @@
</node>
<node name="dictionary" value="Dictionary" toBeTranslated="true">
<node name="summary" value="Dictionary settings" toBeTranslated="true"/>
<node name="dictionary" value="Dictionary" toBeTranslated="true"/>
<node name="tappingAction" value="Long tapping action" toBeTranslated="true">
<node name="doNothing" value="Long tapping does nothing" toBeTranslated="true"/>
<node name="selectWord" value="Long tapping selects the word" toBeTranslated="true"/>

View file

@ -487,6 +487,7 @@
</node>
<node name="dictionary" value="Словарь">
<node name="summary" value="Настройки словаря"/>
<node name="dictionary" value="Словарь"/>
<node name="tappingAction" value="Действие при долгом нажатии на экран">
<node name="doNothing" value="Не делать ничего"/>
<node name="selectWord" value="Выделять слово"/>

View file

@ -480,6 +480,7 @@
</node>
<node name="dictionary" value="Dictionary" toBeTranslated="true">
<node name="summary" value="Dictionary settings" toBeTranslated="true"/>
<node name="dictionary" value="Dictionary" toBeTranslated="true"/>
<node name="tappingAction" value="Long tapping action" toBeTranslated="true">
<node name="doNothing" value="Long tapping does nothing" toBeTranslated="true"/>
<node name="selectWord" value="Long tapping selects the word" toBeTranslated="true"/>

View file

@ -480,6 +480,7 @@
</node>
<node name="dictionary" value="Dictionary" toBeTranslated="true">
<node name="summary" value="Dictionary settings" toBeTranslated="true"/>
<node name="dictionary" value="Dictionary" toBeTranslated="true"/>
<node name="tappingAction" value="Long tapping action" toBeTranslated="true">
<node name="doNothing" value="Long tapping does nothing" toBeTranslated="true"/>
<node name="selectWord" value="Long tapping selects the word" toBeTranslated="true"/>

View file

@ -480,6 +480,7 @@
</node>
<node name="dictionary" value="字典">
<node name="summary" value="字典设定"/>
<node name="dictionary" value="字典"/>
<node name="tappingAction" value="长拍触行为动作">
<node name="doNothing" value="长拍触不做任何动作"/>
<node name="selectWord" value="长拍触选择词语"/>

View file

@ -34,19 +34,7 @@ import org.geometerplus.zlibrary.core.resources.ZLResource;
import org.geometerplus.android.util.UIUtil;
import org.geometerplus.android.util.PackageUtil;
class PackageInfo {
public final String PackageName;
public final String ClassName;
public final String Title;
PackageInfo(String packageName, String className, String title) {
PackageName = packageName;
ClassName = className;
Title = title;
}
}
abstract class DictionaryUtil {
public abstract class DictionaryUtil {
private static LinkedList<PackageInfo> ourDictionaryInfos = new LinkedList<PackageInfo>();
private static ZLStringOption ourDictionaryOption;

View file

@ -0,0 +1,32 @@
/*
* Copyright (C) 2010-2011 Geometer Plus <contact@geometerplus.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
package org.geometerplus.android.fbreader;
public class PackageInfo {
public final String PackageName;
public final String ClassName;
public final String Title;
PackageInfo(String packageName, String className, String title) {
PackageName = packageName;
ClassName = className;
Title = title;
}
}

View file

@ -0,0 +1,57 @@
/*
* Copyright (C) 2009-2011 Geometer Plus <contact@geometerplus.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
package org.geometerplus.android.fbreader.preferences;
import java.util.List;
import android.content.Context;
import org.geometerplus.zlibrary.core.options.ZLStringOption;
import org.geometerplus.zlibrary.core.resources.ZLResource;
import org.geometerplus.android.fbreader.DictionaryUtil;
import org.geometerplus.android.fbreader.PackageInfo;
class DictionaryPreference extends ZLStringListPreference {
private final ZLStringOption myOption;
DictionaryPreference(Context context, ZLResource resource, String resourceKey) {
super(context, resource, resourceKey);
myOption = DictionaryUtil.dictionaryOption();
final List<PackageInfo> infos = DictionaryUtil.dictionaryInfos();
final String[] values = new String[infos.size()];
final String[] texts = new String[infos.size()];
int index = 0;
for (PackageInfo i : infos) {
values[index] = i.ClassName;
texts[index] = i.Title;
++index;
}
setLists(values, texts);
setInitialValue(myOption.getValue());
}
public void onAccept() {
myOption.setValue(getValue());
}
}

View file

@ -334,6 +334,11 @@ public class PreferenceActivity extends ZLPreferenceActivity {
scrollingScreen.addOption(scrollingPreferences.HorizontalOption, "horizontal");
final Screen dictionaryScreen = createPreferenceScreen("dictionary");
dictionaryScreen.addPreference(new DictionaryPreference(
this,
dictionaryScreen.Resource,
"dictionary"
));
dictionaryScreen.addPreference(new ZLBooleanPreference(
this,
fbReader.NavigateAllWordsOption,