summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2022-11-27 23:01:14 +0100
committerChristian Soffke <christian.soffke@gmail.com>2023-01-07 14:53:36 +0100
commit21ca64d7cda167d325d9b21ac25155eff13aac12 (patch)
treee5ee166cbe47fddaa6967d6aa9baed162e91f592
parent5bb062391fc259a7bcdd4d69d587ab4adf454e97 (diff)
downloadrockbox-21ca64d7cda167d325d9b21ac25155eff13aac12.tar.gz
rockbox-21ca64d7cda167d325d9b21ac25155eff13aac12.zip
File Browser: Add “Set As..." context menu
Moves options for configuring: - Playlist Directory - Recording Directory - Start Directory into a single menu. Necessary prerequisite for giving the "Playlist Catalogue" context menu item a title that's a little more action-oriented ("Add to Playlist…”). Change-Id: I4ee08fc67d5350c38ae1a57cb345c4ed1082d0b5
-rw-r--r--apps/lang/english.lang83
-rw-r--r--apps/onplay.c47
-rw-r--r--manual/configure_rockbox/playback_options.tex4
-rw-r--r--manual/rockbox_interface/browsing_and_playing.tex35
4 files changed, 118 insertions, 51 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 29a2527bec..d5f6ac3fa7 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -5411,19 +5411,19 @@
5411</phrase> 5411</phrase>
5412<phrase> 5412<phrase>
5413 id: LANG_SET_AS_REC_DIR 5413 id: LANG_SET_AS_REC_DIR
5414 desc: used in the onplay menu to set a recording dir 5414 desc: deprecated
5415 user: core 5415 user: core
5416 <source> 5416 <source>
5417 *: none 5417 *: none
5418 recording: "Set As Recording Directory" 5418 recording: ""
5419 </source> 5419 </source>
5420 <dest> 5420 <dest>
5421 *: none 5421 *: none
5422 recording: "Set As Recording Directory" 5422 recording: ""
5423 </dest> 5423 </dest>
5424 <voice> 5424 <voice>
5425 *: none 5425 *: none
5426 recording: "Set As Recording Directory" 5426 recording: ""
5427 </voice> 5427 </voice>
5428</phrase> 5428</phrase>
5429<phrase> 5429<phrase>
@@ -11587,16 +11587,16 @@
11587</phrase> 11587</phrase>
11588<phrase> 11588<phrase>
11589 id: LANG_SET_AS_START_DIR 11589 id: LANG_SET_AS_START_DIR
11590 desc: used in the onplay menu to set a starting browser dir 11590 desc: deprecated
11591 user: core 11591 user: core
11592 <source> 11592 <source>
11593 *: "Start File Browser Here" 11593 *: ""
11594 </source> 11594 </source>
11595 <dest> 11595 <dest>
11596 *: "Start File Browser Here" 11596 *: ""
11597 </dest> 11597 </dest>
11598 <voice> 11598 <voice>
11599 *: "Start File Browser Here" 11599 *: ""
11600 </voice> 11600 </voice>
11601</phrase> 11601</phrase>
11602<phrase> 11602<phrase>
@@ -11702,16 +11702,16 @@
11702</phrase> 11702</phrase>
11703<phrase> 11703<phrase>
11704 id: LANG_SET_AS_PLAYLISTCAT_DIR 11704 id: LANG_SET_AS_PLAYLISTCAT_DIR
11705 desc: used in the onplay menu to set a playlist catalogue dir 11705 desc: deprecated
11706 user: core 11706 user: core
11707 <source> 11707 <source>
11708 *: "Set As Playlist Catalogue Directory" 11708 *: ""
11709 </source> 11709 </source>
11710 <dest> 11710 <dest>
11711 *: "Set As Playlist Catalogue Directory" 11711 *: ""
11712 </dest> 11712 </dest>
11713 <voice> 11713 <voice>
11714 *: "Set As Playlist Catalogue Directory" 11714 *: ""
11715 </voice> 11715 </voice>
11716</phrase> 11716</phrase>
11717<phrase> 11717<phrase>
@@ -16402,3 +16402,62 @@
16402 *: "Rewind across tracks" 16402 *: "Rewind across tracks"
16403 </voice> 16403 </voice>
16404</phrase> 16404</phrase>
16405<phrase>
16406 id: LANG_SET_AS
16407 desc: used in the onplay menu
16408 user: core
16409 <source>
16410 *: "Set As..."
16411 </source>
16412 <dest>
16413 *: "Set As..."
16414 </dest>
16415 <voice>
16416 *: "Set As..."
16417 </voice>
16418</phrase>
16419<phrase>
16420 id: LANG_PLAYLIST_DIR
16421 desc: used in the onplay menu
16422 user: core
16423 <source>
16424 *: "Playlist Directory"
16425 </source>
16426 <dest>
16427 *: "Playlist Directory"
16428 </dest>
16429 <voice>
16430 *: "Playlist Directory"
16431 </voice>
16432</phrase>
16433<phrase>
16434 id: LANG_START_DIR
16435 desc: used in the onplay menu
16436 user: core
16437 <source>
16438 *: "Start Directory"
16439 </source>
16440 <dest>
16441 *: "Start Directory"
16442 </dest>
16443 <voice>
16444 *: "Start Directory"
16445 </voice>
16446</phrase>
16447<phrase>
16448 id: LANG_RECORDING_DIR
16449 desc: used in the onplay menu
16450 user: core
16451 <source>
16452 *: none
16453 recording: "Recording Directory"
16454 </source>
16455 <dest>
16456 *: none
16457 recording: "Recording Directory"
16458 </dest>
16459 <voice>
16460 *: none
16461 recording: "Recording Directory"
16462 </voice>
16463</phrase>
diff --git a/apps/onplay.c b/apps/onplay.c
index a3efadd8f6..842a328ee9 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -796,18 +796,6 @@ static bool cat_add_to_a_new_playlist(void)
796 return catalog_add_to_a_playlist(selected_file, selected_file_attr, 796 return catalog_add_to_a_playlist(selected_file, selected_file_attr,
797 true, NULL); 797 true, NULL);
798} 798}
799static int clipboard_callback(int action,
800 const struct menu_item_ex *this_item,
801 struct gui_synclist *this_list);
802
803static bool set_catalogdir(void)
804{
805 catalog_set_directory(selected_file);
806 settings_save();
807 return false;
808}
809MENUITEM_FUNCTION(set_catalogdir_item, 0, ID2P(LANG_SET_AS_PLAYLISTCAT_DIR),
810 set_catalogdir, clipboard_callback, Icon_Playlist);
811 799
812static int cat_playlist_callback(int action, 800static int cat_playlist_callback(int action,
813 const struct menu_item_ex *this_item, 801 const struct menu_item_ex *this_item,
@@ -819,7 +807,7 @@ MENUITEM_FUNCTION(cat_add_to_new, 0, ID2P(LANG_CATALOG_ADD_TO_NEW),
819 cat_add_to_a_new_playlist, NULL, Icon_Playlist); 807 cat_add_to_a_new_playlist, NULL, Icon_Playlist);
820MAKE_ONPLAYMENU(cat_playlist_menu, ID2P(LANG_CATALOG), 808MAKE_ONPLAYMENU(cat_playlist_menu, ID2P(LANG_CATALOG),
821 cat_playlist_callback, Icon_Playlist, 809 cat_playlist_callback, Icon_Playlist,
822 &cat_add_to_list, &cat_add_to_new, &set_catalogdir_item); 810 &cat_add_to_list, &cat_add_to_new);
823 811
824void onplay_show_playlist_cat_menu(char* track_name) 812void onplay_show_playlist_cat_menu(char* track_name)
825{ 813{
@@ -1621,7 +1609,7 @@ static bool set_recdir(void)
1621 settings_save(); 1609 settings_save();
1622 return false; 1610 return false;
1623} 1611}
1624MENUITEM_FUNCTION(set_recdir_item, 0, ID2P(LANG_SET_AS_REC_DIR), 1612MENUITEM_FUNCTION(set_recdir_item, 0, ID2P(LANG_RECORDING_DIR),
1625 set_recdir, clipboard_callback, Icon_Recording); 1613 set_recdir, clipboard_callback, Icon_Recording);
1626#endif 1614#endif
1627static bool set_startdir(void) 1615static bool set_startdir(void)
@@ -1632,9 +1620,26 @@ static bool set_startdir(void)
1632 settings_save(); 1620 settings_save();
1633 return false; 1621 return false;
1634} 1622}
1635MENUITEM_FUNCTION(set_startdir_item, 0, ID2P(LANG_SET_AS_START_DIR), 1623MENUITEM_FUNCTION(set_startdir_item, 0, ID2P(LANG_START_DIR),
1636 set_startdir, clipboard_callback, Icon_file_view_menu); 1624 set_startdir, clipboard_callback, Icon_file_view_menu);
1637 1625
1626static bool set_catalogdir(void)
1627{
1628 catalog_set_directory(selected_file);
1629 settings_save();
1630 return false;
1631}
1632MENUITEM_FUNCTION(set_catalogdir_item, 0, ID2P(LANG_PLAYLIST_DIR),
1633 set_catalogdir, clipboard_callback, Icon_Playlist);
1634
1635MAKE_ONPLAYMENU(set_as_dir_menu, ID2P(LANG_SET_AS),
1636 clipboard_callback, Icon_NOICON,
1637 &set_catalogdir_item,
1638#ifdef HAVE_RECORDING
1639 &set_recdir_item,
1640#endif
1641 &set_startdir_item);
1642
1638static int clipboard_callback(int action, 1643static int clipboard_callback(int action,
1639 const struct menu_item_ex *this_item, 1644 const struct menu_item_ex *this_item,
1640 struct gui_synclist *this_list) 1645 struct gui_synclist *this_list)
@@ -1692,7 +1697,8 @@ static int clipboard_callback(int action,
1692 /* only for directories */ 1697 /* only for directories */
1693 if (this_item == &delete_dir_item || 1698 if (this_item == &delete_dir_item ||
1694 this_item == &set_startdir_item || 1699 this_item == &set_startdir_item ||
1695 this_item == &set_catalogdir_item 1700 this_item == &set_catalogdir_item ||
1701 this_item == &set_as_dir_menu
1696#ifdef HAVE_RECORDING 1702#ifdef HAVE_RECORDING
1697 || this_item == &set_recdir_item 1703 || this_item == &set_recdir_item
1698#endif 1704#endif
@@ -1756,17 +1762,14 @@ MAKE_ONPLAYMENU( tree_onplay_menu, ID2P(LANG_ONPLAY_MENU_TITLE),
1756 &view_playlist_item, &tree_playlist_menu, &cat_playlist_menu, 1762 &view_playlist_item, &tree_playlist_menu, &cat_playlist_menu,
1757 &rename_file_item, &clipboard_cut_item, &clipboard_copy_item, 1763 &rename_file_item, &clipboard_cut_item, &clipboard_copy_item,
1758 &clipboard_paste_item, &delete_file_item, &delete_dir_item, 1764 &clipboard_paste_item, &delete_file_item, &delete_dir_item,
1759#if LCD_DEPTH > 1
1760 &set_backdrop_item,
1761#endif
1762 &list_viewers_item, &create_dir_item, &properties_item, &track_info_item, 1765 &list_viewers_item, &create_dir_item, &properties_item, &track_info_item,
1763#ifdef HAVE_TAGCACHE 1766#ifdef HAVE_TAGCACHE
1764 &pictureflow_item, 1767 &pictureflow_item,
1765#endif 1768#endif
1766#ifdef HAVE_RECORDING 1769#if LCD_DEPTH > 1
1767 &set_recdir_item, 1770 &set_backdrop_item,
1768#endif 1771#endif
1769 &set_startdir_item, &add_to_faves_item, &file_menu, 1772 &add_to_faves_item, &set_as_dir_menu, &file_menu,
1770 ); 1773 );
1771static int onplaymenu_callback(int action, 1774static int onplaymenu_callback(int action,
1772 const struct menu_item_ex *this_item, 1775 const struct menu_item_ex *this_item,
diff --git a/manual/configure_rockbox/playback_options.tex b/manual/configure_rockbox/playback_options.tex
index 0c75315214..efcaa5a181 100644
--- a/manual/configure_rockbox/playback_options.tex
+++ b/manual/configure_rockbox/playback_options.tex
@@ -224,10 +224,10 @@ you to configure settings related to audio playback.
224 % 224 %
225 225
226\section{\label{ref:ConstrainAutoChange}Constrain Auto-Change} 226\section{\label{ref:ConstrainAutoChange}Constrain Auto-Change}
227 If enabled and you have set \setting{Start File Browser Here} to a directory 227 If enabled and you have set \setting{Start Directory} to a directory
228 other than root, \setting{Auto-Change Directory} will be constrained to the 228 other than root, \setting{Auto-Change Directory} will be constrained to the
229 directory you have chosen and those below it. 229 directory you have chosen and those below it.
230 See \reference{ref:StartFileBrowserHere}. 230 See \reference{ref:StartDirectory}.
231 % 231 %
232 232
233\opt{headphone_detection}{ 233\opt{headphone_detection}{
diff --git a/manual/rockbox_interface/browsing_and_playing.tex b/manual/rockbox_interface/browsing_and_playing.tex
index 1a97aaab31..d97d227fe9 100644
--- a/manual/rockbox_interface/browsing_and_playing.tex
+++ b/manual/rockbox_interface/browsing_and_playing.tex
@@ -148,11 +148,6 @@ each option pertains both to files and directories):
148 Deletes the currently selected directory and all of the files and subdirectories 148 Deletes the currently selected directory and all of the files and subdirectories
149 it may contain. Deleted directories cannot be recovered. Use this feature with 149 it may contain. Deleted directories cannot be recovered. Use this feature with
150 caution! 150 caution!
151\opt{lcd_non-mono}{
152\item [Set As Backdrop.]
153 Set the selected \fname{bmp} file as background image. The bitmaps need to meet the
154 conditions explained in \reference{ref:LoadingBackdrops}.
155}
156\item [Open with.] 151\item [Open with.]
157 Runs a viewer plugin on the file. Normally, when a file is selected in Rockbox, 152 Runs a viewer plugin on the file. Normally, when a file is selected in Rockbox,
158 Rockbox automatically detects the file type and runs the appropriate plugin. 153 Rockbox automatically detects the file type and runs the appropriate plugin.
@@ -168,17 +163,11 @@ each option pertains both to files and directories):
168 Shows properties such as size and the time and date of the last modification 163 Shows properties such as size and the time and date of the last modification
169 for the selected file. If used on a directory, the number of files and 164 for the selected file. If used on a directory, the number of files and
170 subdirectories will be shown, as well as the total size. 165 subdirectories will be shown, as well as the total size.
171\opt{recording}{ 166\opt{lcd_non-mono}{
172 \item [Set As Recording Directory.] 167\item [Set As Backdrop.]
173 Save recordings in the selected directory. 168 Set the selected \fname{bmp} file as background image. The bitmaps need to meet the
169 conditions explained in \reference{ref:LoadingBackdrops}.
174} 170}
175\item [\label{ref:StartFileBrowserHere}Start File Browser Here.]
176 This option allows users to set the currently selected directory as the default
177 start directory for the file browser. This option is not available for files.
178 \note{If you have \setting{Auto-Change Directory} and
179 \setting{Constrain Auto-Change} enabled, the directories returned will
180 be constrained to the directory you have chosen here and those below it.
181 See \reference{ref:ConstrainAutoChange}}
182\item [Add to Shortcuts.] 171\item [Add to Shortcuts.]
183 Adds a link to the selected item in the \fname{shortcuts.link} file. 172 Adds a link to the selected item in the \fname{shortcuts.link} file.
184 If the file does not already exist it will be created in the root directory. 173 If the file does not already exist it will be created in the root directory.
@@ -186,6 +175,22 @@ each option pertains both to files and directories):
186 selecting, but simply bring you to its location in the \setting{File Browser}. 175 selecting, but simply bring you to its location in the \setting{File Browser}.
187\end{description} 176\end{description}
188 177
178\subsubsection{Set As...}
179\begin{description}
180 \item [Playlist Directory.]
181 Set as default directory for the Playlist Catalogue.
182 \opt{recording}{
183 \item [Recording Directory.]
184 Save recordings in the selected directory.
185 }
186 \item [\label{ref:StartDirectory}Start Directory.]
187 Set as default start directory for the File Browser.
188 \note{If you have \setting{Auto-Change Directory} and
189 \setting{Constrain Auto-Change} enabled, the directories returned will
190 be constrained to the directory you have chosen here and those below it.
191 See \reference{ref:ConstrainAutoChange}}
192\end{description}
193
189\subsection{\label{sec:virtual_keyboard}Virtual Keyboard} 194\subsection{\label{sec:virtual_keyboard}Virtual Keyboard}
190\screenshot{rockbox_interface/images/ss-virtual-keyboard}{The virtual keyboard}{} 195\screenshot{rockbox_interface/images/ss-virtual-keyboard}{The virtual keyboard}{}
191This is the virtual keyboard that is used when entering text in Rockbox, for 196This is the virtual keyboard that is used when entering text in Rockbox, for