summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2012-01-16 11:57:53 +0000
committerphintuka <phintuka>2012-01-16 11:57:53 +0000
commit42656061ae69fdc033f71281944b5f38673ab059 (patch)
tree1cfbad8a9e4eb31962a71571fa42e98dcd61cdf4
parent2ee95d6dd67ab9b15f654155df2b13028cbb5038 (diff)
downloadxineliboutput-42656061ae69fdc033f71281944b5f38673ab059.tar.gz
xineliboutput-42656061ae69fdc033f71281944b5f38673ab059.tar.bz2
Added setup option to disable "Delete" in file browser
-rw-r--r--config.c4
-rw-r--r--config.h3
-rw-r--r--media_player.c7
-rw-r--r--menu.c9
-rw-r--r--setup_menu.c5
5 files changed, 20 insertions, 8 deletions
diff --git a/config.c b/config.c
index b9f19a0e..79543b4e 100644
--- a/config.c
+++ b/config.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: config.c,v 1.106 2012-01-09 07:29:11 phintuka Exp $
+ * $Id: config.c,v 1.107 2012-01-16 11:57:53 phintuka Exp $
*
*/
@@ -705,6 +705,7 @@ config_t::config_t() {
enable_id3_scanner = 1;
dvd_arrow_keys_control_playback = 1;
media_menu_items = ~0;
+ media_enable_delete = 0;
main_menu_mode = ShowMenu;
force_primary_device = 0;
@@ -1020,6 +1021,7 @@ bool config_t::SetupParse(const char *Name, const char *Value)
else if (!strcasecmp(Name, "Media.EnableID3Scanner")) enable_id3_scanner = atoi(Value);
else if (!strcasecmp(Name, "Media.DVD.ArrowKeysControlPlayback")) dvd_arrow_keys_control_playback = atoi(Value);
else if (!strcasecmp(Name, "Media.MenuItems")) media_menu_items = atoi(Value);
+ else if (!strcasecmp(Name, "Media.EnableDelete")) media_enable_delete = atoi(Value);
else if (!strcasecmp(Name, "Playlist.Tracknumber")) playlist_tracknumber = atoi(Value);
else if (!strcasecmp(Name, "Playlist.Artist")) playlist_artist = atoi(Value);
diff --git a/config.h b/config.h
index 903e5ef2..836e48aa 100644
--- a/config.h
+++ b/config.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: config.h,v 1.81 2011-07-10 21:35:22 phintuka Exp $
+ * $Id: config.h,v 1.82 2012-01-16 11:57:53 phintuka Exp $
*
*/
@@ -346,6 +346,7 @@ class config_t {
int playlist_album;
int dvd_arrow_keys_control_playback;
uint media_menu_items; // enabled items in media player menu (bitmask)
+ int media_enable_delete; // enable Delete in file browser
// Audio visualization
char audio_visualization[64];
diff --git a/media_player.c b/media_player.c
index 45a9bbce..55e1301e 100644
--- a/media_player.c
+++ b/media_player.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: media_player.c,v 1.89 2011-06-15 20:25:16 phintuka Exp $
+ * $Id: media_player.c,v 1.90 2012-01-16 11:57:53 phintuka Exp $
*
*/
@@ -1587,6 +1587,11 @@ void cXinelibImagesControl::Close(void)
void cXinelibImagesControl::Delete(void)
{
+ if (!xc.media_enable_delete) {
+ LOGMSG("Deleting files disabled in config");
+ return;
+ }
+
if(Interface->Confirm(tr("Delete image ?"))) {
if(!unlink(m_Playlist->Current()->Filename)) {
m_Playlist->Del(m_Playlist->Current());
diff --git a/menu.c b/menu.c
index a484c6b0..0f56a7a4 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c,v 1.89 2012-01-16 11:40:40 phintuka Exp $
+ * $Id: menu.c,v 1.90 2012-01-16 11:57:53 phintuka Exp $
*
*/
@@ -270,18 +270,19 @@ void cMenuBrowseFiles::SetHelpButtons(void)
{
bool isDir = !GetCurrent() || GetCurrent()->IsDir();
bool isFile = !isDir;
+ bool bDel = isFile && xc.media_enable_delete;
if (isDir && !strcmp("..", GetCurrent()->Name())) {
help[0] = help[1] = help[2] = help[3] = NULL;
} else if (m_Mode == ShowMusic) {
help[0] = isDir ? trVDR("Button$Play") : NULL;
help[1] = tr ("Button$Queue");
- help[2] = isFile ? trVDR("Button$Delete") : NULL;
+ help[2] = bDel ? trVDR("Button$Delete") : NULL;
help[3] = isFile ? trVDR("Button$Info") : NULL;
} else if (m_Mode == ShowImages) {
help[0] = isDir ? trVDR("Button$Play") : NULL;
help[1] = NULL;
- help[2] = isFile ? trVDR("Button$Delete") : NULL;
+ help[2] = bDel ? trVDR("Button$Delete") : NULL;
help[3] = isFile ? trVDR("Button$Info") : NULL;
} else {
bool isDvd = GetCurrent() && (GetCurrent()->IsDvd() || GetCurrent()->IsBluRay());
@@ -289,7 +290,7 @@ void cMenuBrowseFiles::SetHelpButtons(void)
help[0] = isDir && isDvd ? trVDR("Button$Open") : NULL;
help[1] = hasResume ? trVDR("Button$Rewind") : NULL;
- help[2] = isFile ? trVDR("Button$Delete") : NULL;
+ help[2] = bDel ? trVDR("Button$Delete") : NULL;
help[3] = isFile ? trVDR("Button$Info") : NULL;
}
diff --git a/setup_menu.c b/setup_menu.c
index df8b7c91..60ccc51d 100644
--- a/setup_menu.c
+++ b/setup_menu.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: setup_menu.c,v 1.83 2011-11-29 09:57:35 phintuka Exp $
+ * $Id: setup_menu.c,v 1.84 2012-01-16 11:57:53 phintuka Exp $
*
*/
@@ -1761,6 +1761,8 @@ void cMenuSetupMediaPlayer::Set(void)
&newconfig.dvd_arrow_keys_control_playback));
Add(new cMenuEditBoolItem(tr("Show hidden files"),
&newconfig.show_hidden_files));
+ Add(new cMenuEditBoolItem(tr("Allow removing files"),
+ &newconfig.media_enable_delete));
Add(SeparatorItem(tr("Media Player")));
Add(new cMenuEditBitItem(tr("Play file"), &newconfig.media_menu_items, MEDIA_MENU_FILES));
@@ -1795,6 +1797,7 @@ void cMenuSetupMediaPlayer::Store(void)
SetupStore("Media.DVD.ArrowKeysControlPlayback", xc.dvd_arrow_keys_control_playback);
SetupStore("Media.MenuItems", xc.media_menu_items);
SetupStore("Media.ShowHiddenFiles", xc.show_hidden_files);
+ SetupStore("Media.EnableDelete", xc.media_enable_delete);
Setup.Save();
}