Skip to content

Commit 30a428f

Browse files
committed
a little bit more options on selected text
1 parent dd3919b commit 30a428f

5 files changed

Lines changed: 32 additions & 4 deletions

File tree

android/res/values-ru/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<string name="app_name">Cool Reader</string>
44
<string name="mi_search">Найти</string>
55
<string name="mi_search_web">Найти в интернете</string>
6+
<string name="mi_citation">Сохранить цитату</string>
7+
<string name="mi_user_dic">Сохранить в пользовательский словарь</string>
68
<string name="mi_exit">Закрыть</string>
79
<string name="mi_goto">Перейти</string>
810
<string name="mi_bookmarks">Закладки</string>

android/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<string name="app_name">Cool Reader</string>
44
<string name="mi_search">Search</string>
55
<string name="mi_search_web">Search on web</string>
6+
<string name="mi_citation">Save citation</string>
7+
<string name="mi_user_dic">Save to user dictionary</string>
68
<string name="mi_exit">Exit</string>
79
<string name="mi_goto">Go to</string>
810
<string name="mi_bookmarks">Bookmarks</string>

android/src/org/coolreader/crengine/OptionsDialog.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,10 @@ public static int findBacklightSettingIndex( int value ) {
228228
ReaderView.SELECTION_ACTION_FIND,
229229
ReaderView.SELECTION_ACTION_DICTIONARY_1,
230230
ReaderView.SELECTION_ACTION_DICTIONARY_2,
231-
ReaderView.SELECTION_ACTION_SEARCH_WEB
231+
ReaderView.SELECTION_ACTION_SEARCH_WEB,
232+
ReaderView.SELECTION_ACTION_SEND_TO,
233+
ReaderView.SELECTION_ACTION_USER_DIC,
234+
ReaderView.SELECTION_ACTION_CITATION
232235
};
233236
int[] mSelectionActionTitles = new int[] {
234237
R.string.options_selection_action_toolbar,
@@ -239,6 +242,9 @@ public static int findBacklightSettingIndex( int value ) {
239242
R.string.options_selection_action_dictionary_1,
240243
R.string.options_selection_action_dictionary_2,
241244
R.string.mi_search_web,
245+
R.string.options_selection_action_mail,
246+
R.string.mi_user_dic,
247+
R.string.mi_citation,
242248
};
243249
int[] mMultiSelectionAction = new int[] {
244250
ReaderView.SELECTION_ACTION_TOOLBAR,
@@ -248,7 +254,10 @@ public static int findBacklightSettingIndex( int value ) {
248254
ReaderView.SELECTION_ACTION_FIND,
249255
ReaderView.SELECTION_ACTION_DICTIONARY_1,
250256
ReaderView.SELECTION_ACTION_DICTIONARY_2,
251-
ReaderView.SELECTION_ACTION_SEARCH_WEB
257+
ReaderView.SELECTION_ACTION_SEARCH_WEB,
258+
ReaderView.SELECTION_ACTION_SEND_TO,
259+
ReaderView.SELECTION_ACTION_USER_DIC,
260+
ReaderView.SELECTION_ACTION_CITATION
252261
};
253262
int[] mMultiSelectionActionTitles = new int[] {
254263
R.string.options_selection_action_toolbar,
@@ -259,6 +268,9 @@ public static int findBacklightSettingIndex( int value ) {
259268
R.string.options_selection_action_dictionary_1,
260269
R.string.options_selection_action_dictionary_2,
261270
R.string.mi_search_web,
271+
R.string.options_selection_action_mail,
272+
R.string.mi_user_dic,
273+
R.string.mi_citation,
262274
};
263275
int[] mAntialias = new int[] {
264276
0, 1, 2

android/src/org/coolreader/crengine/ReaderView.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,16 @@ private void onSelectionComplete( Selection sel ) {
682682
case SELECTION_ACTION_SEARCH_WEB:
683683
final Intent emailIntent = new Intent(Intent.ACTION_WEB_SEARCH);
684684
emailIntent.putExtra(SearchManager.QUERY, sel.text.trim());
685-
getActivity().startActivity(emailIntent);
685+
mActivity.startActivity(emailIntent);
686+
break;
687+
case SELECTION_ACTION_SEND_TO:
688+
sendQuotationInEmail(sel);
689+
break;
690+
case SELECTION_ACTION_USER_DIC:
691+
showNewBookmarkDialog(sel, Bookmark.TYPE_USER_DIC);
692+
break;
693+
case SELECTION_ACTION_CITATION:
694+
showNewBookmarkDialog(sel, Bookmark.TYPE_CITATION);
686695
break;
687696
default:
688697
clearSelection();

android/src/org/coolreader/crengine/Settings.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,10 @@ public interface Settings {
170170
public static final int SELECTION_ACTION_DICTIONARY_1 = 5;
171171
public static final int SELECTION_ACTION_DICTIONARY_2 = 6;
172172
public static final int SELECTION_ACTION_SEARCH_WEB = 7;
173-
173+
public static final int SELECTION_ACTION_SEND_TO = 8;
174+
public static final int SELECTION_ACTION_USER_DIC = 9;
175+
public static final int SELECTION_ACTION_CITATION = 10;
176+
174177
// available options for PROP_APP_SECONDARY_TAP_ACTION_TYPE setting
175178
public static final int TAP_ACTION_TYPE_LONGPRESS = 0;
176179
public static final int TAP_ACTION_TYPE_DOUBLE = 1;

0 commit comments

Comments
 (0)