pictureviewer: -add delete pic-file option

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1520 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
satbaby
2011-06-05 12:31:02 +00:00
parent 81acb5e814
commit 083fd6923f
4 changed files with 40 additions and 7 deletions

View File

@@ -164,8 +164,8 @@ audioplayer.building_search_index Erstelle Suchindex
audioplayer.button_select_title_by_id Suche n. ID audioplayer.button_select_title_by_id Suche n. ID
audioplayer.button_select_title_by_name Suche n. Name audioplayer.button_select_title_by_name Suche n. Name
audioplayer.defdir Start-Verz. audioplayer.defdir Start-Verz.
audioplayer.delete Löschen audioplayer.delete entfernen
audioplayer.deleteall Alle löschen audioplayer.deleteall Alle entfernen
audioplayer.display_order Anzeige audioplayer.display_order Anzeige
audioplayer.enable_sc_metadata Aktiviere Shoutcast Meta-Daten Parsing audioplayer.enable_sc_metadata Aktiviere Shoutcast Meta-Daten Parsing
audioplayer.fastforward schneller Vorl. audioplayer.fastforward schneller Vorl.

View File

@@ -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_id search by ID
audioplayer.button_select_title_by_name search by name audioplayer.button_select_title_by_name search by name
audioplayer.defdir start dir. audioplayer.defdir start dir.
audioplayer.delete Delete audioplayer.delete Remove
audioplayer.deleteall delete all audioplayer.deleteall remove all
audioplayer.display_order display order audioplayer.display_order display order
audioplayer.enable_sc_metadata enable shoutcast meta data parsing audioplayer.enable_sc_metadata enable shoutcast meta data parsing
audioplayer.fastforward fast forw. audioplayer.fastforward fast forw.

View File

@@ -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) else if (msg == CRCInput::RC_ok)
{ {
if (!playlist.empty()) 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_RED , LOCALE_AUDIOPLAYER_DELETE },
{ NEUTRINO_ICON_BUTTON_GREEN , LOCALE_AUDIOPLAYER_ADD }, { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_AUDIOPLAYER_ADD },
{ NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_AUDIOPLAYER_DELETEALL }, { 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] = const struct button_label PictureViewerButtons2[][2] =
{ {
@@ -653,7 +669,7 @@ void CPictureViewerGui::paintFoot()
if (!playlist.empty()) 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]); ::paintButtons(x, y + (height - buttonHeight), 0, 2, (m_sort==FILENAME)?PictureViewerButtons2[0]:PictureViewerButtons2[1]);
} }
@@ -724,6 +740,22 @@ void CPictureViewerGui::endView()
m_state=MENU; 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() void CPictureViewerGui::showHelp()
{ {
Helpbox helpbox; Helpbox helpbox;

View File

@@ -107,6 +107,7 @@ class CPictureViewerGui : public CMenuTarget
int show(); int show();
void showHelp(); void showHelp();
void deletePicFile(unsigned int index, bool mode);
public: public:
CPictureViewerGui(); CPictureViewerGui();