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

'Cancel menu' preferences section

This commit is contained in:
Nikolay Pultsin 2011-03-09 23:19:52 +00:00
parent 3911ffc09b
commit d073898d55
20 changed files with 223 additions and 52 deletions

View file

@ -9,6 +9,7 @@
* Periodical update of custom links information has been added * Periodical update of custom links information has been added
* Epub rendering issues (like unexpected paragraph ends) were fixed * Epub rendering issues (like unexpected paragraph ends) were fixed
* Multi-body fb2 file processing has been fixed * Multi-body fb2 file processing has been fixed
* 'Cancel menu' preferences section
===== 0.99.13 (Feb 13, 2011) ===== ===== 0.99.13 (Feb 13, 2011) =====
* Fixed book/position forgetting bug * Fixed book/position forgetting bug

View file

@ -527,6 +527,17 @@
<node name="summaryOff" value="Navigace klávesami prochází pouze hypertextové odkazy"/> <node name="summaryOff" value="Navigace klávesami prochází pouze hypertextové odkazy"/>
</node> </node>
</node> </node>
<node name="cancelMenu" value="Cancel menu" toBeTranslated="true">
<node name="summary" value="Back button action list" toBeTranslated="true"/>
<node name="previousBook" value="Previous book" toBeTranslated="true">
<node name="summaryOn" value="Show 'return to previous book' item" toBeTranslated="true"/>
<node name="summaryOff" value="Don't show 'return to previous book' item" toBeTranslated="true"/>
</node>
<node name="positions" value="Last 3 positions" toBeTranslated="true">
<node name="summaryOn" value="Show items for last 3 positions in the book" toBeTranslated="true"/>
<node name="summaryOff" value="Don't show items for last 3 positions in the book" toBeTranslated="true"/>
</node>
</node>
</node> </node>
<node name="OptionsDialog"> <node name="OptionsDialog">
<node name="tab"> <node name="tab">

View file

@ -528,6 +528,17 @@
<node name="summaryOff" value="Key navigation visits hyperlinks only" toBeTranslated="true"/> <node name="summaryOff" value="Key navigation visits hyperlinks only" toBeTranslated="true"/>
</node> </node>
</node> </node>
<node name="cancelMenu" value="Cancel menu" toBeTranslated="true">
<node name="summary" value="Back button action list" toBeTranslated="true"/>
<node name="previousBook" value="Previous book" toBeTranslated="true">
<node name="summaryOn" value="Show 'return to previous book' item" toBeTranslated="true"/>
<node name="summaryOff" value="Don't show 'return to previous book' item" toBeTranslated="true"/>
</node>
<node name="positions" value="Last 3 positions" toBeTranslated="true">
<node name="summaryOn" value="Show items for last 3 positions in the book" toBeTranslated="true"/>
<node name="summaryOff" value="Don't show items for last 3 positions in the book" toBeTranslated="true"/>
</node>
</node>
</node> </node>
<node name="OptionsDialog"> <node name="OptionsDialog">
<node name="tab"> <node name="tab">

View file

@ -530,6 +530,17 @@
<node name="summaryOff" value="Key navigation visits hyperlinks only"/> <node name="summaryOff" value="Key navigation visits hyperlinks only"/>
</node> </node>
</node> </node>
<node name="cancelMenu" value="Cancel menu">
<node name="summary" value="Back button action list"/>
<node name="previousBook" value="Previous book">
<node name="summaryOn" value="Show 'return to previous book' item"/>
<node name="summaryOff" value="Don't show 'return to previous book' item"/>
</node>
<node name="positions" value="Last 3 positions">
<node name="summaryOn" value="Show items for last 3 positions in the book"/>
<node name="summaryOff" value="Don't show items for last 3 positions in the book"/>
</node>
</node>
</node> </node>
<node name="OptionsDialog"> <node name="OptionsDialog">
<node name="tab"> <node name="tab">

View file

@ -530,6 +530,17 @@
<node name="summaryOff" value="La navigation par touches visite les liens hypertexts uniquement"/> <node name="summaryOff" value="La navigation par touches visite les liens hypertexts uniquement"/>
</node> </node>
</node> </node>
<node name="cancelMenu" value="Cancel menu" toBeTranslated="true">
<node name="summary" value="Back button action list" toBeTranslated="true"/>
<node name="previousBook" value="Previous book" toBeTranslated="true">
<node name="summaryOn" value="Show 'return to previous book' item" toBeTranslated="true"/>
<node name="summaryOff" value="Don't show 'return to previous book' item" toBeTranslated="true"/>
</node>
<node name="positions" value="Last 3 positions" toBeTranslated="true">
<node name="summaryOn" value="Show items for last 3 positions in the book" toBeTranslated="true"/>
<node name="summaryOff" value="Don't show items for last 3 positions in the book" toBeTranslated="true"/>
</node>
</node>
</node> </node>
<node name="OptionsDialog"> <node name="OptionsDialog">
<node name="tab"> <node name="tab">

View file

@ -527,6 +527,17 @@
<node name="summaryOff" value="A tecla de navegación percorre só as ligazóns"/> <node name="summaryOff" value="A tecla de navegación percorre só as ligazóns"/>
</node> </node>
</node> </node>
<node name="cancelMenu" value="Cancel menu" toBeTranslated="true">
<node name="summary" value="Back button action list" toBeTranslated="true"/>
<node name="previousBook" value="Previous book" toBeTranslated="true">
<node name="summaryOn" value="Show 'return to previous book' item" toBeTranslated="true"/>
<node name="summaryOff" value="Don't show 'return to previous book' item" toBeTranslated="true"/>
</node>
<node name="positions" value="Last 3 positions" toBeTranslated="true">
<node name="summaryOn" value="Show items for last 3 positions in the book" toBeTranslated="true"/>
<node name="summaryOff" value="Don't show items for last 3 positions in the book" toBeTranslated="true"/>
</node>
</node>
</node> </node>
<node name="OptionsDialog"> <node name="OptionsDialog">
<node name="tab"> <node name="tab">

View file

@ -527,6 +527,17 @@
<node name="summaryOff" value="A gombnyomásos navigáció linkről linkre ugrik"/> <node name="summaryOff" value="A gombnyomásos navigáció linkről linkre ugrik"/>
</node> </node>
</node> </node>
<node name="cancelMenu" value="Cancel menu" toBeTranslated="true">
<node name="summary" value="Back button action list" toBeTranslated="true"/>
<node name="previousBook" value="Previous book" toBeTranslated="true">
<node name="summaryOn" value="Show 'return to previous book' item" toBeTranslated="true"/>
<node name="summaryOff" value="Don't show 'return to previous book' item" toBeTranslated="true"/>
</node>
<node name="positions" value="Last 3 positions" toBeTranslated="true">
<node name="summaryOn" value="Show items for last 3 positions in the book" toBeTranslated="true"/>
<node name="summaryOff" value="Don't show items for last 3 positions in the book" toBeTranslated="true"/>
</node>
</node>
</node> </node>
<node name="OptionsDialog"> <node name="OptionsDialog">
<node name="tab"> <node name="tab">

View file

@ -527,6 +527,17 @@
<node name="summaryOff" value="Key navigation visits hyperlinks only" toBeTranslated="true"/> <node name="summaryOff" value="Key navigation visits hyperlinks only" toBeTranslated="true"/>
</node> </node>
</node> </node>
<node name="cancelMenu" value="Cancel menu" toBeTranslated="true">
<node name="summary" value="Back button action list" toBeTranslated="true"/>
<node name="previousBook" value="Previous book" toBeTranslated="true">
<node name="summaryOn" value="Show 'return to previous book' item" toBeTranslated="true"/>
<node name="summaryOff" value="Don't show 'return to previous book' item" toBeTranslated="true"/>
</node>
<node name="positions" value="Last 3 positions" toBeTranslated="true">
<node name="summaryOn" value="Show items for last 3 positions in the book" toBeTranslated="true"/>
<node name="summaryOff" value="Don't show items for last 3 positions in the book" toBeTranslated="true"/>
</node>
</node>
</node> </node>
<node name="OptionsDialog"> <node name="OptionsDialog">
<node name="tab"> <node name="tab">

View file

@ -527,6 +527,17 @@
<node name="summaryOff" value="Key navigation visits hyperlinks only" toBeTranslated="true"/> <node name="summaryOff" value="Key navigation visits hyperlinks only" toBeTranslated="true"/>
</node> </node>
</node> </node>
<node name="cancelMenu" value="Cancel menu" toBeTranslated="true">
<node name="summary" value="Back button action list" toBeTranslated="true"/>
<node name="previousBook" value="Previous book" toBeTranslated="true">
<node name="summaryOn" value="Show 'return to previous book' item" toBeTranslated="true"/>
<node name="summaryOff" value="Don't show 'return to previous book' item" toBeTranslated="true"/>
</node>
<node name="positions" value="Last 3 positions" toBeTranslated="true">
<node name="summaryOn" value="Show items for last 3 positions in the book" toBeTranslated="true"/>
<node name="summaryOff" value="Don't show items for last 3 positions in the book" toBeTranslated="true"/>
</node>
</node>
</node> </node>
<node name="OptionsDialog"> <node name="OptionsDialog">
<node name="tab"> <node name="tab">

View file

@ -526,6 +526,17 @@
<node name="summaryOff" value="При перемещении с помощью кнопок помечать только гиперссылки"/> <node name="summaryOff" value="При перемещении с помощью кнопок помечать только гиперссылки"/>
</node> </node>
</node> </node>
<node name="cancelMenu" value="Меню выхода из программы">
<node name="summary" value="Список действий при нажатии на кнопку 'Назад'"/>
<node name="previousBook" value="Предыдущая книга">
<node name="summaryOn" value="Показать пункт меню для возврата к предыдущей книге"/>
<node name="summaryOff" value="Не нужна возможность возврата к предыдущей книге"/>
</node>
<node name="positions" value="Возврат по ссылкам">
<node name="summaryOn" value="Показывать пункты меню для последних 3 позиций в книге"/>
<node name="summaryOff" value="Не нужна возможность возврата по ссылкам"/>
</node>
</node>
</node> </node>
<node name="OptionsDialog"> <node name="OptionsDialog">
<node name="tab"> <node name="tab">

View file

@ -527,6 +527,17 @@
<node name="summaryOff" value="ตัวเลือกคำเลือกได้เฉพาะลิ้งค์ข้อความ"/> <node name="summaryOff" value="ตัวเลือกคำเลือกได้เฉพาะลิ้งค์ข้อความ"/>
</node> </node>
</node> </node>
<node name="cancelMenu" value="Cancel menu" toBeTranslated="true">
<node name="summary" value="Back button action list" toBeTranslated="true"/>
<node name="previousBook" value="Previous book" toBeTranslated="true">
<node name="summaryOn" value="Show 'return to previous book' item" toBeTranslated="true"/>
<node name="summaryOff" value="Don't show 'return to previous book' item" toBeTranslated="true"/>
</node>
<node name="positions" value="Last 3 positions" toBeTranslated="true">
<node name="summaryOn" value="Show items for last 3 positions in the book" toBeTranslated="true"/>
<node name="summaryOff" value="Don't show items for last 3 positions in the book" toBeTranslated="true"/>
</node>
</node>
</node> </node>
<node name="OptionsDialog"> <node name="OptionsDialog">
<node name="tab"> <node name="tab">

View file

@ -527,6 +527,17 @@
<node name="summaryOff" value="Key navigation visits hyperlinks only" toBeTranslated="true"/> <node name="summaryOff" value="Key navigation visits hyperlinks only" toBeTranslated="true"/>
</node> </node>
</node> </node>
<node name="cancelMenu" value="Cancel menu" toBeTranslated="true">
<node name="summary" value="Back button action list" toBeTranslated="true"/>
<node name="previousBook" value="Previous book" toBeTranslated="true">
<node name="summaryOn" value="Show 'return to previous book' item" toBeTranslated="true"/>
<node name="summaryOff" value="Don't show 'return to previous book' item" toBeTranslated="true"/>
</node>
<node name="positions" value="Last 3 positions" toBeTranslated="true">
<node name="summaryOn" value="Show items for last 3 positions in the book" toBeTranslated="true"/>
<node name="summaryOff" value="Don't show items for last 3 positions in the book" toBeTranslated="true"/>
</node>
</node>
</node> </node>
<node name="OptionsDialog"> <node name="OptionsDialog">
<node name="tab"> <node name="tab">

View file

@ -527,6 +527,17 @@
<node name="summaryOff" value="Phím điều hướng chỉ tác động lên siêu liên kết"/> <node name="summaryOff" value="Phím điều hướng chỉ tác động lên siêu liên kết"/>
</node> </node>
</node> </node>
<node name="cancelMenu" value="Cancel menu" toBeTranslated="true">
<node name="summary" value="Back button action list" toBeTranslated="true"/>
<node name="previousBook" value="Previous book" toBeTranslated="true">
<node name="summaryOn" value="Show 'return to previous book' item" toBeTranslated="true"/>
<node name="summaryOff" value="Don't show 'return to previous book' item" toBeTranslated="true"/>
</node>
<node name="positions" value="Last 3 positions" toBeTranslated="true">
<node name="summaryOn" value="Show items for last 3 positions in the book" toBeTranslated="true"/>
<node name="summaryOff" value="Don't show items for last 3 positions in the book" toBeTranslated="true"/>
</node>
</node>
</node> </node>
<node name="OptionsDialog"> <node name="OptionsDialog">
<node name="tab"> <node name="tab">

View file

@ -527,6 +527,17 @@
<node name="summaryOff" value="导航键仅访问超链接词句"/> <node name="summaryOff" value="导航键仅访问超链接词句"/>
</node> </node>
</node> </node>
<node name="cancelMenu" value="Cancel menu" toBeTranslated="true">
<node name="summary" value="Back button action list" toBeTranslated="true"/>
<node name="previousBook" value="Previous book" toBeTranslated="true">
<node name="summaryOn" value="Show 'return to previous book' item" toBeTranslated="true"/>
<node name="summaryOff" value="Don't show 'return to previous book' item" toBeTranslated="true"/>
</node>
<node name="positions" value="Last 3 positions" toBeTranslated="true">
<node name="summaryOn" value="Show items for last 3 positions in the book" toBeTranslated="true"/>
<node name="summaryOff" value="Don't show items for last 3 positions in the book" toBeTranslated="true"/>
</node>
</node>
</node> </node>
<node name="OptionsDialog"> <node name="OptionsDialog">
<node name="tab"> <node name="tab">

View file

@ -237,11 +237,17 @@ class NetworkBookActions extends NetworkTreeActions {
} }
static boolean runActionStatic(Activity activity, NetworkBookTree tree, int actionCode) { static boolean runActionStatic(Activity activity, NetworkBookTree tree, int actionCode) {
final NetworkBookItem book = tree.Book;
switch (actionCode) { switch (actionCode) {
case SHOW_BOOK_ACTIVITY_ITEM_ID: case SHOW_BOOK_ACTIVITY_ITEM_ID:
Util.openTree(activity, tree); Util.openTree(activity, tree);
return true; return true;
default:
return runActionStatic(activity, tree.Book, actionCode);
}
}
static boolean runActionStatic(Activity activity, NetworkBookItem book, int actionCode) {
switch (actionCode) {
case DOWNLOAD_BOOK_ITEM_ID: case DOWNLOAD_BOOK_ITEM_ID:
doDownloadBook(activity, book, false); doDownloadBook(activity, book, false);
return true; return true;

View file

@ -48,7 +48,7 @@ import org.geometerplus.fbreader.network.NetworkBookItem;
import org.geometerplus.fbreader.network.tree.NetworkBookTree; import org.geometerplus.fbreader.network.tree.NetworkBookTree;
public class NetworkBookInfoActivity extends Activity implements NetworkView.EventListener { public class NetworkBookInfoActivity extends Activity implements NetworkView.EventListener {
private NetworkBookTree myTree; private NetworkBookItem myBook;
private View myMainView; private View myMainView;
private final ZLResource myResource = ZLResource.resource("networkBookView"); private final ZLResource myResource = ZLResource.resource("networkBookView");
@ -58,6 +58,15 @@ public class NetworkBookInfoActivity extends Activity implements NetworkView.Eve
protected void onCreate(Bundle icicle) { protected void onCreate(Bundle icicle) {
super.onCreate(icicle); super.onCreate(icicle);
myMainView = getLayoutInflater().inflate(R.layout.network_book, null, false);
setContentView(myMainView);
myMainView.setOnCreateContextMenuListener(this);
}
@Override
protected void onResume() {
super.onResume();
if (!NetworkView.Instance().isInitialized()) { if (!NetworkView.Instance().isInitialized()) {
if (NetworkInitializer.Instance == null) { if (NetworkInitializer.Instance == null) {
new NetworkInitializer(this); new NetworkInitializer(this);
@ -65,32 +74,30 @@ public class NetworkBookInfoActivity extends Activity implements NetworkView.Eve
} else { } else {
NetworkInitializer.Instance.setActivity(this); NetworkInitializer.Instance.setActivity(this);
} }
return;
} }
final NetworkTree tree = Util.getTreeFromIntent(getIntent()); if (myBook == null) {
if (!(tree instanceof NetworkBookTree)) { final NetworkTree tree = Util.getTreeFromIntent(getIntent());
finish(); if (!(tree instanceof NetworkBookTree)) {
return; finish();
return;
}
myBook = ((NetworkBookTree)tree).Book;
myConnection = new BookDownloaderServiceConnection();
bindService(
new Intent(getApplicationContext(), BookDownloaderService.class),
myConnection,
BIND_AUTO_CREATE
);
setTitle(myBook.Title);
setupDescription();
setupInfo();
setupCover();
setupButtons();
} }
myTree = (NetworkBookTree)tree;
myConnection = new BookDownloaderServiceConnection();
bindService(
new Intent(getApplicationContext(), BookDownloaderService.class),
myConnection,
BIND_AUTO_CREATE
);
setTitle(myTree.Book.Title);
myMainView = getLayoutInflater().inflate(R.layout.network_book, null, false);
setContentView(myMainView);
myMainView.setOnCreateContextMenuListener(this);
setupDescription();
setupInfo();
setupCover();
setupButtons();
} }
View getMainView() { View getMainView() {
@ -119,19 +126,19 @@ public class NetworkBookInfoActivity extends Activity implements NetworkView.Eve
@Override @Override
public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo) { public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo) {
NetworkView.Instance().getTopUpActions().buildContextMenu(this, menu, myTree.Book.Link); NetworkView.Instance().getTopUpActions().buildContextMenu(this, menu, myBook.Link);
} }
@Override @Override
public boolean onContextItemSelected(MenuItem item) { public boolean onContextItemSelected(MenuItem item) {
RefillAccountActions.runAction(this, myTree.Book.Link, item.getItemId()); RefillAccountActions.runAction(this, myBook.Link, item.getItemId());
return true; return true;
} }
private final void setupDescription() { private final void setupDescription() {
setTextFromResource(R.id.network_book_description_title, "description"); setTextFromResource(R.id.network_book_description_title, "description");
String description = myTree.Book.Summary; String description = myBook.Summary;
if (description == null) { if (description == null) {
description = myResource.getResource("noDescription").getValue(); description = myResource.getResource("noDescription").getValue();
} }
@ -150,8 +157,6 @@ public class NetworkBookInfoActivity extends Activity implements NetworkView.Eve
} }
private void setupInfo() { private void setupInfo() {
final NetworkBookItem book = myTree.Book;
setTextFromResource(R.id.network_book_info_title, "bookInfo"); setTextFromResource(R.id.network_book_info_title, "bookInfo");
setPairLabelTextFromResource(R.id.network_book_title, "title"); setPairLabelTextFromResource(R.id.network_book_title, "title");
@ -161,12 +166,12 @@ public class NetworkBookInfoActivity extends Activity implements NetworkView.Eve
setPairLabelTextFromResource(R.id.network_book_tags, "tags"); setPairLabelTextFromResource(R.id.network_book_tags, "tags");
setPairLabelTextFromResource(R.id.network_book_catalog, "catalog"); setPairLabelTextFromResource(R.id.network_book_catalog, "catalog");
setPairValueText(R.id.network_book_title, book.Title); setPairValueText(R.id.network_book_title, myBook.Title);
if (book.Authors.size() > 0) { if (myBook.Authors.size() > 0) {
findViewById(R.id.network_book_authors).setVisibility(View.VISIBLE); findViewById(R.id.network_book_authors).setVisibility(View.VISIBLE);
final StringBuilder authorsText = new StringBuilder(); final StringBuilder authorsText = new StringBuilder();
for (NetworkBookItem.AuthorData author : book.Authors) { for (NetworkBookItem.AuthorData author : myBook.Authors) {
if (authorsText.length() > 0) { if (authorsText.length() > 0) {
authorsText.append(", "); authorsText.append(", ");
} }
@ -177,11 +182,11 @@ public class NetworkBookInfoActivity extends Activity implements NetworkView.Eve
findViewById(R.id.network_book_authors).setVisibility(View.GONE); findViewById(R.id.network_book_authors).setVisibility(View.GONE);
} }
if (book.SeriesTitle != null) { if (myBook.SeriesTitle != null) {
findViewById(R.id.network_book_series_title).setVisibility(View.VISIBLE); findViewById(R.id.network_book_series_title).setVisibility(View.VISIBLE);
setPairValueText(R.id.network_book_series_title, book.SeriesTitle); setPairValueText(R.id.network_book_series_title, myBook.SeriesTitle);
if (book.IndexInSeries > 0) { if (myBook.IndexInSeries > 0) {
setPairValueText(R.id.network_book_series_index, String.valueOf(book.IndexInSeries)); setPairValueText(R.id.network_book_series_index, String.valueOf(myBook.IndexInSeries));
findViewById(R.id.network_book_series_index).setVisibility(View.VISIBLE); findViewById(R.id.network_book_series_index).setVisibility(View.VISIBLE);
} else { } else {
findViewById(R.id.network_book_series_index).setVisibility(View.GONE); findViewById(R.id.network_book_series_index).setVisibility(View.GONE);
@ -191,10 +196,10 @@ public class NetworkBookInfoActivity extends Activity implements NetworkView.Eve
findViewById(R.id.network_book_series_index).setVisibility(View.GONE); findViewById(R.id.network_book_series_index).setVisibility(View.GONE);
} }
if (book.Tags.size() > 0) { if (myBook.Tags.size() > 0) {
findViewById(R.id.network_book_tags).setVisibility(View.VISIBLE); findViewById(R.id.network_book_tags).setVisibility(View.VISIBLE);
final StringBuilder tagsText = new StringBuilder(); final StringBuilder tagsText = new StringBuilder();
for (String tag : book.Tags) { for (String tag : myBook.Tags) {
if (tagsText.length() > 0) { if (tagsText.length() > 0) {
tagsText.append(", "); tagsText.append(", ");
} }
@ -205,7 +210,7 @@ public class NetworkBookInfoActivity extends Activity implements NetworkView.Eve
findViewById(R.id.network_book_tags).setVisibility(View.GONE); findViewById(R.id.network_book_tags).setVisibility(View.GONE);
} }
setPairValueText(R.id.network_book_catalog, book.Link.getTitle()); setPairValueText(R.id.network_book_catalog, myBook.Link.getTitle());
} }
private final void setupCover() { private final void setupCover() {
@ -218,7 +223,7 @@ public class NetworkBookInfoActivity extends Activity implements NetworkView.Eve
final int maxHeight = metrics.heightPixels * 2 / 3; final int maxHeight = metrics.heightPixels * 2 / 3;
final int maxWidth = maxHeight * 2 / 3; final int maxWidth = maxHeight * 2 / 3;
Bitmap coverBitmap = null; Bitmap coverBitmap = null;
final ZLImage cover = NetworkTree.createCover(myTree.Book); final ZLImage cover = NetworkTree.createCover(myBook);
if (cover != null) { if (cover != null) {
ZLAndroidImageData data = null; ZLAndroidImageData data = null;
final ZLAndroidImageManager mgr = (ZLAndroidImageManager)ZLAndroidImageManager.Instance(); final ZLAndroidImageManager mgr = (ZLAndroidImageManager)ZLAndroidImageManager.Instance();
@ -262,7 +267,7 @@ public class NetworkBookInfoActivity extends Activity implements NetworkView.Eve
R.id.network_book_button2, R.id.network_book_button2,
R.id.network_book_button3, R.id.network_book_button3,
}; };
final Set<NetworkBookActions.Action> actions = NetworkBookActions.getContextMenuActions(myTree.Book, myConnection); final Set<NetworkBookActions.Action> actions = NetworkBookActions.getContextMenuActions(myBook, myConnection);
final boolean skipSecondButton = final boolean skipSecondButton =
actions.size() < buttons.length && actions.size() < buttons.length &&
@ -289,7 +294,7 @@ public class NetworkBookInfoActivity extends Activity implements NetworkView.Eve
button.setVisibility(View.VISIBLE); button.setVisibility(View.VISIBLE);
button.setOnClickListener(new View.OnClickListener() { button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) { public void onClick(View v) {
NetworkBookActions.runActionStatic(NetworkBookInfoActivity.this, myTree, a.Id); NetworkBookActions.runActionStatic(NetworkBookInfoActivity.this, myBook, a.Id);
NetworkBookInfoActivity.this.updateView(); NetworkBookInfoActivity.this.updateView();
} }
}); });

View file

@ -378,5 +378,9 @@ public class PreferenceActivity extends ZLPreferenceActivity {
"navigateOverAllWords" "navigateOverAllWords"
)); ));
dictionaryScreen.addOption(fbReader.DictionaryTappingActionOption, "tappingAction"); dictionaryScreen.addOption(fbReader.DictionaryTappingActionOption, "tappingAction");
final Screen cancelMenuScreen = createPreferenceScreen("cancelMenu");
cancelMenuScreen.addOption(fbReader.ShowPreviousBookInCancelMenuOption, "previousBook");
cancelMenuScreen.addOption(fbReader.ShowPositionsInCancelMenuOption, "positions");
} }
} }

View file

@ -89,6 +89,11 @@ public final class FBReaderApp extends ZLApplication {
final ZLStringOption ColorProfileOption = final ZLStringOption ColorProfileOption =
new ZLStringOption("Options", "ColorProfile", ColorProfile.DAY); new ZLStringOption("Options", "ColorProfile", ColorProfile.DAY);
public final ZLBooleanOption ShowPreviousBookInCancelMenuOption =
new ZLBooleanOption("CancelMenu", "previousBook", false);
public final ZLBooleanOption ShowPositionsInCancelMenuOption =
new ZLBooleanOption("CancelMenu", "positions", true);
private final ZLKeyBindings myBindings = new ZLKeyBindings("Keys"); private final ZLKeyBindings myBindings = new ZLKeyBindings("Keys");
public final FBView BookTextView; public final FBView BookTextView;
@ -324,15 +329,19 @@ public final class FBReaderApp extends ZLApplication {
public List<CancelActionDescription> getCancelActionsList() { public List<CancelActionDescription> getCancelActionsList() {
myCancelActionsList.clear(); myCancelActionsList.clear();
final Book previousBook = Library.getPreviousBook(); if (ShowPreviousBookInCancelMenuOption.getValue()) {
if (previousBook != null) { final Book previousBook = Library.getPreviousBook();
myCancelActionsList.add(new CancelActionDescription( if (previousBook != null) {
CancelActionType.previousBook, previousBook.getTitle() myCancelActionsList.add(new CancelActionDescription(
)); CancelActionType.previousBook, previousBook.getTitle()
));
}
} }
if (Model != null && Model.Book != null) { if (ShowPositionsInCancelMenuOption.getValue()) {
for (Bookmark bookmark : Bookmark.invisibleBookmarks(Model.Book)) { if (Model != null && Model.Book != null) {
myCancelActionsList.add(new BookmarkDescription(bookmark)); for (Bookmark bookmark : Bookmark.invisibleBookmarks(Model.Book)) {
myCancelActionsList.add(new BookmarkDescription(bookmark));
}
} }
} }
myCancelActionsList.add(new CancelActionDescription( myCancelActionsList.add(new CancelActionDescription(

View file

@ -408,6 +408,9 @@ public class NetworkLibrary {
} }
public NetworkTree getTreeByKey(NetworkTree.Key key) { public NetworkTree getTreeByKey(NetworkTree.Key key) {
if (key == null) {
return null;
}
if (key.Parent == null) { if (key.Parent == null) {
return key.equals(myRootTree.getUniqueKey()) ? myRootTree : null; return key.equals(myRootTree.getUniqueKey()) ? myRootTree : null;
} }

View file

@ -174,7 +174,7 @@ public class LitResBookshelfItem extends NetworkCatalogItem {
listener.onNewItem(Link, item); listener.onNewItem(Link, item);
} }
} else { } else {
listener.onNewItem(Link, new ByDateCatalogItem(this, children)); //listener.onNewItem(Link, new ByDateCatalogItem(this, children));
listener.onNewItem(Link, new ByAuthorCatalogItem(this, children)); listener.onNewItem(Link, new ByAuthorCatalogItem(this, children));
listener.onNewItem(Link, new ByTitleCatalogItem(this, children)); listener.onNewItem(Link, new ByTitleCatalogItem(this, children));
final BySeriesCatalogItem bySeries = new BySeriesCatalogItem(this, children); final BySeriesCatalogItem bySeries = new BySeriesCatalogItem(this, children);