diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 7bca91b26..56c9b6879 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -164,8 +164,8 @@ audioplayer.building_search_index Erstelle Suchindex audioplayer.button_select_title_by_id Suche n. ID audioplayer.button_select_title_by_name Suche n. Name audioplayer.defdir Start-Verz. -audioplayer.delete Löschen -audioplayer.deleteall Alle löschen +audioplayer.delete entfernen +audioplayer.deleteall Alle entfernen audioplayer.display_order Anzeige audioplayer.enable_sc_metadata Aktiviere Shoutcast Meta-Daten Parsing audioplayer.fastforward schneller Vorl. diff --git a/data/locale/english.locale b/data/locale/english.locale index 31c175f72..ab8648eab 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -164,8 +164,8 @@ audioplayer.building_search_index building search index audioplayer.button_select_title_by_id search by ID audioplayer.button_select_title_by_name search by name audioplayer.defdir start dir. -audioplayer.delete Delete -audioplayer.deleteall delete all +audioplayer.delete Remove +audioplayer.deleteall remove all audioplayer.display_order display order audioplayer.enable_sc_metadata enable shoutcast meta data parsing audioplayer.fastforward fast forw. diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 6b2b38d3c..78ac47f6c 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -343,6 +343,21 @@ int CPictureViewerGui::show() } } } + else if (msg == CRCInput::RC_spkr) + { + if (!playlist.empty()) + { + if (m_state == MENU) + { + deletePicFile(selected, false); + update = true; + } + else{ + deletePicFile(selected, true); + } + } + } + else if (msg == CRCInput::RC_ok) { if (!playlist.empty()) @@ -627,12 +642,13 @@ void CPictureViewerGui::paintHead() } //------------------------------------------------------------------------ -const struct button_label PictureViewerButtons[4] = +const struct button_label PictureViewerButtons[5] = { { NEUTRINO_ICON_BUTTON_RED , LOCALE_AUDIOPLAYER_DELETE }, { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_AUDIOPLAYER_ADD }, { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_AUDIOPLAYER_DELETEALL }, - { NEUTRINO_ICON_BUTTON_BLUE , LOCALE_PICTUREVIEWER_SLIDESHOW } + { NEUTRINO_ICON_BUTTON_BLUE , LOCALE_PICTUREVIEWER_SLIDESHOW }, + { NEUTRINO_ICON_BUTTON_MUTE_SMALL , LOCALE_FILEBROWSER_DELETE } }; const struct button_label PictureViewerButtons2[][2] = { @@ -653,7 +669,7 @@ void CPictureViewerGui::paintFoot() if (!playlist.empty()) { - ::paintButtons(x, y + (height - 2 * buttonHeight), 0, 4, PictureViewerButtons); + ::paintButtons(x, y + (height - 2 * buttonHeight), 0, 5, PictureViewerButtons); ::paintButtons(x, y + (height - buttonHeight), 0, 2, (m_sort==FILENAME)?PictureViewerButtons2[0]:PictureViewerButtons2[1]); } @@ -724,6 +740,22 @@ void CPictureViewerGui::endView() m_state=MENU; } +void CPictureViewerGui::deletePicFile(unsigned int index, bool mode) +{ + CVFD::getInstance()->showMenuText(0, playlist[index].Name.c_str()); + if (ShowMsgUTF(LOCALE_FILEBROWSER_DELETE, playlist[index].Filename, CMessageBox::mbrNo, CMessageBox::mbYes|CMessageBox::mbNo)==CMessageBox::mbrYes) + { + unlink(playlist[index].Filename.c_str()); + printf("[ %s ] delete file: %s\r\n",__FUNCTION__,playlist[index].Filename.c_str()); + CViewList::iterator p = playlist.begin()+index; + playlist.erase(p); + if(mode) + selected = selected-1; + if (selected >= playlist.size()) + selected = playlist.size()-1; + } +} + void CPictureViewerGui::showHelp() { Helpbox helpbox; diff --git a/src/gui/pictureviewer.h b/src/gui/pictureviewer.h index a9175c2a8..dda45557e 100644 --- a/src/gui/pictureviewer.h +++ b/src/gui/pictureviewer.h @@ -107,6 +107,7 @@ class CPictureViewerGui : public CMenuTarget int show(); void showHelp(); + void deletePicFile(unsigned int index, bool mode); public: CPictureViewerGui();