diff --git a/assets/resources/application/en.xml b/assets/resources/application/en.xml index 109b9201b..4917d61b0 100644 --- a/assets/resources/application/en.xml +++ b/assets/resources/application/en.xml @@ -325,23 +325,15 @@ - + - - - - - - - - - - - - + + + + diff --git a/src/org/geometerplus/android/fbreader/preferences/BatteryLevelToTurnScreenOffPreference.java b/src/org/geometerplus/android/fbreader/preferences/BatteryLevelToTurnScreenOffPreference.java index b241b9b46..0dc8288fa 100644 --- a/src/org/geometerplus/android/fbreader/preferences/BatteryLevelToTurnScreenOffPreference.java +++ b/src/org/geometerplus/android/fbreader/preferences/BatteryLevelToTurnScreenOffPreference.java @@ -27,8 +27,8 @@ import org.geometerplus.zlibrary.core.options.ZLIntegerRangeOption; class BatteryLevelToTurnScreenOffPreference extends ZLStringListPreference { private final ZLIntegerRangeOption myOption; - BatteryLevelToTurnScreenOffPreference(Context context, ZLIntegerRangeOption option, ZLResource rootResource, String resourceKey) { - super(context, rootResource, resourceKey); + BatteryLevelToTurnScreenOffPreference(Context context, ZLIntegerRangeOption option, ZLResource resource) { + super(context, resource); myOption = option; String[] entries = { "0", "25", "50", "100" }; setList(entries); diff --git a/src/org/geometerplus/android/fbreader/preferences/DictionaryPreference.java b/src/org/geometerplus/android/fbreader/preferences/DictionaryPreference.java index 8d5a41ba1..601937e0f 100644 --- a/src/org/geometerplus/android/fbreader/preferences/DictionaryPreference.java +++ b/src/org/geometerplus/android/fbreader/preferences/DictionaryPreference.java @@ -31,8 +31,8 @@ import org.geometerplus.android.fbreader.DictionaryUtil; class DictionaryPreference extends ZLStringListPreference { private final ZLStringOption myOption; - DictionaryPreference(Context context, ZLResource resource, String resourceKey, ZLStringOption dictionaryOption, List infos) { - super(context, resource, resourceKey); + DictionaryPreference(Context context, ZLResource resource, ZLStringOption dictionaryOption, List infos) { + super(context, resource); myOption = dictionaryOption; diff --git a/src/org/geometerplus/android/fbreader/preferences/EditBookInfoActivity.java b/src/org/geometerplus/android/fbreader/preferences/EditBookInfoActivity.java index fedc71bb9..fe56c26fb 100644 --- a/src/org/geometerplus/android/fbreader/preferences/EditBookInfoActivity.java +++ b/src/org/geometerplus/android/fbreader/preferences/EditBookInfoActivity.java @@ -68,8 +68,8 @@ class BookLanguagePreference extends LanguagePreference { return new ArrayList(set); } - BookLanguagePreference(Context context, ZLResource rootResource, String resourceKey, Book book) { - super(context, rootResource, resourceKey, languages()); + BookLanguagePreference(Context context, ZLResource resource, Book book) { + super(context, resource, languages()); myBook = book; final String language = myBook.getLanguage(); if (language == null || !setInitialValue(language)) { @@ -91,8 +91,8 @@ class BookLanguagePreference extends LanguagePreference { class EncodingPreference extends ZLStringListPreference { private final Book myBook; - EncodingPreference(Context context, ZLResource rootResource, String resourceKey, Book book) { - super(context, rootResource, resourceKey); + EncodingPreference(Context context, ZLResource resource, Book book) { + super(context, resource); myBook = book; final FormatPlugin plugin; @@ -278,8 +278,8 @@ public class EditBookInfoActivity extends ZLPreferenceActivity { addPreference(new BookTitlePreference(EditBookInfoActivity.this, Resource, "title", myBook)); myEditAuthorsPreference = (EditAuthorsPreference)addPreference(new EditAuthorsPreference(EditBookInfoActivity.this, Resource, "authors", myBook)); myEditTagsPreference = (EditTagsPreference)addPreference(new EditTagsPreference(EditBookInfoActivity.this, Resource, "tags", myBook)); - addPreference(new BookLanguagePreference(EditBookInfoActivity.this, Resource, "language", myBook)); - addPreference(new EncodingPreference(EditBookInfoActivity.this, Resource, "encoding", myBook)); + addPreference(new BookLanguagePreference(EditBookInfoActivity.this, Resource.getResource("language"), myBook)); + addPreference(new EncodingPreference(EditBookInfoActivity.this, Resource.getResource("encoding"), myBook)); } }); } diff --git a/src/org/geometerplus/android/fbreader/preferences/FontPreference.java b/src/org/geometerplus/android/fbreader/preferences/FontPreference.java index cfb12d867..1225a0975 100644 --- a/src/org/geometerplus/android/fbreader/preferences/FontPreference.java +++ b/src/org/geometerplus/android/fbreader/preferences/FontPreference.java @@ -34,8 +34,8 @@ class FontPreference extends ZLStringListPreference implements ReloadablePrefere private static String UNCHANGED = "inherit"; - FontPreference(Context context, ZLResource resource, String resourceKey, ZLStringOption option, boolean includeDummyValue) { - super(context, resource, resourceKey); + FontPreference(Context context, ZLResource resource, ZLStringOption option, boolean includeDummyValue) { + super(context, resource); myOption = option; myIncludeDummyValue = includeDummyValue; diff --git a/src/org/geometerplus/android/fbreader/preferences/FontStylePreference.java b/src/org/geometerplus/android/fbreader/preferences/FontStylePreference.java index d34f35c1a..bcec009ef 100644 --- a/src/org/geometerplus/android/fbreader/preferences/FontStylePreference.java +++ b/src/org/geometerplus/android/fbreader/preferences/FontStylePreference.java @@ -29,8 +29,8 @@ class FontStylePreference extends ZLStringListPreference { private final ZLBooleanOption myItalicOption; private final String[] myValues = { "regular", "bold", "italic", "boldItalic" }; - FontStylePreference(Context context, ZLResource resource, String resourceKey, ZLBooleanOption boldOption, ZLBooleanOption italicOption) { - super(context, resource, resourceKey); + FontStylePreference(Context context, ZLResource resource, ZLBooleanOption boldOption, ZLBooleanOption italicOption) { + super(context, resource); myBoldOption = boldOption; myItalicOption = italicOption; diff --git a/src/org/geometerplus/android/fbreader/preferences/LanguagePreference.java b/src/org/geometerplus/android/fbreader/preferences/LanguagePreference.java index 373fc52c4..a03981895 100644 --- a/src/org/geometerplus/android/fbreader/preferences/LanguagePreference.java +++ b/src/org/geometerplus/android/fbreader/preferences/LanguagePreference.java @@ -28,9 +28,9 @@ import org.geometerplus.zlibrary.core.resources.ZLResource; abstract class LanguagePreference extends ZLStringListPreference { LanguagePreference( - Context context, ZLResource rootResource, String resourceKey, List languages + Context context, ZLResource resource, List languages ) { - super(context, rootResource, resourceKey); + super(context, resource); final int size = languages.size(); String[] codes = new String[size]; diff --git a/src/org/geometerplus/android/fbreader/preferences/PreferenceActivity.java b/src/org/geometerplus/android/fbreader/preferences/PreferenceActivity.java index abf4352c3..56a3dfe98 100644 --- a/src/org/geometerplus/android/fbreader/preferences/PreferenceActivity.java +++ b/src/org/geometerplus/android/fbreader/preferences/PreferenceActivity.java @@ -138,15 +138,15 @@ public class PreferenceActivity extends ZLPreferenceActivity { syncPreferences.run(); } }); - syncPreferences.add(syncScreen.addOption(syncOptions.UploadAllBooks, "uploadAllBooks")); - syncPreferences.add(syncScreen.addOption(syncOptions.Positions, "positions")); - //syncPreferences.add(syncScreen.addOption(syncOptions.Metainfo, "metainfo")); - //syncPreferences.add(syncScreen.addOption(syncOptions.Bookmarks, "bookmarks")); + syncPreferences.add(syncScreen.addOption(syncOptions.UploadAllBooks, "uploadAllBooks", "values")); + syncPreferences.add(syncScreen.addOption(syncOptions.Positions, "positions", "values")); + //syncPreferences.add(syncScreen.addOption(syncOptions.Metainfo, "metainfo", "values")); + //syncPreferences.add(syncScreen.addOption(syncOptions.Bookmarks, "bookmarks", "values")); syncPreferences.run(); final Screen appearanceScreen = createPreferenceScreen("appearance"); appearanceScreen.addPreference(new LanguagePreference( - this, appearanceScreen.Resource, "language", ZLResource.interfaceLanguages() + this, appearanceScreen.Resource.getResource("language"), ZLResource.interfaceLanguages() ) { @Override protected void init() { @@ -166,7 +166,7 @@ public class PreferenceActivity extends ZLPreferenceActivity { } }); appearanceScreen.addPreference(new ZLStringChoicePreference( - this, appearanceScreen.Resource, "screenOrientation", + this, appearanceScreen.Resource.getResource("screenOrientation"), androidLibrary.getOrientationOption(), androidLibrary.allOrientations() )); appearanceScreen.addPreference(new ZLBooleanPreference( @@ -192,8 +192,7 @@ public class PreferenceActivity extends ZLPreferenceActivity { appearanceScreen.addPreference(new BatteryLevelToTurnScreenOffPreference( this, androidLibrary.BatteryLevelToTurnScreenOffOption, - appearanceScreen.Resource, - "dontTurnScreenOff" + appearanceScreen.Resource.getResource("dontTurnScreenOff") )); /* appearanceScreen.addPreference(new ZLBooleanPreference( @@ -245,19 +244,16 @@ public class PreferenceActivity extends ZLPreferenceActivity { final ZLTextBaseStyle baseStyle = collection.getBaseStyle(); - final FontPreference fontPreference = new FontPreference( - this, textScreen.Resource, "font", + fontReloader.add(textScreen.addPreference(new FontPreference( + this, textScreen.Resource.getResource("font"), baseStyle.FontFamilyOption, false - ); - textScreen.addPreference(fontPreference); - fontReloader.add(fontPreference); - + ))); textScreen.addPreference(new ZLIntegerRangePreference( this, textScreen.Resource.getResource("fontSize"), baseStyle.FontSizeOption )); textScreen.addPreference(new FontStylePreference( - this, textScreen.Resource, "fontStyle", + this, textScreen.Resource.getResource("fontStyle"), baseStyle.BoldOption, baseStyle.ItalicOption )); final ZLIntegerRangeOption spaceOption = baseStyle.LineSpaceOption; @@ -267,12 +263,12 @@ public class PreferenceActivity extends ZLPreferenceActivity { spacings[i] = (char)(val / 10 + '0') + decimalSeparator + (char)(val % 10 + '0'); } textScreen.addPreference(new ZLChoicePreference( - this, textScreen.Resource, "lineSpacing", + this, textScreen.Resource.getResource("lineSpacing"), spaceOption, spacings )); final String[] alignments = { "left", "right", "center", "justify" }; textScreen.addPreference(new ZLChoicePreference( - this, textScreen.Resource, "alignment", + this, textScreen.Resource.getResource("alignment"), baseStyle.AlignmentOption, alignments )); textScreen.addOption(baseStyle.AutoHyphenationOption, "autoHyphenations"); @@ -281,7 +277,7 @@ public class PreferenceActivity extends ZLPreferenceActivity { for (ZLTextNGStyleDescription description : collection.getDescriptionList()) { final Screen ngScreen = moreStylesScreen.createPreferenceScreen(description.Name); ngScreen.addPreference(new FontPreference( - this, textScreen.Resource, "font", + this, textScreen.Resource.getResource("font"), description.FontFamilyOption, true )); ngScreen.addPreference(new StringPreference( @@ -290,27 +286,27 @@ public class PreferenceActivity extends ZLPreferenceActivity { textScreen.Resource, "fontSize" )); ngScreen.addPreference(new ZLStringChoicePreference( - this, textScreen.Resource, "bold", + this, textScreen.Resource.getResource("bold"), description.FontWeightOption, new String[] { "inherit", "normal", "bold" } )); ngScreen.addPreference(new ZLStringChoicePreference( - this, textScreen.Resource, "italic", + this, textScreen.Resource.getResource("italic"), description.FontStyleOption, new String[] { "inherit", "normal", "italic" } )); ngScreen.addPreference(new ZLStringChoicePreference( - this, textScreen.Resource, "textDecoration", + this, textScreen.Resource.getResource("textDecoration"), description.TextDecorationOption, new String[] { "inherit", "none", "underline", "line-through" } )); ngScreen.addPreference(new ZLStringChoicePreference( - this, textScreen.Resource, "allowHyphenations", + this, textScreen.Resource.getResource("allowHyphenations"), description.HyphenationOption, new String[] { "inherit", "none", "auto" } )); ngScreen.addPreference(new ZLStringChoicePreference( - this, textScreen.Resource, "alignment", + this, textScreen.Resource.getResource("alignment"), description.AlignmentOption, new String[] { "inherit", "left", "right", "center", "justify" } )); @@ -373,7 +369,7 @@ public class PreferenceActivity extends ZLPreferenceActivity { final Screen colorsScreen = createPreferenceScreen("colors"); final WallpaperPreference wallpaperPreference = new WallpaperPreference( - this, profile, colorsScreen.Resource, "background" + this, profile, colorsScreen.Resource.getResource("background") ) { @Override protected void onDialogClosed(boolean result) { @@ -422,7 +418,7 @@ public class PreferenceActivity extends ZLPreferenceActivity { final String[] scrollBarTypes = {"hide", "show", "showAsProgress", "showAsFooter"}; statusLineScreen.addPreference(new ZLChoicePreference( - this, statusLineScreen.Resource, "scrollbarType", + this, statusLineScreen.Resource.getResource("scrollbarType"), viewOptions.ScrollbarType, scrollBarTypes ) { @Override @@ -443,7 +439,7 @@ public class PreferenceActivity extends ZLPreferenceActivity { footerPreferences.add(statusLineScreen.addOption(footerOptions.ShowClock, "showClock")); footerPreferences.add(statusLineScreen.addOption(footerOptions.ShowBattery, "showBattery")); footerPreferences.add(statusLineScreen.addPreference(new FontPreference( - this, statusLineScreen.Resource, "font", + this, statusLineScreen.Resource.getResource("font"), footerOptions.Font, false ))); footerPreferences.run(); @@ -533,7 +529,7 @@ public class PreferenceActivity extends ZLPreferenceActivity { Language.ANY_CODE, dictionaryScreen.Resource.getResource("targetLanguage") )); final LanguagePreference targetLanguagePreference = new LanguagePreference( - this, dictionaryScreen.Resource, "targetLanguage", languages + this, dictionaryScreen.Resource.getResource("targetLanguage"), languages ) { @Override protected void init() { @@ -550,8 +546,7 @@ public class PreferenceActivity extends ZLPreferenceActivity { public void run() { dictionaryScreen.addPreference(new DictionaryPreference( PreferenceActivity.this, - dictionaryScreen.Resource, - "dictionary", + dictionaryScreen.Resource.getResource("dictionary"), DictionaryUtil.singleWordTranslatorOption(), DictionaryUtil.dictionaryInfos(PreferenceActivity.this, true) ) { @@ -565,8 +560,7 @@ public class PreferenceActivity extends ZLPreferenceActivity { }); dictionaryScreen.addPreference(new DictionaryPreference( PreferenceActivity.this, - dictionaryScreen.Resource, - "translator", + dictionaryScreen.Resource.getResource("translator"), DictionaryUtil.multiWordTranslatorOption(), DictionaryUtil.dictionaryInfos(PreferenceActivity.this, false) )); @@ -599,13 +593,13 @@ public class PreferenceActivity extends ZLPreferenceActivity { final String[] backKeyActions = { ActionCode.EXIT, ActionCode.SHOW_CANCEL_MENU }; cancelMenuScreen.addPreference(new ZLStringChoicePreference( - this, cancelMenuScreen.Resource, "backKeyAction", + this, cancelMenuScreen.Resource.getResource("backKeyAction"), keyBindings.getOption(KeyEvent.KEYCODE_BACK, false), backKeyActions )); final String[] backKeyLongPressActions = { ActionCode.EXIT, ActionCode.SHOW_CANCEL_MENU, FBReaderApp.NoAction }; cancelMenuScreen.addPreference(new ZLStringChoicePreference( - this, cancelMenuScreen.Resource, "backKeyLongPressAction", + this, cancelMenuScreen.Resource.getResource("backKeyLongPressAction"), keyBindings.getOption(KeyEvent.KEYCODE_BACK, true), backKeyLongPressActions )); diff --git a/src/org/geometerplus/android/fbreader/preferences/WallpaperPreference.java b/src/org/geometerplus/android/fbreader/preferences/WallpaperPreference.java index 9fbdf10d0..a279aecd9 100644 --- a/src/org/geometerplus/android/fbreader/preferences/WallpaperPreference.java +++ b/src/org/geometerplus/android/fbreader/preferences/WallpaperPreference.java @@ -33,8 +33,8 @@ import org.geometerplus.fbreader.fbreader.options.ColorProfile; class WallpaperPreference extends ZLStringListPreference implements ReloadablePreference { private final ZLStringOption myOption; - WallpaperPreference(Context context, ColorProfile profile, ZLResource resource, String resourceKey) { - super(context, resource, resourceKey); + WallpaperPreference(Context context, ColorProfile profile, ZLResource resource) { + super(context, resource); myOption = profile.WallpaperOption; reload(); @@ -49,12 +49,12 @@ class WallpaperPreference extends ZLStringListPreference implements ReloadablePr final String[] texts = new String[size]; values[0] = ""; - texts[0] = myResource.getResource("solidColor").getValue(); + texts[0] = myValuesResource.getResource("solidColor").getValue(); int index = 1; for (ZLFile f : predefined) { values[index] = f.getPath(); final String name = f.getShortName(); - texts[index] = myResource.getResource( + texts[index] = myValuesResource.getResource( name.substring(0, name.indexOf(".")) ).getValue(); ++index; diff --git a/src/org/geometerplus/android/fbreader/preferences/ZLBoolean3Preference.java b/src/org/geometerplus/android/fbreader/preferences/ZLBoolean3Preference.java index 9009e808c..36e06dc2e 100644 --- a/src/org/geometerplus/android/fbreader/preferences/ZLBoolean3Preference.java +++ b/src/org/geometerplus/android/fbreader/preferences/ZLBoolean3Preference.java @@ -32,8 +32,8 @@ class ZLBoolean3Preference extends ZLStringListPreference { private final ZLBoolean3Option myOption; - ZLBoolean3Preference(Context context, ZLResource resource, String resourceKey, ZLBoolean3Option option) { - super(context, resource, resourceKey); + ZLBoolean3Preference(Context context, ZLResource resource, ZLBoolean3Option option) { + super(context, resource); myOption = option; setList(new String[] { ON, OFF, UNCHANGED }); diff --git a/src/org/geometerplus/android/fbreader/preferences/ZLChoicePreference.java b/src/org/geometerplus/android/fbreader/preferences/ZLChoicePreference.java index e5f0cc5a1..2e7edb28d 100644 --- a/src/org/geometerplus/android/fbreader/preferences/ZLChoicePreference.java +++ b/src/org/geometerplus/android/fbreader/preferences/ZLChoicePreference.java @@ -27,8 +27,8 @@ import org.geometerplus.zlibrary.core.resources.ZLResource; class ZLChoicePreference extends ZLStringListPreference { private final ZLIntegerRangeOption myOption; - ZLChoicePreference(Context context, ZLResource resource, String resourceKey, ZLIntegerRangeOption option, String[] valueResourceKeys) { - super(context, resource, resourceKey); + ZLChoicePreference(Context context, ZLResource resource, ZLIntegerRangeOption option, String[] valueResourceKeys) { + super(context, resource); assert(option.MaxValue - option.MinValue + 1 == valueResourceKeys.length); diff --git a/src/org/geometerplus/android/fbreader/preferences/ZLEnumPreference.java b/src/org/geometerplus/android/fbreader/preferences/ZLEnumPreference.java index c2d04aa30..ac5043fba 100644 --- a/src/org/geometerplus/android/fbreader/preferences/ZLEnumPreference.java +++ b/src/org/geometerplus/android/fbreader/preferences/ZLEnumPreference.java @@ -27,8 +27,12 @@ import org.geometerplus.zlibrary.core.resources.ZLResource; class ZLEnumPreference> extends ZLStringListPreference { private final ZLEnumOption myOption; - ZLEnumPreference(Context context, ZLEnumOption option, ZLResource resource, String resourceKey) { - super(context, resource, resourceKey); + ZLEnumPreference(Context context, ZLEnumOption option, ZLResource resource) { + this(context, option, resource, resource); + } + + ZLEnumPreference(Context context, ZLEnumOption option, ZLResource resource, ZLResource valuesResource) { + super(context, resource, valuesResource); myOption = option; final T initialValue = option.getValue(); diff --git a/src/org/geometerplus/android/fbreader/preferences/ZLIntegerChoicePreference.java b/src/org/geometerplus/android/fbreader/preferences/ZLIntegerChoicePreference.java index 65bacd06b..b5c8f0a3c 100644 --- a/src/org/geometerplus/android/fbreader/preferences/ZLIntegerChoicePreference.java +++ b/src/org/geometerplus/android/fbreader/preferences/ZLIntegerChoicePreference.java @@ -28,8 +28,8 @@ class ZLIntegerChoicePreference extends ZLStringListPreference { private final ZLIntegerOption myOption; private final int[] myValues; - ZLIntegerChoicePreference(Context context, ZLResource resource, String resourceKey, ZLIntegerOption option, int[] values, String[] valueResourceKeys) { - super(context, resource, resourceKey); + ZLIntegerChoicePreference(Context context, ZLResource resource, ZLIntegerOption option, int[] values, String[] valueResourceKeys) { + super(context, resource); assert(values.length == valueResourceKeys.length); myOption = option; diff --git a/src/org/geometerplus/android/fbreader/preferences/ZLPreferenceActivity.java b/src/org/geometerplus/android/fbreader/preferences/ZLPreferenceActivity.java index 80dd62e76..070f78fae 100644 --- a/src/org/geometerplus/android/fbreader/preferences/ZLPreferenceActivity.java +++ b/src/org/geometerplus/android/fbreader/preferences/ZLPreferenceActivity.java @@ -73,9 +73,15 @@ abstract class ZLPreferenceActivity extends android.preference.PreferenceActivit ); } - public > Preference addOption(ZLEnumOption option, String resourceKey) { + public > Preference addOption(ZLEnumOption option, String key) { return addPreference( - new ZLEnumPreference(ZLPreferenceActivity.this, option, Resource, resourceKey) + new ZLEnumPreference(ZLPreferenceActivity.this, option, Resource.getResource(key)) + ); + } + + public > Preference addOption(ZLEnumOption option, String key, String valuesKey) { + return addPreference( + new ZLEnumPreference(ZLPreferenceActivity.this, option, Resource.getResource(key), Resource.getResource(valuesKey)) ); } } diff --git a/src/org/geometerplus/android/fbreader/preferences/ZLStringChoicePreference.java b/src/org/geometerplus/android/fbreader/preferences/ZLStringChoicePreference.java index 7dfab6221..eb09bbe50 100644 --- a/src/org/geometerplus/android/fbreader/preferences/ZLStringChoicePreference.java +++ b/src/org/geometerplus/android/fbreader/preferences/ZLStringChoicePreference.java @@ -27,8 +27,8 @@ import org.geometerplus.zlibrary.core.resources.ZLResource; class ZLStringChoicePreference extends ZLStringListPreference { private final ZLStringOption myOption; - ZLStringChoicePreference(Context context, ZLResource rootResource, String resourceKey, ZLStringOption option, String[] values) { - super(context, rootResource, resourceKey); + ZLStringChoicePreference(Context context, ZLResource resource, ZLStringOption option, String[] values) { + super(context, resource); setList(values); setInitialValue(option.getValue()); myOption = option; diff --git a/src/org/geometerplus/android/fbreader/preferences/ZLStringListPreference.java b/src/org/geometerplus/android/fbreader/preferences/ZLStringListPreference.java index 497c2cade..b51b30def 100644 --- a/src/org/geometerplus/android/fbreader/preferences/ZLStringListPreference.java +++ b/src/org/geometerplus/android/fbreader/preferences/ZLStringListPreference.java @@ -25,19 +25,22 @@ import android.preference.ListPreference; import org.geometerplus.zlibrary.core.resources.ZLResource; abstract class ZLStringListPreference extends ListPreference { - protected final ZLResource myResource; + protected final ZLResource myValuesResource; - ZLStringListPreference(Context context, ZLResource rootResource, String resourceKey) { + ZLStringListPreference(Context context, ZLResource resource) { + this(context, resource, resource); + } + + ZLStringListPreference(Context context, ZLResource resource, ZLResource valuesResource) { super(context); - - myResource = rootResource.getResource(resourceKey); - setTitle(myResource.getValue()); + setTitle(resource.getValue()); + myValuesResource = valuesResource; } protected final void setList(String[] values) { String[] texts = new String[values.length]; for (int i = 0; i < values.length; ++i) { - final ZLResource resource = myResource.getResource(values[i]); + final ZLResource resource = myValuesResource.getResource(values[i]); texts[i] = resource.hasValue() ? resource.getValue() : values[i]; } setLists(values, texts); diff --git a/src/org/geometerplus/fbreader/fbreader/options/SyncOptions.java b/src/org/geometerplus/fbreader/fbreader/options/SyncOptions.java index 0f6be791a..741649538 100644 --- a/src/org/geometerplus/fbreader/fbreader/options/SyncOptions.java +++ b/src/org/geometerplus/fbreader/fbreader/options/SyncOptions.java @@ -30,10 +30,10 @@ public class SyncOptions { } public final ZLEnumOption UploadAllBooks = new ZLEnumOption("Sync", "UploadAllBooks", SyncCondition.viaWifi); - public final ZLBooleanOption Positions = - new ZLBooleanOption("Sync", "Positions", true); - public final ZLBooleanOption Bookmarks = - new ZLBooleanOption("Sync", "Bookmarks", true); - public final ZLBooleanOption Metainfo = - new ZLBooleanOption("Sync", "Metainfo", true); + public final ZLEnumOption Positions = + new ZLEnumOption("Sync", "Positions", SyncCondition.always); + public final ZLEnumOption Bookmarks = + new ZLEnumOption("Sync", "Bookmarks", SyncCondition.always); + public final ZLEnumOption Metainfo = + new ZLEnumOption("Sync", "Metainfo", SyncCondition.always); }